diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5b89347b626..7eb1366cf5d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -14,3 +14,4 @@ /handwritten/spanner @googleapis/spanner-team /handwritten/bigquery-storage @googleapis/bigquery-team /handwritten/pubsub @googleapis/pubsub-team +/handwritten/bigtable @googleapis/bigtable-team diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml new file mode 100644 index 00000000000..df2be307998 --- /dev/null +++ b/.github/workflows/conformance.yaml @@ -0,0 +1,51 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + push: + branches: + - main + paths: + - 'handwritten/bigtable/**' + pull_request: + paths: + - 'handwritten/bigtable/**' +name: conformance +jobs: + conformance: + runs-on: ubuntu-latest + defaults: + run: + working-directory: handwritten/bigtable + strategy: + matrix: + node: [ 18, 20 ] + steps: + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + repository: googleapis/cloud-bigtable-clients-test + ref: main + path: handwritten/bigtable/cloud-bigtable-clients-test + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + - uses: actions/setup-go@v5 + with: + go-version: '>=1.20.2' + - run: chmod +x .kokoro/conformance.sh + - run: npm install + - run: go version + - run: .kokoro/conformance.sh diff --git a/.github/workflows/mandatory-conformance.yaml b/.github/workflows/mandatory-conformance.yaml new file mode 100644 index 00000000000..85c8e1699a2 --- /dev/null +++ b/.github/workflows/mandatory-conformance.yaml @@ -0,0 +1,51 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + push: + branches: + - main + paths: + - 'handwritten/bigtable/**' + pull_request: + paths: + - 'handwritten/bigtable/**' +name: mandatory-conformance +jobs: + mandatory-conformance: + runs-on: ubuntu-latest + defaults: + run: + working-directory: handwritten/bigtable + strategy: + matrix: + node: [ 18, 20 ] + steps: + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + repository: googleapis/cloud-bigtable-clients-test + ref: v0.0.3 + path: handwritten/bigtable/cloud-bigtable-clients-test + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + - uses: actions/setup-go@v5 + with: + go-version: '>=1.20.2' + - run: chmod +x .kokoro/mandatory-conformance.sh + - run: npm install + - run: go version + - run: .kokoro/mandatory-conformance.sh \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 56f5b85ed70..3a61edf9869 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -6,6 +6,7 @@ "core/promisify": "5.0.0", "handwritten/bigquery": "8.2.0", "handwritten/bigquery-storage": "5.1.0", + "handwritten/bigtable": "6.5.0", "handwritten/cloud-profiler": "6.0.4", "handwritten/datastore": "10.1.0", "handwritten/error-reporting": "3.0.5", @@ -213,6 +214,7 @@ "packages/google-maps-fleetengine": "0.8.1", "packages/google-maps-fleetengine-delivery": "0.6.1", "packages/google-maps-mapsplatformdatasets": "3.1.1", + "packages/google-maps-navconnect": "0.1.0", "packages/google-maps-places": "2.4.0", "packages/google-maps-routeoptimization": "0.6.0", "packages/google-maps-routing": "2.2.0", @@ -239,6 +241,5 @@ "packages/google-streetview-publish": "0.4.1", "packages/grafeas": "6.1.1", "packages/typeless-sample-bot": "3.1.1", - "packages/google-maps-navconnect": "0.1.0", "packages/google-cloud-datacatalog-lineage-configmanagement": "0.1.0" } diff --git a/handwritten/bigtable/.OwlBot.yaml b/handwritten/bigtable/.OwlBot.yaml new file mode 100644 index 00000000000..d5e188fe900 --- /dev/null +++ b/handwritten/bigtable/.OwlBot.yaml @@ -0,0 +1,26 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/bigtable/(v.*)/.*-nodejs + dest: /owl-bot-staging/bigtable/$1 + - source: /google/bigtable/(admin/v.*)/.*-nodejs + dest: /owl-bot-staging/bigtable/$1 + +begin-after-commit-hash: 3ff710d08cb30ef881e037f69e0a967af060d36e + diff --git a/handwritten/bigtable/.eslintignore b/handwritten/bigtable/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/handwritten/bigtable/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/handwritten/bigtable/.eslintrc.json b/handwritten/bigtable/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/handwritten/bigtable/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/handwritten/bigtable/.gitattributes b/handwritten/bigtable/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/handwritten/bigtable/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/handwritten/bigtable/.gitignore b/handwritten/bigtable/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/handwritten/bigtable/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/handwritten/bigtable/.jsdoc.js b/handwritten/bigtable/.jsdoc.js new file mode 100644 index 00000000000..ffcc0e18f08 --- /dev/null +++ b/handwritten/bigtable/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2025 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/bigtable', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/handwritten/bigtable/.kokoro/.gitattributes b/handwritten/bigtable/.kokoro/.gitattributes new file mode 100644 index 00000000000..87acd4f484e --- /dev/null +++ b/handwritten/bigtable/.kokoro/.gitattributes @@ -0,0 +1 @@ +* linguist-generated=true diff --git a/handwritten/bigtable/.kokoro/coerce_logs.sh b/handwritten/bigtable/.kokoro/coerce_logs.sh new file mode 100644 index 00000000000..883ee0faaa0 --- /dev/null +++ b/handwritten/bigtable/.kokoro/coerce_logs.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done \ No newline at end of file diff --git a/handwritten/bigtable/.kokoro/common.cfg b/handwritten/bigtable/.kokoro/common.cfg new file mode 100644 index 00000000000..68b024b6e04 --- /dev/null +++ b/handwritten/bigtable/.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-bigtable/handwritten/bigtable/.kokoro/trampoline_v2.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:18-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-bigtable/handwritten/bigtable/.kokoro/test.sh" +} diff --git a/handwritten/bigtable/.kokoro/conformance.sh b/handwritten/bigtable/.kokoro/conformance.sh new file mode 100755 index 00000000000..1fba9ee86bf --- /dev/null +++ b/handwritten/bigtable/.kokoro/conformance.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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 + +export NPM_CONFIG_PREFIX=${HOME}/.npm-global + +## cd to the parent directory, i.e. the root of the git repo +cd $(dirname $0)/.. + +# Stop the testbench & cleanup environment variables +function cleanup() { + echo "Cleanup testbench" + # Stop the proxy + kill $proxyPID +} +trap cleanup EXIT + +# Build and start the proxy in a separate process +pushd . +npm install +nohup npm run testproxy & +proxyPID=$! +popd + +# Run the conformance test +cd cloud-bigtable-clients-test/tests +eval "go test -v -proxy_addr=:9999" +RETURN_CODE=$? + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +echo "exiting with ${RETURN_CODE}" + +# Keep running these tests, but don't cause a CI failure for now, +# until they're fully fixed. +#exit ${RETURN_CODE} +exit 0 diff --git a/handwritten/bigtable/.kokoro/continuous/node18/common.cfg b/handwritten/bigtable/.kokoro/continuous/node18/common.cfg new file mode 100644 index 00000000000..68b024b6e04 --- /dev/null +++ b/handwritten/bigtable/.kokoro/continuous/node18/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-bigtable/handwritten/bigtable/.kokoro/trampoline_v2.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:18-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-bigtable/handwritten/bigtable/.kokoro/test.sh" +} diff --git a/handwritten/bigtable/.kokoro/continuous/node18/lint.cfg b/handwritten/bigtable/.kokoro/continuous/node18/lint.cfg new file mode 100644 index 00000000000..a22d1462173 --- /dev/null +++ b/handwritten/bigtable/.kokoro/continuous/node18/lint.cfg @@ -0,0 +1,4 @@ +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-bigtable/handwritten/bigtable/.kokoro/lint.sh" +} diff --git a/handwritten/bigtable/.kokoro/continuous/node18/samples-test.cfg b/handwritten/bigtable/.kokoro/continuous/node18/samples-test.cfg new file mode 100644 index 00000000000..b57b6da635b --- /dev/null +++ b/handwritten/bigtable/.kokoro/continuous/node18/samples-test.cfg @@ -0,0 +1,12 @@ +# 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-bigtable/handwritten/bigtable/.kokoro/samples-test.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "long-door-651-kokoro-system-test-service-account" +} \ No newline at end of file diff --git a/handwritten/bigtable/.kokoro/continuous/node18/system-test.cfg b/handwritten/bigtable/.kokoro/continuous/node18/system-test.cfg new file mode 100644 index 00000000000..e8c22a04651 --- /dev/null +++ b/handwritten/bigtable/.kokoro/continuous/node18/system-test.cfg @@ -0,0 +1,12 @@ +# 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-bigtable/handwritten/bigtable/.kokoro/system-test.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "long-door-651-kokoro-system-test-service-account" +} \ No newline at end of file diff --git a/handwritten/bigtable/.kokoro/continuous/node18/test.cfg b/handwritten/bigtable/.kokoro/continuous/node18/test.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/handwritten/bigtable/.kokoro/docs.sh b/handwritten/bigtable/.kokoro/docs.sh new file mode 100755 index 00000000000..85901242b5e --- /dev/null +++ b/handwritten/bigtable/.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}/.npm-global + +cd $(dirname $0)/.. + +npm install + +npm run docs-test diff --git a/handwritten/bigtable/.kokoro/lint.sh b/handwritten/bigtable/.kokoro/lint.sh new file mode 100755 index 00000000000..c7ffa6438b0 --- /dev/null +++ b/handwritten/bigtable/.kokoro/lint.sh @@ -0,0 +1,38 @@ +#!/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}/.npm-global +export PATH="${NPM_CONFIG_PREFIX}/bin:${PATH}" + +# Ensure the npm global directory is writable, otherwise rebuild `npm` +mkdir -p ${NPM_CONFIG_PREFIX}/lib +npm config -g ls || npm i -g npm@`npm --version` + +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/handwritten/bigtable/.kokoro/mandatory-conformance.sh b/handwritten/bigtable/.kokoro/mandatory-conformance.sh new file mode 100644 index 00000000000..879d224e400 --- /dev/null +++ b/handwritten/bigtable/.kokoro/mandatory-conformance.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.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 + +export NPM_CONFIG_PREFIX=${HOME}/.npm-global + +## cd to the parent directory, i.e. the root of the git repo +cd $(dirname $0)/.. + +# Stop the testbench & cleanup environment variables +function cleanup() { + echo "Cleanup testbench" + # Stop the proxy + kill $proxyPID +} +trap cleanup EXIT + +# Build and start the proxy in a separate process +pushd . +npm install +nohup npm run testproxy & +proxyPID=$! +popd + +# Run the conformance test skipping known failures +cd cloud-bigtable-clients-test/tests +eval "go test -v -proxy_addr=:9999 -skip `tr -d '\n' < ../../testproxy/known_failures.txt``tr -d '\n' < ../../testproxy/known_unsupported.txt`" +RETURN_CODE=$? + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/handwritten/bigtable/.kokoro/populate-secrets.sh b/handwritten/bigtable/.kokoro/populate-secrets.sh new file mode 100755 index 00000000000..deb2b199eb4 --- /dev/null +++ b/handwritten/bigtable/.kokoro/populate-secrets.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# Copyright 2020 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file is called in the early stage of `trampoline_v2.sh` to +# populate secrets needed for the CI builds. + +set -eo pipefail + +function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} +function msg { println "$*" >&2 ;} +function println { printf '%s\n' "$(now) $*" ;} + +# Populates requested secrets set in SECRET_MANAGER_KEYS + +# In Kokoro CI builds, we use the service account attached to the +# Kokoro VM. This means we need to setup auth on other CI systems. +# For local run, we just use the gcloud command for retrieving the +# secrets. + +if [[ "${RUNNING_IN_CI:-}" == "true" ]]; then + GCLOUD_COMMANDS=( + "docker" + "run" + "--entrypoint=gcloud" + "--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR}" + "gcr.io/google.com/cloudsdktool/cloud-sdk" + ) + if [[ "${TRAMPOLINE_CI:-}" == "kokoro" ]]; then + SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" + else + echo "Authentication for this CI system is not implemented yet." + exit 2 + # TODO: Determine appropriate SECRET_LOCATION and the GCLOUD_COMMANDS. + fi +else + # For local run, use /dev/shm or temporary directory for + # KOKORO_GFILE_DIR. + if [[ -d "/dev/shm" ]]; then + export KOKORO_GFILE_DIR=/dev/shm + else + export KOKORO_GFILE_DIR=$(mktemp -d -t ci-XXXXXXXX) + fi + SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" + GCLOUD_COMMANDS=("gcloud") +fi + +msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" +mkdir -p ${SECRET_LOCATION} + +for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") +do + msg "Retrieving secret ${key}" + "${GCLOUD_COMMANDS[@]}" \ + secrets versions access latest \ + --project cloud-devrel-kokoro-resources \ + --secret $key > \ + "$SECRET_LOCATION/$key" + if [[ $? == 0 ]]; then + msg "Secret written to ${SECRET_LOCATION}/${key}" + else + msg "Error retrieving secret ${key}" + exit 2 + fi +done diff --git a/handwritten/bigtable/.kokoro/presubmit/node18/common.cfg b/handwritten/bigtable/.kokoro/presubmit/node18/common.cfg new file mode 100644 index 00000000000..68b024b6e04 --- /dev/null +++ b/handwritten/bigtable/.kokoro/presubmit/node18/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-bigtable/handwritten/bigtable/.kokoro/trampoline_v2.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:18-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-bigtable/handwritten/bigtable/.kokoro/test.sh" +} diff --git a/handwritten/bigtable/.kokoro/presubmit/node18/samples-test.cfg b/handwritten/bigtable/.kokoro/presubmit/node18/samples-test.cfg new file mode 100644 index 00000000000..b57b6da635b --- /dev/null +++ b/handwritten/bigtable/.kokoro/presubmit/node18/samples-test.cfg @@ -0,0 +1,12 @@ +# 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-bigtable/handwritten/bigtable/.kokoro/samples-test.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "long-door-651-kokoro-system-test-service-account" +} \ No newline at end of file diff --git a/handwritten/bigtable/.kokoro/presubmit/node18/system-test.cfg b/handwritten/bigtable/.kokoro/presubmit/node18/system-test.cfg new file mode 100644 index 00000000000..e8c22a04651 --- /dev/null +++ b/handwritten/bigtable/.kokoro/presubmit/node18/system-test.cfg @@ -0,0 +1,12 @@ +# 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-bigtable/handwritten/bigtable/.kokoro/system-test.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "long-door-651-kokoro-system-test-service-account" +} \ No newline at end of file diff --git a/handwritten/bigtable/.kokoro/presubmit/node18/test.cfg b/handwritten/bigtable/.kokoro/presubmit/node18/test.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/handwritten/bigtable/.kokoro/presubmit/windows/common.cfg b/handwritten/bigtable/.kokoro/presubmit/windows/common.cfg new file mode 100644 index 00000000000..d6e25e0b1b8 --- /dev/null +++ b/handwritten/bigtable/.kokoro/presubmit/windows/common.cfg @@ -0,0 +1,2 @@ +# Format: //devtools/kokoro/config/proto/build.proto + diff --git a/handwritten/bigtable/.kokoro/presubmit/windows/test.cfg b/handwritten/bigtable/.kokoro/presubmit/windows/test.cfg new file mode 100644 index 00000000000..6fed9d94cc9 --- /dev/null +++ b/handwritten/bigtable/.kokoro/presubmit/windows/test.cfg @@ -0,0 +1,2 @@ +# Use the test file directly +build_file: "nodejs-bigtable/handwritten/bigtable/.kokoro/test.bat" diff --git a/handwritten/bigtable/.kokoro/publish.sh b/handwritten/bigtable/.kokoro/publish.sh new file mode 100755 index 00000000000..ca1d47af347 --- /dev/null +++ b/handwritten/bigtable/.kokoro/publish.sh @@ -0,0 +1,42 @@ +#!/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}/.npm-global + +# Start the releasetool reporter +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-npm-token-1) +echo "//wombat-dressing-room.appspot.com/:_authToken=${NPM_TOKEN}" > ~/.npmrc + +npm install +npm pack . +# npm provides no way to specify, observe, or predict the name of the tarball +# file it generates. We have to look in the current directory for the freshest +# .tgz file. +TARBALL=$(ls -1 -t *.tgz | head -1) + +npm publish --access=public --registry=https://wombat-dressing-room.appspot.com "$TARBALL" + +# Kokoro collects *.tgz and package-lock.json files and stores them in Placer +# so we can generate SBOMs and attestations. +# However, we *don't* want Kokoro to collect package-lock.json and *.tgz files +# that happened to be installed with dependencies. +find node_modules -name package-lock.json -o -name "*.tgz" | xargs rm -f \ No newline at end of file diff --git a/handwritten/bigtable/.kokoro/release/common.cfg b/handwritten/bigtable/.kokoro/release/common.cfg new file mode 100644 index 00000000000..3ba2eb095fe --- /dev/null +++ b/handwritten/bigtable/.kokoro/release/common.cfg @@ -0,0 +1,8 @@ +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + } + } +} diff --git a/handwritten/bigtable/.kokoro/release/docs-devsite.cfg b/handwritten/bigtable/.kokoro/release/docs-devsite.cfg new file mode 100644 index 00000000000..ae1b95c63b7 --- /dev/null +++ b/handwritten/bigtable/.kokoro/release/docs-devsite.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:18-user" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-bigtable/handwritten/bigtable/.kokoro/trampoline_v2.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-bigtable/handwritten/bigtable/.kokoro/release/docs-devsite.sh" +} diff --git a/handwritten/bigtable/.kokoro/release/docs-devsite.sh b/handwritten/bigtable/.kokoro/release/docs-devsite.sh new file mode 100755 index 00000000000..81a89f6c172 --- /dev/null +++ b/handwritten/bigtable/.kokoro/release/docs-devsite.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +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}/.npm-global + export PATH="$PATH:${NPM_CONFIG_PREFIX}/bin" + cd $(dirname $0)/../.. +fi + +npm install +npm install --no-save @google-cloud/cloud-rad@^0.4.0 +# publish docs to devsite +npx @google-cloud/cloud-rad . cloud-rad diff --git a/handwritten/bigtable/.kokoro/release/docs.cfg b/handwritten/bigtable/.kokoro/release/docs.cfg new file mode 100644 index 00000000000..892e48ef02f --- /dev/null +++ b/handwritten/bigtable/.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:18-user" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-bigtable/handwritten/bigtable/.kokoro/trampoline_v2.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-bigtable/handwritten/bigtable/.kokoro/release/docs.sh" +} diff --git a/handwritten/bigtable/.kokoro/release/docs.sh b/handwritten/bigtable/.kokoro/release/docs.sh new file mode 100755 index 00000000000..e9079a60530 --- /dev/null +++ b/handwritten/bigtable/.kokoro/release/docs.sh @@ -0,0 +1,49 @@ +#!/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 18 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}/.npm-global + export PATH="$PATH:${NPM_CONFIG_PREFIX}/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 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/handwritten/bigtable/.kokoro/release/publish.cfg b/handwritten/bigtable/.kokoro/release/publish.cfg new file mode 100644 index 00000000000..413ff6646fe --- /dev/null +++ b/handwritten/bigtable/.kokoro/release/publish.cfg @@ -0,0 +1,51 @@ +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "google-cloud-npm-token-1" + } + } +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-bigtable/handwritten/bigtable/.kokoro/trampoline_v2.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:18-user" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-bigtable/handwritten/bigtable/.kokoro/publish.sh" +} + +# Store the packages we uploaded to npmjs.com and their corresponding +# package-lock.jsons in Placer. That way, we have a record of exactly +# what we published, and which version of which tools we used to publish +# it, which we can use to generate SBOMs and attestations. +action { + define_artifacts { + regex: "github/**/*.tgz" + regex: "github/**/package-lock.json" + strip_prefix: "github" + } +} diff --git a/handwritten/bigtable/.kokoro/samples-test.sh b/handwritten/bigtable/.kokoro/samples-test.sh new file mode 100755 index 00000000000..b51def34b32 --- /dev/null +++ b/handwritten/bigtable/.kokoro/samples-test.sh @@ -0,0 +1,73 @@ +#!/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 + +# Ensure the npm global directory is writable, otherwise rebuild `npm` +mkdir -p $NPM_CONFIG_PREFIX +npm config -g ls || npm i -g npm@`npm --version` + +# Setup service account credentials. +export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secret_manager/long-door-651-kokoro-system-test-service-account +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 .. + # If tests are running against main branch, configure flakybot + # to open issues on failures: + if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]] || [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"nightly"* ]]; then + #export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml + #export MOCHA_REPORTER=xunit + #cleanup() { + # chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot + # $KOKORO_GFILE_DIR/linux_amd64/flakybot + #} + #trap cleanup EXIT HUP + + # These are currently disabled pending figuring out admin quota issues. + exit 0 + fi + + 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=18 +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/handwritten/bigtable/.kokoro/system-test.sh b/handwritten/bigtable/.kokoro/system-test.sh new file mode 100755 index 00000000000..773fc110c97 --- /dev/null +++ b/handwritten/bigtable/.kokoro/system-test.sh @@ -0,0 +1,64 @@ +#!/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}/.npm-global + +# Setup service account credentials. +export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secret_manager/long-door-651-kokoro-system-test-service-account +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 + +# If tests are running against main branch, configure flakybot +# to open issues on failures: +if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]] || [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"nightly"* ]]; then + #export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml + #export MOCHA_REPORTER=xunit + #cleanup() { + # chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot + # $KOKORO_GFILE_DIR/linux_amd64/flakybot + #} + #trap cleanup EXIT HUP + + # These are currently disabled pending figuring out admin quota issues. + exit 0 +fi + +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=18 +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/handwritten/bigtable/.kokoro/test.bat b/handwritten/bigtable/.kokoro/test.bat new file mode 100644 index 00000000000..caf825656c2 --- /dev/null +++ b/handwritten/bigtable/.kokoro/test.bat @@ -0,0 +1,33 @@ +@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 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 18 +call which node + +call npm install || goto :error +call npm run test || goto :error + +goto :EOF + +:error +exit /b 1 diff --git a/handwritten/bigtable/.kokoro/test.sh b/handwritten/bigtable/.kokoro/test.sh new file mode 100755 index 00000000000..d537f2e568d --- /dev/null +++ b/handwritten/bigtable/.kokoro/test.sh @@ -0,0 +1,54 @@ +#!/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}/.npm-global + +cd $(dirname $0)/.. + +npm install +# If tests are running against main branch, configure flakybot +# to open issues on failures: +if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]] || [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"nightly"* ]]; then + #export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml + #export MOCHA_REPORTER=xunit + #cleanup() { + # chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot + # $KOKORO_GFILE_DIR/linux_amd64/flakybot + #} + #trap cleanup EXIT HUP + + # These are currently disabled pending figuring out admin quota issues. + exit 0 +fi +# Unit tests exercise the entire API surface, which may include +# deprecation warnings: +export MOCHA_THROW_DEPRECATION=false +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=18 +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/handwritten/bigtable/.kokoro/trampoline.sh b/handwritten/bigtable/.kokoro/trampoline.sh new file mode 100755 index 00000000000..f693a1ce7aa --- /dev/null +++ b/handwritten/bigtable/.kokoro/trampoline.sh @@ -0,0 +1,32 @@ +#!/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. + +# This file is not used any more, but we keep this file for making it +# easy to roll back. +# TODO: Remove this file from the template. + +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 + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/handwritten/bigtable/.kokoro/trampoline_v2.sh b/handwritten/bigtable/.kokoro/trampoline_v2.sh new file mode 100755 index 00000000000..0a023890039 --- /dev/null +++ b/handwritten/bigtable/.kokoro/trampoline_v2.sh @@ -0,0 +1,510 @@ +#!/usr/bin/env bash +# 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. + +# trampoline_v2.sh +# +# If you want to make a change to this file, consider doing so at: +# https://github.com/googlecloudplatform/docker-ci-helper +# +# This script is for running CI builds. For Kokoro builds, we +# set this script to `build_file` field in the Kokoro configuration. + +# This script does 3 things. +# +# 1. Prepare the Docker image for the test +# 2. Run the Docker with appropriate flags to run the test +# 3. Upload the newly built Docker image +# +# in a way that is somewhat compatible with trampoline_v1. +# +# These environment variables are required: +# TRAMPOLINE_IMAGE: The docker image to use. +# TRAMPOLINE_DOCKERFILE: The location of the Dockerfile. +# +# You can optionally change these environment variables: +# TRAMPOLINE_IMAGE_UPLOAD: +# (true|false): Whether to upload the Docker image after the +# successful builds. +# TRAMPOLINE_BUILD_FILE: The script to run in the docker container. +# TRAMPOLINE_WORKSPACE: The workspace path in the docker container. +# Defaults to /workspace. +# Potentially there are some repo specific envvars in .trampolinerc in +# the project root. +# +# Here is an example for running this script. +# TRAMPOLINE_IMAGE=gcr.io/cloud-devrel-kokoro-resources/node:18-user \ +# TRAMPOLINE_BUILD_FILE=.kokoro/system-test.sh \ +# .kokoro/trampoline_v2.sh + +set -euo pipefail + +TRAMPOLINE_VERSION="2.0.7" + +if command -v tput >/dev/null && [[ -n "${TERM:-}" ]]; then + readonly IO_COLOR_RED="$(tput setaf 1)" + readonly IO_COLOR_GREEN="$(tput setaf 2)" + readonly IO_COLOR_YELLOW="$(tput setaf 3)" + readonly IO_COLOR_RESET="$(tput sgr0)" +else + readonly IO_COLOR_RED="" + readonly IO_COLOR_GREEN="" + readonly IO_COLOR_YELLOW="" + readonly IO_COLOR_RESET="" +fi + +function function_exists { + [ $(LC_ALL=C type -t $1)"" == "function" ] +} + +# Logs a message using the given color. The first argument must be one +# of the IO_COLOR_* variables defined above, such as +# "${IO_COLOR_YELLOW}". The remaining arguments will be logged in the +# given color. The log message will also have an RFC-3339 timestamp +# prepended (in UTC). You can disable the color output by setting +# TERM=vt100. +function log_impl() { + local color="$1" + shift + local timestamp="$(date -u "+%Y-%m-%dT%H:%M:%SZ")" + echo "================================================================" + echo "${color}${timestamp}:" "$@" "${IO_COLOR_RESET}" + echo "================================================================" +} + +# Logs the given message with normal coloring and a timestamp. +function log() { + log_impl "${IO_COLOR_RESET}" "$@" +} + +# Logs the given message in green with a timestamp. +function log_green() { + log_impl "${IO_COLOR_GREEN}" "$@" +} + +# Logs the given message in yellow with a timestamp. +function log_yellow() { + log_impl "${IO_COLOR_YELLOW}" "$@" +} + +# Logs the given message in red with a timestamp. +function log_red() { + log_impl "${IO_COLOR_RED}" "$@" +} + +readonly tmpdir=$(mktemp -d -t ci-XXXXXXXX) +readonly tmphome="${tmpdir}/h" +mkdir -p "${tmphome}" + +function cleanup() { + rm -rf "${tmpdir}" +} +trap cleanup EXIT + +RUNNING_IN_CI="${RUNNING_IN_CI:-false}" + +# The workspace in the container, defaults to /workspace. +TRAMPOLINE_WORKSPACE="${TRAMPOLINE_WORKSPACE:-/workspace}" + +pass_down_envvars=( + # TRAMPOLINE_V2 variables. + # Tells scripts whether they are running as part of CI or not. + "RUNNING_IN_CI" + # Indicates which CI system we're in. + "TRAMPOLINE_CI" + # Indicates the version of the script. + "TRAMPOLINE_VERSION" + # Contains path to build artifacts being executed. + "KOKORO_BUILD_ARTIFACTS_SUBDIR" +) + +log_yellow "Building with Trampoline ${TRAMPOLINE_VERSION}" + +# Detect which CI systems we're in. If we're in any of the CI systems +# we support, `RUNNING_IN_CI` will be true and `TRAMPOLINE_CI` will be +# the name of the CI system. Both envvars will be passing down to the +# container for telling which CI system we're in. +if [[ -n "${KOKORO_BUILD_ID:-}" ]]; then + # descriptive env var for indicating it's on CI. + RUNNING_IN_CI="true" + TRAMPOLINE_CI="kokoro" + if [[ "${TRAMPOLINE_USE_LEGACY_SERVICE_ACCOUNT:-}" == "true" ]]; then + if [[ ! -f "${KOKORO_GFILE_DIR}/kokoro-trampoline.service-account.json" ]]; then + log_red "${KOKORO_GFILE_DIR}/kokoro-trampoline.service-account.json does not exist. Did you forget to mount cloud-devrel-kokoro-resources/trampoline? Aborting." + exit 1 + fi + # This service account will be activated later. + TRAMPOLINE_SERVICE_ACCOUNT="${KOKORO_GFILE_DIR}/kokoro-trampoline.service-account.json" + else + if [[ "${TRAMPOLINE_VERBOSE:-}" == "true" ]]; then + gcloud auth list + fi + log_yellow "Configuring Container Registry access" + gcloud auth configure-docker --quiet + fi + pass_down_envvars+=( + # KOKORO dynamic variables. + "KOKORO_BUILD_NUMBER" + "KOKORO_BUILD_ID" + "KOKORO_JOB_NAME" + "KOKORO_GIT_COMMIT" + "KOKORO_GITHUB_COMMIT" + "KOKORO_GITHUB_PULL_REQUEST_NUMBER" + "KOKORO_GITHUB_PULL_REQUEST_COMMIT" + # For flakybot + "KOKORO_GITHUB_COMMIT_URL" + "KOKORO_GITHUB_PULL_REQUEST_URL" + ) +elif [[ "${TRAVIS:-}" == "true" ]]; then + RUNNING_IN_CI="true" + TRAMPOLINE_CI="travis" + pass_down_envvars+=( + "TRAVIS_BRANCH" + "TRAVIS_BUILD_ID" + "TRAVIS_BUILD_NUMBER" + "TRAVIS_BUILD_WEB_URL" + "TRAVIS_COMMIT" + "TRAVIS_COMMIT_MESSAGE" + "TRAVIS_COMMIT_RANGE" + "TRAVIS_JOB_NAME" + "TRAVIS_JOB_NUMBER" + "TRAVIS_JOB_WEB_URL" + "TRAVIS_PULL_REQUEST" + "TRAVIS_PULL_REQUEST_BRANCH" + "TRAVIS_PULL_REQUEST_SHA" + "TRAVIS_PULL_REQUEST_SLUG" + "TRAVIS_REPO_SLUG" + "TRAVIS_SECURE_ENV_VARS" + "TRAVIS_TAG" + ) +elif [[ -n "${GITHUB_RUN_ID:-}" ]]; then + RUNNING_IN_CI="true" + TRAMPOLINE_CI="github-workflow" + pass_down_envvars+=( + "GITHUB_WORKFLOW" + "GITHUB_RUN_ID" + "GITHUB_RUN_NUMBER" + "GITHUB_ACTION" + "GITHUB_ACTIONS" + "GITHUB_ACTOR" + "GITHUB_REPOSITORY" + "GITHUB_EVENT_NAME" + "GITHUB_EVENT_PATH" + "GITHUB_SHA" + "GITHUB_REF" + "GITHUB_HEAD_REF" + "GITHUB_BASE_REF" + ) +elif [[ "${CIRCLECI:-}" == "true" ]]; then + RUNNING_IN_CI="true" + TRAMPOLINE_CI="circleci" + pass_down_envvars+=( + "CIRCLE_BRANCH" + "CIRCLE_BUILD_NUM" + "CIRCLE_BUILD_URL" + "CIRCLE_COMPARE_URL" + "CIRCLE_JOB" + "CIRCLE_NODE_INDEX" + "CIRCLE_NODE_TOTAL" + "CIRCLE_PREVIOUS_BUILD_NUM" + "CIRCLE_PROJECT_REPONAME" + "CIRCLE_PROJECT_USERNAME" + "CIRCLE_REPOSITORY_URL" + "CIRCLE_SHA1" + "CIRCLE_STAGE" + "CIRCLE_USERNAME" + "CIRCLE_WORKFLOW_ID" + "CIRCLE_WORKFLOW_JOB_ID" + "CIRCLE_WORKFLOW_UPSTREAM_JOB_IDS" + "CIRCLE_WORKFLOW_WORKSPACE_ID" + ) +fi + +# Configure the service account for pulling the docker image. +function repo_root() { + local dir="$1" + while [[ ! -d "${dir}/.git" ]]; do + dir="$(dirname "$dir")" + done + echo "${dir}" +} + +# Detect the project root. In CI builds, we assume the script is in +# the git tree and traverse from there, otherwise, traverse from `pwd` +# to find `.git` directory. +if [[ "${RUNNING_IN_CI:-}" == "true" ]]; then + PROGRAM_PATH="$(realpath "$0")" + PROGRAM_DIR="$(dirname "${PROGRAM_PATH}")" + PROJECT_ROOT="$(repo_root "${PROGRAM_DIR}")/handwritten/bigtable" +else + PROJECT_ROOT="$(repo_root $(pwd))/handwritten/bigtable" +fi + +log_yellow "Changing to the project root: ${PROJECT_ROOT}." +cd "${PROJECT_ROOT}" + +# Auto-injected conditional check +# Check if the package directory has changes. If not, skip tests. +if [[ "${RUNNING_IN_CI:-}" == "true" ]]; then + # The package path is hardcoded during migration + RELATIVE_PKG_PATH="handwritten/bigtable" + + echo "Checking for changes in ${RELATIVE_PKG_PATH}..." + + # Determine the diff range based on the CI system/event + # Safe default: HEAD~1..HEAD + DIFF_RANGE="HEAD~1..HEAD" + + if git diff --quiet "${DIFF_RANGE}" -- "${RELATIVE_PKG_PATH}"; then + echo "No changes detected in ${RELATIVE_PKG_PATH}. Skipping tests." + exit 0 + else + echo "Changes detected in ${RELATIVE_PKG_PATH}. Proceeding with tests." + fi +fi + +# To support relative path for `TRAMPOLINE_SERVICE_ACCOUNT`, we need +# to use this environment variable in `PROJECT_ROOT`. +if [[ -n "${TRAMPOLINE_SERVICE_ACCOUNT:-}" ]]; then + + mkdir -p "${tmpdir}/gcloud" + gcloud_config_dir="${tmpdir}/gcloud" + + log_yellow "Using isolated gcloud config: ${gcloud_config_dir}." + export CLOUDSDK_CONFIG="${gcloud_config_dir}" + + log_yellow "Using ${TRAMPOLINE_SERVICE_ACCOUNT} for authentication." + gcloud auth activate-service-account \ + --key-file "${TRAMPOLINE_SERVICE_ACCOUNT}" + log_yellow "Configuring Container Registry access" + gcloud auth configure-docker --quiet +fi + +required_envvars=( + # The basic trampoline configurations. + "TRAMPOLINE_IMAGE" + "TRAMPOLINE_BUILD_FILE" +) + +if [[ -f "${PROJECT_ROOT}/.trampolinerc" ]]; then + source "${PROJECT_ROOT}/.trampolinerc" +fi + +log_yellow "Checking environment variables." +for e in "${required_envvars[@]}" +do + if [[ -z "${!e:-}" ]]; then + log "Missing ${e} env var. Aborting." + exit 1 + fi +done + +# We want to support legacy style TRAMPOLINE_BUILD_FILE used with V1 +# script: e.g. "github/repo-name/.kokoro/run_tests.sh" +TRAMPOLINE_BUILD_FILE="${TRAMPOLINE_BUILD_FILE#github/*/}" +log_yellow "Using TRAMPOLINE_BUILD_FILE: ${TRAMPOLINE_BUILD_FILE}" + +# ignore error on docker operations and test execution +set +e + +log_yellow "Preparing Docker image." +# We only download the docker image in CI builds. +if [[ "${RUNNING_IN_CI:-}" == "true" ]]; then + # Download the docker image specified by `TRAMPOLINE_IMAGE` + + # We may want to add --max-concurrent-downloads flag. + + log_yellow "Start pulling the Docker image: ${TRAMPOLINE_IMAGE}." + if docker pull "${TRAMPOLINE_IMAGE}"; then + log_green "Finished pulling the Docker image: ${TRAMPOLINE_IMAGE}." + has_image="true" + else + log_red "Failed pulling the Docker image: ${TRAMPOLINE_IMAGE}." + has_image="false" + fi +else + # For local run, check if we have the image. + if docker images "${TRAMPOLINE_IMAGE}" | grep "${TRAMPOLINE_IMAGE%:*}"; then + has_image="true" + else + has_image="false" + fi +fi + + +# The default user for a Docker container has uid 0 (root). To avoid +# creating root-owned files in the build directory we tell docker to +# use the current user ID. +user_uid="$(id -u)" +user_gid="$(id -g)" +user_name="$(id -un)" + +# To allow docker in docker, we add the user to the docker group in +# the host os. +docker_gid=$(cut -d: -f3 < <(getent group docker)) + +update_cache="false" +if [[ "${TRAMPOLINE_DOCKERFILE:-none}" != "none" ]]; then + # Build the Docker image from the source. + context_dir=$(dirname "${TRAMPOLINE_DOCKERFILE}") + docker_build_flags=( + "-f" "${TRAMPOLINE_DOCKERFILE}" + "-t" "${TRAMPOLINE_IMAGE}" + "--build-arg" "UID=${user_uid}" + "--build-arg" "USERNAME=${user_name}" + ) + if [[ "${has_image}" == "true" ]]; then + docker_build_flags+=("--cache-from" "${TRAMPOLINE_IMAGE}") + fi + + log_yellow "Start building the docker image." + if [[ "${TRAMPOLINE_VERBOSE:-false}" == "true" ]]; then + echo "docker build" "${docker_build_flags[@]}" "${context_dir}" + fi + + # ON CI systems, we want to suppress docker build logs, only + # output the logs when it fails. + if [[ "${RUNNING_IN_CI:-}" == "true" ]]; then + if docker build "${docker_build_flags[@]}" "${context_dir}" \ + > "${tmpdir}/docker_build.log" 2>&1; then + if [[ "${TRAMPOLINE_VERBOSE:-}" == "true" ]]; then + cat "${tmpdir}/docker_build.log" + fi + + log_green "Finished building the docker image." + update_cache="true" + else + log_red "Failed to build the Docker image, aborting." + log_yellow "Dumping the build logs:" + cat "${tmpdir}/docker_build.log" + exit 1 + fi + else + if docker build "${docker_build_flags[@]}" "${context_dir}"; then + log_green "Finished building the docker image." + update_cache="true" + else + log_red "Failed to build the Docker image, aborting." + exit 1 + fi + fi +else + if [[ "${has_image}" != "true" ]]; then + log_red "We do not have ${TRAMPOLINE_IMAGE} locally, aborting." + exit 1 + fi +fi + +# We use an array for the flags so they are easier to document. +docker_flags=( + # Remove the container after it exists. + "--rm" + + # Use the host network. + "--network=host" + + # Run in priviledged mode. We are not using docker for sandboxing or + # isolation, just for packaging our dev tools. + "--privileged" + + # Run the docker script with the user id. Because the docker image gets to + # write in ${PWD} you typically want this to be your user id. + # To allow docker in docker, we need to use docker gid on the host. + "--user" "${user_uid}:${docker_gid}" + + # Pass down the USER. + "--env" "USER=${user_name}" + + # Mount the project directory inside the Docker container. + "--volume" "${PROJECT_ROOT}:${TRAMPOLINE_WORKSPACE}" + "--workdir" "${TRAMPOLINE_WORKSPACE}" + "--env" "PROJECT_ROOT=${TRAMPOLINE_WORKSPACE}" + + # Mount the temporary home directory. + "--volume" "${tmphome}:/h" + "--env" "HOME=/h" + + # Allow docker in docker. + "--volume" "/var/run/docker.sock:/var/run/docker.sock" + + # Mount the /tmp so that docker in docker can mount the files + # there correctly. + "--volume" "/tmp:/tmp" + # Pass down the KOKORO_GFILE_DIR and KOKORO_KEYSTORE_DIR + # TODO(tmatsuo): This part is not portable. + "--env" "TRAMPOLINE_SECRET_DIR=/secrets" + "--volume" "${KOKORO_GFILE_DIR:-/dev/shm}:/secrets/gfile" + "--env" "KOKORO_GFILE_DIR=/secrets/gfile" + "--volume" "${KOKORO_KEYSTORE_DIR:-/dev/shm}:/secrets/keystore" + "--env" "KOKORO_KEYSTORE_DIR=/secrets/keystore" +) + +# Add an option for nicer output if the build gets a tty. +if [[ -t 0 ]]; then + docker_flags+=("-it") +fi + +# Passing down env vars +for e in "${pass_down_envvars[@]}" +do + if [[ -n "${!e:-}" ]]; then + docker_flags+=("--env" "${e}=${!e}") + fi +done + +# If arguments are given, all arguments will become the commands run +# in the container, otherwise run TRAMPOLINE_BUILD_FILE. +if [[ $# -ge 1 ]]; then + log_yellow "Running the given commands '" "${@:1}" "' in the container." + readonly commands=("${@:1}") + if [[ "${TRAMPOLINE_VERBOSE:-}" == "true" ]]; then + echo docker run "${docker_flags[@]}" "${TRAMPOLINE_IMAGE}" "${commands[@]}" + fi + docker run "${docker_flags[@]}" "${TRAMPOLINE_IMAGE}" "${commands[@]}" +else + log_yellow "Running the tests in a Docker container." + docker_flags+=("--entrypoint=${TRAMPOLINE_BUILD_FILE}") + if [[ "${TRAMPOLINE_VERBOSE:-}" == "true" ]]; then + echo docker run "${docker_flags[@]}" "${TRAMPOLINE_IMAGE}" + fi + docker run "${docker_flags[@]}" "${TRAMPOLINE_IMAGE}" +fi + + +test_retval=$? + +if [[ ${test_retval} -eq 0 ]]; then + log_green "Build finished with ${test_retval}" +else + log_red "Build finished with ${test_retval}" +fi + +# Only upload it when the test passes. +if [[ "${update_cache}" == "true" ]] && \ + [[ $test_retval == 0 ]] && \ + [[ "${TRAMPOLINE_IMAGE_UPLOAD:-false}" == "true" ]]; then + log_yellow "Uploading the Docker image." + if docker push "${TRAMPOLINE_IMAGE}"; then + log_green "Finished uploading the Docker image." + else + log_red "Failed uploading the Docker image." + fi + # Call trampoline_after_upload_hook if it's defined. + if function_exists trampoline_after_upload_hook; then + trampoline_after_upload_hook + fi + +fi + +exit "${test_retval}" diff --git a/handwritten/bigtable/.mocharc.js b/handwritten/bigtable/.mocharc.js new file mode 100644 index 00000000000..9dd7568d789 --- /dev/null +++ b/handwritten/bigtable/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": false, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/handwritten/bigtable/.nycrc b/handwritten/bigtable/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/handwritten/bigtable/.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/handwritten/bigtable/.prettierignore b/handwritten/bigtable/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/handwritten/bigtable/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/handwritten/bigtable/.prettierrc.js b/handwritten/bigtable/.prettierrc.js new file mode 100644 index 00000000000..d2eddc2ed89 --- /dev/null +++ b/handwritten/bigtable/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/handwritten/bigtable/.repo-metadata.json b/handwritten/bigtable/.repo-metadata.json new file mode 100644 index 00000000000..c9f884fae8c --- /dev/null +++ b/handwritten/bigtable/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "bigtable", + "name_pretty": "Cloud Bigtable", + "product_documentation": "https://cloud.google.com/bigtable", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/bigtable/latest", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559777", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/bigtable", + "api_id": "bigtable.googleapis.com", + "requires_billing": true, + "codeowner_team": "@googleapis/bigtable-team @googleapis/cloud-sdk-nodejs-team", + "api_shortname": "bigtable", + "library_type": "GAPIC_COMBO" +} diff --git a/handwritten/bigtable/.trampolinerc b/handwritten/bigtable/.trampolinerc new file mode 100644 index 00000000000..a38a309cd7e --- /dev/null +++ b/handwritten/bigtable/.trampolinerc @@ -0,0 +1,52 @@ +# 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. + +# Template for .trampolinerc + +# Add required env vars here. +required_envvars+=( +) + +# Add env vars which are passed down into the container here. +pass_down_envvars+=( + "AUTORELEASE_PR" + "VERSION" +) + +# Prevent unintentional override on the default image. +if [[ "${TRAMPOLINE_IMAGE_UPLOAD:-false}" == "true" ]] && \ + [[ -z "${TRAMPOLINE_IMAGE:-}" ]]; then + echo "Please set TRAMPOLINE_IMAGE if you want to upload the Docker image." + exit 1 +fi + +# Define the default value if it makes sense. +if [[ -z "${TRAMPOLINE_IMAGE_UPLOAD:-}" ]]; then + TRAMPOLINE_IMAGE_UPLOAD="" +fi + +if [[ -z "${TRAMPOLINE_IMAGE:-}" ]]; then + TRAMPOLINE_IMAGE="" +fi + +if [[ -z "${TRAMPOLINE_DOCKERFILE:-}" ]]; then + TRAMPOLINE_DOCKERFILE="" +fi + +if [[ -z "${TRAMPOLINE_BUILD_FILE:-}" ]]; then + TRAMPOLINE_BUILD_FILE="" +fi + +# Secret Manager secrets. +source ${PROJECT_ROOT}/handwritten/bigtable/.kokoro/populate-secrets.sh diff --git a/handwritten/bigtable/CHANGELOG.md b/handwritten/bigtable/CHANGELOG.md new file mode 100644 index 00000000000..42a676d8ee9 --- /dev/null +++ b/handwritten/bigtable/CHANGELOG.md @@ -0,0 +1,875 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/bigtable?activeTab=versions + +## [6.5.0](https://github.com/googleapis/nodejs-bigtable/compare/v6.4.1...v6.5.0) (2026-01-28) + + +### Features + +* Admin function modernization ([#1748](https://github.com/googleapis/nodejs-bigtable/issues/1748)) ([a0f216e](https://github.com/googleapis/nodejs-bigtable/commit/a0f216e68d8e90000d00bba49899e9306dd687f9)) + + +### Bug Fixes + +* Client side metrics should record the version number of @google-cloud/bigtable not the customer package version ([#1752](https://github.com/googleapis/nodejs-bigtable/issues/1752)) ([3e532ab](https://github.com/googleapis/nodejs-bigtable/commit/3e532ab657409c7acd09008c143c41d36d9efd41)) +* Correct project id on client side metrics by avoiding getProjectId calls with the metric service client ([#1757](https://github.com/googleapis/nodejs-bigtable/issues/1757)) ([a719d9f](https://github.com/googleapis/nodejs-bigtable/commit/a719d9f295c91e5b63592e34954059a9fa8fd8b3)) +* **deps:** Update dependency arrify to v2.0.1 ([#1588](https://github.com/googleapis/nodejs-bigtable/issues/1588)) ([fccdbbb](https://github.com/googleapis/nodejs-bigtable/commit/fccdbbb0309191a731c23b196a4c19c59e057cd7)) +* Record grpc code string for client side metrics instead of grpc code number ([#1754](https://github.com/googleapis/nodejs-bigtable/issues/1754)) ([be5b598](https://github.com/googleapis/nodejs-bigtable/commit/be5b598dd3fbb08e6c7bb5960b8c04a7e54da16a)) + +## [6.4.1](https://github.com/googleapis/nodejs-bigtable/compare/v6.4.0...v6.4.1) (2025-09-09) + + +### Bug Fixes + +* Directly import JS-native impl for crc32c on non-x64 platforms to avoid segfault ([#1715](https://github.com/googleapis/nodejs-bigtable/issues/1715)) ([9848963](https://github.com/googleapis/nodejs-bigtable/commit/98489637befe779df0438f466eecb0428222a29a)) + +## [6.4.0](https://github.com/googleapis/nodejs-bigtable/compare/v6.3.0...v6.4.0) (2025-08-21) + + +### Features + +* Enable csm by default ([#1695](https://github.com/googleapis/nodejs-bigtable/issues/1695)) ([9744aa3](https://github.com/googleapis/nodejs-bigtable/commit/9744aa355e87c2170019c52b58d1045160f19e7c)) +* For application latencies timed stream a few cosmetic changes are needed ([#1645](https://github.com/googleapis/nodejs-bigtable/issues/1645)) ([75d1a6f](https://github.com/googleapis/nodejs-bigtable/commit/75d1a6f5bc8d8cd74214bdf3c9db9d06786f9575)) + +## [6.3.0](https://github.com/googleapis/nodejs-bigtable/compare/v6.2.0...v6.3.0) (2025-08-11) + + +### Features + +* Add client side metrics for checkAndMutateRow calls ([#1661](https://github.com/googleapis/nodejs-bigtable/issues/1661)) ([c258ea1](https://github.com/googleapis/nodejs-bigtable/commit/c258ea1b29203aad3eaaf9cfe64ddabb8c1018bf)) +* Add client side metrics for readModifyWriteRow calls ([#1656](https://github.com/googleapis/nodejs-bigtable/issues/1656)) ([2129312](https://github.com/googleapis/nodejs-bigtable/commit/2129312401bf9f5b8e51b13ac576cb765de401df)) +* Client side metrics support for mutateRows ([#1638](https://github.com/googleapis/nodejs-bigtable/issues/1638)) ([7601e4d](https://github.com/googleapis/nodejs-bigtable/commit/7601e4da115ff6a5da411cc857917b579c70ced7)) +* Collect client side metrics for sampleRowKeys calls ([#1660](https://github.com/googleapis/nodejs-bigtable/issues/1660)) ([6ed98fa](https://github.com/googleapis/nodejs-bigtable/commit/6ed98faefe446e67f83fd5394aae30374fd3ec3a)) +* For client side metrics, record metrics as MUTATE_ROW for single row mutates ([#1650](https://github.com/googleapis/nodejs-bigtable/issues/1650)) ([f190a8c](https://github.com/googleapis/nodejs-bigtable/commit/f190a8c322498ddfbe73406759a43a268c16bdc4)) +* Record ReadRows application latencies for client side metrics ([#1647](https://github.com/googleapis/nodejs-bigtable/issues/1647)) ([8af801b](https://github.com/googleapis/nodejs-bigtable/commit/8af801b3ecd7ff5e30e6c8cc67bd4123bdf34ee9)) + + +### Bug Fixes + +* FirstResponseLatencies should only be collected for readRows calls ([#1658](https://github.com/googleapis/nodejs-bigtable/issues/1658)) ([99cf5a6](https://github.com/googleapis/nodejs-bigtable/commit/99cf5a6010249ed0eedd88f23b2d32cacb106c07)) + +## [6.2.0](https://github.com/googleapis/nodejs-bigtable/compare/v6.1.0...v6.2.0) (2025-07-23) + + +### Features + +* Add client side metrics collection to readRows calls ([#1571](https://github.com/googleapis/nodejs-bigtable/issues/1571)) ([71f4d78](https://github.com/googleapis/nodejs-bigtable/commit/71f4d78422137c88f1521be45004982367dbda31)) +* Add plumbing to support unary calls for client side metric collection ([#1631](https://github.com/googleapis/nodejs-bigtable/issues/1631)) ([c267ede](https://github.com/googleapis/nodejs-bigtable/commit/c267ede0140aa29bc75feada93899a4945980375)) +* Add support for Execute Query ([#1613](https://github.com/googleapis/nodejs-bigtable/issues/1613)) ([e3894ed](https://github.com/googleapis/nodejs-bigtable/commit/e3894edf4fc881153432f77ce976141397dc0348)) +* Initial timed stream implementation for application latencies ([#1639](https://github.com/googleapis/nodejs-bigtable/issues/1639)) ([ca490e8](https://github.com/googleapis/nodejs-bigtable/commit/ca490e80f2359156475e52c5f72fe0a9fe8e9740)) + + +### Bug Fixes + +* In Client-side metrics makes sure that the right views get created for the right metrics ([#1590](https://github.com/googleapis/nodejs-bigtable/issues/1590)) ([6cb7cdd](https://github.com/googleapis/nodejs-bigtable/commit/6cb7cddf42ff1fe29b2ae4a729739bc12c3d4942)) + +## [6.1.0](https://github.com/googleapis/nodejs-bigtable/compare/v6.0.0...v6.1.0) (2025-05-30) + + +### Features + +* Add full support for Universe Domain ([#1604](https://github.com/googleapis/nodejs-bigtable/issues/1604)) ([4562e23](https://github.com/googleapis/nodejs-bigtable/commit/4562e2329e734c0c9d9f00cfa83aa2be13e9a7fe)) + +## [6.0.0](https://github.com/googleapis/nodejs-bigtable/compare/v5.1.2...v6.0.0) (2025-04-22) + + +### ⚠ BREAKING CHANGES + +* migrate to Node 18 ([#1582](https://github.com/googleapis/nodejs-bigtable/issues/1582)) + +### Features + +* Add fields and the BackupType proto for Hot Backups ([#1439](https://github.com/googleapis/nodejs-bigtable/issues/1439)) ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177)) +* Add MergeToCell to Mutation APIs ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177)) +* Add min, max, hll aggregators and more types ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177)) +* Add plumbing PR for client side metrics to support the open telemetry instruments ([#1569](https://github.com/googleapis/nodejs-bigtable/issues/1569)) ([c37a451](https://github.com/googleapis/nodejs-bigtable/commit/c37a451c52ff5639fc9f5e76c88e93ba549fe6c9)) +* Add the MetricsCollector for client side metrics ([#1566](https://github.com/googleapis/nodejs-bigtable/issues/1566)) ([d475ef2](https://github.com/googleapis/nodejs-bigtable/commit/d475ef2131ab1d18d70b2666d9f3405ad8a21449)) +* Add the plumbing for application blocking latencies client side metrics ([#1575](https://github.com/googleapis/nodejs-bigtable/issues/1575)) ([967f440](https://github.com/googleapis/nodejs-bigtable/commit/967f440fbcdc29040dddfae561b03f3c3462b671)) +* Bigtable authorized views requests on the Data plane ([#1509](https://github.com/googleapis/nodejs-bigtable/issues/1509)) ([da373b5](https://github.com/googleapis/nodejs-bigtable/commit/da373b5dcc51b459527c0797ac237c073364ca36)) +* Move the metrics handler fixture ([#1570](https://github.com/googleapis/nodejs-bigtable/issues/1570)) ([c97ebcc](https://github.com/googleapis/nodejs-bigtable/commit/c97ebcc6b9b8c36e0f39b79dd3ab75aaef6c52c5)) +* Publish ProtoRows Message ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177)) +* Publish the Cloud Bigtable ExecuteQuery API ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177)) +* Update Go Bigtable import path ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177)) +* Update Go Datastore import path ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177)) + + +### Bug Fixes + +* Address assertion error in TestReadRows_Retry_LastScannedRow conformance test ([#1521](https://github.com/googleapis/nodejs-bigtable/issues/1521)) ([0552638](https://github.com/googleapis/nodejs-bigtable/commit/0552638ca4c820dadcd66633d1f555ab3e5b1937)) +* Check and mutate generic header conformance test ([#1551](https://github.com/googleapis/nodejs-bigtable/issues/1551)) ([7f1099a](https://github.com/googleapis/nodejs-bigtable/commit/7f1099afbd5af1639b843285a9ce6358f067e50e)) +* Conformance test sample rowkeys generic deadline ([#1562](https://github.com/googleapis/nodejs-bigtable/issues/1562)) ([2fdf98f](https://github.com/googleapis/nodejs-bigtable/commit/2fdf98f9398761046f41bd58e00258f0d4963a3d)) +* Fix plumbing errors for client side metrics collection ([#1583](https://github.com/googleapis/nodejs-bigtable/issues/1583)) ([574c2f4](https://github.com/googleapis/nodejs-bigtable/commit/574c2f473e88174c05889e0294b2d25de2ad11dd)) +* Fix TestReadRows_Generic_CloseClient conformance test by passing grpc status codes for closed client errors ([#1524](https://github.com/googleapis/nodejs-bigtable/issues/1524)) ([8524174](https://github.com/googleapis/nodejs-bigtable/commit/8524174d9214c4391e9f1c06458c206acd685dc2)) +* Paused scan test is now fixed ([#1539](https://github.com/googleapis/nodejs-bigtable/issues/1539)) ([d009a8f](https://github.com/googleapis/nodejs-bigtable/commit/d009a8f9bb86c2efa192e98e565cd7b305700ff9)) +* Sample rowkey generic header conformance test ([#1550](https://github.com/googleapis/nodejs-bigtable/issues/1550)) ([6ef7671](https://github.com/googleapis/nodejs-bigtable/commit/6ef76713dc8823cfb2131a60f3a09174d42b655c)) +* TestMutateRow_Generic_Headers ([#1540](https://github.com/googleapis/nodejs-bigtable/issues/1540)) ([f6176c1](https://github.com/googleapis/nodejs-bigtable/commit/f6176c110f832dbacc14ac60fa1870e69aa139ce)) +* Update owlbot.py to exculde sync repo ([#1549](https://github.com/googleapis/nodejs-bigtable/issues/1549)) ([f1ad565](https://github.com/googleapis/nodejs-bigtable/commit/f1ad565b321b0d45baed5c3304b4a9990c4b9c41)) +* Update sync-repo-settings.yaml to make owl bot optional ([#1547](https://github.com/googleapis/nodejs-bigtable/issues/1547)) ([d745412](https://github.com/googleapis/nodejs-bigtable/commit/d745412dd43965d5d8ac7f83c823314043bc0fca)) +* Use the universe domain if it is provided by the user ([#1563](https://github.com/googleapis/nodejs-bigtable/issues/1563)) ([d26ecb8](https://github.com/googleapis/nodejs-bigtable/commit/d26ecb8d2260b434d2f37abf28b92e50db25c45d)) + + +### Miscellaneous Chores + +* Migrate to Node 18 ([#1582](https://github.com/googleapis/nodejs-bigtable/issues/1582)) ([e50b67d](https://github.com/googleapis/nodejs-bigtable/commit/e50b67da62f9640c10a32bd9e0ff067fc522a7b0)) + +## [5.1.2](https://github.com/googleapis/nodejs-bigtable/compare/v5.1.1...v5.1.2) (2024-07-22) + + +### Bug Fixes + +* Throw away excess data in order to avoid delivering duplicate data ([#1453](https://github.com/googleapis/nodejs-bigtable/issues/1453)) ([069239d](https://github.com/googleapis/nodejs-bigtable/commit/069239dce83498293e86851d37ad5943b5d919da)) + +## [5.1.1](https://github.com/googleapis/nodejs-bigtable/compare/v5.1.0...v5.1.1) (2024-07-11) + + +### Bug Fixes + +* Ensure that during resumption of a scan, rows that have not been observed by the caller are re-requested ([#1444](https://github.com/googleapis/nodejs-bigtable/issues/1444)) ([2d8de32](https://github.com/googleapis/nodejs-bigtable/commit/2d8de3247595a08c5cd0f7b42a59eb44dd255797)) +* Remove custom readrows retry logic and rely on gax for retries ([#1422](https://github.com/googleapis/nodejs-bigtable/issues/1422)) ([3e0a46e](https://github.com/googleapis/nodejs-bigtable/commit/3e0a46e1a9bf68ac8f4b74f9a202291d00681074)) + +## [5.1.0](https://github.com/googleapis/nodejs-bigtable/compare/v5.0.0...v5.1.0) (2024-05-28) + + +### Features + +* Add feature for copying backups ([#1153](https://github.com/googleapis/nodejs-bigtable/issues/1153)) ([91f85b5](https://github.com/googleapis/nodejs-bigtable/commit/91f85b53340b9bf0bfb4620a4027333890030efe)) +* Add String type with Utf8Raw encoding to Bigtable API ([#1419](https://github.com/googleapis/nodejs-bigtable/issues/1419)) ([724b711](https://github.com/googleapis/nodejs-bigtable/commit/724b7118972e6697e3fd648b5d6ce2d047ab2b6a)) +* Publish Automated Backups protos ([#1391](https://github.com/googleapis/nodejs-bigtable/issues/1391)) ([17838ed](https://github.com/googleapis/nodejs-bigtable/commit/17838eda19b001e322765c33a83a756eeeb68963)) +* Trusted Private Cloud support, use the universeDomain parameter ([#1386](https://github.com/googleapis/nodejs-bigtable/issues/1386)) ([c0c287e](https://github.com/googleapis/nodejs-bigtable/commit/c0c287e2d386758609f57f3efee78b18fc9d8b7d)) + + +### Bug Fixes + +* **deps:** Update dependency @google-cloud/precise-date to v4 ([#1318](https://github.com/googleapis/nodejs-bigtable/issues/1318)) ([9dcef90](https://github.com/googleapis/nodejs-bigtable/commit/9dcef901b0cc7a52afb4c3f85622bd08e67d7429)) +* Extend timeouts for deleting snapshots, backups and tables ([#1387](https://github.com/googleapis/nodejs-bigtable/issues/1387)) ([1a6f59a](https://github.com/googleapis/nodejs-bigtable/commit/1a6f59afd238ccda4427251cbe0c71c8db37568e)) +* Fix flakey test by extending timeout ([#1350](https://github.com/googleapis/nodejs-bigtable/issues/1350)) ([906ac79](https://github.com/googleapis/nodejs-bigtable/commit/906ac796e3aaf724d00607854162bdefedcee96d)) +* Improve retry logic for streaming API calls ([#1372](https://github.com/googleapis/nodejs-bigtable/issues/1372)) ([e8083a4](https://github.com/googleapis/nodejs-bigtable/commit/e8083a4c71e0523e196911fbf6262ff8fe6272de)) +* Remove the watermarks ([#1313](https://github.com/googleapis/nodejs-bigtable/issues/1313)) ([0126a0e](https://github.com/googleapis/nodejs-bigtable/commit/0126a0ea1e4b6a845acb4e5600ddb3082443d310)) + +## [5.0.0](https://github.com/googleapis/nodejs-bigtable/compare/v4.6.1...v5.0.0) (2023-08-10) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 14 ([#1311](https://github.com/googleapis/nodejs-bigtable/issues/1311)) + +### Miscellaneous Chores + +* Upgrade to Node 14 ([#1311](https://github.com/googleapis/nodejs-bigtable/issues/1311)) ([4330cb2](https://github.com/googleapis/nodejs-bigtable/commit/4330cb238ec887e85456cde0f18f3881caca5e14)) + +## [4.6.1](https://github.com/googleapis/nodejs-bigtable/compare/v4.6.0...v4.6.1) (2023-05-30) + + +### Bug Fixes + +* Properly handle asynchronous read from stream ([#1284](https://github.com/googleapis/nodejs-bigtable/issues/1284)) ([55d86ba](https://github.com/googleapis/nodejs-bigtable/commit/55d86baaf554247c0c3d063fc790a37569f3e77b)). This could result in silently dropped rows in a `createReadStream`. The bug is active when the `ReadRows` stream would be piped into a consumer that would defer the processing of the rows until the next event loop run (i.e. use a `Transform` that would defer the callback invocation via `setTimeout()`). + + +## [4.6.0](https://github.com/googleapis/nodejs-bigtable/compare/v4.5.2...v4.6.0) (2023-05-26) + + +### Features + +* Add ChangeStreamConfig to CreateTable and UpdateTable ([#1269](https://github.com/googleapis/nodejs-bigtable/issues/1269)) ([2b05fa4](https://github.com/googleapis/nodejs-bigtable/commit/2b05fa4c7ad37fa4478f5de3cf5645b44b34ecfc)) + +## [4.5.2](https://github.com/googleapis/nodejs-bigtable/compare/v4.5.1...v4.5.2) (2023-05-24) + + +### Bug Fixes + +* Parsing for qualifiers with colon characters ([#1277](https://github.com/googleapis/nodejs-bigtable/issues/1277)) ([b80f533](https://github.com/googleapis/nodejs-bigtable/commit/b80f5338ae1721659c61e48d80ba976c148c8087)) + +## [4.5.1](https://github.com/googleapis/nodejs-bigtable/compare/v4.5.0...v4.5.1) (2023-04-28) + + +### Bug Fixes + +* Remove bigtable instances left over when system tests run ([#1265](https://github.com/googleapis/nodejs-bigtable/issues/1265)) ([0526612](https://github.com/googleapis/nodejs-bigtable/commit/0526612c1023816053775fa1956cbb8b97f49b00)) + +## [4.5.0](https://github.com/googleapis/nodejs-bigtable/compare/v4.4.0...v4.5.0) (2023-03-20) + + +### Features + +* Add npm run compile to the testproxy command ([#1258](https://github.com/googleapis/nodejs-bigtable/issues/1258)) ([52c06a2](https://github.com/googleapis/nodejs-bigtable/commit/52c06a2684824f10e218856f632da7e4e252b2bf)) + + +### Bug Fixes + +* Always set the retry attempt to 0 for now ([#1251](https://github.com/googleapis/nodejs-bigtable/issues/1251)) ([5ee6f19](https://github.com/googleapis/nodejs-bigtable/commit/5ee6f19f6dd6fee0d48e692242e99c1966bb8df6)) + +## [4.4.0](https://github.com/googleapis/nodejs-bigtable/compare/v4.3.0...v4.4.0) (2023-03-01) + + +### Features + +* Add new_partitions field for CloseStream for Cloud Bigtable ChangeStream ([#1247](https://github.com/googleapis/nodejs-bigtable/issues/1247)) ([ecbdb52](https://github.com/googleapis/nodejs-bigtable/commit/ecbdb52ddc920bd493b284fb7d96b359a2f773f9)) + +## [4.3.0](https://github.com/googleapis/nodejs-bigtable/compare/v4.2.0...v4.3.0) (2023-02-10) + + +### Features + +* Publish the Cloud Bigtable Change Streams ([#1237](https://github.com/googleapis/nodejs-bigtable/issues/1237)) ([000a353](https://github.com/googleapis/nodejs-bigtable/commit/000a353f05fa65bc0a7dc551c777ac55c6c08875)) + + +### Bug Fixes + +* Out of order read rows fix ([#1231](https://github.com/googleapis/nodejs-bigtable/issues/1231)) ([7dbaa6e](https://github.com/googleapis/nodejs-bigtable/commit/7dbaa6eebc5df6c073c78ff77f38b70c3e6f29d5)) + +## [4.2.0](https://github.com/googleapis/nodejs-bigtable/compare/v4.1.1...v4.2.0) (2023-01-31) + + +### Features + +* Added SuggestConversationSummary RPC ([#1182](https://github.com/googleapis/nodejs-bigtable/issues/1182)) ([355925e](https://github.com/googleapis/nodejs-bigtable/commit/355925ee519fa27e216a76c500ab8c94de1d2c96)) + +## [4.1.1](https://github.com/googleapis/nodejs-bigtable/compare/v4.1.0...v4.1.1) (2023-01-30) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#1186](https://github.com/googleapis/nodejs-bigtable/issues/1186)) ([4b1dd6e](https://github.com/googleapis/nodejs-bigtable/commit/4b1dd6e8d0f1b215a3e8183e5893e9dd01c15eed)) +* Pipe metadata along ([#1178](https://github.com/googleapis/nodejs-bigtable/issues/1178)) ([0822e4d](https://github.com/googleapis/nodejs-bigtable/commit/0822e4d17d28e47b5377d6d3853a4c5bc125a2e9)) + +## [4.1.0](https://github.com/googleapis/nodejs-bigtable/compare/v4.0.5...v4.1.0) (2022-09-26) + + +### Features + +* Publish the RequestStats proto ([#1177](https://github.com/googleapis/nodejs-bigtable/issues/1177)) ([89dfc83](https://github.com/googleapis/nodejs-bigtable/commit/89dfc83b4fed199d70934c34ab7f4c4d17796418)) + +## [4.0.5](https://github.com/googleapis/nodejs-bigtable/compare/v4.0.4...v4.0.5) (2022-09-23) + + +### Bug Fixes + +* Test is less restrictive to allow changes ([#1160](https://github.com/googleapis/nodejs-bigtable/issues/1160)) ([7d05b96](https://github.com/googleapis/nodejs-bigtable/commit/7d05b96f0adcbcdab2598ea52bc6a60005c7251b)) + +## [4.0.4](https://github.com/googleapis/nodejs-bigtable/compare/v4.0.3...v4.0.4) (2022-09-14) + + +### Bug Fixes + +* **deps:** Use grpc-gcp v1.0.0 ([#1156](https://github.com/googleapis/nodejs-bigtable/issues/1156)) ([6196424](https://github.com/googleapis/nodejs-bigtable/commit/61964246cc79b0cb70f18d6bc1e524c01fdd51b0)) + +## [4.0.3](https://github.com/googleapis/nodejs-bigtable/compare/v4.0.2...v4.0.3) (2022-09-09) + + +### Bug Fixes + +* **deps:** Update dependency uuid to v9 ([#1152](https://github.com/googleapis/nodejs-bigtable/issues/1152)) ([dea0425](https://github.com/googleapis/nodejs-bigtable/commit/dea0425df05218cf7fb42e4ef72f3952782f7bbb)) +* Wait for instances to get created in all samples ([#1149](https://github.com/googleapis/nodejs-bigtable/issues/1149)) ([c9dd9c6](https://github.com/googleapis/nodejs-bigtable/commit/c9dd9c614b963763b361394332ad227a86eb0de9)) + +## [4.0.2](https://github.com/googleapis/nodejs-bigtable/compare/v4.0.1...v4.0.2) (2022-08-27) + + +### Bug Fixes + +* add operation ([#1145](https://github.com/googleapis/nodejs-bigtable/issues/1145)) ([3a1e282](https://github.com/googleapis/nodejs-bigtable/commit/3a1e2827990729df078fe1d075c100ace1833a96)) +* do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-bigtable/issues/1553)) ([#1148](https://github.com/googleapis/nodejs-bigtable/issues/1148)) ([262d3d7](https://github.com/googleapis/nodejs-bigtable/commit/262d3d729211da7fa23043c64de59ba67de2ce5b)) +* use google-gax v3.3.0 ([262d3d7](https://github.com/googleapis/nodejs-bigtable/commit/262d3d729211da7fa23043c64de59ba67de2ce5b)) + +## [4.0.1](https://github.com/googleapis/nodejs-bigtable/compare/v4.0.0...v4.0.1) (2022-08-25) + + +### Bug Fixes + +* change import long to require ([#1139](https://github.com/googleapis/nodejs-bigtable/issues/1139)) ([a7079bc](https://github.com/googleapis/nodejs-bigtable/commit/a7079bc414b9d9e64cd47766c68d41740c9ce9e3)) +* **deps:** update dependency @google-cloud/bigtable to v4 ([#1127](https://github.com/googleapis/nodejs-bigtable/issues/1127)) ([c88801a](https://github.com/googleapis/nodejs-bigtable/commit/c88801a8cd872a6bb837e8880f8e7294b6255fb7)) +* fixed the closed client test ([#1138](https://github.com/googleapis/nodejs-bigtable/issues/1138)) ([7f6f0e6](https://github.com/googleapis/nodejs-bigtable/commit/7f6f0e629a7b3f15c9d4bab06b3209d35656d992)) +* Integration test close function again ([#1103](https://github.com/googleapis/nodejs-bigtable/issues/1103)) ([10dcd21](https://github.com/googleapis/nodejs-bigtable/commit/10dcd217a6f276f53f58f3cd89650040d7b88089)) +* Make a ten minute timeout for delete operations ([#1143](https://github.com/googleapis/nodejs-bigtable/issues/1143)) ([94e61dd](https://github.com/googleapis/nodejs-bigtable/commit/94e61dd05134d2d1cb4e04a94f7a4f927da90ea2)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-bigtable/issues/1546)) ([#1140](https://github.com/googleapis/nodejs-bigtable/issues/1140)) ([5bea48f](https://github.com/googleapis/nodejs-bigtable/commit/5bea48f9fcf50575453f6ee85881785e07917543)) +* Wait for long running operation on flakey test ([#1141](https://github.com/googleapis/nodejs-bigtable/issues/1141)) ([7be90ee](https://github.com/googleapis/nodejs-bigtable/commit/7be90ee1011ad44f2f6cd998443a95b73aaa2c55)) + +## [4.0.0](https://github.com/googleapis/nodejs-bigtable/compare/v3.12.0...v4.0.0) (2022-07-04) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#1089) + +### Features + +* Autoscaler ([#1077](https://github.com/googleapis/nodejs-bigtable/issues/1077)) ([e5f6fdb](https://github.com/googleapis/nodejs-bigtable/commit/e5f6fdb5345a19055be812c59796a2e08ea45345)) +* Errors from gax layer ([#1090](https://github.com/googleapis/nodejs-bigtable/issues/1090)) ([ecae5f3](https://github.com/googleapis/nodejs-bigtable/commit/ecae5f3bc00210c44513a40895a3c128938383bf)) +* Multi cluster routing ([#1007](https://github.com/googleapis/nodejs-bigtable/issues/1007)) ([3468cd9](https://github.com/googleapis/nodejs-bigtable/commit/3468cd99f3ea82d06b76359087a82845394dfd03)) +* Remove need to pass location parameter along ([#1093](https://github.com/googleapis/nodejs-bigtable/issues/1093)) ([75c1a30](https://github.com/googleapis/nodejs-bigtable/commit/75c1a301cd3ec91c7b251b384307687d081525b9)) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/precise-date to v3 ([#1097](https://github.com/googleapis/nodejs-bigtable/issues/1097)) ([e8a5ab8](https://github.com/googleapis/nodejs-bigtable/commit/e8a5ab8bc2dd800a78c625ecb42c230c446e092f)) +* **deps:** update dependency @google-cloud/projectify to v3 ([#1102](https://github.com/googleapis/nodejs-bigtable/issues/1102)) ([b997a6b](https://github.com/googleapis/nodejs-bigtable/commit/b997a6b7be9f58a2d2d4884527260a643ae84252)) +* **deps:** update dependency @google-cloud/promisify to v3 ([#1085](https://github.com/googleapis/nodejs-bigtable/issues/1085)) ([62fc17e](https://github.com/googleapis/nodejs-bigtable/commit/62fc17ea517f9b61270b9227226619bd0259a553)) +* **deps:** update dependency grpc-gcp to v0.4.2 ([#1074](https://github.com/googleapis/nodejs-bigtable/issues/1074)) ([54f4202](https://github.com/googleapis/nodejs-bigtable/commit/54f42024c0d3b6dcb117c8ac9811ff14d413454d)) +* fixes for dynamic routing and streaming descriptors ([#1088](https://github.com/googleapis/nodejs-bigtable/issues/1088)) ([bdca7d1](https://github.com/googleapis/nodejs-bigtable/commit/bdca7d18308d5cb1797f6fab5603e55fb3f726b2)) + + +### Build System + +* update library to use Node 12 ([#1089](https://github.com/googleapis/nodejs-bigtable/issues/1089)) ([033bfc8](https://github.com/googleapis/nodejs-bigtable/commit/033bfc878c2aeb40cc40ca66f905e47810f42c12)) + +## [3.13.0](https://github.com/googleapis/nodejs-bigtable/compare/v3.12.0...v3.13.0) (2022-05-11) + + +### Features + +* Multi cluster routing ([#1007](https://github.com/googleapis/nodejs-bigtable/issues/1007)) ([3468cd9](https://github.com/googleapis/nodejs-bigtable/commit/3468cd99f3ea82d06b76359087a82845394dfd03)) + + +### Bug Fixes + +* **deps:** update dependency grpc-gcp to v0.4.2 ([#1074](https://github.com/googleapis/nodejs-bigtable/issues/1074)) ([54f4202](https://github.com/googleapis/nodejs-bigtable/commit/54f42024c0d3b6dcb117c8ac9811ff14d413454d)) + +## [3.12.0](https://github.com/googleapis/nodejs-bigtable/compare/v3.11.0...v3.12.0) (2022-04-13) + + +### Features + +* enable retries for RESOURCE_EXHAUSTED an simplify error codes ([#1070](https://github.com/googleapis/nodejs-bigtable/issues/1070)) ([6832df7](https://github.com/googleapis/nodejs-bigtable/commit/6832df7e5cd863b9c7f0dc67b0602cb8f579d59f)) + +## [3.11.0](https://github.com/googleapis/nodejs-bigtable/compare/v3.10.0...v3.11.0) (2022-04-13) + + +### Features + +* send retry attempt header to ease debugging ([#1068](https://github.com/googleapis/nodejs-bigtable/issues/1068)) ([37f9b3c](https://github.com/googleapis/nodejs-bigtable/commit/37f9b3c841ce34c2a7f4ab140de86eab584b51b9)) + +## [3.10.0](https://github.com/googleapis/nodejs-bigtable/compare/v3.9.4...v3.10.0) (2022-04-06) + + +### Features + +* Add ListHotTablets API method and protobufs ([#1057](https://github.com/googleapis/nodejs-bigtable/issues/1057)) ([2b175ac](https://github.com/googleapis/nodejs-bigtable/commit/2b175ac515948711b2ed9f34136255f69445e02a)) +* AuditConfig for IAM v1 ([#1061](https://github.com/googleapis/nodejs-bigtable/issues/1061)) ([d1b5f1a](https://github.com/googleapis/nodejs-bigtable/commit/d1b5f1aca4464b5e344de19e892dcf889243c578)) +* enable channel pooling ([#1065](https://github.com/googleapis/nodejs-bigtable/issues/1065)) ([6c3c397](https://github.com/googleapis/nodejs-bigtable/commit/6c3c397d080750b696024266a114e12b2db8ab04)) + + +### Bug Fixes + +* disable retry-request, add exponential backoff in mutateRows and readRows ([#1060](https://github.com/googleapis/nodejs-bigtable/issues/1060)) ([3718011](https://github.com/googleapis/nodejs-bigtable/commit/3718011e6d09a062e8e8c3dba822e060340e8b50)) +* retry rst_stream errors ([#1059](https://github.com/googleapis/nodejs-bigtable/issues/1059)) ([90de80f](https://github.com/googleapis/nodejs-bigtable/commit/90de80f7f32e644a0762579afe37951714ac7271)) + +### [3.9.4](https://github.com/googleapis/nodejs-bigtable/compare/v3.9.3...v3.9.4) (2022-03-16) + + +### Bug Fixes + +* do not cancel stream after server returned ok or cancelled status ([#1029](https://github.com/googleapis/nodejs-bigtable/issues/1029)) ([33754a2](https://github.com/googleapis/nodejs-bigtable/commit/33754a2c0cc180cd6ab6e34d722e34c35df9e757)) + +### [3.9.3](https://github.com/googleapis/nodejs-bigtable/compare/v3.9.2...v3.9.3) (2022-03-16) + + +### Bug Fixes + +* fix createReadStream retry from sending a full table scan ([#1026](https://github.com/googleapis/nodejs-bigtable/issues/1026)) ([f926992](https://github.com/googleapis/nodejs-bigtable/commit/f9269926bed0858d122ab6019a9b1e4c33e4307a)) + +### [3.9.2](https://github.com/googleapis/nodejs-bigtable/compare/v3.9.1...v3.9.2) (2022-02-03) + + +### Bug Fixes + +* manual generate library for ongoing stream on closed client ([#1011](https://github.com/googleapis/nodejs-bigtable/issues/1011)) ([b6fec4c](https://github.com/googleapis/nodejs-bigtable/commit/b6fec4ccfebd616b1d79da05817e82d59fdcbe9d)) + +### [3.9.1](https://github.com/googleapis/nodejs-bigtable/compare/v3.9.0...v3.9.1) (2022-02-01) + + +### Bug Fixes + +* update to latest generator with fix for regex bug ([#1000](https://github.com/googleapis/nodejs-bigtable/issues/1000)) ([6a26c07](https://github.com/googleapis/nodejs-bigtable/commit/6a26c07da47c8bcc4ccb399e9289f078e7827780)) + +## [3.9.0](https://github.com/googleapis/nodejs-bigtable/compare/v3.8.0...v3.9.0) (2022-01-18) + + +### Features + +* add Autoscaling API ([#963](https://github.com/googleapis/nodejs-bigtable/issues/963)) ([86d21e8](https://github.com/googleapis/nodejs-bigtable/commit/86d21e8a63449bbf04e26612f44432e33043cc03)) + + +### Bug Fixes + +* add close() in the wrapper ([#986](https://github.com/googleapis/nodejs-bigtable/issues/986)) ([839f429](https://github.com/googleapis/nodejs-bigtable/commit/839f429f707bc7f528e49625af974cf2ab1bde38)) + +## [3.8.0](https://github.com/googleapis/nodejs-bigtable/compare/v3.7.0...v3.8.0) (2022-01-12) + + +### Features + +* Add create_time to Instance ([#953](https://github.com/googleapis/nodejs-bigtable/issues/953)) ([de3fc03](https://github.com/googleapis/nodejs-bigtable/commit/de3fc035092a45e032d53aeaa352e98ad9233213)) + + +### Bug Fixes + +* **deps:** gax to 2.27.1 ([#949](https://github.com/googleapis/nodejs-bigtable/issues/949)) ([0111143](https://github.com/googleapis/nodejs-bigtable/commit/0111143eaee7c93aedb2891867a981f9d63c4f02)) +* fix retry logic in mutate and read ([#980](https://github.com/googleapis/nodejs-bigtable/issues/980)) ([bfa84e1](https://github.com/googleapis/nodejs-bigtable/commit/bfa84e1490d396456d8efbd0fced84b0c71f88a8)) + +## [3.7.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.6.0...v3.7.0) (2021-09-27) + + +### Features + +* turns on self-signed JWT feature flag ([#931](https://www.github.com/googleapis/nodejs-bigtable/issues/931)) ([e16df4b](https://www.github.com/googleapis/nodejs-bigtable/commit/e16df4b482a9d9888a02d8b82250ca1bb01bc18a)) + +## [3.6.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.5.4...v3.6.0) (2021-08-19) + + +### Features + +* Publish new fields to support cluster group routing for Cloud Bigtable ([#928](https://www.github.com/googleapis/nodejs-bigtable/issues/928)) ([52ce890](https://www.github.com/googleapis/nodejs-bigtable/commit/52ce89019fa3f4365f06692db6d7ce3d28aa74a6)) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#925](https://www.github.com/googleapis/nodejs-bigtable/issues/925)) ([135391f](https://www.github.com/googleapis/nodejs-bigtable/commit/135391f4462744d02f51a7351ef8edd8e39034ad)) +* **deps:** google-gax v2.24.1 ([#927](https://www.github.com/googleapis/nodejs-bigtable/issues/927)) ([4869718](https://www.github.com/googleapis/nodejs-bigtable/commit/48697180ed43109e310ae924c8dda0b6a43c5a36)) + +### [3.5.4](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.5.3...v3.5.4) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#914](https://www.github.com/googleapis/nodejs-bigtable/issues/914)) ([f5292e1](https://www.github.com/googleapis/nodejs-bigtable/commit/f5292e1a6899213f229ddaa18cdf13b239487de4)) + +### [3.5.3](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.5.2...v3.5.3) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#912](https://www.github.com/googleapis/nodejs-bigtable/issues/912)) ([18198ab](https://www.github.com/googleapis/nodejs-bigtable/commit/18198ab199b4b88847eca70f9087032723c4a324)) + +### [3.5.2](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.5.1...v3.5.2) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#907](https://www.github.com/googleapis/nodejs-bigtable/issues/907)) ([cf661df](https://www.github.com/googleapis/nodejs-bigtable/commit/cf661df12da9dfd02e97d343a2110ce6099891b9)) + +### [3.5.1](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.5.0...v3.5.1) (2021-06-22) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#873](https://www.github.com/googleapis/nodejs-bigtable/issues/873)) ([9b7c8ca](https://www.github.com/googleapis/nodejs-bigtable/commit/9b7c8ca3acfa5957924735304d6f7f2e8a91bd04)) +* make request optional in all cases ([#901](https://www.github.com/googleapis/nodejs-bigtable/issues/901)) ([0591d53](https://www.github.com/googleapis/nodejs-bigtable/commit/0591d53efeb4b6e5c8f5188e8186e7272932f0e1)) + +## [3.5.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.4.0...v3.5.0) (2021-05-05) + + +### Features + +* implement support for clusters with CMEK encryption ([#855](https://www.github.com/googleapis/nodejs-bigtable/issues/855)) ([0d5d8e6](https://www.github.com/googleapis/nodejs-bigtable/commit/0d5d8e66bb3ce7947903795a5ea0c74362327ebf)) + +## [3.4.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.3.1...v3.4.0) (2021-05-04) + + +### Features + +* implement restore table to a different instance feature ([#830](https://www.github.com/googleapis/nodejs-bigtable/issues/830)) ([#863](https://www.github.com/googleapis/nodejs-bigtable/issues/863)) ([c900b0a](https://www.github.com/googleapis/nodejs-bigtable/commit/c900b0a2bce3d91decbac716da879953966af8c9)) + +### [3.3.1](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.3.0...v3.3.1) (2021-04-20) + + +### Bug Fixes + +* remove common protos ([#853](https://www.github.com/googleapis/nodejs-bigtable/issues/853)) ([d08f481](https://www.github.com/googleapis/nodejs-bigtable/commit/d08f4816205dd5562c280779d5f4c6708cb792be)) + +## [3.3.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.2.0...v3.3.0) (2021-03-08) + + +### Features + +* add CMEK fields ([#845](https://www.github.com/googleapis/nodejs-bigtable/issues/845)) ([0381fb7](https://www.github.com/googleapis/nodejs-bigtable/commit/0381fb7da68492b85f8a3359d5fb97ca4898810e)) +* introduce style enumeration ([#833](https://www.github.com/googleapis/nodejs-bigtable/issues/833)) ([99b7617](https://www.github.com/googleapis/nodejs-bigtable/commit/99b7617e215126fc36ef3c3ebefb244e0d8d2242)) +* **protos:** update BigtableTableAdmin GetIamPolicy, change DeleteAppProfileRequest.ignore_warnings to REQUIRED ([59a0d26](https://www.github.com/googleapis/nodejs-bigtable/commit/59a0d269d5196991dd395e671d7d5f54ce449005)) + + +### Bug Fixes + +* **browser:** check for fetch on window ([#824](https://www.github.com/googleapis/nodejs-bigtable/issues/824)) ([a38cbcc](https://www.github.com/googleapis/nodejs-bigtable/commit/a38cbcca1660bc40fe137acb973bf62f3c55754e)) +* Renaming region tags to not conflict with documentation snippets ([#834](https://www.github.com/googleapis/nodejs-bigtable/issues/834)) ([5d3e8f7](https://www.github.com/googleapis/nodejs-bigtable/commit/5d3e8f721c2a32a33bf41baa1ed237fb90f7cbd6)) +* **retry:** restore grpc_service_config for CreateBackup and RestoreTable ([#851](https://www.github.com/googleapis/nodejs-bigtable/issues/851)) ([3ff2828](https://www.github.com/googleapis/nodejs-bigtable/commit/3ff282855f4f9a52a89bca8d087c1423e71bd7c6)) +* set keepalive configuration ([#836](https://www.github.com/googleapis/nodejs-bigtable/issues/836)) ([8105dea](https://www.github.com/googleapis/nodejs-bigtable/commit/8105dea272de44e69915d3e62e5b5add106b54cb)) + + +## [3.2.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.1.1...v3.2.0) (2020-11-07) + + +### Features + +* add backup level IAM policy controls ([#799](https://www.github.com/googleapis/nodejs-bigtable/issues/799)) ([0f3b8b3](https://www.github.com/googleapis/nodejs-bigtable/commit/0f3b8b3042001f9c47dc1f153c94f1b19a625504)) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#819](https://www.github.com/googleapis/nodejs-bigtable/issues/819)) ([8ad7ab1](https://www.github.com/googleapis/nodejs-bigtable/commit/8ad7ab191e41f18ff2de9803d520f1c05a4940b5)) + +### [3.1.1](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.1.0...v3.1.1) (2020-10-16) + + +### Bug Fixes + +* **deps:** update dependency dot-prop to v6 ([#806](https://www.github.com/googleapis/nodejs-bigtable/issues/806)) ([edf65be](https://www.github.com/googleapis/nodejs-bigtable/commit/edf65bee1b75faac44a6ce15cdf7fab14a3a4405)) + +## [3.1.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.0.1...v3.1.0) (2020-09-10) + + +### Features + +* add gapic getAppProfilesStream method ([#771](https://www.github.com/googleapis/nodejs-bigtable/issues/771)) ([c694ae5](https://www.github.com/googleapis/nodejs-bigtable/commit/c694ae5a9875c2862ecc001f9e5f6bd8212483fa)) +* getAppProfilesStream emits (if there are any failed locations present) decorated error with failedLocations info ([#795](https://www.github.com/googleapis/nodejs-bigtable/issues/795)) ([dbb19fe](https://www.github.com/googleapis/nodejs-bigtable/commit/dbb19fed8ffcd6c5737b65dbe202b3031e4d3387)) +* introduce Backups ([#794](https://www.github.com/googleapis/nodejs-bigtable/issues/794)) ([7979e39](https://www.github.com/googleapis/nodejs-bigtable/commit/7979e3958cf4d1c21f24dc2bfd9fd0e245506fd5)) +* remove through2 dependency ([#770](https://www.github.com/googleapis/nodejs-bigtable/issues/770)) ([29c85d8](https://www.github.com/googleapis/nodejs-bigtable/commit/29c85d828fd7606c24d44a3ee8d5633967a1c089)) +* respect pageSize and pageToken from gaxOptions ([#781](https://www.github.com/googleapis/nodejs-bigtable/issues/781)) ([3ca5de3](https://www.github.com/googleapis/nodejs-bigtable/commit/3ca5de3af142d0015209ee1281a767f6fd5a5093)) + + +### Bug Fixes + +* **deps:** update dependency yargs to v16 ([#797](https://www.github.com/googleapis/nodejs-bigtable/issues/797)) ([3a50ecf](https://www.github.com/googleapis/nodejs-bigtable/commit/3a50ecf081e4846372c147eeb7a1806ed0aa981f)) + +### [3.0.1](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.0.0...v3.0.1) (2020-07-09) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/bigtable to v3 ([#756](https://www.github.com/googleapis/nodejs-bigtable/issues/756)) ([e5e8189](https://www.github.com/googleapis/nodejs-bigtable/commit/e5e8189b3254a7a1d216f5380b6e88c7cdeb0c5e)) +* typeo in nodejs .gitattribute ([#759](https://www.github.com/googleapis/nodejs-bigtable/issues/759)) ([843d1da](https://www.github.com/googleapis/nodejs-bigtable/commit/843d1daa9bdf30b8a5ab612967fbd8652723612d)) + +## [3.0.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.3.2...v3.0.0) (2020-07-06) + + +### ⚠ BREAKING CHANGES + +* **types:** cluster.setMetadata(): only node count is updatable on an existing cluster; getInstancesCallback/Response: dropped nextQuery property as it is deprecated for this method, exposed failedLocations property; instance.createCluster(): removed unsupported params serveNodes and defaultStorageType +* drop node8 support, support for async iterators (#682) + +### Features + +* check status of long running operation by its name ([#724](https://www.github.com/googleapis/nodejs-bigtable/issues/724)) ([f2c1675](https://www.github.com/googleapis/nodejs-bigtable/commit/f2c1675d3c5352bc5a9083a7eb0a3666815e5854)) +* Cloud Bigtable Managed Backup service ([21f585b](https://www.github.com/googleapis/nodejs-bigtable/commit/21f585b97aa88b95d04153984a71c51b029b57fe)) +* Cloud functions example for Bigtable ([#728](https://www.github.com/googleapis/nodejs-bigtable/issues/728)) ([95a5db4](https://www.github.com/googleapis/nodejs-bigtable/commit/95a5db49cb896c82487b87638c3ad5cb4b81e91c)) +* drop node8 support, support for async iterators ([#682](https://www.github.com/googleapis/nodejs-bigtable/issues/682)) ([2834e93](https://www.github.com/googleapis/nodejs-bigtable/commit/2834e93a7a6aec4ffff439850d07aa7f9ef79e7f)) +* drop support for node.js 8.x ([#669](https://www.github.com/googleapis/nodejs-bigtable/issues/669)) ([7ec9150](https://www.github.com/googleapis/nodejs-bigtable/commit/7ec9150331bf5337879d91a146a713e51702164b)) +* export protos in src/index.ts ([edac2c5](https://www.github.com/googleapis/nodejs-bigtable/commit/edac2c5b5c97ae301ef70776621d5cd0add79f5d)) +* move to Typescript code generation ([#631](https://www.github.com/googleapis/nodejs-bigtable/issues/631)) ([6749aa5](https://www.github.com/googleapis/nodejs-bigtable/commit/6749aa5b1f56e7204ffdea7daab0217525e220ce)) +* **secrets:** begin migration to secret manager from keystore ([#740](https://www.github.com/googleapis/nodejs-bigtable/issues/740)) ([85eb5d2](https://www.github.com/googleapis/nodejs-bigtable/commit/85eb5d278d5969e1b03e0a52eb08664d13f25f46)) +* update bigtable grpc service config ([#747](https://www.github.com/googleapis/nodejs-bigtable/issues/747)) ([be27a70](https://www.github.com/googleapis/nodejs-bigtable/commit/be27a7022a5a3d3f704b65350d76a57385a0c2df)) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/common to v3 and handle stream ending ([#704](https://www.github.com/googleapis/nodejs-bigtable/issues/704)) ([d8ada04](https://www.github.com/googleapis/nodejs-bigtable/commit/d8ada04a189ecb3e3628b55f5a2883b5d18727fe)) +* **deps:** update dependency @google-cloud/paginator to v3 ([#674](https://www.github.com/googleapis/nodejs-bigtable/issues/674)) ([9abcaee](https://www.github.com/googleapis/nodejs-bigtable/commit/9abcaee8160c89de4258b0ad0a9185f5ada634df)) +* **deps:** update dependency @google-cloud/projectify to v2 ([#673](https://www.github.com/googleapis/nodejs-bigtable/issues/673)) ([b0a7aa8](https://www.github.com/googleapis/nodejs-bigtable/commit/b0a7aa8ff93b7d359cd728d240af1203aee2ffc2)) +* **deps:** update dependency @google-cloud/promisify to v2 ([#672](https://www.github.com/googleapis/nodejs-bigtable/issues/672)) ([5a7d66f](https://www.github.com/googleapis/nodejs-bigtable/commit/5a7d66f061ae20e9e763d3477c38ee845f06fac7)) +* **deps:** update dependency escape-string-regexp to v3 ([#697](https://www.github.com/googleapis/nodejs-bigtable/issues/697)) ([799dcca](https://www.github.com/googleapis/nodejs-bigtable/commit/799dccace91bb4742e54efcf64b688815c0f086d)) +* **deps:** update dependency escape-string-regexp to v4 ([#719](https://www.github.com/googleapis/nodejs-bigtable/issues/719)) ([5c54e70](https://www.github.com/googleapis/nodejs-bigtable/commit/5c54e7089c146dedf8610e6ed730554921e24f32)) +* **deps:** update dependency uuid to v8 ([#723](https://www.github.com/googleapis/nodejs-bigtable/issues/723)) ([998ec84](https://www.github.com/googleapis/nodejs-bigtable/commit/998ec842344dd2ca79736bc14dd4fa4c4b72eb25)) +* **docs:** contigous to contiguous ([#637](https://www.github.com/googleapis/nodejs-bigtable/issues/637)) ([9d09d37](https://www.github.com/googleapis/nodejs-bigtable/commit/9d09d375b29bc21fcccd2c5341dc5d2046e00b7e)) +* cluster id store as undefined in createInstance request ([#654](https://www.github.com/googleapis/nodejs-bigtable/issues/654)) ([809c719](https://www.github.com/googleapis/nodejs-bigtable/commit/809c7198ac933d3efea05b4451cdc327b0871598)) +* **types:** improve types in index.ts ([#720](https://www.github.com/googleapis/nodejs-bigtable/issues/720)) ([508d1f9](https://www.github.com/googleapis/nodejs-bigtable/commit/508d1f9e0c5b089d7a649eb1dd9e6fc166d17f7e)) +* clusterId issue in sample test(should list zones) ([#684](https://www.github.com/googleapis/nodejs-bigtable/issues/684)) ([b92dfc5](https://www.github.com/googleapis/nodejs-bigtable/commit/b92dfc58aa44cc19faaeee06c53309a032009e32)) +* doc for create instance cluster id ([#642](https://www.github.com/googleapis/nodejs-bigtable/issues/642)) ([838837c](https://www.github.com/googleapis/nodejs-bigtable/commit/838837c643d61861ecbb15636375620a914aad86)) +* export all available types ([#691](https://www.github.com/googleapis/nodejs-bigtable/issues/691)) ([63bb2ec](https://www.github.com/googleapis/nodejs-bigtable/commit/63bb2ec9d496148edfc31f3e716c26fda31dcb24)) +* handle fallback option properly ([21f8fef](https://www.github.com/googleapis/nodejs-bigtable/commit/21f8fef9f2c08be458478d1f2ccd0be5c60446c5)) +* improve types for instance ([#655](https://www.github.com/googleapis/nodejs-bigtable/issues/655)) ([4910e77](https://www.github.com/googleapis/nodejs-bigtable/commit/4910e779fb8168f6e6a7d76bf1a444c793aa7682)) +* improve types for row ([#661](https://www.github.com/googleapis/nodejs-bigtable/issues/661)) ([340689e](https://www.github.com/googleapis/nodejs-bigtable/commit/340689e639e79a7fca7c6e022d4d95bd414f0003)) +* improve TypeScript types ([#646](https://www.github.com/googleapis/nodejs-bigtable/issues/646)) ([f4e1b86](https://www.github.com/googleapis/nodejs-bigtable/commit/f4e1b862ab94e82312413f0b983dd67fdab24f8a)) +* improve TypeScript types ([#650](https://www.github.com/googleapis/nodejs-bigtable/issues/650)) ([b54830f](https://www.github.com/googleapis/nodejs-bigtable/commit/b54830fb2ec52811c101661bce7db5d421841567)) +* improve typescript types ([#663](https://www.github.com/googleapis/nodejs-bigtable/issues/663)) ([47b506a](https://www.github.com/googleapis/nodejs-bigtable/commit/47b506ae8843d78d18cef76cb19a90320a770966)) +* improve typescript types for Table class ([#641](https://www.github.com/googleapis/nodejs-bigtable/issues/641)) ([68179d1](https://www.github.com/googleapis/nodejs-bigtable/commit/68179d194aeb8246e3c19e0072085cf82cf3f609)) +* make sure generated protos.js have unique root name ([#690](https://www.github.com/googleapis/nodejs-bigtable/issues/690)) ([cc695db](https://www.github.com/googleapis/nodejs-bigtable/commit/cc695dbd0365c1ca6451d9d4e766e63000475b67)) +* Point to team in correct org ([#729](https://www.github.com/googleapis/nodejs-bigtable/issues/729)) ([998dc4b](https://www.github.com/googleapis/nodejs-bigtable/commit/998dc4b5a41bcd7a1e12250623486cbe6ac9ab12)) +* reduce through2 usage ([#711](https://www.github.com/googleapis/nodejs-bigtable/issues/711)) ([dd84765](https://www.github.com/googleapis/nodejs-bigtable/commit/dd847652eb00dd14f42211d5c9e20817aca7081b)) +* remove eslint, update gax, fix generated protos, run the generator ([#699](https://www.github.com/googleapis/nodejs-bigtable/issues/699)) ([85b8585](https://www.github.com/googleapis/nodejs-bigtable/commit/85b858572018380c7a335d09d17c5629ad7fe3a3)) +* **types:** stricter types are now enforced ([#733](https://www.github.com/googleapis/nodejs-bigtable/issues/733)) ([dfd22a2](https://www.github.com/googleapis/nodejs-bigtable/commit/dfd22a208ead6e97a3964354be55025c53acbf66)) +* row.exists out of memory errors ([#676](https://www.github.com/googleapis/nodejs-bigtable/issues/676)) ([191aa0f](https://www.github.com/googleapis/nodejs-bigtable/commit/191aa0f577989227ebdd9a8d7718869fc623b1e9)) +* update types for app profile ([#649](https://www.github.com/googleapis/nodejs-bigtable/issues/649)) ([271d480](https://www.github.com/googleapis/nodejs-bigtable/commit/271d480ada622da7ffc4bc4da64a8626dc0e0e71)) +* UpdateBackupRequest.backup is a resource, not a resource reference - remove annotation ([#725](https://www.github.com/googleapis/nodejs-bigtable/issues/725)) ([0802552](https://www.github.com/googleapis/nodejs-bigtable/commit/0802552cf8d9ac4de77b231b2b26cbfc87434064)) + +### [2.3.2](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.3.1...v2.3.2) (2020-02-12) + + +### Bug Fixes + +* migrate to new proto annotations ([#604](https://www.github.com/googleapis/nodejs-bigtable/issues/604)) ([e095c5a](https://www.github.com/googleapis/nodejs-bigtable/commit/e095c5a85f86fde44e7560c4599894d61180afbe)) + +### [2.3.1](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.3.0...v2.3.1) (2019-12-27) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([0c6232d](https://www.github.com/googleapis/nodejs-bigtable/commit/0c6232df47194b2d43e86c484f25d6f3b933b605)) +* **types:** overload for bigtable.getInstances ([#579](https://www.github.com/googleapis/nodejs-bigtable/issues/579)) ([91a07ba](https://www.github.com/googleapis/nodejs-bigtable/commit/91a07bab35c6ec4b8c4143c6499914aa34ef3689)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.2.3...v2.3.0) (2019-12-03) + + +### Features + +* implement instance and table level IAM policy ([#584](https://www.github.com/googleapis/nodejs-bigtable/issues/584)) ([5c22968](https://www.github.com/googleapis/nodejs-bigtable/commit/5c229685dacf8bebda6e030d21a2bbf2ed2cec76)) +* **samples:** adds read and filter snippets ([#586](https://www.github.com/googleapis/nodejs-bigtable/issues/586)) ([896d024](https://www.github.com/googleapis/nodejs-bigtable/commit/896d02454b359f90c93e88c760ad699aa6999341)), closes [#584](https://www.github.com/googleapis/nodejs-bigtable/issues/584) + + +### Bug Fixes + +* safe integer bounds conversion ([#576](https://www.github.com/googleapis/nodejs-bigtable/issues/576)) ([a1cd9c0](https://www.github.com/googleapis/nodejs-bigtable/commit/a1cd9c0ad5f732a13f12784f18fb895f9765ea4f)) +* **deps:** update dependency yargs to v15 ([#583](https://www.github.com/googleapis/nodejs-bigtable/issues/583)) ([b95c430](https://www.github.com/googleapis/nodejs-bigtable/commit/b95c430796175f03d063ad863d685752d0534dcd)) + +### [2.2.3](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.2.2...v2.2.3) (2019-11-12) + + +### Bug Fixes + +* **docs:** add jsdoc-region-tag plugin ([#571](https://www.github.com/googleapis/nodejs-bigtable/issues/571)) ([3159302](https://www.github.com/googleapis/nodejs-bigtable/commit/315930236ec396c3743d4929087e2d6565224072)) +* include long in types ([1cb65a4](https://www.github.com/googleapis/nodejs-bigtable/commit/1cb65a47553ab93572bfd95825074ab362ecd9f8)) + +### [2.2.2](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.2.1...v2.2.2) (2019-11-11) + + +### Bug Fixes + +* **docs:** fix missing snippets in sample documentation ([af6e15a](https://www.github.com/googleapis/nodejs-bigtable/commit/af6e15a1df3106368efa8a7fb1f81f0eb8e8663f)) + +### [2.2.1](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.2.0...v2.2.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#558](https://www.github.com/googleapis/nodejs-bigtable/issues/558)) ([02d48ee](https://www.github.com/googleapis/nodejs-bigtable/commit/02d48eee4a0f903abafb5f9f5a261bb06ab3b18c)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.1.0...v2.2.0) (2019-10-09) + + +### Bug Fixes + +* do not exclude d.ts files, and add install test ([#545](https://www.github.com/googleapis/nodejs-bigtable/issues/545)) ([60acdf8](https://www.github.com/googleapis/nodejs-bigtable/commit/60acdf8)) +* use compatible version of google-gax ([588509b](https://www.github.com/googleapis/nodejs-bigtable/commit/588509b)) + + +### Features + +* .d.ts for protos ([#542](https://www.github.com/googleapis/nodejs-bigtable/issues/542)) ([3acf841](https://www.github.com/googleapis/nodejs-bigtable/commit/3acf841)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.0.5...v2.1.0) (2019-09-09) + + +### Bug Fixes + +* **deps:** update dependency yargs to v14 ([e0478d7](https://www.github.com/googleapis/nodejs-bigtable/commit/e0478d7)) +* use correct version for x-goog-api-client ([#533](https://www.github.com/googleapis/nodejs-bigtable/issues/533)) ([1614e9e](https://www.github.com/googleapis/nodejs-bigtable/commit/1614e9e)) + + +### Features + +* load protos from JSON, grpc-fallback support, IAM protos ([#536](https://www.github.com/googleapis/nodejs-bigtable/issues/536)) ([04404a4](https://www.github.com/googleapis/nodejs-bigtable/commit/04404a4)) + +### [2.0.5](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.0.4...v2.0.5) (2019-08-13) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([fb6ced6](https://www.github.com/googleapis/nodejs-bigtable/commit/fb6ced6)) +* **deps:** use the latest extend ([#529](https://www.github.com/googleapis/nodejs-bigtable/issues/529)) ([7090c39](https://www.github.com/googleapis/nodejs-bigtable/commit/7090c39)) +* **types:** Include TypeScript types with module ([#527](https://www.github.com/googleapis/nodejs-bigtable/issues/527)) ([cd9e517](https://www.github.com/googleapis/nodejs-bigtable/commit/cd9e517)) + +### [2.0.4](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.0.3...v2.0.4) (2019-08-01) + + +### Bug Fixes + +* cancel streaming grpc request when user ends stream ([#507](https://www.github.com/googleapis/nodejs-bigtable/issues/507)) ([2b4297c](https://www.github.com/googleapis/nodejs-bigtable/commit/2b4297c)) + +### [2.0.3](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.0.2...v2.0.3) (2019-07-29) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/paginator to v2 ([#513](https://www.github.com/googleapis/nodejs-bigtable/issues/513)) ([f4fdb7e](https://www.github.com/googleapis/nodejs-bigtable/commit/f4fdb7e)) +* **deps:** update dependency google-auth-library to v5 ([#514](https://www.github.com/googleapis/nodejs-bigtable/issues/514)) ([b3ef8f1](https://www.github.com/googleapis/nodejs-bigtable/commit/b3ef8f1)) +* **deps:** update dependency pumpify to v2 ([#515](https://www.github.com/googleapis/nodejs-bigtable/issues/515)) ([309e625](https://www.github.com/googleapis/nodejs-bigtable/commit/309e625)) + +### [2.0.2](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.0.1...v2.0.2) (2019-07-23) + + +### Bug Fixes + +* modified timeout and retry parameters ([451bba9](https://www.github.com/googleapis/nodejs-bigtable/commit/451bba9)) + +### [2.0.1](https://www.github.com/googleapis/nodejs-bigtable/compare/v2.0.0...v2.0.1) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#502](https://www.github.com/googleapis/nodejs-bigtable/issues/502)) ([8b4a93e](https://www.github.com/googleapis/nodejs-bigtable/commit/8b4a93e)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v1.0.1...v2.0.0) (2019-06-24) + + +### ⚠ BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#463) + +### Bug Fixes + +* **deps:** update dependency @google-cloud/common-grpc to v1 ([#478](https://www.github.com/googleapis/nodejs-bigtable/issues/478)) ([40197e4](https://www.github.com/googleapis/nodejs-bigtable/commit/40197e4)) +* **deps:** update dependency @google-cloud/paginator to ^0.2.0 ([a25627c](https://www.github.com/googleapis/nodejs-bigtable/commit/a25627c)), closes [#8203](https://www.github.com/googleapis/nodejs-bigtable/issues/8203) +* **deps:** update dependency @google-cloud/paginator to v1 ([#468](https://www.github.com/googleapis/nodejs-bigtable/issues/468)) ([ae06ec2](https://www.github.com/googleapis/nodejs-bigtable/commit/ae06ec2)) +* **deps:** update dependency @google-cloud/projectify to v1 ([#466](https://www.github.com/googleapis/nodejs-bigtable/issues/466)) ([6c6dd40](https://www.github.com/googleapis/nodejs-bigtable/commit/6c6dd40)) +* **deps:** update dependency @google-cloud/promisify to ^0.4.0 ([#420](https://www.github.com/googleapis/nodejs-bigtable/issues/420)) ([d5c2862](https://www.github.com/googleapis/nodejs-bigtable/commit/d5c2862)) +* **deps:** update dependency @google-cloud/promisify to v1 ([#467](https://www.github.com/googleapis/nodejs-bigtable/issues/467)) ([5473fb9](https://www.github.com/googleapis/nodejs-bigtable/commit/5473fb9)) +* **deps:** update dependency arrify to v2 ([e29f9aa](https://www.github.com/googleapis/nodejs-bigtable/commit/e29f9aa)) +* **deps:** update dependency dot-prop to v5 ([#455](https://www.github.com/googleapis/nodejs-bigtable/issues/455)) ([3949356](https://www.github.com/googleapis/nodejs-bigtable/commit/3949356)) +* **deps:** update dependency escape-string-regexp to v2 ([#457](https://www.github.com/googleapis/nodejs-bigtable/issues/457)) ([d923b58](https://www.github.com/googleapis/nodejs-bigtable/commit/d923b58)) +* **deps:** update dependency google-auth-library to v4 ([#475](https://www.github.com/googleapis/nodejs-bigtable/issues/475)) ([a58547c](https://www.github.com/googleapis/nodejs-bigtable/commit/a58547c)) +* **deps:** update dependency google-gax to ^0.26.0 ([#461](https://www.github.com/googleapis/nodejs-bigtable/issues/461)) ([4462869](https://www.github.com/googleapis/nodejs-bigtable/commit/4462869)) +* **deps:** update dependency google-gax to v1 ([#476](https://www.github.com/googleapis/nodejs-bigtable/issues/476)) ([adfeb9c](https://www.github.com/googleapis/nodejs-bigtable/commit/adfeb9c)) +* **deps:** update dependency yargs to v13 ([#417](https://www.github.com/googleapis/nodejs-bigtable/issues/417)) ([fac8d4e](https://www.github.com/googleapis/nodejs-bigtable/commit/fac8d4e)) +* "requires_billing " should be "requires_billing" ([#498](https://www.github.com/googleapis/nodejs-bigtable/issues/498)) ([c9f6f7e](https://www.github.com/googleapis/nodejs-bigtable/commit/c9f6f7e)) +* DEADLINE_EXCEEDED is no longer retried ([c1190d3](https://www.github.com/googleapis/nodejs-bigtable/commit/c1190d3)) +* DEADLINE_EXCEEDED retry code is idempotent ([#477](https://www.github.com/googleapis/nodejs-bigtable/issues/477)) ([2783944](https://www.github.com/googleapis/nodejs-bigtable/commit/2783944)) +* throw on invalid credentials ([#418](https://www.github.com/googleapis/nodejs-bigtable/issues/418)) ([5b836fd](https://www.github.com/googleapis/nodejs-bigtable/commit/5b836fd)) +* **docs:** move to new client docs URL ([#499](https://www.github.com/googleapis/nodejs-bigtable/issues/499)) ([acfe7c2](https://www.github.com/googleapis/nodejs-bigtable/commit/acfe7c2)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#463](https://www.github.com/googleapis/nodejs-bigtable/issues/463)) ([35cb71f](https://www.github.com/googleapis/nodejs-bigtable/commit/35cb71f)) + + +### Features + +* support apiEndpoint override ([#500](https://www.github.com/googleapis/nodejs-bigtable/issues/500)) ([89124f6](https://www.github.com/googleapis/nodejs-bigtable/commit/89124f6)) +* update the admin APIs ([#485](https://www.github.com/googleapis/nodejs-bigtable/issues/485)) ([c76fba9](https://www.github.com/googleapis/nodejs-bigtable/commit/c76fba9)) + +## v1.0.1 + +01-29-2019 16:49 PST + +### Bug Fixes +- fix: Prevent error when `decode: false` option is set in createReadStream. ([#403](https://github.com/googleapis/nodejs-bigtable/pull/403)) + +### Dependencies +- fix(deps): update dependency @google-cloud/common-grpc to ^0.10.0 ([#408](https://github.com/googleapis/nodejs-bigtable/pull/408)) +- fix(deps): update dependency google-gax to ^0.24.0 ([#405](https://github.com/googleapis/nodejs-bigtable/pull/405)) +- fix(deps): update dependency google-auth-library to v3 ([#402](https://github.com/googleapis/nodejs-bigtable/pull/402)) +- fix(deps): update dependency concat-stream to v2 ([#396](https://github.com/googleapis/nodejs-bigtable/pull/396)) + +### Documentation +- refactor: modernize the samples a bit ([#398](https://github.com/googleapis/nodejs-bigtable/pull/398)) +- docs: Added example region-tags for app-profile object ([#288](https://github.com/googleapis/nodejs-bigtable/pull/288)) +- fix(docs): fix namespaces causing 404s ([#385](https://github.com/googleapis/nodejs-bigtable/pull/385)) +- docs: update readme badges ([#379](https://github.com/googleapis/nodejs-bigtable/pull/379)) + +## v1.0.0 + +11-13-2018 08:31 PST + + +### Implementation Changes +- Empty column qualifiers are no longer rejected ([#353](https://github.com/googleapis/nodejs-bigtable/pull/353)) + +### Dependencies +- fix(deps): update dependency google-gax to ^0.22.0 ([#366](https://github.com/googleapis/nodejs-bigtable/pull/366)) +- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#364](https://github.com/googleapis/nodejs-bigtable/pull/364)) + +### Documentation +- Added example region-tag for Family.js ([#262](https://github.com/googleapis/nodejs-bigtable/pull/262)) +- Added example region-tags for cluster object ([#284](https://github.com/googleapis/nodejs-bigtable/pull/284)) +- chore: drop contributors from multiple places ([#363](https://github.com/googleapis/nodejs-bigtable/pull/363)) +- fix(samples): Fixing the Hello world ([#339](https://github.com/googleapis/nodejs-bigtable/pull/339)) + +### Internal / Testing Changes +- chore: update eslintignore config ([#365](https://github.com/googleapis/nodejs-bigtable/pull/365)) +- refactor: use object.assign and drop lodash.flatten ([#362](https://github.com/googleapis/nodejs-bigtable/pull/362)) +- chore: remove a few unused dependencies ([#358](https://github.com/googleapis/nodejs-bigtable/pull/358)) +- chore: use latest npm on Windows ([#361](https://github.com/googleapis/nodejs-bigtable/pull/361)) +- chore: fix and run the linter ([#357](https://github.com/googleapis/nodejs-bigtable/pull/357)) +- fix(deps): update dependency through2 to v3 ([#359](https://github.com/googleapis/nodejs-bigtable/pull/359)) +- Cleanup of `ChunkTransformer` ([#355](https://github.com/googleapis/nodejs-bigtable/pull/355)) +- chore: update CircleCI config ([#352](https://github.com/googleapis/nodejs-bigtable/pull/352)) +- chore: include build in eslintignore ([#349](https://github.com/googleapis/nodejs-bigtable/pull/349)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#345](https://github.com/googleapis/nodejs-bigtable/pull/345)) +- chore: update issue templates ([#344](https://github.com/googleapis/nodejs-bigtable/pull/344)) +- chore: remove old issue template ([#340](https://github.com/googleapis/nodejs-bigtable/pull/340)) +- build: run tests on node11 ([#338](https://github.com/googleapis/nodejs-bigtable/pull/338)) + +## v0.16.1 + +### Dependencies +- fix(deps): update dependency @google-cloud/bigtable to ^0.16.0 ([#326](https://github.com/googleapis/nodejs-bigtable/pull/326)) + +### Documentation +- Clean up the "hello world" code sample ([#328](https://github.com/googleapis/nodejs-bigtable/pull/328)) +- fix(docs): make Filter class public should it shows up in docs ([#331](https://github.com/googleapis/nodejs-bigtable/pull/331)) + +### Internal / Testing Changes +- chores(build): run codecov on continuous builds ([#334](https://github.com/googleapis/nodejs-bigtable/pull/334)) +- chore: update new issue template ([#332](https://github.com/googleapis/nodejs-bigtable/pull/332)) +- Fix some issues in the contributing instructions. ([#325](https://github.com/googleapis/nodejs-bigtable/pull/325)) + +## v0.16.0 + +### Implementation Changes +- Restricted combinations of row selection on read rows. ([#315](https://github.com/googleapis/nodejs-bigtable/pull/315)) +- table.exists uses getTable with a Name only view for better perofrmance. ([#280](https://github.com/googleapis/nodejs-bigtable/pull/280)) + +### New Features +- Added Table.getReplicationStates ([#279](https://github.com/googleapis/nodejs-bigtable/pull/279)) + +### Dependencies +- chore(deps): update dependency sinon to v7 ([#321](https://github.com/googleapis/nodejs-bigtable/pull/321)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#317](https://github.com/googleapis/nodejs-bigtable/pull/317)) +- fix(deps): update dependency @google-cloud/common-grpc to ^0.9.0 ([#307](https://github.com/googleapis/nodejs-bigtable/pull/307)) +- fix(deps): update dependency google-gax to ^0.20.0 ([#302](https://github.com/googleapis/nodejs-bigtable/pull/302)) +- chore(deps): update dependency nyc to v13 ([#285](https://github.com/googleapis/nodejs-bigtable/pull/285)) +- fix(deps): update dependency @google-cloud/common-grpc to ^0.8.0 ([#289](https://github.com/googleapis/nodejs-bigtable/pull/289)) +- fix(deps): update dependency google-auth-library to v2 ([#290](https://github.com/googleapis/nodejs-bigtable/pull/290)) +- fix(deps): update dependency google-gax to ^0.19.0 ([#281](https://github.com/googleapis/nodejs-bigtable/pull/281)) +- chore(deps): update dependency eslint-config-prettier to v3 ([#274](https://github.com/googleapis/nodejs-bigtable/pull/274)) +- fix(deps): update dependency google-gax to ^0.18.0 ([#263](https://github.com/googleapis/nodejs-bigtable/pull/263)) + +### Documentation +- Added @example tags to src/table.js ([#239](https://github.com/googleapis/nodejs-bigtable/pull/239)) +- Added example region-tags for row object ([#266](https://github.com/googleapis/nodejs-bigtable/pull/266)) +- documentation update for getTables ([#311](https://github.com/googleapis/nodejs-bigtable/pull/311)) +- move instance snippet tests to document-snippets/tests ([#308](https://github.com/googleapis/nodejs-bigtable/pull/308)) +- Added @example tags to src/instance.js ([#222](https://github.com/googleapis/nodejs-bigtable/pull/222)) ([#252](https://github.com/googleapis/nodejs-bigtable/pull/252)) + +### Internal / Testing Changes +- build: fix codecov uploading on Kokoro ([#323](https://github.com/googleapis/nodejs-bigtable/pull/323)) +- test: System test fix ([#322](https://github.com/googleapis/nodejs-bigtable/pull/322)) +- Update kokoro config ([#318](https://github.com/googleapis/nodejs-bigtable/pull/318)) +- build: prevent system/sample-test from leaking credentials +- Update the kokoro config ([#313](https://github.com/googleapis/nodejs-bigtable/pull/313)) +- test: remove appveyor config ([#312](https://github.com/googleapis/nodejs-bigtable/pull/312)) +- Update the CI config ([#310](https://github.com/googleapis/nodejs-bigtable/pull/310)) +- Fix the linter ([#306](https://github.com/googleapis/nodejs-bigtable/pull/306)) +- Enable prefer-const in the eslint config ([#305](https://github.com/googleapis/nodejs-bigtable/pull/305)) +- Enable no-var in eslint ([#304](https://github.com/googleapis/nodejs-bigtable/pull/304)) +- Re-generate library using /synth.py ([#303](https://github.com/googleapis/nodejs-bigtable/pull/303)) +- test: throw on deprecation ([#264](https://github.com/googleapis/nodejs-bigtable/pull/264)) +- Update CI config ([#300](https://github.com/googleapis/nodejs-bigtable/pull/300)) +- Split usage of common module ([#297](https://github.com/googleapis/nodejs-bigtable/pull/297)) +- Retry npm install in CI ([#295](https://github.com/googleapis/nodejs-bigtable/pull/295)) +- Re-generate library using /synth.py ([#292](https://github.com/googleapis/nodejs-bigtable/pull/292)) +- Re-generate library using /synth.py ([#287](https://github.com/googleapis/nodejs-bigtable/pull/287)) +- Update the CI config ([#283](https://github.com/googleapis/nodejs-bigtable/pull/283)) +- Update synth.py ([#276](https://github.com/googleapis/nodejs-bigtable/pull/276)) +- chore: make the CircleCI config consistent ([#282](https://github.com/googleapis/nodejs-bigtable/pull/282)) +- Re-generate library using /synth.py ([#277](https://github.com/googleapis/nodejs-bigtable/pull/277)) +- build: add repo_name to synth.py ([#275](https://github.com/googleapis/nodejs-bigtable/pull/275)) +- chore: run prettier for auto-generated code ([#273](https://github.com/googleapis/nodejs-bigtable/pull/273)) +- chore: do not use npm ci ([#272](https://github.com/googleapis/nodejs-bigtable/pull/272)) +- Re-generate library using /synth.py ([#270](https://github.com/googleapis/nodejs-bigtable/pull/270)) +- chore: ignore package-lock.json ([#269](https://github.com/googleapis/nodejs-bigtable/pull/269)) +- chore(deps): lock file maintenance ([#268](https://github.com/googleapis/nodejs-bigtable/pull/268)) +- chore(deps): lock file maintenance ([#267](https://github.com/googleapis/nodejs-bigtable/pull/267)) +- chore: update renovate config ([#265](https://github.com/googleapis/nodejs-bigtable/pull/265)) +- chore(deps): lock file maintenance ([#261](https://github.com/googleapis/nodejs-bigtable/pull/261)) +- Use assert.deepStrictEqual instead of deepEqual. ([#253](https://github.com/googleapis/nodejs-bigtable/pull/253)) +- test: use strictEqual in tests ([#250](https://github.com/googleapis/nodejs-bigtable/pull/250)) diff --git a/handwritten/bigtable/CODE_OF_CONDUCT.md b/handwritten/bigtable/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/handwritten/bigtable/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/handwritten/bigtable/CONTRIBUTING.md b/handwritten/bigtable/CONTRIBUTING.md new file mode 100644 index 00000000000..802c122734d --- /dev/null +++ b/handwritten/bigtable/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Bigtable API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=bigtable.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/handwritten/bigtable/LICENSE b/handwritten/bigtable/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/handwritten/bigtable/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/handwritten/bigtable/README.md b/handwritten/bigtable/README.md new file mode 100644 index 00000000000..19cb238bc1b --- /dev/null +++ b/handwritten/bigtable/README.md @@ -0,0 +1,170 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Bigtable: Node.js Client](https://github.com/googleapis/nodejs-bigtable) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/bigtable.svg)](https://www.npmjs.com/package/@google-cloud/bigtable) + + + + +Cloud Bigtable Client Library for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-bigtable/blob/main/CHANGELOG.md). + +* [Cloud Bigtable Node.js Client API Reference][client-docs] +* [Cloud Bigtable Documentation][product-docs] +* [github.com/googleapis/nodejs-bigtable](https://github.com/googleapis/nodejs-bigtable) + +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 Cloud Bigtable API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/bigtable +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library +const {Bigtable} = require('@google-cloud/bigtable'); + +const bigtable = new Bigtable(); + +async function quickstart() { + // Connect to an existing instance:my-bigtable-instance + const instance = bigtable.instance(INSTANCE_ID); + + // Connect to an existing table:my-table + const table = instance.table(TABLE_ID); + + // Read a row from my-table using a row key + const [singleRow] = await table.row('r1').get(); + + // Print the row key and data (column value, labels, timestamp) + const rowData = JSON.stringify(singleRow.data, null, 4); + console.log(`Row key: ${singleRow.id}\nData: ${rowData}`); +} +quickstart(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-bigtable/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Delete Snippets | [source code](https://github.com/googleapis/nodejs-bigtable/blob/main/samples/deleteSnippets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigtable&page=editor&open_in_editor=samples/deleteSnippets.js,samples/README.md) | +| Filter Snippets | [source code](https://github.com/googleapis/nodejs-bigtable/blob/main/samples/filterSnippets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigtable&page=editor&open_in_editor=samples/filterSnippets.js,samples/README.md) | +| Instances | [source code](https://github.com/googleapis/nodejs-bigtable/blob/main/samples/instances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigtable&page=editor&open_in_editor=samples/instances.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-bigtable/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigtable&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Read Snippets | [source code](https://github.com/googleapis/nodejs-bigtable/blob/main/samples/readSnippets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigtable&page=editor&open_in_editor=samples/readSnippets.js,samples/README.md) | +| Tableadmin | [source code](https://github.com/googleapis/nodejs-bigtable/blob/main/samples/tableadmin.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigtable&page=editor&open_in_editor=samples/tableadmin.js,samples/README.md) | +| Write Batch | [source code](https://github.com/googleapis/nodejs-bigtable/blob/main/samples/writeBatch.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigtable&page=editor&open_in_editor=samples/writeBatch.js,samples/README.md) | +| Write Conditionally | [source code](https://github.com/googleapis/nodejs-bigtable/blob/main/samples/writeConditionally.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigtable&page=editor&open_in_editor=samples/writeConditionally.js,samples/README.md) | +| Write Increment | [source code](https://github.com/googleapis/nodejs-bigtable/blob/main/samples/writeIncrement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigtable&page=editor&open_in_editor=samples/writeIncrement.js,samples/README.md) | +| Simple Insert | [source code](https://github.com/googleapis/nodejs-bigtable/blob/main/samples/writeSimple.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigtable&page=editor&open_in_editor=samples/writeSimple.js,samples/README.md) | + + + +The [Cloud Bigtable Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/bigtable@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +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-bigtable/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-bigtable/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/bigtable/latest +[product-docs]: https://cloud.google.com/bigtable +[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=bigtable.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local diff --git a/handwritten/bigtable/__snapshots__/cluster.js b/handwritten/bigtable/__snapshots__/cluster.js new file mode 100644 index 00000000000..6dc32ca31f7 --- /dev/null +++ b/handwritten/bigtable/__snapshots__/cluster.js @@ -0,0 +1,184 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +exports[ + 'Bigtable/Cluster setMetadata should provide the proper request options asynchronously 1' +] = { + input: { + id: 'my-cluster', + options: { + nodes: 2, + location: 'us-central2-d', + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'partialUpdateCluster', + reqOpts: { + cluster: { + name: 'projects/grape-spaceship-123/instances/i/clusters/my-cluster', + location: 'us-central2-d', + serveNodes: 2, + }, + updateMask: { + paths: ['serve_nodes', 'cluster_config.cluster_autoscaling_config'], + }, + }, + gaxOpts: {}, + }, + }, +}; + +exports[ + 'Bigtable/Cluster setMetadata should provide the proper request options asynchronously 2' +] = { + input: { + id: 'my-cluster', + options: { + nodes: 2, + storage: 'ssd', + location: 'us-central2-d', + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'partialUpdateCluster', + reqOpts: { + cluster: { + name: 'projects/grape-spaceship-123/instances/i/clusters/my-cluster', + location: 'us-central2-d', + serveNodes: 2, + storage: 'ssd', + }, + updateMask: { + paths: ['serve_nodes', 'cluster_config.cluster_autoscaling_config'], + }, + }, + gaxOpts: {}, + }, + }, +}; + +exports[ + 'Bigtable/Cluster setMetadata should provide the proper request options asynchronously 3' +] = { + input: { + id: 'my-cluster', + options: { + nodes: 2, + key: 'kms-key-name', + location: 'us-central2-d', + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'partialUpdateCluster', + reqOpts: { + cluster: { + name: 'projects/grape-spaceship-123/instances/i/clusters/my-cluster', + location: 'us-central2-d', + serveNodes: 2, + key: 'kms-key-name', + }, + updateMask: { + paths: ['serve_nodes', 'cluster_config.cluster_autoscaling_config'], + }, + }, + gaxOpts: {}, + }, + }, +}; + +exports[ + 'Bigtable/Cluster setMetadata should provide the proper request options asynchronously 4' +] = { + input: { + id: 'my-cluster', + options: { + nodes: 2, + encryption: { + kmsKeyName: 'kms-key-name', + }, + location: 'us-central2-d', + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'partialUpdateCluster', + reqOpts: { + cluster: { + name: 'projects/grape-spaceship-123/instances/i/clusters/my-cluster', + location: 'us-central2-d', + serveNodes: 2, + encryption: { + kmsKeyName: 'kms-key-name', + }, + }, + updateMask: { + paths: ['serve_nodes', 'cluster_config.cluster_autoscaling_config'], + }, + }, + gaxOpts: {}, + }, + }, +}; + +exports[ + 'Bigtable/Cluster setMetadata should provide the proper request options asynchronously 5' +] = { + input: { + id: 'my-cluster', + options: { + minServeNodes: 2, + maxServeNodes: 3, + cpuUtilizationPercent: 50, + location: 'us-central2-d', + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'partialUpdateCluster', + reqOpts: { + cluster: { + name: 'projects/grape-spaceship-123/instances/i/clusters/my-cluster', + location: 'us-central2-d', + clusterConfig: { + clusterAutoscalingConfig: { + autoscalingTargets: { + cpuUtilizationPercent: 50, + }, + autoscalingLimits: { + minServeNodes: 2, + maxServeNodes: 3, + }, + }, + }, + }, + updateMask: { + paths: [ + 'cluster_config.cluster_autoscaling_config.autoscaling_limits.min_serve_nodes', + 'cluster_config.cluster_autoscaling_config.autoscaling_limits.max_serve_nodes', + 'cluster_config.cluster_autoscaling_config.autoscaling_targets.cpu_utilization_percent', + ], + }, + }, + gaxOpts: {}, + }, + }, +}; diff --git a/handwritten/bigtable/__snapshots__/index.js b/handwritten/bigtable/__snapshots__/index.js new file mode 100644 index 00000000000..123ac3d9fa9 --- /dev/null +++ b/handwritten/bigtable/__snapshots__/index.js @@ -0,0 +1,211 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +exports[ + 'Bigtable createInstance should provide the proper request options asynchronously 1' +] = { + input: { + id: 'my-instance', + options: { + clusters: { + nodes: 2, + location: 'us-central2-d', + id: 'my-cluster', + }, + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'createInstance', + reqOpts: { + parent: 'projects/test-project', + instanceId: 'my-instance', + instance: { + displayName: 'my-instance', + }, + clusters: { + 'my-cluster': { + location: 'projects/test-project/locations/us-central2-d', + serveNodes: 2, + defaultStorageType: 0, + }, + }, + }, + }, + }, +}; + +exports[ + 'Bigtable createInstance should provide the proper request options asynchronously 2' +] = { + input: { + id: 'my-instance', + options: { + clusters: { + nodes: 2, + storage: 'ssd', + location: 'us-central2-d', + id: 'my-cluster', + }, + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'createInstance', + reqOpts: { + parent: 'projects/test-project', + instanceId: 'my-instance', + instance: { + displayName: 'my-instance', + }, + clusters: { + 'my-cluster': { + location: 'projects/test-project/locations/us-central2-d', + serveNodes: 2, + defaultStorageType: 1, + }, + }, + }, + }, + }, +}; + +exports[ + 'Bigtable createInstance should provide the proper request options asynchronously 3' +] = { + input: { + id: 'my-instance', + options: { + clusters: { + nodes: 2, + key: 'kms-key-name', + location: 'us-central2-d', + id: 'my-cluster', + }, + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'createInstance', + reqOpts: { + parent: 'projects/test-project', + instanceId: 'my-instance', + instance: { + displayName: 'my-instance', + }, + clusters: { + 'my-cluster': { + location: 'projects/test-project/locations/us-central2-d', + serveNodes: 2, + defaultStorageType: 0, + encryptionConfig: { + kmsKeyName: 'kms-key-name', + }, + }, + }, + }, + }, + }, +}; + +exports[ + 'Bigtable createInstance should provide the proper request options asynchronously 4' +] = { + input: { + id: 'my-instance', + options: { + clusters: { + nodes: 2, + encryption: { + kmsKeyName: 'kms-key-name', + }, + location: 'us-central2-d', + id: 'my-cluster', + }, + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'createInstance', + reqOpts: { + parent: 'projects/test-project', + instanceId: 'my-instance', + instance: { + displayName: 'my-instance', + }, + clusters: { + 'my-cluster': { + location: 'projects/test-project/locations/us-central2-d', + serveNodes: 2, + defaultStorageType: 0, + encryptionConfig: { + kmsKeyName: 'kms-key-name', + }, + }, + }, + }, + }, + }, +}; + +exports[ + 'Bigtable createInstance should provide the proper request options asynchronously 5' +] = { + input: { + id: 'my-instance', + options: { + clusters: { + minServeNodes: 2, + maxServeNodes: 3, + cpuUtilizationPercent: 50, + location: 'us-central2-d', + id: 'my-cluster', + }, + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'createInstance', + reqOpts: { + parent: 'projects/test-project', + instanceId: 'my-instance', + instance: { + displayName: 'my-instance', + }, + clusters: { + 'my-cluster': { + location: 'projects/test-project/locations/us-central2-d', + clusterConfig: { + clusterAutoscalingConfig: { + autoscalingTargets: { + cpuUtilizationPercent: 50, + }, + autoscalingLimits: { + minServeNodes: 2, + maxServeNodes: 3, + }, + }, + }, + defaultStorageType: 0, + }, + }, + }, + }, + }, +}; diff --git a/handwritten/bigtable/__snapshots__/instance.js b/handwritten/bigtable/__snapshots__/instance.js new file mode 100644 index 00000000000..c8d4aed4776 --- /dev/null +++ b/handwritten/bigtable/__snapshots__/instance.js @@ -0,0 +1,167 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +exports[ + 'Bigtable/Instance createCluster should provide the proper request options asynchronously 1' +] = { + input: { + id: 'my-cluster', + options: { + nodes: 2, + location: 'us-central2-d', + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'createCluster', + reqOpts: { + parent: 'projects/my-project/instances/my-instance', + clusterId: 'my-cluster', + cluster: { + location: 'projects/my-project/locations/us-central2-d', + serveNodes: 2, + }, + }, + }, + }, +}; + +exports[ + 'Bigtable/Instance createCluster should provide the proper request options asynchronously 2' +] = { + input: { + id: 'my-cluster', + options: { + nodes: 2, + storage: 'ssd', + location: 'us-central2-d', + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'createCluster', + reqOpts: { + parent: 'projects/my-project/instances/my-instance', + clusterId: 'my-cluster', + cluster: { + location: 'projects/my-project/locations/us-central2-d', + serveNodes: 2, + defaultStorageType: 1, + }, + }, + }, + }, +}; + +exports[ + 'Bigtable/Instance createCluster should provide the proper request options asynchronously 3' +] = { + input: { + id: 'my-cluster', + options: { + nodes: 2, + key: 'kms-key-name', + location: 'us-central2-d', + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'createCluster', + reqOpts: { + parent: 'projects/my-project/instances/my-instance', + clusterId: 'my-cluster', + cluster: { + location: 'projects/my-project/locations/us-central2-d', + serveNodes: 2, + encryptionConfig: { + kmsKeyName: 'kms-key-name', + }, + }, + }, + }, + }, +}; + +exports[ + 'Bigtable/Instance createCluster should provide the proper request options asynchronously 4' +] = { + input: { + id: 'my-cluster', + options: { + nodes: 2, + encryption: { + kmsKeyName: 'kms-key-name', + }, + location: 'us-central2-d', + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'createCluster', + reqOpts: { + parent: 'projects/my-project/instances/my-instance', + clusterId: 'my-cluster', + cluster: { + location: 'projects/my-project/locations/us-central2-d', + serveNodes: 2, + encryptionConfig: { + kmsKeyName: 'kms-key-name', + }, + }, + }, + }, + }, +}; + +exports[ + 'Bigtable/Instance createCluster should provide the proper request options asynchronously 5' +] = { + input: { + id: 'my-cluster', + options: { + minServeNodes: 2, + maxServeNodes: 3, + cpuUtilizationPercent: 50, + location: 'us-central2-d', + }, + }, + output: { + config: { + client: 'BigtableInstanceAdminClient', + method: 'createCluster', + reqOpts: { + parent: 'projects/my-project/instances/my-instance', + clusterId: 'my-cluster', + cluster: { + location: 'projects/my-project/locations/us-central2-d', + clusterConfig: { + clusterAutoscalingConfig: { + autoscalingTargets: { + cpuUtilizationPercent: 50, + }, + autoscalingLimits: { + minServeNodes: 2, + maxServeNodes: 3, + }, + }, + }, + }, + }, + }, + }, +}; diff --git a/handwritten/bigtable/linkinator.config.json b/handwritten/bigtable/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/handwritten/bigtable/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/handwritten/bigtable/owlbot.py b/handwritten/bigtable/owlbot.py new file mode 100644 index 00000000000..bb4ea4dee0b --- /dev/null +++ b/handwritten/bigtable/owlbot.py @@ -0,0 +1,180 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.node_mono_repo as node +import logging +import os +from pathlib import Path +from synthtool import _tracked_paths +from typing import AnyStr +import shutil + +logging.basicConfig(level=logging.DEBUG) + +staging = Path("owl-bot-staging/bigtable") + +if staging.is_dir(): + versions = ['v2'] + versions_admin = [f"admin/{p}" for p in versions] + + logging.info(f"Copying files from staging directory {staging}.") + + src_paths = {} + src_files = {} + for version in versions + versions_admin: + src_paths[version] = staging / version + src_files[version] = list([fn for fn in src_paths[version].glob('**/*.*')]) + + # Copy bigtable library. + # src/index.ts src/admin/v2/index.ts has added AdminClients manually; we don't want to override it. + # src/*.ts is a added layer for the client libraries, they need extra setting in tsconfig.json & tslint.json + # Tracking issues: 1. https://github.com/googleapis/nodejs-bigtable/issues/636 + # 2. https://github.com/googleapis/nodejs-bigtable/issues/635 + for version in versions: + library = src_paths[version] + _tracked_paths.add(library) + admin_files = filter( + lambda f: str(f).find('_admin') >= 0, + src_files[version] + ) + excludes = [ + 'package.json', + 'README.md', + 'src/index.ts', + 'src/v2/index.ts', + 'tsconfig.json', + 'tslint.json', + '.github/sync-repo-settings.yaml', + '.github/workflows/ci.yaml', + '.OwlBot.yaml', + 'samples/generated/v2/*', # we don't want to encourage non-veneer use here. + '.kokoro/samples-test.sh', # get to green + '.kokoro/system-test.sh', + '.kokoro/test.sh', + ] + list(admin_files) + logging.info(f"excluding files for non-admin: {excludes}") + s.copy([library], destination="handwritten/bigtable", excludes = excludes) + + # Copy the admin library pieces and knit them in. + # Don't override system-test for admin/v2, just keep the v2 version. + for version in versions: + admin_version = f"admin/{version}" + library = src_paths[admin_version] + inProtoPath = f"handwritten/bigtable/protos/google/bigtable/{admin_version}" + protos = library / inProtoPath + classes = library / 'src' / version + samples = library / 'samples' / 'generated' + tests = library / 'test' + _tracked_paths.add(library) + + # We also have to munge the proto paths in the *_proto_list.json due to making it a level deeper. + # That also applies to the classes themselves. + classesStr = str(classes) + jsons = [fn + for fn + in src_files[admin_version] + if str(fn)[:len(classesStr)] == classesStr] + for jfn in jsons: + logging.info(f"munging json file: {str(jfn)}") + contents = jfn.read_text() + contents = contents.replace("'../..", "'../../..") + contents = contents.replace('"../..', '"../../..') + jfn.write_text(contents) + + # Also to the tests that import stuff from src. ../ -> ../../../ + testsStr = str(tests) + tfns = [fn + for fn + in src_files[admin_version] + if str(fn)[:len(testsStr)] == testsStr] + for tfn in tfns: + logging.info(f"munging test file: {str(tfn)}") + contents = tfn.read_text() + + # Fix relative paths. + contents = contents.replace("'../", "'../../../") + + # Use the selective subclasses. + contents = contents.replace(".v2.BigtableInstanceAdminClient", ".admin.InstanceAdminClient") + contents = contents.replace(".v2.BigtableTableAdminClient", ".admin.TableAdminClient") + + # Statics also. + contents = contents.replace("bigtabletableadminModule.v2.BigtableTableAdminClient", \ + "bigtabletableadminModule.admin.TableAdminClient") + contents = contents.replace("bigtabletableadminModule.v2.BigtableInstanceAdminClient", \ + "bigtabletableadminModule.admin.InstanceAdminClient") + + tfn.write_text(contents) + + # Finally, the samples. Shift to selective subclasses, and mark the samples + # with CUJs as internal, in favour of the handwritten ones. + samplesStr = str(samples) + sfns = [fn + for fn + in src_files[admin_version] + if str(fn)[:len(samplesStr)] == samplesStr] + for sfn in sfns: + logging.info(f"munging sample file: {str(sfn)}") + contents = sfn.read_text() + contents = contents.replace("const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2", \ + "const {InstanceAdminClient} = require('@google-cloud/bigtable').admin") + contents = contents.replace("const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2", \ + "const {TableAdminClient} = require('@google-cloud/bigtable').admin") + contents = contents.replace("new BigtableInstanceAdminClient", "new InstanceAdminClient") + contents = contents.replace("new BigtableTableAdminClient", "new TableAdminClient") + + # We need to disable this one so the handwritten sample + # can take over for the CUJ. + contents = contents.replace("bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async", \ + "bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async_internal") + + sfn.write_text(contents) + + os.system(f"mkdir -p {inProtoPath}") + s.copy([protos / '*'], destination=inProtoPath) + os.system(f"mkdir -p src/{admin_version}") + s.copy([classes / '*'], destination=f"handwritten/bigtable/src/{admin_version}") + os.system(f"mkdir -p samples/generated/{admin_version}") + s.copy([samples / 'v2' / '*admin*'], destination=f"handwritten/bigtable/samples/generated/{admin_version}") + os.system(f"mkdir -p test/{admin_version}") + s.copy([tests / '*admin*.ts'], destination=f"handwritten/bigtable/test/{admin_version}") + + # Replace the client name for generated system-test. + system_test_files=['handwritten/bigtable/system-test/fixtures/sample/src/index.ts','handwritten/bigtable/system-test/fixtures/sample/src/index.js'] + for file in system_test_files: + s.replace(file, 'BigtableClient', 'Bigtable') + s.replace(file, 'client.close', '// client.close') # this does not work with the manual layer + s.replace(file, 'function doStuffWith', '// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction doStuffWith') + + # The staging directory should never be merged into the main branch. + shutil.rmtree(staging) + +common_templates = gcp.CommonTemplates() +templates = common_templates.node_mono_repo_library( + relative_dir="handwritten/bigtable", + source_location='build/src' +) +s.copy(templates,destination="handwritten/bigtable", excludes=[ + '.github/auto-approve.yml', + '.github/sync-repo-settings.yaml', + '.github/workflows/ci.yaml', + '.kokoro/samples-test.sh', # get to green + '.kokoro/system-test.sh', + '.kokoro/test.sh', + '.mocharc.js', + 'README.md' +]) + +node.postprocess_gapic_library_hermetic(relative_dir="handwritten/bigtable") diff --git a/handwritten/bigtable/package.json b/handwritten/bigtable/package.json new file mode 100644 index 00000000000..c0d768b960f --- /dev/null +++ b/handwritten/bigtable/package.json @@ -0,0 +1,120 @@ +{ + "name": "@google-cloud/bigtable", + "version": "6.5.0", + "description": "Cloud Bigtable Client Library for Node.js", + "keywords": [ + "bigtable", + "cloud", + "google", + "google api", + "google api client", + "google apis", + "google apis client", + "google bigtable", + "google cloud", + "google cloud platform" + ], + "repository": { + "type": "git", + "directory": "handwritten/bigtable", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "license": "Apache-2.0", + "author": "Google Inc.", + "main": "build/src/index.js", + "types": "./build/src/index.d.ts", + "files": [ + "build/protos", + "build/src", + "!**/*.map" + ], + "scripts": { + "compile": "tsc -p . && cp -r proto* build/ && cp -r testproxy/proto* build/testproxy/", + "compile-protos": "compileProtos src && sh testproxy/compile-protos.sh", + "predocs": "npm run compile", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "prelint": "cd samples; npm link ../; npm install", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", + "snippet-test": "mocha samples/api-reference-doc-snippets/tests/*.js --timeout 600000 --retries 3", + "presystem-test": "npm run compile", + "system-test": "mocha build/system-test --timeout 600000 --retries 3", + "pretest": "npm run compile", + "test": "c8 mocha build/test", + "test:snap": "SNAPSHOT_UPDATE=1 npm test", + "testproxy": "npm run compile && node build/testproxy/index.js", + "clean": "gts clean", + "precompile": "gts clean" + }, + "dependencies": { + "@google-cloud/monitoring": "^5.0.1", + "@google-cloud/opentelemetry-cloud-monitoring-exporter": "^0.20.0", + "@google-cloud/opentelemetry-resource-util": "^2.4.0", + "@google-cloud/precise-date": "^5.0.0", + "@google-cloud/projectify": "^5.0.0", + "@google-cloud/promisify": "^5.0.0", + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/resources": "^1.30.0", + "@opentelemetry/sdk-metrics": "^1.30.0", + "@types/long": "^4.0.0", + "abort-controller": "^3.0.0", + "arrify": "2.0.1", + "concat-stream": "^2.0.0", + "dot-prop": "6.0.0", + "escape-string-regexp": "4.0.0", + "extend": "^3.0.2", + "fast-crc32c": "^2.0.0", + "google-gax": "^5.0.1-rc.0", + "grpc-gcp": "^1.0.1", + "is": "^3.3.0", + "is-utf8": "^0.2.1", + "lodash.snakecase": "^4.1.1", + "long": "4.0.0", + "p-queue": "^8.1.0", + "pumpify": "^2.0.1", + "stream-events": "^1.0.5" + }, + "devDependencies": { + "@grpc/grpc-js": "^1.13.2", + "@grpc/proto-loader": "^0.7.13", + "@types/escape-string-regexp": "^2.0.3", + "@types/extend": "^3.0.4", + "@types/is": "^0.0.25", + "@types/lodash.snakecase": "^4.1.9", + "@types/mocha": "^10.0.10", + "@types/node": "^22.14.0", + "@types/p-queue": "^3.2.1", + "@types/proxyquire": "^1.3.31", + "@types/pumpify": "^1.4.4", + "@types/sinon": "^17.0.4", + "@types/uuid": "^10.0.0", + "c8": "^10.1.3", + "codecov": "^3.8.3", + "gapic-tools": "^1.0.1", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "linkinator": "^6.1.2", + "mocha": "^11.1.0", + "null-loader": "^4.0.1", + "pack-n-play": "^3.0.0", + "proxyquire": "^2.1.3", + "sinon": "^20.0.0", + "snap-shot-it": "^7.9.10", + "tcp-port-used": "^1.0.2", + "ts-loader": "^9.5.2", + "typescript": "^5.8.2", + "uuid": "8.0.0", + "webpack": "^5.98.0", + "webpack-cli": "^6.0.1" + }, + "engines": { + "node": ">=18" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/handwritten/bigtable" +} diff --git a/handwritten/bigtable/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto b/handwritten/bigtable/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto new file mode 100644 index 00000000000..a800f990da0 --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto @@ -0,0 +1,1137 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.admin.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/bigtable/admin/v2/instance.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; +option go_package = "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "BigtableInstanceAdminProto"; +option java_package = "com.google.bigtable.admin.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; +option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; + +// Service for creating, configuring, and deleting Cloud Bigtable Instances and +// Clusters. Provides access to the Instance and Cluster schemas only, not the +// tables' metadata or data stored in those tables. +service BigtableInstanceAdmin { + option (google.api.default_host) = "bigtableadmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigtable.admin," + "https://www.googleapis.com/auth/bigtable.admin.cluster," + "https://www.googleapis.com/auth/bigtable.admin.instance," + "https://www.googleapis.com/auth/cloud-bigtable.admin," + "https://www.googleapis.com/auth/cloud-bigtable.admin.cluster," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Create an instance within a project. + // + // Note that exactly one of Cluster.serve_nodes and + // Cluster.cluster_config.cluster_autoscaling_config can be set. If + // serve_nodes is set to non-zero, then the cluster is manually scaled. If + // cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is + // enabled. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/instances" + body: "*" + }; + option (google.api.method_signature) = + "parent,instance_id,instance,clusters"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "CreateInstanceMetadata" + }; + } + + // Gets information about an instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists information about instances in a project. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an instance within a project. This method updates only the display + // name and type for an Instance. To update other Instance properties, such as + // labels, use PartialUpdateInstance. + rpc UpdateInstance(Instance) returns (Instance) { + option (google.api.http) = { + put: "/v2/{name=projects/*/instances/*}" + body: "*" + }; + } + + // Partially updates an instance within a project. This method can modify all + // fields of an Instance and is the preferred way to update an Instance. + rpc PartialUpdateInstance(PartialUpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{instance.name=projects/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "UpdateInstanceMetadata" + }; + } + + // Delete an instance from a project. + rpc DeleteInstance(DeleteInstanceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a cluster within an instance. + // + // Note that exactly one of Cluster.serve_nodes and + // Cluster.cluster_config.cluster_autoscaling_config can be set. If + // serve_nodes is set to non-zero, then the cluster is manually scaled. If + // cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is + // enabled. + rpc CreateCluster(CreateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/clusters" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster_id,cluster"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "CreateClusterMetadata" + }; + } + + // Gets information about a cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists information about clusters in an instance. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a cluster within an instance. + // + // Note that UpdateCluster does not support updating + // cluster_config.cluster_autoscaling_config. In order to update it, you + // must use PartialUpdateCluster. + rpc UpdateCluster(Cluster) returns (google.longrunning.Operation) { + option (google.api.http) = { + put: "/v2/{name=projects/*/instances/*/clusters/*}" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "UpdateClusterMetadata" + }; + } + + // Partially updates a cluster within a project. This method is the preferred + // way to update a Cluster. + // + // To enable and update autoscaling, set + // cluster_config.cluster_autoscaling_config. When autoscaling is enabled, + // serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it + // are ignored. Note that an update cannot simultaneously set serve_nodes to + // non-zero and cluster_config.cluster_autoscaling_config to non-empty, and + // also specify both in the update_mask. + // + // To disable autoscaling, clear cluster_config.cluster_autoscaling_config, + // and explicitly set a serve_node count via the update_mask. + rpc PartialUpdateCluster(PartialUpdateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{cluster.name=projects/*/instances/*/clusters/*}" + body: "cluster" + }; + option (google.api.method_signature) = "cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "PartialUpdateClusterMetadata" + }; + } + + // Deletes a cluster from an instance. + rpc DeleteCluster(DeleteClusterRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an app profile within an instance. + rpc CreateAppProfile(CreateAppProfileRequest) returns (AppProfile) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/appProfiles" + body: "app_profile" + }; + option (google.api.method_signature) = "parent,app_profile_id,app_profile"; + } + + // Gets information about an app profile. + rpc GetAppProfile(GetAppProfileRequest) returns (AppProfile) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/appProfiles/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists information about app profiles in an instance. + rpc ListAppProfiles(ListAppProfilesRequest) + returns (ListAppProfilesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/appProfiles" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an app profile within an instance. + rpc UpdateAppProfile(UpdateAppProfileRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{app_profile.name=projects/*/instances/*/appProfiles/*}" + body: "app_profile" + }; + option (google.api.method_signature) = "app_profile,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AppProfile" + metadata_type: "UpdateAppProfileMetadata" + }; + } + + // Deletes an app profile from an instance. + rpc DeleteAppProfile(DeleteAppProfileRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/appProfiles/*}" + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "name,ignore_warnings"; + } + + // Gets the access control policy for an instance resource. Returns an empty + // policy if an instance exists but does not have a policy set. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/materializedViews/*}:getIamPolicy" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/logicalViews/*}:getIamPolicy" + body: "*" + } + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the access control policy on an instance resource. Replaces any + // existing policy. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/materializedViews/*}:setIamPolicy" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/logicalViews/*}:setIamPolicy" + body: "*" + } + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns permissions that the caller has on the specified instance resource. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/materializedViews/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/logicalViews/*}:testIamPermissions" + body: "*" + } + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Lists hot tablets in a cluster, within the time range provided. Hot + // tablets are ordered based on CPU usage. + rpc ListHotTablets(ListHotTabletsRequest) returns (ListHotTabletsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*/clusters/*}/hotTablets" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a logical view within an instance. + rpc CreateLogicalView(CreateLogicalViewRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/logicalViews" + body: "logical_view" + }; + option (google.api.method_signature) = + "parent,logical_view,logical_view_id"; + option (google.longrunning.operation_info) = { + response_type: "LogicalView" + metadata_type: "CreateLogicalViewMetadata" + }; + } + + // Gets information about a logical view. + rpc GetLogicalView(GetLogicalViewRequest) returns (LogicalView) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/logicalViews/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists information about logical views in an instance. + rpc ListLogicalViews(ListLogicalViewsRequest) + returns (ListLogicalViewsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/logicalViews" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a logical view within an instance. + rpc UpdateLogicalView(UpdateLogicalViewRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{logical_view.name=projects/*/instances/*/logicalViews/*}" + body: "logical_view" + }; + option (google.api.method_signature) = "logical_view,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "LogicalView" + metadata_type: "UpdateLogicalViewMetadata" + }; + } + + // Deletes a logical view from an instance. + rpc DeleteLogicalView(DeleteLogicalViewRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/logicalViews/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a materialized view within an instance. + rpc CreateMaterializedView(CreateMaterializedViewRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/materializedViews" + body: "materialized_view" + }; + option (google.api.method_signature) = + "parent,materialized_view,materialized_view_id"; + option (google.longrunning.operation_info) = { + response_type: "MaterializedView" + metadata_type: "CreateMaterializedViewMetadata" + }; + } + + // Gets information about a materialized view. + rpc GetMaterializedView(GetMaterializedViewRequest) + returns (MaterializedView) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/materializedViews/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists information about materialized views in an instance. + rpc ListMaterializedViews(ListMaterializedViewsRequest) + returns (ListMaterializedViewsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/materializedViews" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a materialized view within an instance. + rpc UpdateMaterializedView(UpdateMaterializedViewRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{materialized_view.name=projects/*/instances/*/materializedViews/*}" + body: "materialized_view" + }; + option (google.api.method_signature) = "materialized_view,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MaterializedView" + metadata_type: "UpdateMaterializedViewMetadata" + }; + } + + // Deletes a materialized view from an instance. + rpc DeleteMaterializedView(DeleteMaterializedViewRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/materializedViews/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for BigtableInstanceAdmin.CreateInstance. +message CreateInstanceRequest { + // Required. The unique name of the project in which to create the new + // instance. Values are of the form `projects/{project}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The ID to be used when referring to the new instance within its + // project, e.g., just `myinstance` rather than + // `projects/myproject/instances/myinstance`. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The instance to create. + // Fields marked `OutputOnly` must be left blank. + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The clusters to be created within the instance, mapped by desired + // cluster ID, e.g., just `mycluster` rather than + // `projects/myproject/instances/myinstance/clusters/mycluster`. + // Fields marked `OutputOnly` must be left blank. + map clusters = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for BigtableInstanceAdmin.GetInstance. +message GetInstanceRequest { + // Required. The unique name of the requested instance. Values are of the form + // `projects/{project}/instances/{instance}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; +} + +// Request message for BigtableInstanceAdmin.ListInstances. +message ListInstancesRequest { + // Required. The unique name of the project for which a list of instances is + // requested. Values are of the form `projects/{project}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // DEPRECATED: This field is unused and ignored. + string page_token = 2; +} + +// Response message for BigtableInstanceAdmin.ListInstances. +message ListInstancesResponse { + // The list of requested instances. + repeated Instance instances = 1; + + // Locations from which Instance information could not be retrieved, + // due to an outage or some other transient condition. + // Instances whose Clusters are all in one of the failed locations + // may be missing from `instances`, and Instances with at least one + // Cluster in a failed location may only have partial information returned. + // Values are of the form `projects//locations/` + repeated string failed_locations = 2; + + // DEPRECATED: This field is unused and ignored. + string next_page_token = 3; +} + +// Request message for BigtableInstanceAdmin.PartialUpdateInstance. +message PartialUpdateInstanceRequest { + // Required. The Instance which will (partially) replace the current value. + Instance instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The subset of Instance fields which should be replaced. + // Must be explicitly set. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for BigtableInstanceAdmin.DeleteInstance. +message DeleteInstanceRequest { + // Required. The unique name of the instance to be deleted. + // Values are of the form `projects/{project}/instances/{instance}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; +} + +// Request message for BigtableInstanceAdmin.CreateCluster. +message CreateClusterRequest { + // Required. The unique name of the instance in which to create the new + // cluster. Values are of the form `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The ID to be used when referring to the new cluster within its + // instance, e.g., just `mycluster` rather than + // `projects/myproject/instances/myinstance/clusters/mycluster`. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster to be created. + // Fields marked `OutputOnly` must be left blank. + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for BigtableInstanceAdmin.GetCluster. +message GetClusterRequest { + // Required. The unique name of the requested cluster. Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; +} + +// Request message for BigtableInstanceAdmin.ListClusters. +message ListClustersRequest { + // Required. The unique name of the instance for which a list of clusters is + // requested. Values are of the form + // `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list + // Clusters for all Instances in a project, e.g., + // `projects/myproject/instances/-`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // DEPRECATED: This field is unused and ignored. + string page_token = 2; +} + +// Response message for BigtableInstanceAdmin.ListClusters. +message ListClustersResponse { + // The list of requested clusters. + repeated Cluster clusters = 1; + + // Locations from which Cluster information could not be retrieved, + // due to an outage or some other transient condition. + // Clusters from these locations may be missing from `clusters`, + // or may only have partial information returned. + // Values are of the form `projects//locations/` + repeated string failed_locations = 2; + + // DEPRECATED: This field is unused and ignored. + string next_page_token = 3; +} + +// Request message for BigtableInstanceAdmin.DeleteCluster. +message DeleteClusterRequest { + // Required. The unique name of the cluster to be deleted. Values are of the + // form `projects/{project}/instances/{instance}/clusters/{cluster}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; +} + +// The metadata for the Operation returned by CreateInstance. +message CreateInstanceMetadata { + // The request that prompted the initiation of this CreateInstance operation. + CreateInstanceRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// The metadata for the Operation returned by UpdateInstance. +message UpdateInstanceMetadata { + // The request that prompted the initiation of this UpdateInstance operation. + PartialUpdateInstanceRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// The metadata for the Operation returned by CreateCluster. +message CreateClusterMetadata { + // Progress info for copying a table's data to the new cluster. + message TableProgress { + enum State { + STATE_UNSPECIFIED = 0; + + // The table has not yet begun copying to the new cluster. + PENDING = 1; + + // The table is actively being copied to the new cluster. + COPYING = 2; + + // The table has been fully copied to the new cluster. + COMPLETED = 3; + + // The table was deleted before it finished copying to the new cluster. + // Note that tables deleted after completion will stay marked as + // COMPLETED, not CANCELLED. + CANCELLED = 4; + } + + // Estimate of the size of the table to be copied. + int64 estimated_size_bytes = 2; + + // Estimate of the number of bytes copied so far for this table. + // This will eventually reach 'estimated_size_bytes' unless the table copy + // is CANCELLED. + int64 estimated_copied_bytes = 3; + + State state = 4; + } + + // The request that prompted the initiation of this CreateCluster operation. + CreateClusterRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; + + // Keys: the full `name` of each table that existed in the instance when + // CreateCluster was first called, i.e. + // `projects//instances//tables/`. Any table added + // to the instance by a later API call will be created in the new cluster by + // that API call, not this one. + // + // Values: information on how much of a table's data has been copied to the + // newly-created cluster so far. + map tables = 4; +} + +// The metadata for the Operation returned by UpdateCluster. +message UpdateClusterMetadata { + // The request that prompted the initiation of this UpdateCluster operation. + Cluster original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// The metadata for the Operation returned by PartialUpdateCluster. +message PartialUpdateClusterMetadata { + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 1; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 2; + + // The original request for PartialUpdateCluster. + PartialUpdateClusterRequest original_request = 3; +} + +// Request message for BigtableInstanceAdmin.PartialUpdateCluster. +message PartialUpdateClusterRequest { + // Required. The Cluster which contains the partial updates to be applied, + // subject to the update_mask. + Cluster cluster = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The subset of Cluster fields which should be replaced. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for BigtableInstanceAdmin.CreateAppProfile. +message CreateAppProfileRequest { + // Required. The unique name of the instance in which to create the new app + // profile. Values are of the form `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The ID to be used when referring to the new app profile within + // its instance, e.g., just `myprofile` rather than + // `projects/myproject/instances/myinstance/appProfiles/myprofile`. + string app_profile_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The app profile to be created. + // Fields marked `OutputOnly` will be ignored. + AppProfile app_profile = 3 [(google.api.field_behavior) = REQUIRED]; + + // If true, ignore safety checks when creating the app profile. + bool ignore_warnings = 4; +} + +// Request message for BigtableInstanceAdmin.GetAppProfile. +message GetAppProfileRequest { + // Required. The unique name of the requested app profile. Values are of the + // form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AppProfile" + } + ]; +} + +// Request message for BigtableInstanceAdmin.ListAppProfiles. +message ListAppProfilesRequest { + // Required. The unique name of the instance for which a list of app profiles + // is requested. Values are of the form + // `projects/{project}/instances/{instance}`. + // Use `{instance} = '-'` to list AppProfiles for all Instances in a project, + // e.g., `projects/myproject/instances/-`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Maximum number of results per page. + // + // A page_size of zero lets the server choose the number of items to return. + // A page_size which is strictly positive will return at most that many items. + // A negative page_size will cause an error. + // + // Following the first request, subsequent paginated calls are not required + // to pass a page_size. If a page_size is set in subsequent calls, it must + // match the page_size given in the first request. + int32 page_size = 3; + + // The value of `next_page_token` returned by a previous call. + string page_token = 2; +} + +// Response message for BigtableInstanceAdmin.ListAppProfiles. +message ListAppProfilesResponse { + // The list of requested app profiles. + repeated AppProfile app_profiles = 1; + + // Set if not all app profiles could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + string next_page_token = 2; + + // Locations from which AppProfile information could not be retrieved, + // due to an outage or some other transient condition. + // AppProfiles from these locations may be missing from `app_profiles`. + // Values are of the form `projects//locations/` + repeated string failed_locations = 3; +} + +// Request message for BigtableInstanceAdmin.UpdateAppProfile. +message UpdateAppProfileRequest { + // Required. The app profile which will (partially) replace the current value. + AppProfile app_profile = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The subset of app profile fields which should be replaced. + // If unset, all fields will be replaced. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // If true, ignore safety checks when updating the app profile. + bool ignore_warnings = 3; +} + +// Request message for BigtableInstanceAdmin.DeleteAppProfile. +message DeleteAppProfileRequest { + // Required. The unique name of the app profile to be deleted. Values are of + // the form + // `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AppProfile" + } + ]; + + // Required. If true, ignore safety checks when deleting the app profile. + bool ignore_warnings = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The metadata for the Operation returned by UpdateAppProfile. +message UpdateAppProfileMetadata {} + +// Request message for BigtableInstanceAdmin.ListHotTablets. +message ListHotTabletsRequest { + // Required. The cluster name to list hot tablets. + // Value is in the following form: + // `projects/{project}/instances/{instance}/clusters/{cluster}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; + + // The start time to list hot tablets. The hot tablets in the response will + // have start times between the requested start time and end time. Start time + // defaults to Now if it is unset, and end time defaults to Now - 24 hours if + // it is unset. The start time should be less than the end time, and the + // maximum allowed time range between start time and end time is 48 hours. + // Start time and end time should have values between Now and Now - 14 days. + google.protobuf.Timestamp start_time = 2; + + // The end time to list hot tablets. + google.protobuf.Timestamp end_time = 3; + + // Maximum number of results per page. + // + // A page_size that is empty or zero lets the server choose the number of + // items to return. A page_size which is strictly positive will return at most + // that many items. A negative page_size will cause an error. + // + // Following the first request, subsequent paginated calls do not need a + // page_size field. If a page_size is set in subsequent calls, it must match + // the page_size given in the first request. + int32 page_size = 4; + + // The value of `next_page_token` returned by a previous call. + string page_token = 5; +} + +// Response message for BigtableInstanceAdmin.ListHotTablets. +message ListHotTabletsResponse { + // List of hot tablets in the tables of the requested cluster that fall + // within the requested time range. Hot tablets are ordered by node cpu usage + // percent. If there are multiple hot tablets that correspond to the same + // tablet within a 15-minute interval, only the hot tablet with the highest + // node cpu usage will be included in the response. + repeated HotTablet hot_tablets = 1; + + // Set if not all hot tablets could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + string next_page_token = 2; +} + +// Request message for BigtableInstanceAdmin.CreateLogicalView. +message CreateLogicalViewRequest { + // Required. The parent instance where this logical view will be created. + // Format: `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The ID to use for the logical view, which will become the final + // component of the logical view's resource name. + string logical_view_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The logical view to create. + LogicalView logical_view = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The metadata for the Operation returned by CreateLogicalView. +message CreateLogicalViewMetadata { + // The request that prompted the initiation of this CreateLogicalView + // operation. + CreateLogicalViewRequest original_request = 1; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// Request message for BigtableInstanceAdmin.GetLogicalView. +message GetLogicalViewRequest { + // Required. The unique name of the requested logical view. Values are of the + // form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/LogicalView" + } + ]; +} + +// Request message for BigtableInstanceAdmin.ListLogicalViews. +message ListLogicalViewsRequest { + // Required. The unique name of the instance for which the list of logical + // views is requested. Values are of the form + // `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigtableadmin.googleapis.com/LogicalView" + } + ]; + + // Optional. The maximum number of logical views to return. The service may + // return fewer than this value + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListLogicalViews` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListLogicalViews` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for BigtableInstanceAdmin.ListLogicalViews. +message ListLogicalViewsResponse { + // The list of requested logical views. + repeated LogicalView logical_views = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for BigtableInstanceAdmin.UpdateLogicalView. +message UpdateLogicalViewRequest { + // Required. The logical view to update. + // + // The logical view's `name` field is used to identify the view to update. + // Format: + // `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + LogicalView logical_view = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The metadata for the Operation returned by UpdateLogicalView. +message UpdateLogicalViewMetadata { + // The request that prompted the initiation of this UpdateLogicalView + // operation. + UpdateLogicalViewRequest original_request = 1; + + // The time at which this operation was started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// Request message for BigtableInstanceAdmin.DeleteLogicalView. +message DeleteLogicalViewRequest { + // Required. The unique name of the logical view to be deleted. + // Format: + // `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/LogicalView" + } + ]; + + // Optional. The current etag of the logical view. + // If an etag is provided and does not match the current etag of the + // logical view, deletion will be blocked and an ABORTED error will be + // returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for BigtableInstanceAdmin.CreateMaterializedView. +message CreateMaterializedViewRequest { + // Required. The parent instance where this materialized view will be created. + // Format: `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The ID to use for the materialized view, which will become the + // final component of the materialized view's resource name. + string materialized_view_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The materialized view to create. + MaterializedView materialized_view = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// The metadata for the Operation returned by CreateMaterializedView. +message CreateMaterializedViewMetadata { + // The request that prompted the initiation of this CreateMaterializedView + // operation. + CreateMaterializedViewRequest original_request = 1; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// Request message for BigtableInstanceAdmin.GetMaterializedView. +message GetMaterializedViewRequest { + // Required. The unique name of the requested materialized view. Values are of + // the form + // `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/MaterializedView" + } + ]; +} + +// Request message for BigtableInstanceAdmin.ListMaterializedViews. +message ListMaterializedViewsRequest { + // Required. The unique name of the instance for which the list of + // materialized views is requested. Values are of the form + // `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigtableadmin.googleapis.com/MaterializedView" + } + ]; + + // Optional. The maximum number of materialized views to return. The service + // may return fewer than this value + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListMaterializedViews` + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListMaterializedViews` + // must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for BigtableInstanceAdmin.ListMaterializedViews. +message ListMaterializedViewsResponse { + // The list of requested materialized views. + repeated MaterializedView materialized_views = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for BigtableInstanceAdmin.UpdateMaterializedView. +message UpdateMaterializedViewRequest { + // Required. The materialized view to update. + // + // The materialized view's `name` field is used to identify the view to + // update. Format: + // `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + MaterializedView materialized_view = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The metadata for the Operation returned by UpdateMaterializedView. +message UpdateMaterializedViewMetadata { + // The request that prompted the initiation of this UpdateMaterializedView + // operation. + UpdateMaterializedViewRequest original_request = 1; + + // The time at which this operation was started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// Request message for BigtableInstanceAdmin.DeleteMaterializedView. +message DeleteMaterializedViewRequest { + // Required. The unique name of the materialized view to be deleted. + // Format: + // `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/MaterializedView" + } + ]; + + // Optional. The current etag of the materialized view. + // If an etag is provided and does not match the current etag of the + // materialized view, deletion will be blocked and an ABORTED error will be + // returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/handwritten/bigtable/protos/google/bigtable/admin/v2/bigtable_table_admin.proto b/handwritten/bigtable/protos/google/bigtable/admin/v2/bigtable_table_admin.proto new file mode 100644 index 00000000000..6267fa90973 --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/admin/v2/bigtable_table_admin.proto @@ -0,0 +1,1660 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.admin.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/bigtable/admin/v2/common.proto"; +import "google/bigtable/admin/v2/table.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; +option go_package = "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "BigtableTableAdminProto"; +option java_package = "com.google.bigtable.admin.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; +option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; + +// Service for creating, configuring, and deleting Cloud Bigtable tables. +// +// +// Provides access to the table schemas only, not the data stored within +// the tables. +service BigtableTableAdmin { + option (google.api.default_host) = "bigtableadmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigtable.admin," + "https://www.googleapis.com/auth/bigtable.admin.table," + "https://www.googleapis.com/auth/cloud-bigtable.admin," + "https://www.googleapis.com/auth/cloud-bigtable.admin.table," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Creates a new table in the specified instance. + // The table can be created with a full set of initial column families, + // specified in the request. + rpc CreateTable(CreateTableRequest) returns (Table) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/tables" + body: "*" + }; + option (google.api.method_signature) = "parent,table_id,table"; + } + + // Creates a new table from the specified snapshot. The target table must + // not exist. The snapshot and the table must be in the same instance. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. + rpc CreateTableFromSnapshot(CreateTableFromSnapshotRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot" + body: "*" + }; + option (google.api.method_signature) = "parent,table_id,source_snapshot"; + option (google.longrunning.operation_info) = { + response_type: "Table" + metadata_type: "CreateTableFromSnapshotMetadata" + }; + } + + // Lists all tables served from a specified instance. + rpc ListTables(ListTablesRequest) returns (ListTablesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/tables" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets metadata information about the specified table. + rpc GetTable(GetTableRequest) returns (Table) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/tables/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a specified table. + rpc UpdateTable(UpdateTableRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{table.name=projects/*/instances/*/tables/*}" + body: "table" + }; + option (google.api.method_signature) = "table,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Table" + metadata_type: "UpdateTableMetadata" + }; + } + + // Permanently deletes a specified table and all of its data. + rpc DeleteTable(DeleteTableRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/tables/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Restores a specified table which was accidentally deleted. + rpc UndeleteTable(UndeleteTableRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Table" + metadata_type: "UndeleteTableMetadata" + }; + } + + // Creates a new AuthorizedView in a table. + rpc CreateAuthorizedView(CreateAuthorizedViewRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews" + body: "authorized_view" + }; + option (google.api.method_signature) = + "parent,authorized_view,authorized_view_id"; + option (google.longrunning.operation_info) = { + response_type: "AuthorizedView" + metadata_type: "CreateAuthorizedViewMetadata" + }; + } + + // Lists all AuthorizedViews from a specific table. + rpc ListAuthorizedViews(ListAuthorizedViewsRequest) + returns (ListAuthorizedViewsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets information from a specified AuthorizedView. + rpc GetAuthorizedView(GetAuthorizedViewRequest) returns (AuthorizedView) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an AuthorizedView in a table. + rpc UpdateAuthorizedView(UpdateAuthorizedViewRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{authorized_view.name=projects/*/instances/*/tables/*/authorizedViews/*}" + body: "authorized_view" + }; + option (google.api.method_signature) = "authorized_view,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AuthorizedView" + metadata_type: "UpdateAuthorizedViewMetadata" + }; + } + + // Permanently deletes a specified AuthorizedView. + rpc DeleteAuthorizedView(DeleteAuthorizedViewRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Performs a series of column family modifications on the specified table. + // Either all or none of the modifications will occur before this method + // returns, but data requests received prior to that point may see a table + // where only some modifications have taken effect. + rpc ModifyColumnFamilies(ModifyColumnFamiliesRequest) returns (Table) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:modifyColumnFamilies" + body: "*" + }; + option (google.api.method_signature) = "name,modifications"; + } + + // Permanently drop/delete a row range from a specified table. The request can + // specify whether to delete all rows in a table, or only those that match a + // particular prefix. + rpc DropRowRange(DropRowRangeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:dropRowRange" + body: "*" + }; + } + + // Generates a consistency token for a Table, which can be used in + // CheckConsistency to check whether mutations to the table that finished + // before this call started have been replicated. The tokens will be available + // for 90 days. + rpc GenerateConsistencyToken(GenerateConsistencyTokenRequest) + returns (GenerateConsistencyTokenResponse) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Checks replication consistency based on a consistency token, that is, if + // replication has caught up based on the conditions specified in the token + // and the check request. + rpc CheckConsistency(CheckConsistencyRequest) + returns (CheckConsistencyResponse) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:checkConsistency" + body: "*" + }; + option (google.api.method_signature) = "name,consistency_token"; + } + + // Creates a new snapshot in the specified cluster from the specified + // source table. The cluster and the table must be in the same instance. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. + rpc SnapshotTable(SnapshotTableRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:snapshot" + body: "*" + }; + option (google.api.method_signature) = + "name,cluster,snapshot_id,description"; + option (google.longrunning.operation_info) = { + response_type: "Snapshot" + metadata_type: "SnapshotTableMetadata" + }; + } + + // Gets metadata information about the specified snapshot. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. + rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all snapshots associated with the specified cluster. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. + rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*/clusters/*}/snapshots" + }; + option (google.api.method_signature) = "parent"; + } + + // Permanently deletes the specified snapshot. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. + rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Starts creating a new Cloud Bigtable Backup. The returned backup + // [long-running operation][google.longrunning.Operation] can be used to + // track creation of the backup. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The + // [response][google.longrunning.Operation.response] field type is + // [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the + // returned operation will stop the creation and delete the backup. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*/clusters/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup_id,backup"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "CreateBackupMetadata" + }; + } + + // Gets metadata on a pending or completed Cloud Bigtable Backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/clusters/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a pending or completed Cloud Bigtable Backup. + rpc UpdateBackup(UpdateBackupRequest) returns (Backup) { + option (google.api.http) = { + patch: "/v2/{backup.name=projects/*/instances/*/clusters/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + } + + // Deletes a pending or completed Cloud Bigtable backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/clusters/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Cloud Bigtable backups. Returns both completed and pending + // backups. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*/clusters/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Create a new table by restoring from a completed backup. The + // returned table [long-running operation][google.longrunning.Operation] can + // be used to track the progress of the operation, and to cancel it. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata]. The + // [response][google.longrunning.Operation.response] type is + // [Table][google.bigtable.admin.v2.Table], if successful. + rpc RestoreTable(RestoreTableRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/tables:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Table" + metadata_type: "RestoreTableMetadata" + }; + } + + // Copy a Cloud Bigtable backup to a new backup in the destination cluster + // located in the destination instance and project. + rpc CopyBackup(CopyBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*/clusters/*}/backups:copy" + body: "*" + }; + option (google.api.method_signature) = + "parent,backup_id,source_backup,expire_time"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "CopyBackupMetadata" + }; + } + + // Gets the access control policy for a Bigtable resource. + // Returns an empty policy if the resource exists but does not have a policy + // set. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*/tables/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:getIamPolicy" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/tables/*/authorizedViews/*}:getIamPolicy" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:getIamPolicy" + body: "*" + } + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the access control policy on a Bigtable resource. + // Replaces any existing policy. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*/tables/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:setIamPolicy" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/tables/*/authorizedViews/*}:setIamPolicy" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:setIamPolicy" + body: "*" + } + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns permissions that the caller has on the specified Bigtable + // resource. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*/tables/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/tables/*/authorizedViews/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:testIamPermissions" + body: "*" + } + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Creates a new schema bundle in the specified table. + rpc CreateSchemaBundle(CreateSchemaBundleRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*/tables/*}/schemaBundles" + body: "schema_bundle" + }; + option (google.api.method_signature) = + "parent,schema_bundle_id,schema_bundle"; + option (google.longrunning.operation_info) = { + response_type: "SchemaBundle" + metadata_type: "CreateSchemaBundleMetadata" + }; + } + + // Updates a schema bundle in the specified table. + rpc UpdateSchemaBundle(UpdateSchemaBundleRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{schema_bundle.name=projects/*/instances/*/tables/*/schemaBundles/*}" + body: "schema_bundle" + }; + option (google.api.method_signature) = "schema_bundle,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "SchemaBundle" + metadata_type: "UpdateSchemaBundleMetadata" + }; + } + + // Gets metadata information about the specified schema bundle. + rpc GetSchemaBundle(GetSchemaBundleRequest) returns (SchemaBundle) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/tables/*/schemaBundles/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all schema bundles associated with the specified table. + rpc ListSchemaBundles(ListSchemaBundlesRequest) + returns (ListSchemaBundlesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*/tables/*}/schemaBundles" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a schema bundle in the specified table. + rpc DeleteSchemaBundle(DeleteSchemaBundleRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/tables/*/schemaBundles/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request for +// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. +message RestoreTableRequest { + // Required. The name of the instance in which to create the restored + // table. Values are of the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The id of the table to create and restore to. This + // table must not already exist. The `table_id` appended to + // `parent` forms the full table name of the form + // `projects//instances//tables/`. + string table_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The source from which to restore. + oneof source { + // Name of the backup from which to restore. Values are of the form + // `projects//instances//clusters//backups/`. + string backup = 3 [(google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Backup" + }]; + } +} + +// Metadata type for the long-running operation returned by +// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. +message RestoreTableMetadata { + // Name of the table being created and restored to. + string name = 1; + + // The type of the restore source. + RestoreSourceType source_type = 2; + + // Information about the source used to restore the table, as specified by + // `source` in + // [RestoreTableRequest][google.bigtable.admin.v2.RestoreTableRequest]. + oneof source_info { + BackupInfo backup_info = 3; + } + + // If exists, the name of the long-running operation that will be used to + // track the post-restore optimization process to optimize the performance of + // the restored table. The metadata type of the long-running operation is + // [OptimizeRestoreTableMetadata][]. The response type is + // [Empty][google.protobuf.Empty]. This long-running operation may be + // automatically created by the system if applicable after the + // RestoreTable long-running operation completes successfully. This operation + // may not be created if the table is already optimized or the restore was + // not successful. + string optimize_table_operation_name = 4; + + // The progress of the + // [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable] + // operation. + OperationProgress progress = 5; +} + +// Metadata type for the long-running operation used to track the progress +// of optimizations performed on a newly restored table. This long-running +// operation is automatically created by the system after the successful +// completion of a table restore, and cannot be cancelled. +message OptimizeRestoredTableMetadata { + // Name of the restored table being optimized. + string name = 1; + + // The progress of the post-restore optimizations. + OperationProgress progress = 2; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable] +message CreateTableRequest { + // An initial split point for a newly created table. + message Split { + // Row key to use as an initial tablet boundary. + bytes key = 1; + } + + // Required. The unique name of the instance in which to create the table. + // Values are of the form `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The name by which the new table should be referred to within the + // parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + // Maximum 50 characters. + string table_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Table to create. + Table table = 3 [(google.api.field_behavior) = REQUIRED]; + + // The optional list of row keys that will be used to initially split the + // table into several tablets (tablets are similar to HBase regions). + // Given two split keys, `s1` and `s2`, three tablets will be created, + // spanning the key ranges: `[, s1), [s1, s2), [s2, )`. + // + // Example: + // + // * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` + // `"other", "zz"]` + // * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` + // * Key assignment: + // - Tablet 1 `[, apple) => {"a"}.` + // - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` + // - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` + // - Tablet 4 `[customer_2, other) => {"customer_2"}.` + // - Tablet 5 `[other, ) => {"other", "zz"}.` + repeated Split initial_splits = 4; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message CreateTableFromSnapshotRequest { + // Required. The unique name of the instance in which to create the table. + // Values are of the form `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The name by which the new table should be referred to within the + // parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + string table_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The unique name of the snapshot from which to restore the table. + // The snapshot and the table must be in the same instance. Values are of the + // form + // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + string source_snapshot = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Snapshot" + } + ]; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange] +message DropRowRangeRequest { + // Required. The unique name of the table on which to drop a range of rows. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Delete all rows or by prefix. + oneof target { + // Delete all rows that start with this row key prefix. Prefix cannot be + // zero length. + bytes row_key_prefix = 2; + + // Delete all rows in the table. Setting this to false is a no-op. + bool delete_all_data_from_table = 3; + } +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] +message ListTablesRequest { + // Required. The unique name of the instance for which tables should be + // listed. Values are of the form `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // The view to be applied to the returned tables' fields. + // NAME_ONLY view (default) and REPLICATION_VIEW are supported. + Table.View view = 2; + + // Maximum number of results per page. + // + // A page_size of zero lets the server choose the number of items to return. + // A page_size which is strictly positive will return at most that many items. + // A negative page_size will cause an error. + // + // Following the first request, subsequent paginated calls are not required + // to pass a page_size. If a page_size is set in subsequent calls, it must + // match the page_size given in the first request. + int32 page_size = 4; + + // The value of `next_page_token` returned by a previous call. + string page_token = 3; +} + +// Response message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] +message ListTablesResponse { + // The tables present in the requested instance. + repeated Table tables = 1; + + // Set if not all tables could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + string next_page_token = 2; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable] +message GetTableRequest { + // Required. The unique name of the requested table. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // The view to be applied to the returned table's fields. + // Defaults to `SCHEMA_VIEW` if unspecified. + Table.View view = 2; +} + +// The request for +// [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]. +message UpdateTableRequest { + // Required. The table to update. + // The table's `name` field is used to identify the table to update. + Table table = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + // A mask specifying which fields (e.g. `change_stream_config`) in the `table` + // field should be updated. This mask is relative to the `table` field, not to + // the request message. The wildcard (*) path is currently not supported. + // Currently UpdateTable is only supported for the following fields: + // + // * `change_stream_config` + // * `change_stream_config.retention_period` + // * `deletion_protection` + // * `row_key_schema` + // + // If `column_families` is set in `update_mask`, it will return an + // UNIMPLEMENTED error. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, ignore safety checks when updating the table. + bool ignore_warnings = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata type for the operation returned by +// [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]. +message UpdateTableMetadata { + // The name of the table being updated. + string name = 1; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable] +message DeleteTableRequest { + // Required. The unique name of the table to be deleted. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable] +message UndeleteTableRequest { + // Required. The unique name of the table to be restored. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; +} + +// Metadata type for the operation returned by +// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable]. +message UndeleteTableMetadata { + // The name of the table being restored. + string name = 1; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was cancelled. + google.protobuf.Timestamp end_time = 3; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies] +message ModifyColumnFamiliesRequest { + // A create, update, or delete of a particular column family. + message Modification { + // The ID of the column family to be modified. + string id = 1; + + // Column family modifications. + oneof mod { + // Create a new column family with the specified schema, or fail if + // one already exists with the given ID. + ColumnFamily create = 2; + + // Update an existing column family to the specified schema, or fail + // if no column family exists with the given ID. + ColumnFamily update = 3; + + // Drop (delete) the column family with the given ID, or fail if no such + // family exists. + bool drop = 4; + } + + // Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update` + // mod should be updated, ignored for other modification types. If unset or + // empty, we treat it as updating `gc_rule` to be backward compatible. + google.protobuf.FieldMask update_mask = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The unique name of the table whose families should be modified. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Required. Modifications to be atomically applied to the specified table's + // families. Entries are applied in order, meaning that earlier modifications + // can be masked by later ones (in the case of repeated updates to the same + // family, for example). + repeated Modification modifications = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, ignore safety checks when modifying the column families. + bool ignore_warnings = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] +message GenerateConsistencyTokenRequest { + // Required. The unique name of the Table for which to create a consistency + // token. Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; +} + +// Response message for +// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] +message GenerateConsistencyTokenResponse { + // The generated consistency token. + string consistency_token = 1; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] +message CheckConsistencyRequest { + // Required. The unique name of the Table for which to check replication + // consistency. Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Required. The token created using GenerateConsistencyToken for the Table. + string consistency_token = 2 [(google.api.field_behavior) = REQUIRED]; + + // Which type of read needs to consistently observe which type of write? + // Default: `standard_read_remote_writes` + oneof mode { + // Checks that reads using an app profile with `StandardIsolation` can + // see all writes committed before the token was created, even if the + // read and write target different clusters. + StandardReadRemoteWrites standard_read_remote_writes = 3; + + // Checks that reads using an app profile with `DataBoostIsolationReadOnly` + // can see all writes committed before the token was created, but only if + // the read and write target the same cluster. + DataBoostReadLocalWrites data_boost_read_local_writes = 4; + } +} + +// Checks that all writes before the consistency token was generated are +// replicated in every cluster and readable. +message StandardReadRemoteWrites {} + +// Checks that all writes before the consistency token was generated in the same +// cluster are readable by Databoost. +message DataBoostReadLocalWrites {} + +// Response message for +// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] +message CheckConsistencyResponse { + // True only if the token is consistent. A token is consistent if replication + // has caught up with the restrictions specified in the request. + bool consistent = 1; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message SnapshotTableRequest { + // Required. The unique name of the table to have the snapshot taken. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Required. The name of the cluster where the snapshot will be created in. + // Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}`. + string cluster = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; + + // Required. The ID by which the new snapshot should be referred to within the + // parent cluster, e.g., `mysnapshot` of the form: + // `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than + // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + string snapshot_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // The amount of time that the new snapshot can stay active after it is + // created. Once 'ttl' expires, the snapshot will get deleted. The maximum + // amount of time a snapshot can stay active is 7 days. If 'ttl' is not + // specified, the default value of 24 hours will be used. + google.protobuf.Duration ttl = 4; + + // Description of the snapshot. + string description = 5; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message GetSnapshotRequest { + // Required. The unique name of the requested snapshot. + // Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Snapshot" + } + ]; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message ListSnapshotsRequest { + // Required. The unique name of the cluster for which snapshots should be + // listed. Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}`. + // Use `{cluster} = '-'` to list snapshots for all clusters in an instance, + // e.g., `projects/{project}/instances/{instance}/clusters/-`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; + + // The maximum number of snapshots to return per page. + // CURRENTLY UNIMPLEMENTED AND IGNORED. + int32 page_size = 2; + + // The value of `next_page_token` returned by a previous call. + string page_token = 3; +} + +// Response message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message ListSnapshotsResponse { + // The snapshots present in the requested cluster. + repeated Snapshot snapshots = 1; + + // Set if not all snapshots could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + string next_page_token = 2; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message DeleteSnapshotRequest { + // Required. The unique name of the snapshot to be deleted. + // Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Snapshot" + } + ]; +} + +// The metadata for the Operation returned by SnapshotTable. +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message SnapshotTableMetadata { + // The request that prompted the initiation of this SnapshotTable operation. + SnapshotTableRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// The metadata for the Operation returned by CreateTableFromSnapshot. +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message CreateTableFromSnapshotMetadata { + // The request that prompted the initiation of this CreateTableFromSnapshot + // operation. + CreateTableFromSnapshotRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// The request for +// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]. +message CreateBackupRequest { + // Required. This must be one of the clusters in the instance in which this + // table is located. The backup will be stored in this cluster. Values are + // of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; + + // Required. The id of the backup to be created. The `backup_id` along with + // the parent `parent` are combined as {parent}/backups/{backup_id} to create + // the full backup name, of the form: + // `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + // This string must be between 1 and 50 characters in length and match the + // regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The backup to create. + Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata type for the operation returned by +// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]. +message CreateBackupMetadata { + // The name of the backup being created. + string name = 1; + + // The name of the table the backup is created from. + string source_table = 2; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 3; + + // If set, the time at which this operation finished or was cancelled. + google.protobuf.Timestamp end_time = 4; +} + +// The request for +// [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup]. +message UpdateBackupRequest { + // Required. The backup to update. `backup.name`, and the fields to be updated + // as specified by `update_mask` are required. Other fields are ignored. + // Update is only supported for the following fields: + // + // * `backup.expire_time`. + Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields (e.g. `expire_time`) in the + // Backup resource should be updated. This mask is relative to the Backup + // resource, not to the request message. The field mask must always be + // specified; this prevents any future fields from being erased accidentally + // by clients that do not know about them. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup]. +message GetBackupRequest { + // Required. Name of the backup. + // Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Backup" + } + ]; +} + +// The request for +// [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup]. +message DeleteBackupRequest { + // Required. Name of the backup to delete. + // Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Backup" + } + ]; +} + +// The request for +// [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. +message ListBackupsRequest { + // Required. The cluster to list backups from. Values are of the + // form `projects/{project}/instances/{instance}/clusters/{cluster}`. + // Use `{cluster} = '-'` to list backups for all clusters in an instance, + // e.g., `projects/{project}/instances/{instance}/clusters/-`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; + + // A filter expression that filters backups listed in the response. + // The expression must specify the field name, a comparison operator, + // and the value that you want to use for filtering. The value must be a + // string, a number, or a boolean. The comparison operator must be + // <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is + // roughly synonymous with equality. Filter rules are case insensitive. + // + // The fields eligible for filtering are: + // + // * `name` + // * `source_table` + // * `state` + // * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `size_bytes` + // + // To filter on multiple expressions, provide each separate expression within + // parentheses. By default, each expression is an AND expression. However, + // you can include AND, OR, and NOT expressions explicitly. + // + // Some examples of using filters are: + // + // * `name:"exact"` --> The backup's name is the string "exact". + // * `name:howl` --> The backup's name contains the string "howl". + // * `source_table:prod` + // --> The source_table's name contains the string "prod". + // * `state:CREATING` --> The backup is pending creation. + // * `state:READY` --> The backup is fully created and ready for use. + // * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` + // --> The backup name contains the string "howl" and start_time + // of the backup is before 2018-03-28T14:50:00Z. + // * `size_bytes > 10000000000` --> The backup's size is greater than 10GB + string filter = 2; + + // An expression for specifying the sort order of the results of the request. + // The string value should specify one or more fields in + // [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at + // https://aip.dev/132#ordering. + // + // Fields supported are: + // + // * name + // * source_table + // * expire_time + // * start_time + // * end_time + // * size_bytes + // * state + // + // For example, "start_time". The default sorting order is ascending. + // To specify descending order for the field, a suffix " desc" should + // be appended to the field name. For example, "start_time desc". + // Redundant space characters in the syntax are insigificant. + // + // If order_by is empty, results will be sorted by `start_time` in descending + // order starting from the most recently created backup. + string order_by = 3; + + // Number of backups to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 4; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token] + // from a previous + // [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the + // same `parent` and with the same `filter`. + string page_token = 5; +} + +// The response for +// [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. +message ListBackupsResponse { + // The list of matching backups. + repeated Backup backups = 1; + + // `next_page_token` can be sent in a subsequent + // [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call + // to fetch more of the matching backups. + string next_page_token = 2; +} + +// The request for +// [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]. +message CopyBackupRequest { + // Required. The name of the destination cluster that will contain the backup + // copy. The cluster must already exist. Values are of the form: + // `projects/{project}/instances/{instance}/clusters/{cluster}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; + + // Required. The id of the new backup. The `backup_id` along with `parent` + // are combined as {parent}/backups/{backup_id} to create the full backup + // name, of the form: + // `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + // This string must be between 1 and 50 characters in length and match the + // regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The source backup to be copied from. + // The source backup needs to be in READY state for it to be copied. + // Copying a copied backup is not allowed. + // Once CopyBackup is in progress, the source backup cannot be deleted or + // cleaned up on expiration until CopyBackup is finished. + // Values are of the form: + // `projects//instances//clusters//backups/`. + string source_backup = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Backup" + } + ]; + + // Required. Required. The expiration time of the copied backup with + // microsecond granularity that must be at least 6 hours and at most 30 days + // from the time the request is received. Once the `expire_time` has + // passed, Cloud Bigtable will delete the backup and free the resources used + // by the backup. + google.protobuf.Timestamp expire_time = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata type for the google.longrunning.Operation returned by +// [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]. +message CopyBackupMetadata { + // The name of the backup being created through the copy operation. + // Values are of the form + // `projects//instances//clusters//backups/`. + string name = 1 [(google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Backup" + }]; + + // Information about the source backup that is being copied from. + BackupInfo source_backup_info = 2; + + // The progress of the + // [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup] + // operation. + OperationProgress progress = 3; +} + +// The request for +// [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView] +message CreateAuthorizedViewRequest { + // Required. This is the name of the table the AuthorizedView belongs to. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // Required. The id of the AuthorizedView to create. This AuthorizedView must + // not already exist. The `authorized_view_id` appended to `parent` forms the + // full AuthorizedView name of the form + // `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`. + string authorized_view_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The AuthorizedView to create. + AuthorizedView authorized_view = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The metadata for the Operation returned by CreateAuthorizedView. +message CreateAuthorizedViewMetadata { + // The request that prompted the initiation of this CreateAuthorizedView + // operation. + CreateAuthorizedViewRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] +message ListAuthorizedViewsRequest { + // Required. The unique name of the table for which AuthorizedViews should be + // listed. Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // Optional. Maximum number of results per page. + // + // A page_size of zero lets the server choose the number of items to return. + // A page_size which is strictly positive will return at most that many items. + // A negative page_size will cause an error. + // + // Following the first request, subsequent paginated calls are not required + // to pass a page_size. If a page_size is set in subsequent calls, it must + // match the page_size given in the first request. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value of `next_page_token` returned by a previous call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The resource_view to be applied to the returned AuthorizedViews' + // fields. Default to NAME_ONLY. + AuthorizedView.ResponseView view = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] +message ListAuthorizedViewsResponse { + // The AuthorizedViews present in the requested table. + repeated AuthorizedView authorized_views = 1; + + // Set if not all tables could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + string next_page_token = 2; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView] +message GetAuthorizedViewRequest { + // Required. The unique name of the requested AuthorizedView. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // Optional. The resource_view to be applied to the returned AuthorizedView's + // fields. Default to BASIC. + AuthorizedView.ResponseView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for +// [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]. +message UpdateAuthorizedViewRequest { + // Required. The AuthorizedView to update. The `name` in `authorized_view` is + // used to identify the AuthorizedView. AuthorizedView name must in this + // format: + // `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + AuthorizedView authorized_view = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + // A mask specifying which fields in the AuthorizedView resource should be + // updated. This mask is relative to the AuthorizedView resource, not to the + // request message. A field will be overwritten if it is in the mask. If + // empty, all fields set in the request will be overwritten. A special value + // `*` means to overwrite all fields (including fields not set in the + // request). + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, ignore the safety checks when updating the + // AuthorizedView. + bool ignore_warnings = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata for the google.longrunning.Operation returned by +// [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]. +message UpdateAuthorizedViewMetadata { + // The request that prompted the initiation of this UpdateAuthorizedView + // operation. + UpdateAuthorizedViewRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView] +message DeleteAuthorizedViewRequest { + // Required. The unique name of the AuthorizedView to be deleted. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // Optional. The current etag of the AuthorizedView. + // If an etag is provided and does not match the current etag of the + // AuthorizedView, deletion will be blocked and an ABORTED error will be + // returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for +// [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle]. +message CreateSchemaBundleRequest { + // Required. The parent resource where this schema bundle will be created. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Required. The unique ID to use for the schema bundle, which will become the + // final component of the schema bundle's resource name. + string schema_bundle_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The schema bundle to create. + SchemaBundle schema_bundle = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The metadata for the Operation returned by +// [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle]. +message CreateSchemaBundleMetadata { + // The unique name identifying this schema bundle. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + string name = 1; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// The request for +// [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle]. +message UpdateSchemaBundleRequest { + // Required. The schema bundle to update. + // + // The schema bundle's `name` field is used to identify the schema bundle to + // update. Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + SchemaBundle schema_bundle = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, ignore the safety checks when updating the Schema Bundle. + // The safety checks are: + // - The new Schema Bundle is backwards compatible with the existing Schema + // Bundle. + bool ignore_warnings = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The metadata for the Operation returned by +// [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle]. +message UpdateSchemaBundleMetadata { + // The unique name identifying this schema bundle. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + string name = 1; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// The request for +// [GetSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundle]. +message GetSchemaBundleRequest { + // Required. The unique name of the schema bundle to retrieve. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/SchemaBundle" + } + ]; +} + +// The request for +// [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]. +message ListSchemaBundlesRequest { + // Required. The parent, which owns this collection of schema bundles. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigtableadmin.googleapis.com/SchemaBundle" + } + ]; + + // The maximum number of schema bundles to return. If the value is positive, + // the server may return at most this value. If unspecified, the server will + // return the maximum allowed page size. + int32 page_size = 2; + + // A page token, received from a previous `ListSchemaBundles` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListSchemaBundles` must + // match the call that provided the page token. + string page_token = 3; +} + +// The response for +// [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]. +message ListSchemaBundlesResponse { + // The schema bundles from the specified table. + repeated SchemaBundle schema_bundles = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The request for +// [DeleteSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundle]. +message DeleteSchemaBundleRequest { + // Required. The unique name of the schema bundle to delete. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/SchemaBundle" + } + ]; + + // Optional. The etag of the schema bundle. + // If this is provided, it must match the server's etag. The server + // returns an ABORTED error on a mismatched etag. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/handwritten/bigtable/protos/google/bigtable/admin/v2/common.proto b/handwritten/bigtable/protos/google/bigtable/admin/v2/common.proto new file mode 100644 index 00000000000..0d8c184ec0e --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/admin/v2/common.proto @@ -0,0 +1,54 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.admin.v2; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; +option go_package = "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.bigtable.admin.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; +option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; + +// Storage media types for persisting Bigtable data. +enum StorageType { + // The user did not specify a storage type. + STORAGE_TYPE_UNSPECIFIED = 0; + + // Flash (SSD) storage should be used. + SSD = 1; + + // Magnetic drive (HDD) storage should be used. + HDD = 2; +} + +// Encapsulates progress related information for a Cloud Bigtable long +// running operation. +message OperationProgress { + // Percent completion of the operation. + // Values are between 0 and 100 inclusive. + int32 progress_percent = 1; + + // Time the request was received. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation failed or was completed + // successfully. + google.protobuf.Timestamp end_time = 3; +} diff --git a/handwritten/bigtable/protos/google/bigtable/admin/v2/instance.proto b/handwritten/bigtable/protos/google/bigtable/admin/v2/instance.proto new file mode 100644 index 00000000000..5baa006a9c8 --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/admin/v2/instance.proto @@ -0,0 +1,533 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.admin.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/bigtable/admin/v2/common.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; +option go_package = "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "InstanceProto"; +option java_package = "com.google.bigtable.admin.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; +option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; + +// A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and +// the resources that serve them. +// All tables in an instance are served from all +// [Clusters][google.bigtable.admin.v2.Cluster] in the instance. +message Instance { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/Instance" + pattern: "projects/{project}/instances/{instance}" + plural: "instances" + singular: "instance" + }; + + // Possible states of an instance. + enum State { + // The state of the instance could not be determined. + STATE_NOT_KNOWN = 0; + + // The instance has been successfully created and can serve requests + // to its tables. + READY = 1; + + // The instance is currently being created, and may be destroyed + // if the creation process encounters an error. + CREATING = 2; + } + + // The type of the instance. + enum Type { + // The type of the instance is unspecified. If set when creating an + // instance, a `PRODUCTION` instance will be created. If set when updating + // an instance, the type will be left unchanged. + TYPE_UNSPECIFIED = 0; + + // An instance meant for production use. `serve_nodes` must be set + // on the cluster. + PRODUCTION = 1; + + // DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces + // a higher minimum node count than DEVELOPMENT. + DEVELOPMENT = 2; + } + + // The unique name of the instance. Values are of the form + // `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. + string name = 1; + + // Required. The descriptive name for this instance as it appears in UIs. + // Can be changed at any time, but should be kept globally unique + // to avoid confusion. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The current state of the instance. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The type of the instance. Defaults to `PRODUCTION`. + Type type = 4; + + // Labels are a flexible and lightweight mechanism for organizing cloud + // resources into groups that reflect a customer's organizational needs and + // deployment strategies. They can be used to filter resources and aggregate + // metrics. + // + // * Label keys must be between 1 and 63 characters long and must conform to + // the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. + // * Label values must be between 0 and 63 characters long and must conform to + // the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. + // * No more than 64 labels can be associated with a given resource. + // * Keys and values must both be under 128 bytes. + map labels = 5; + + // Output only. A commit timestamp representing when this Instance was + // created. For instances created before this field was added (August 2021), + // this value is `seconds: 0, nanos: 1`. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + optional bool satisfies_pzs = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + optional bool satisfies_pzi = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Input only. Immutable. Tag keys/values directly bound to this + // resource. For example: + // - "123/environment": "production", + // - "123/costCenter": "marketing" + // + // Tags and Labels (above) are both used to bind metadata to resources, with + // different use-cases. See + // https://cloud.google.com/resource-manager/docs/tags/tags-overview for an + // in-depth overview on the difference between tags and labels. + map tags = 12 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The Autoscaling targets for a Cluster. These determine the recommended nodes. +message AutoscalingTargets { + // The cpu utilization that the Autoscaler should be trying to achieve. + // This number is on a scale from 0 (no utilization) to + // 100 (total utilization), and is limited between 10 and 80, otherwise it + // will return INVALID_ARGUMENT error. + int32 cpu_utilization_percent = 2; + + // The storage utilization that the Autoscaler should be trying to achieve. + // This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD + // cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster, + // otherwise it will return INVALID_ARGUMENT error. If this value is set to 0, + // it will be treated as if it were set to the default value: 2560 for SSD, + // 8192 for HDD. + int32 storage_utilization_gib_per_node = 3; +} + +// Limits for the number of nodes a Cluster can autoscale up/down to. +message AutoscalingLimits { + // Required. Minimum number of nodes to scale down to. + int32 min_serve_nodes = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Maximum number of nodes to scale up to. + int32 max_serve_nodes = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A resizable group of nodes in a particular cloud location, capable +// of serving all [Tables][google.bigtable.admin.v2.Table] in the parent +// [Instance][google.bigtable.admin.v2.Instance]. +message Cluster { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/Cluster" + pattern: "projects/{project}/instances/{instance}/clusters/{cluster}" + plural: "clusters" + singular: "cluster" + }; + + // Possible states of a cluster. + enum State { + // The state of the cluster could not be determined. + STATE_NOT_KNOWN = 0; + + // The cluster has been successfully created and is ready to serve requests. + READY = 1; + + // The cluster is currently being created, and may be destroyed + // if the creation process encounters an error. + // A cluster may not be able to serve requests while being created. + CREATING = 2; + + // The cluster is currently being resized, and may revert to its previous + // node count if the process encounters an error. + // A cluster is still capable of serving requests while being resized, + // but may exhibit performance as if its number of allocated nodes is + // between the starting and requested states. + RESIZING = 3; + + // The cluster has no backing nodes. The data (tables) still + // exist, but no operations can be performed on the cluster. + DISABLED = 4; + } + + // Possible node scaling factors of the clusters. Node scaling delivers better + // latency and more throughput by removing node boundaries. + enum NodeScalingFactor { + // No node scaling specified. Defaults to NODE_SCALING_FACTOR_1X. + NODE_SCALING_FACTOR_UNSPECIFIED = 0; + + // The cluster is running with a scaling factor of 1. + NODE_SCALING_FACTOR_1X = 1; + + // The cluster is running with a scaling factor of 2. + // All node count values must be in increments of 2 with this scaling factor + // enabled, otherwise an INVALID_ARGUMENT error will be returned. + NODE_SCALING_FACTOR_2X = 2; + } + + // Autoscaling config for a cluster. + message ClusterAutoscalingConfig { + // Required. Autoscaling limits for this cluster. + AutoscalingLimits autoscaling_limits = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Autoscaling targets for this cluster. + AutoscalingTargets autoscaling_targets = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // Configuration for a cluster. + message ClusterConfig { + // Autoscaling configuration for this cluster. + ClusterAutoscalingConfig cluster_autoscaling_config = 1; + } + + // Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected + // cluster. + message EncryptionConfig { + // Describes the Cloud KMS encryption key that will be used to protect the + // destination Bigtable cluster. The requirements for this key are: + // 1) The Cloud Bigtable service account associated with the project that + // contains this cluster must be granted the + // `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. + // 2) Only regional keys can be used and the region of the CMEK key must + // match the region of the cluster. + // Values are of the form + // `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` + string kms_key_name = 1 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + } + + // The unique name of the cluster. Values are of the form + // `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. + string name = 1; + + // Immutable. The location where this cluster's nodes and storage reside. For + // best performance, clients should be located as close as possible to this + // cluster. Currently only zones are supported, so values should be of the + // form `projects/{project}/locations/{zone}`. + string location = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Output only. The current state of the cluster. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The number of nodes in the cluster. If no value is set, + // Cloud Bigtable automatically allocates nodes based on your data footprint + // and optimized for 50% storage utilization. + int32 serve_nodes = 4; + + // Immutable. The node scaling factor of this cluster. + NodeScalingFactor node_scaling_factor = 9 + [(google.api.field_behavior) = IMMUTABLE]; + + oneof config { + // Configuration for this cluster. + ClusterConfig cluster_config = 7; + } + + // Immutable. The type of storage used by this cluster to serve its + // parent instance's tables, unless explicitly overridden. + StorageType default_storage_type = 5 + [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The encryption configuration for CMEK-protected clusters. + EncryptionConfig encryption_config = 6 + [(google.api.field_behavior) = IMMUTABLE]; +} + +// A configuration object describing how Cloud Bigtable should treat traffic +// from a particular end user application. +message AppProfile { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/AppProfile" + pattern: "projects/{project}/instances/{instance}/appProfiles/{app_profile}" + plural: "appProfiles" + singular: "appProfile" + }; + + // Read/write requests are routed to the nearest cluster in the instance, and + // will fail over to the nearest cluster that is available in the event of + // transient errors or delays. Clusters in a region are considered + // equidistant. Choosing this option sacrifices read-your-writes consistency + // to improve availability. + message MultiClusterRoutingUseAny { + // If enabled, Bigtable will route the request based on the row key of the + // request, rather than randomly. Instead, each row key will be assigned + // to a cluster, and will stick to that cluster. If clusters are added or + // removed, then this may affect which row keys stick to which clusters. + // To avoid this, users can use a cluster group to specify which clusters + // are to be used. In this case, new clusters that are not a part of the + // cluster group will not be routed to, and routing will be unaffected by + // the new cluster. Moreover, clusters specified in the cluster group cannot + // be deleted unless removed from the cluster group. + message RowAffinity {} + + // The set of clusters to route to. The order is ignored; clusters will be + // tried in order of distance. If left empty, all clusters are eligible. + repeated string cluster_ids = 1; + + // Possible algorithms for routing affinity. If enabled, Bigtable will + // route between equidistant clusters in a deterministic order rather than + // choosing randomly. + // + // This mechanism gives read-your-writes consistency for *most* requests + // under *most* circumstances, without sacrificing availability. Consistency + // is *not* guaranteed, as requests might still fail over between clusters + // in the event of errors or latency. + oneof affinity { + // Row affinity sticky routing based on the row key of the request. + // Requests that span multiple rows are routed non-deterministically. + RowAffinity row_affinity = 3; + } + } + + // Unconditionally routes all read/write requests to a specific cluster. + // This option preserves read-your-writes consistency but does not improve + // availability. + message SingleClusterRouting { + // The cluster to which read/write requests should be routed. + string cluster_id = 1; + + // Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are + // allowed by this app profile. It is unsafe to send these requests to + // the same table/row/column in multiple clusters. + bool allow_transactional_writes = 2; + } + + // Possible priorities for an app profile. Note that higher priority writes + // can sometimes queue behind lower priority writes to the same tablet, as + // writes must be strictly sequenced in the durability log. + enum Priority { + // Default value. Mapped to PRIORITY_HIGH (the legacy behavior) on creation. + PRIORITY_UNSPECIFIED = 0; + + PRIORITY_LOW = 1; + + PRIORITY_MEDIUM = 2; + + PRIORITY_HIGH = 3; + } + + // Standard options for isolating this app profile's traffic from other use + // cases. + message StandardIsolation { + // The priority of requests sent using this app profile. + Priority priority = 1; + } + + // Data Boost is a serverless compute capability that lets you run + // high-throughput read jobs and queries on your Bigtable data, without + // impacting the performance of the clusters that handle your application + // traffic. Data Boost supports read-only use cases with single-cluster + // routing. + message DataBoostIsolationReadOnly { + // Compute Billing Owner specifies how usage should be accounted when using + // Data Boost. Compute Billing Owner also configures which Cloud Project is + // charged for relevant quota. + enum ComputeBillingOwner { + // Unspecified value. + COMPUTE_BILLING_OWNER_UNSPECIFIED = 0; + + // The host Cloud Project containing the targeted Bigtable Instance / + // Table pays for compute. + HOST_PAYS = 1; + } + + // The Compute Billing Owner for this Data Boost App Profile. + optional ComputeBillingOwner compute_billing_owner = 1; + } + + // The unique name of the app profile. Values are of the form + // `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + string name = 1; + + // Strongly validated etag for optimistic concurrency control. Preserve the + // value returned from `GetAppProfile` when calling `UpdateAppProfile` to + // fail the request if there has been a modification in the mean time. The + // `update_mask` of the request need not include `etag` for this protection + // to apply. + // See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and + // [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more + // details. + string etag = 2; + + // Long form description of the use case for this AppProfile. + string description = 3; + + // The routing policy for all read/write requests that use this app profile. + // A value must be explicitly set. + oneof routing_policy { + // Use a multi-cluster routing policy. + MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + + // Use a single-cluster routing policy. + SingleClusterRouting single_cluster_routing = 6; + } + + // Options for isolating this app profile's traffic from other use cases. + oneof isolation { + // This field has been deprecated in favor of `standard_isolation.priority`. + // If you set this field, `standard_isolation.priority` will be set instead. + // + // The priority of requests sent using this app profile. + Priority priority = 7 [deprecated = true]; + + // The standard options used for isolating this app profile's traffic from + // other use cases. + StandardIsolation standard_isolation = 11; + + // Specifies that this app profile is intended for read-only usage via the + // Data Boost feature. + DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + } +} + +// A tablet is a defined by a start and end key and is explained in +// https://cloud.google.com/bigtable/docs/overview#architecture and +// https://cloud.google.com/bigtable/docs/performance#optimization. +// A Hot tablet is a tablet that exhibits high average cpu usage during the time +// interval from start time to end time. +message HotTablet { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/HotTablet" + pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}" + plural: "hotTablets" + singular: "hotTablet" + }; + + // The unique name of the hot tablet. Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`. + string name = 1; + + // Name of the table that contains the tablet. Values are of the form + // `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + string table_name = 2 [(google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + }]; + + // Output only. The start time of the hot tablet. + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end time of the hot tablet. + google.protobuf.Timestamp end_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Tablet Start Key (inclusive). + string start_key = 5; + + // Tablet End Key (inclusive). + string end_key = 6; + + // Output only. The average CPU usage spent by a node on this tablet over the + // start_time to end_time time range. The percentage is the amount of CPU used + // by the node to serve the tablet, from 0% (tablet was not interacted with) + // to 100% (the node spent all cycles serving the hot tablet). + float node_cpu_usage_percent = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A SQL logical view object that can be referenced in SQL queries. +message LogicalView { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/LogicalView" + pattern: "projects/{project}/instances/{instance}/logicalViews/{logical_view}" + plural: "logicalViews" + singular: "logicalView" + }; + + // Identifier. The unique name of the logical view. + // Format: + // `projects/{project}/instances/{instance}/logicalViews/{logical_view}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The logical view's select query. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The etag for this logical view. + // This may be sent on update requests to ensure that the client has an + // up-to-date value before proceeding. The server returns an ABORTED error on + // a mismatched etag. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set to true to make the LogicalView protected against deletion. + bool deletion_protection = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// A materialized view object that can be referenced in SQL queries. +message MaterializedView { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/MaterializedView" + pattern: "projects/{project}/instances/{instance}/materializedViews/{materialized_view}" + plural: "materializedViews" + singular: "materializedView" + }; + + // Identifier. The unique name of the materialized view. + // Format: + // `projects/{project}/instances/{instance}/materializedViews/{materialized_view}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. The materialized view's select query. + string query = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The etag for this materialized view. + // This may be sent on update requests to ensure that the client has an + // up-to-date value before proceeding. The server returns an ABORTED error on + // a mismatched etag. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Set to true to make the MaterializedView protected against deletion. + bool deletion_protection = 6; +} diff --git a/handwritten/bigtable/protos/google/bigtable/admin/v2/table.proto b/handwritten/bigtable/protos/google/bigtable/admin/v2/table.proto new file mode 100644 index 00000000000..68913d057a1 --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/admin/v2/table.proto @@ -0,0 +1,687 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.admin.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/bigtable/admin/v2/types.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; +option go_package = "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "TableProto"; +option java_package = "com.google.bigtable.admin.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; +option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; + +// Information about a table restore. +message RestoreInfo { + // The type of the restore source. + RestoreSourceType source_type = 1; + + // Information about the source used to restore the table. + oneof source_info { + // Information about the backup used to restore the table. The backup + // may no longer exist. + BackupInfo backup_info = 2; + } +} + +// Change stream configuration. +message ChangeStreamConfig { + // How long the change stream should be retained. Change stream data older + // than the retention period will not be returned when reading the change + // stream from the table. + // Values must be at least 1 day and at most 7 days, and will be truncated to + // microsecond granularity. + google.protobuf.Duration retention_period = 1; +} + +// A collection of user data indexed by row, column, and timestamp. +// Each table is served using the resources of its parent cluster. +message Table { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/Table" + pattern: "projects/{project}/instances/{instance}/tables/{table}" + }; + + // The state of a table's data in a particular cluster. + message ClusterState { + // Table replication states. + enum ReplicationState { + // The replication state of the table is unknown in this cluster. + STATE_NOT_KNOWN = 0; + + // The cluster was recently created, and the table must finish copying + // over pre-existing data from other clusters before it can begin + // receiving live replication updates and serving Data API requests. + INITIALIZING = 1; + + // The table is temporarily unable to serve Data API requests from this + // cluster due to planned internal maintenance. + PLANNED_MAINTENANCE = 2; + + // The table is temporarily unable to serve Data API requests from this + // cluster due to unplanned or emergency maintenance. + UNPLANNED_MAINTENANCE = 3; + + // The table can serve Data API requests from this cluster. Depending on + // replication delay, reads may not immediately reflect the state of the + // table in other clusters. + READY = 4; + + // The table is fully created and ready for use after a restore, and is + // being optimized for performance. When optimizations are complete, the + // table will transition to `READY` state. + READY_OPTIMIZING = 5; + } + + // Output only. The state of replication for the table in this cluster. + ReplicationState replication_state = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The encryption information for the table in this cluster. + // If the encryption key protecting this resource is customer managed, then + // its version can be rotated in Cloud Key Management Service (Cloud KMS). + // The primary version of the key and its status will be reflected here when + // changes propagate from Cloud KMS. + repeated EncryptionInfo encryption_info = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Possible timestamp granularities to use when keeping multiple versions + // of data in a table. + enum TimestampGranularity { + // The user did not specify a granularity. Should not be returned. + // When specified during table creation, MILLIS will be used. + TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; + + // The table keeps data versioned at a granularity of 1ms. + MILLIS = 1; + } + + // Defines a view over a table's fields. + enum View { + // Uses the default view for each method as documented in its request. + VIEW_UNSPECIFIED = 0; + + // Only populates `name`. + NAME_ONLY = 1; + + // Only populates `name` and fields related to the table's schema. + SCHEMA_VIEW = 2; + + // Only populates `name` and fields related to the table's replication + // state. + REPLICATION_VIEW = 3; + + // Only populates `name` and fields related to the table's encryption state. + ENCRYPTION_VIEW = 5; + + // Populates all fields. + FULL = 4; + } + + // Defines an automated backup policy for a table + message AutomatedBackupPolicy { + // Required. How long the automated backups should be retained. The only + // supported value at this time is 3 days. + google.protobuf.Duration retention_period = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. How frequently automated backups should occur. The only + // supported value at this time is 24 hours. + google.protobuf.Duration frequency = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // The unique name of the table. Values are of the form + // `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + // Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` + string name = 1; + + // Output only. Map from cluster ID to per-cluster table state. + // If it could not be determined whether or not the table has data in a + // particular cluster (for example, if its zone is unavailable), then + // there will be an entry for the cluster with UNKNOWN `replication_status`. + // Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` + map cluster_states = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The column families configured for this table, mapped by column family ID. + // Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL` + map column_families = 3; + + // Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored + // in this table. Timestamps not matching the granularity will be rejected. If + // unspecified at creation time, the value will be set to `MILLIS`. Views: + // `SCHEMA_VIEW`, `FULL`. + TimestampGranularity granularity = 4 + [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. If this table was restored from another data source (e.g. a + // backup), this field will be populated with information about the restore. + RestoreInfo restore_info = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // If specified, enable the change stream on this table. + // Otherwise, the change stream is disabled and the change stream is not + // retained. + ChangeStreamConfig change_stream_config = 8; + + // Set to true to make the table protected against data loss. i.e. deleting + // the following resources through Admin APIs are prohibited: + // + // * The table. + // * The column families in the table. + // * The instance containing the table. + // + // Note one can still delete the data stored in the table through Data APIs. + bool deletion_protection = 9; + + oneof automated_backup_config { + // If specified, automated backups are enabled for this table. + // Otherwise, automated backups are disabled. + AutomatedBackupPolicy automated_backup_policy = 13; + } + + // The row key schema for this table. The schema is used to decode the raw row + // key bytes into a structured format. The order of field declarations in this + // schema is important, as it reflects how the raw row key bytes are + // structured. Currently, this only affects how the key is read via a + // GoogleSQL query from the ExecuteQuery API. + // + // For a SQL query, the _key column is still read as raw bytes. But queries + // can reference the key fields by name, which will be decoded from _key using + // provided type and encoding. Queries that reference key fields will fail if + // they encounter an invalid row key. + // + // For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the + // following schema: + // { + // fields { + // field_name: "id" + // type { string { encoding: utf8_bytes {} } } + // } + // fields { + // field_name: "date" + // type { string { encoding: utf8_bytes {} } } + // } + // fields { + // field_name: "product_code" + // type { int64 { encoding: big_endian_bytes {} } } + // } + // encoding { delimited_bytes { delimiter: "#" } } + // } + // + // The decoded key parts would be: + // id = "some_id", date = "2024-04-30", product_code = 1245427 + // The query "SELECT _key, product_code FROM table" will return two columns: + // /------------------------------------------------------\ + // | _key | product_code | + // | --------------------------------------|--------------| + // | "some_id#2024-04-30#\x00\x13\x00\xf3" | 1245427 | + // \------------------------------------------------------/ + // + // The schema has the following invariants: + // (1) The decoded field values are order-preserved. For read, the field + // values will be decoded in sorted mode from the raw bytes. + // (2) Every field in the schema must specify a non-empty name. + // (3) Every field must specify a type with an associated encoding. The type + // is limited to scalar types only: Array, Map, Aggregate, and Struct are not + // allowed. + // (4) The field names must not collide with existing column family + // names and reserved keywords "_key" and "_timestamp". + // + // The following update operations are allowed for row_key_schema: + // - Update from an empty schema to a new schema. + // - Remove the existing schema. This operation requires setting the + // `ignore_warnings` flag to `true`, since it might be a backward + // incompatible change. Without the flag, the update request will fail with + // an INVALID_ARGUMENT error. + // Any other row key schema update operation (e.g. update existing schema + // columns names or types) is currently unsupported. + Type.Struct row_key_schema = 15; +} + +// AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users +// can configure access to each Authorized View independently from the table and +// use the existing Data APIs to access the subset of data. +message AuthorizedView { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + pattern: "projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}" + plural: "authorizedViews" + singular: "authorizedView" + }; + + // Subsets of a column family that are included in this AuthorizedView. + message FamilySubsets { + // Individual exact column qualifiers to be included in the AuthorizedView. + repeated bytes qualifiers = 1; + + // Prefixes for qualifiers to be included in the AuthorizedView. Every + // qualifier starting with one of these prefixes is included in the + // AuthorizedView. To provide access to all qualifiers, include the empty + // string as a prefix + // (""). + repeated bytes qualifier_prefixes = 2; + } + + // Defines a simple AuthorizedView that is a subset of the underlying Table. + message SubsetView { + // Row prefixes to be included in the AuthorizedView. + // To provide access to all rows, include the empty string as a prefix (""). + repeated bytes row_prefixes = 1; + + // Map from column family name to the columns in this family to be included + // in the AuthorizedView. + map family_subsets = 2; + } + + // Defines a subset of an AuthorizedView's fields. + enum ResponseView { + // Uses the default view for each method as documented in the request. + RESPONSE_VIEW_UNSPECIFIED = 0; + + // Only populates `name`. + NAME_ONLY = 1; + + // Only populates the AuthorizedView's basic metadata. This includes: + // name, deletion_protection, etag. + BASIC = 2; + + // Populates every fields. + FULL = 3; + } + + // Identifier. The name of this AuthorizedView. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The type of this AuthorizedView. + oneof authorized_view { + // An AuthorizedView permitting access to an explicit subset of a Table. + SubsetView subset_view = 2; + } + + // The etag for this AuthorizedView. + // If this is provided on update, it must match the server's etag. The server + // returns ABORTED error on a mismatched etag. + string etag = 3; + + // Set to true to make the AuthorizedView protected against deletion. + // The parent Table and containing Instance cannot be deleted if an + // AuthorizedView has this bit set. + bool deletion_protection = 4; +} + +// A set of columns within a table which share a common configuration. +message ColumnFamily { + // Garbage collection rule specified as a protobuf. + // Must serialize to at most 500 bytes. + // + // NOTE: Garbage collection executes opportunistically in the background, and + // so it's possible for reads to return a cell even if it matches the active + // GC expression for its family. + GcRule gc_rule = 1; + + // The type of data stored in each of this family's cell values, including its + // full encoding. If omitted, the family only serves raw untyped bytes. + // + // For now, only the `Aggregate` type is supported. + // + // `Aggregate` can only be set at family creation and is immutable afterwards. + // + // + // If `value_type` is `Aggregate`, written data must be compatible with: + // * `value_type.input_type` for `AddInput` mutations + Type value_type = 3; +} + +// Rule for determining which cells to delete during garbage collection. +message GcRule { + // A GcRule which deletes cells matching all of the given rules. + message Intersection { + // Only delete cells which would be deleted by every element of `rules`. + repeated GcRule rules = 1; + } + + // A GcRule which deletes cells matching any of the given rules. + message Union { + // Delete cells which would be deleted by any element of `rules`. + repeated GcRule rules = 1; + } + + // Garbage collection rules. + oneof rule { + // Delete all cells in a column except the most recent N. + int32 max_num_versions = 1; + + // Delete cells in a column older than the given age. + // Values must be at least one millisecond, and will be truncated to + // microsecond granularity. + google.protobuf.Duration max_age = 2; + + // Delete cells that would be deleted by every nested rule. + Intersection intersection = 3; + + // Delete cells that would be deleted by any nested rule. + Union union = 4; + } +} + +// Encryption information for a given resource. +// If this resource is protected with customer managed encryption, the in-use +// Cloud Key Management Service (Cloud KMS) key version is specified along with +// its status. +message EncryptionInfo { + // Possible encryption types for a resource. + enum EncryptionType { + // Encryption type was not specified, though data at rest remains encrypted. + ENCRYPTION_TYPE_UNSPECIFIED = 0; + + // The data backing this resource is encrypted at rest with a key that is + // fully managed by Google. No key version or status will be populated. + // This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1; + + // The data backing this resource is encrypted at rest with a key that is + // managed by the customer. + // The in-use version of the key and its status are populated for + // CMEK-protected tables. + // CMEK-protected backups are pinned to the key version that was in use at + // the time the backup was taken. This key version is populated but its + // status is not tracked and is reported as `UNKNOWN`. + CUSTOMER_MANAGED_ENCRYPTION = 2; + } + + // Output only. The type of encryption used to protect this resource. + EncryptionType encryption_type = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The status of encrypt/decrypt calls on underlying data for + // this resource. Regardless of status, the existing data is always encrypted + // at rest. + google.rpc.Status encryption_status = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The version of the Cloud KMS key specified in the parent + // cluster that is in use for the data underlying this table. + string kms_key_version = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// A snapshot of a table at a particular time. A snapshot can be used as a +// checkpoint for data restoration or a data source for a new table. +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message Snapshot { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/Snapshot" + pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}" + }; + + // Possible states of a snapshot. + enum State { + // The state of the snapshot could not be determined. + STATE_NOT_KNOWN = 0; + + // The snapshot has been successfully created and can serve all requests. + READY = 1; + + // The snapshot is currently being created, and may be destroyed if the + // creation process encounters an error. A snapshot may not be restored to a + // table while it is being created. + CREATING = 2; + } + + // The unique name of the snapshot. + // Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + string name = 1; + + // Output only. The source table at the time the snapshot was taken. + Table source_table = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The size of the data in the source table at the time the + // snapshot was taken. In some cases, this value may be computed + // asynchronously via a background process and a placeholder of 0 will be used + // in the meantime. + int64 data_size_bytes = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the snapshot is created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The time when the snapshot will be deleted. The maximum amount of time a + // snapshot can stay active is 365 days. If 'ttl' is not specified, + // the default maximum of 365 days will be used. + google.protobuf.Timestamp delete_time = 5; + + // Output only. The current state of the snapshot. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of the snapshot. + string description = 7; +} + +// A backup of a Cloud Bigtable table. +message Backup { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/Backup" + pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}" + }; + + // Indicates the current state of the backup. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The pending backup is still being created. Operations on the + // backup may fail with `FAILED_PRECONDITION` in this state. + CREATING = 1; + + // The backup is complete and ready for use. + READY = 2; + } + + // The type of the backup. + enum BackupType { + // Not specified. + BACKUP_TYPE_UNSPECIFIED = 0; + + // The default type for Cloud Bigtable managed backups. Supported for + // backups created in both HDD and SSD instances. Requires optimization when + // restored to a table in an SSD instance. + STANDARD = 1; + + // A backup type with faster restore to SSD performance. Only supported for + // backups created in SSD instances. A new SSD table restored from a hot + // backup reaches production performance more quickly than a standard + // backup. + HOT = 2; + } + + // A globally unique identifier for the backup which cannot be + // changed. Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/ + // backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*` + // The final segment of the name must be between 1 and 50 characters + // in length. + // + // The backup is stored in the cluster identified by the prefix of the backup + // name of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}`. + string name = 1; + + // Required. Immutable. Name of the table from which this backup was created. + // This needs to be in the same instance as the backup. Values are of the form + // `projects/{project}/instances/{instance}/tables/{source_table}`. + string source_table = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. Name of the backup from which this backup was copied. If a + // backup is not created by copying a backup, this field will be empty. Values + // are of the form: + // projects//instances//clusters//backups/ + string source_backup = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The expiration time of the backup. + // When creating a backup or updating its `expire_time`, the value must be + // greater than the backup creation time by: + // - At least 6 hours + // - At most 90 days + // + // Once the `expire_time` has passed, Cloud Bigtable will delete the backup. + google.protobuf.Timestamp expire_time = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Output only. `start_time` is the time that the backup was started + // (i.e. approximately the time the + // [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup] + // request is received). The row data in this backup will be no older than + // this timestamp. + google.protobuf.Timestamp start_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. `end_time` is the time that the backup was finished. The row + // data in the backup will be no newer than this timestamp. + google.protobuf.Timestamp end_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Size of the backup in bytes. + int64 size_bytes = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the backup. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The encryption information for the backup. + EncryptionInfo encryption_info = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Indicates the backup type of the backup. + BackupType backup_type = 11; + + // The time at which the hot backup will be converted to a standard backup. + // Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the + // hot backup to a standard backup. This value must be greater than the backup + // creation time by: + // - At least 24 hours + // + // This field only applies for hot backups. When creating or updating a + // standard backup, attempting to set this field will fail the request. + google.protobuf.Timestamp hot_to_standard_time = 12; +} + +// Information about a backup. +message BackupInfo { + // Output only. Name of the backup. + string backup = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time that the backup was started. Row data in the backup + // will be no older than this timestamp. + google.protobuf.Timestamp start_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This time that the backup was finished. Row data in the + // backup will be no newer than this timestamp. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the table the backup was created from. + string source_table = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the backup from which this backup was copied. If a + // backup is not created by copying a backup, this field will be empty. Values + // are of the form: + // projects//instances//clusters//backups/ + string source_backup = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Indicates the type of the restore source. +enum RestoreSourceType { + // No restore associated. + RESTORE_SOURCE_TYPE_UNSPECIFIED = 0; + + // A backup was used as the source of the restore. + BACKUP = 1; +} + +// Represents a protobuf schema. +message ProtoSchema { + // Required. Contains a protobuf-serialized + // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto), + // which could include multiple proto files. + // To generate it, [install](https://grpc.io/docs/protoc-installation/) and + // run `protoc` with + // `--include_imports` and `--descriptor_set_out`. For example, to generate + // for moon/shot/app.proto, run + // ``` + // $protoc --proto_path=/app_path --proto_path=/lib_path \ + // --include_imports \ + // --descriptor_set_out=descriptors.pb \ + // moon/shot/app.proto + // ``` + // For more details, see protobuffer [self + // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + bytes proto_descriptors = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A named collection of related schemas. +message SchemaBundle { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/SchemaBundle" + pattern: "projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}" + plural: "schemaBundles" + singular: "schemaBundle" + }; + + // Identifier. The unique name identifying this schema bundle. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The type of this schema bundle. The oneof case cannot change after + // creation. + oneof type { + // Schema for Protobufs. + ProtoSchema proto_schema = 2; + } + + // Optional. The etag for this schema bundle. + // This may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. The server + // returns an ABORTED error on a mismatched etag. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/handwritten/bigtable/protos/google/bigtable/admin/v2/types.proto b/handwritten/bigtable/protos/google/bigtable/admin/v2/types.proto new file mode 100644 index 00000000000..adafda693b9 --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/admin/v2/types.proto @@ -0,0 +1,445 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.admin.v2; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; +option go_package = "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "TypesProto"; +option java_package = "com.google.bigtable.admin.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; +option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; + +// `Type` represents the type of data that is written to, read from, or stored +// in Bigtable. It is heavily based on the GoogleSQL standard to help maintain +// familiarity and consistency across products and features. +// +// For compatibility with Bigtable's existing untyped APIs, each `Type` includes +// an `Encoding` which describes how to convert to or from the underlying data. +// +// Each encoding can operate in one of two modes: +// +// - Sorted: In this mode, Bigtable guarantees that `Encode(X) <= Encode(Y)` +// if and only if `X <= Y`. This is useful anywhere sort order is important, +// for example when encoding keys. +// - Distinct: In this mode, Bigtable guarantees that if `X != Y` then +// `Encode(X) != Encode(Y)`. However, the converse is not guaranteed. For +// example, both "{'foo': '1', 'bar': '2'}" and "{'bar': '2', 'foo': '1'}" +// are valid encodings of the same JSON value. +// +// The API clearly documents which mode is used wherever an encoding can be +// configured. Each encoding also documents which values are supported in which +// modes. For example, when encoding INT64 as a numeric STRING, negative numbers +// cannot be encoded in sorted mode. This is because `INT64(1) > INT64(-1)`, but +// `STRING("-00001") > STRING("00001")`. +message Type { + // Bytes + // Values of type `Bytes` are stored in `Value.bytes_value`. + message Bytes { + // Rules used to convert to or from lower level types. + message Encoding { + // Leaves the value as-is. + // + // Sorted mode: all values are supported. + // + // Distinct mode: all values are supported. + message Raw {} + + // Which encoding to use. + oneof encoding { + // Use `Raw` encoding. + Raw raw = 1; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // String + // Values of type `String` are stored in `Value.string_value`. + message String { + // Rules used to convert to or from lower level types. + message Encoding { + // Deprecated: prefer the equivalent `Utf8Bytes`. + message Utf8Raw { + option deprecated = true; + } + + // UTF-8 encoding. + // + // Sorted mode: + // - All values are supported. + // - Code point order is preserved. + // + // Distinct mode: all values are supported. + // + // Compatible with: + // + // - BigQuery `TEXT` encoding + // - HBase `Bytes.toBytes` + // - Java `String#getBytes(StandardCharsets.UTF_8)` + message Utf8Bytes {} + + // Which encoding to use. + oneof encoding { + // Deprecated: if set, converts to an empty `utf8_bytes`. + Utf8Raw utf8_raw = 1 [deprecated = true]; + + // Use `Utf8Bytes` encoding. + Utf8Bytes utf8_bytes = 2; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // Int64 + // Values of type `Int64` are stored in `Value.int_value`. + message Int64 { + // Rules used to convert to or from lower level types. + message Encoding { + // Encodes the value as an 8-byte big-endian two's complement value. + // + // Sorted mode: non-negative values are supported. + // + // Distinct mode: all values are supported. + // + // Compatible with: + // + // - BigQuery `BINARY` encoding + // - HBase `Bytes.toBytes` + // - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN` + message BigEndianBytes { + // Deprecated: ignored if set. + Bytes bytes_type = 1 [deprecated = true]; + } + + // Encodes the value in a variable length binary format of up to 10 bytes. + // Values that are closer to zero use fewer bytes. + // + // Sorted mode: all values are supported. + // + // Distinct mode: all values are supported. + message OrderedCodeBytes {} + + // Which encoding to use. + oneof encoding { + // Use `BigEndianBytes` encoding. + BigEndianBytes big_endian_bytes = 1; + + // Use `OrderedCodeBytes` encoding. + OrderedCodeBytes ordered_code_bytes = 2; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // bool + // Values of type `Bool` are stored in `Value.bool_value`. + message Bool {} + + // Float32 + // Values of type `Float32` are stored in `Value.float_value`. + message Float32 {} + + // Float64 + // Values of type `Float64` are stored in `Value.float_value`. + message Float64 {} + + // Timestamp + // Values of type `Timestamp` are stored in `Value.timestamp_value`. + message Timestamp { + // Rules used to convert to or from lower level types. + message Encoding { + // Which encoding to use. + oneof encoding { + // Encodes the number of microseconds since the Unix epoch using the + // given `Int64` encoding. Values must be microsecond-aligned. + // + // Compatible with: + // + // - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS` + Int64.Encoding unix_micros_int64 = 1; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // Date + // Values of type `Date` are stored in `Value.date_value`. + message Date {} + + // A structured data value, consisting of fields which map to dynamically + // typed values. + // Values of type `Struct` are stored in `Value.array_value` where entries are + // in the same order and number as `field_types`. + message Struct { + // A struct field and its type. + message Field { + // The field name (optional). Fields without a `field_name` are considered + // anonymous and cannot be referenced by name. + string field_name = 1; + + // The type of values in this field. + Type type = 2; + } + + // Rules used to convert to or from lower level types. + message Encoding { + // Uses the encoding of `fields[0].type` as-is. + // Only valid if `fields.size == 1`. + message Singleton {} + + // Fields are encoded independently and concatenated with a configurable + // `delimiter` in between. + // + // A struct with no fields defined is encoded as a single `delimiter`. + // + // Sorted mode: + // + // - Fields are encoded in sorted mode. + // - Encoded field values must not contain any bytes <= `delimiter[0]` + // - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if + // `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first. + // + // Distinct mode: + // + // - Fields are encoded in distinct mode. + // - Encoded field values must not contain `delimiter[0]`. + message DelimitedBytes { + // Byte sequence used to delimit concatenated fields. The delimiter must + // contain at least 1 character and at most 50 characters. + bytes delimiter = 1; + } + + // Fields are encoded independently and concatenated with the fixed byte + // pair {0x00, 0x01} in between. + // + // Any null (0x00) byte in an encoded field is replaced by the fixed byte + // pair {0x00, 0xFF}. + // + // Fields that encode to the empty string "" have special handling: + // + // - If *every* field encodes to "", or if the STRUCT has no fields + // defined, then the STRUCT is encoded as the fixed byte pair + // {0x00, 0x00}. + // - Otherwise, the STRUCT only encodes until the last non-empty field, + // omitting any trailing empty fields. Any empty fields that aren't + // omitted are replaced with the fixed byte pair {0x00, 0x00}. + // + // Examples: + // + // - STRUCT() -> "\00\00" + // - STRUCT("") -> "\00\00" + // - STRUCT("", "") -> "\00\00" + // - STRUCT("", "B") -> "\00\00" + "\00\01" + "B" + // - STRUCT("A", "") -> "A" + // - STRUCT("", "B", "") -> "\00\00" + "\00\01" + "B" + // - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C" + // + // + // Since null bytes are always escaped, this encoding can cause size + // blowup for encodings like `Int64.BigEndianBytes` that are likely to + // produce many such bytes. + // + // Sorted mode: + // + // - Fields are encoded in sorted mode. + // - All values supported by the field encodings are allowed + // - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if + // `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first. + // + // Distinct mode: + // + // - Fields are encoded in distinct mode. + // - All values supported by the field encodings are allowed. + message OrderedCodeBytes {} + + // Which encoding to use. + oneof encoding { + // Use `Singleton` encoding. + Singleton singleton = 1; + + // Use `DelimitedBytes` encoding. + DelimitedBytes delimited_bytes = 2; + + // User `OrderedCodeBytes` encoding. + OrderedCodeBytes ordered_code_bytes = 3; + } + } + + // The names and types of the fields in this struct. + repeated Field fields = 1; + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 2; + } + + // A protobuf message type. + // Values of type `Proto` are stored in `Value.bytes_value`. + message Proto { + // The ID of the schema bundle that this proto is defined in. + string schema_bundle_id = 1; + + // The fully qualified name of the protobuf message, including package. In + // the format of "foo.bar.Message". + string message_name = 2; + } + + // A protobuf enum type. + // Values of type `Enum` are stored in `Value.int_value`. + message Enum { + // The ID of the schema bundle that this enum is defined in. + string schema_bundle_id = 1; + + // The fully qualified name of the protobuf enum message, including package. + // In the format of "foo.bar.EnumMessage". + string enum_name = 2; + } + + // An ordered list of elements of a given type. + // Values of type `Array` are stored in `Value.array_value`. + message Array { + // The type of the elements in the array. This must not be `Array`. + Type element_type = 1; + } + + // A mapping of keys to values of a given type. + // Values of type `Map` are stored in a `Value.array_value` where each entry + // is another `Value.array_value` with two elements (the key and the value, + // in that order). + // Normally encoded Map values won't have repeated keys, however, clients are + // expected to handle the case in which they do. If the same key appears + // multiple times, the _last_ value takes precedence. + message Map { + // The type of a map key. + // Only `Bytes`, `String`, and `Int64` are allowed as key types. + Type key_type = 1; + + // The type of the values in a map. + Type value_type = 2; + } + + // A value that combines incremental updates into a summarized value. + // + // Data is never directly written or read using type `Aggregate`. Writes will + // provide either the `input_type` or `state_type`, and reads will always + // return the `state_type` . + message Aggregate { + // Computes the sum of the input values. + // Allowed input: `Int64` + // State: same as input + message Sum {} + + // Computes the max of the input values. + // Allowed input: `Int64` + // State: same as input + message Max {} + + // Computes the min of the input values. + // Allowed input: `Int64` + // State: same as input + message Min {} + + // Computes an approximate unique count over the input values. When using + // raw data as input, be careful to use a consistent encoding. Otherwise + // the same value encoded differently could count more than once, or two + // distinct values could count as identical. + // Input: Any, or omit for Raw + // State: TBD + // Special state conversions: `Int64` (the unique count estimate) + message HyperLogLogPlusPlusUniqueCount {} + + // Type of the inputs that are accumulated by this `Aggregate`, which must + // specify a full encoding. + // Use `AddInput` mutations to accumulate new inputs. + Type input_type = 1; + + // Output only. Type that holds the internal accumulator state for the + // `Aggregate`. This is a function of the `input_type` and `aggregator` + // chosen, and will always specify a full encoding. + Type state_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Which aggregator function to use. The configured types must match. + oneof aggregator { + // Sum aggregator. + Sum sum = 4; + + // HyperLogLogPlusPlusUniqueCount aggregator. + HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + + // Max aggregator. + Max max = 6; + + // Min aggregator. + Min min = 7; + } + } + + // The kind of type that this represents. + oneof kind { + // Bytes + Bytes bytes_type = 1; + + // String + String string_type = 2; + + // Int64 + Int64 int64_type = 5; + + // Float32 + Float32 float32_type = 12; + + // Float64 + Float64 float64_type = 9; + + // Bool + Bool bool_type = 8; + + // Timestamp + Timestamp timestamp_type = 10; + + // Date + Date date_type = 11; + + // Aggregate + Aggregate aggregate_type = 6; + + // Struct + Struct struct_type = 7; + + // Array + Array array_type = 3; + + // Map + Map map_type = 4; + + // Proto + Proto proto_type = 13; + + // Enum + Enum enum_type = 14; + } +} diff --git a/handwritten/bigtable/protos/google/bigtable/v2/bigtable.proto b/handwritten/bigtable/protos/google/bigtable/v2/bigtable.proto new file mode 100644 index 00000000000..66536293e36 --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/v2/bigtable.proto @@ -0,0 +1,1239 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/api/routing.proto"; +import "google/bigtable/v2/data.proto"; +import "google/bigtable/v2/request_stats.proto"; +import "google/bigtable/v2/types.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "BigtableProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; +option (google.api.resource_definition) = { + type: "bigtableadmin.googleapis.com/Instance" + pattern: "projects/{project}/instances/{instance}" +}; +option (google.api.resource_definition) = { + type: "bigtableadmin.googleapis.com/Table" + pattern: "projects/{project}/instances/{instance}/tables/{table}" +}; +option (google.api.resource_definition) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + pattern: "projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}" +}; +option (google.api.resource_definition) = { + type: "bigtableadmin.googleapis.com/MaterializedView" + pattern: "projects/{project}/instances/{instance}/materializedViews/{materialized_view}" +}; + +// Service for reading from and writing to existing Bigtable tables. +service Bigtable { + option (google.api.default_host) = "bigtable.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigtable.data," + "https://www.googleapis.com/auth/bigtable.data.readonly," + "https://www.googleapis.com/auth/cloud-bigtable.data," + "https://www.googleapis.com/auth/cloud-bigtable.data.readonly," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Streams back the contents of all requested rows in key order, optionally + // applying the same Reader filter to each. Depending on their size, + // rows and cells may be broken up across multiple responses, but + // atomicity of each row will still be preserved. See the + // ReadRowsResponse documentation for details. + rpc ReadRows(ReadRowsRequest) returns (stream ReadRowsResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:readRows" + body: "*" + additional_bindings { + post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readRows" + body: "*" + } + additional_bindings { + post: "/v2/{materialized_view_name=projects/*/instances/*/materializedViews/*}:readRows" + body: "*" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { field: "app_profile_id" } + routing_parameters { + field: "authorized_view_name" + path_template: "{table_name=projects/*/instances/*/tables/*}/**" + } + routing_parameters { + field: "materialized_view_name" + path_template: "{name=projects/*/instances/*}/**" + } + }; + option (google.api.method_signature) = "table_name"; + option (google.api.method_signature) = "table_name,app_profile_id"; + } + + // Returns a sample of row keys in the table. The returned row keys will + // delimit contiguous sections of the table of approximately equal size, + // which can be used to break up the data for distributed tasks like + // mapreduces. + rpc SampleRowKeys(SampleRowKeysRequest) + returns (stream SampleRowKeysResponse) { + option (google.api.http) = { + get: "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys" + additional_bindings { + get: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:sampleRowKeys" + } + additional_bindings { + get: "/v2/{materialized_view_name=projects/*/instances/*/materializedViews/*}:sampleRowKeys" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { field: "app_profile_id" } + routing_parameters { + field: "authorized_view_name" + path_template: "{table_name=projects/*/instances/*/tables/*}/**" + } + routing_parameters { + field: "materialized_view_name" + path_template: "{name=projects/*/instances/*}/**" + } + }; + option (google.api.method_signature) = "table_name"; + option (google.api.method_signature) = "table_name,app_profile_id"; + } + + // Mutates a row atomically. Cells already present in the row are left + // unchanged unless explicitly changed by `mutation`. + rpc MutateRow(MutateRowRequest) returns (MutateRowResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRow" + body: "*" + additional_bindings { + post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRow" + body: "*" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { field: "app_profile_id" } + routing_parameters { + field: "authorized_view_name" + path_template: "{table_name=projects/*/instances/*/tables/*}/**" + } + }; + option (google.api.method_signature) = "table_name,row_key,mutations"; + option (google.api.method_signature) = + "table_name,row_key,mutations,app_profile_id"; + } + + // Mutates multiple rows in a batch. Each individual row is mutated + // atomically as in MutateRow, but the entire batch is not executed + // atomically. + rpc MutateRows(MutateRowsRequest) returns (stream MutateRowsResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRows" + body: "*" + additional_bindings { + post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRows" + body: "*" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { field: "app_profile_id" } + routing_parameters { + field: "authorized_view_name" + path_template: "{table_name=projects/*/instances/*/tables/*}/**" + } + }; + option (google.api.method_signature) = "table_name,entries"; + option (google.api.method_signature) = "table_name,entries,app_profile_id"; + } + + // Mutates a row atomically based on the output of a predicate Reader filter. + rpc CheckAndMutateRow(CheckAndMutateRowRequest) + returns (CheckAndMutateRowResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow" + body: "*" + additional_bindings { + post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:checkAndMutateRow" + body: "*" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { field: "app_profile_id" } + routing_parameters { + field: "authorized_view_name" + path_template: "{table_name=projects/*/instances/*/tables/*}/**" + } + }; + option (google.api.method_signature) = + "table_name,row_key,predicate_filter,true_mutations,false_mutations"; + option (google.api.method_signature) = + "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id"; + } + + // Warm up associated instance metadata for this connection. + // This call is not required but may be useful for connection keep-alive. + rpc PingAndWarm(PingAndWarmRequest) returns (PingAndWarmResponse) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*}:ping" + body: "*" + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{name=projects/*/instances/*}" + } + routing_parameters { field: "app_profile_id" } + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "name,app_profile_id"; + } + + // Modifies a row atomically on the server. The method reads the latest + // existing timestamp and value from the specified columns and writes a new + // entry based on pre-defined read/modify/write rules. The new value for the + // timestamp is the greater of the existing timestamp or the current server + // time. The method returns the new contents of all modified cells. + rpc ReadModifyWriteRow(ReadModifyWriteRowRequest) + returns (ReadModifyWriteRowResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow" + body: "*" + additional_bindings { + post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readModifyWriteRow" + body: "*" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { field: "app_profile_id" } + routing_parameters { + field: "authorized_view_name" + path_template: "{table_name=projects/*/instances/*/tables/*}/**" + } + }; + option (google.api.method_signature) = "table_name,row_key,rules"; + option (google.api.method_signature) = + "table_name,row_key,rules,app_profile_id"; + } + + // Returns the current list of partitions that make up the table's + // change stream. The union of partitions will cover the entire keyspace. + // Partitions can be read with `ReadChangeStream`. + // NOTE: This API is only intended to be used by Apache Beam BigtableIO. + rpc GenerateInitialChangeStreamPartitions( + GenerateInitialChangeStreamPartitionsRequest) + returns (stream GenerateInitialChangeStreamPartitionsResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:generateInitialChangeStreamPartitions" + body: "*" + }; + option (google.api.method_signature) = "table_name"; + option (google.api.method_signature) = "table_name,app_profile_id"; + } + + // Reads changes from a table's change stream. Changes will + // reflect both user-initiated mutations and mutations that are caused by + // garbage collection. + // NOTE: This API is only intended to be used by Apache Beam BigtableIO. + rpc ReadChangeStream(ReadChangeStreamRequest) + returns (stream ReadChangeStreamResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:readChangeStream" + body: "*" + }; + option (google.api.method_signature) = "table_name"; + option (google.api.method_signature) = "table_name,app_profile_id"; + } + + // Prepares a GoogleSQL query for execution on a particular Bigtable instance. + rpc PrepareQuery(PrepareQueryRequest) returns (PrepareQueryResponse) { + option (google.api.http) = { + post: "/v2/{instance_name=projects/*/instances/*}:prepareQuery" + body: "*" + }; + option (google.api.routing) = { + routing_parameters { + field: "instance_name" + path_template: "{name=projects/*/instances/*}" + } + routing_parameters { field: "app_profile_id" } + }; + option (google.api.method_signature) = "instance_name,query"; + option (google.api.method_signature) = "instance_name,query,app_profile_id"; + } + + // Executes a SQL query against a particular Bigtable instance. + rpc ExecuteQuery(ExecuteQueryRequest) returns (stream ExecuteQueryResponse) { + option (google.api.http) = { + post: "/v2/{instance_name=projects/*/instances/*}:executeQuery" + body: "*" + }; + option (google.api.routing) = { + routing_parameters { + field: "instance_name" + path_template: "{name=projects/*/instances/*}" + } + routing_parameters { field: "app_profile_id" } + }; + option (google.api.method_signature) = "instance_name,query"; + option (google.api.method_signature) = "instance_name,query,app_profile_id"; + } +} + +// Request message for Bigtable.ReadRows. +message ReadRowsRequest { + // The desired view into RequestStats that should be returned in the response. + // + // See also: RequestStats message. + enum RequestStatsView { + // The default / unset value. The API will default to the NONE option below. + REQUEST_STATS_VIEW_UNSPECIFIED = 0; + + // Do not include any RequestStats in the response. This will leave the + // RequestStats embedded message unset in the response. + REQUEST_STATS_NONE = 1; + + // Include the full set of available RequestStats in the response, + // applicable to this read. + REQUEST_STATS_FULL = 2; + } + + // Optional. The unique name of the table from which to read. + // + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Optional. The unique name of the AuthorizedView from which to read. + // + // Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // Optional. The unique name of the MaterializedView from which to read. + // + // Values are of the form + // `projects//instances//materializedViews/`. + string materialized_view_name = 11 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/MaterializedView" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 5; + + // The row keys and/or ranges to read sequentially. If not specified, reads + // from all rows. + RowSet rows = 2; + + // The filter to apply to the contents of the specified row(s). If unset, + // reads the entirety of each row. + RowFilter filter = 3; + + // The read will stop after committing to N rows' worth of results. The + // default (zero) is to return all results. + int64 rows_limit = 4; + + // The view into RequestStats, as described above. + RequestStatsView request_stats_view = 6; + + // Experimental API - Please note that this API is currently experimental + // and can change in the future. + // + // Return rows in lexiographical descending order of the row keys. The row + // contents will not be affected by this flag. + // + // Example result set: + // + // [ + // {key: "k2", "f:col1": "v1", "f:col2": "v1"}, + // {key: "k1", "f:col1": "v2", "f:col2": "v2"} + // ] + bool reversed = 7; +} + +// Response message for Bigtable.ReadRows. +message ReadRowsResponse { + // Specifies a piece of a row's contents returned as part of the read + // response stream. + message CellChunk { + // The row key for this chunk of data. If the row key is empty, + // this CellChunk is a continuation of the same row as the previous + // CellChunk in the response stream, even if that CellChunk was in a + // previous ReadRowsResponse message. + bytes row_key = 1; + + // The column family name for this chunk of data. If this message + // is not present this CellChunk is a continuation of the same column + // family as the previous CellChunk. The empty string can occur as a + // column family name in a response so clients must check + // explicitly for the presence of this message, not just for + // `family_name.value` being non-empty. + google.protobuf.StringValue family_name = 2; + + // The column qualifier for this chunk of data. If this message + // is not present, this CellChunk is a continuation of the same column + // as the previous CellChunk. Column qualifiers may be empty so + // clients must check for the presence of this message, not just + // for `qualifier.value` being non-empty. + google.protobuf.BytesValue qualifier = 3; + + // The cell's stored timestamp, which also uniquely identifies it + // within its column. Values are always expressed in + // microseconds, but individual tables may set a coarser + // granularity to further restrict the allowed values. For + // example, a table which specifies millisecond granularity will + // only allow values of `timestamp_micros` which are multiples of + // 1000. Timestamps are only set in the first CellChunk per cell + // (for cells split into multiple chunks). + int64 timestamp_micros = 4; + + // Labels applied to the cell by a + // [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set + // on the first CellChunk per cell. + repeated string labels = 5; + + // The value stored in the cell. Cell values can be split across + // multiple CellChunks. In that case only the value field will be + // set in CellChunks after the first: the timestamp and labels + // will only be present in the first CellChunk, even if the first + // CellChunk came in a previous ReadRowsResponse. + bytes value = 6; + + // If this CellChunk is part of a chunked cell value and this is + // not the final chunk of that cell, value_size will be set to the + // total length of the cell value. The client can use this size + // to pre-allocate memory to hold the full cell value. + int32 value_size = 7; + + // Signals to the client concerning previous CellChunks received. + oneof row_status { + // Indicates that the client should drop all previous chunks for + // `row_key`, as it will be re-read from the beginning. + bool reset_row = 8; + + // Indicates that the client can safely process all previous chunks for + // `row_key`, as its data has been fully read. + bool commit_row = 9; + } + } + + // A collection of a row's contents as part of the read request. + repeated CellChunk chunks = 1; + + // Optionally the server might return the row key of the last row it + // has scanned. The client can use this to construct a more + // efficient retry request if needed: any row keys or portions of + // ranges less than this row key can be dropped from the request. + // This is primarily useful for cases where the server has read a + // lot of data that was filtered out since the last committed row + // key, allowing the client to skip that work on a retry. + bytes last_scanned_row_key = 2; + + // If requested, return enhanced query performance statistics. The field + // request_stats is empty in a streamed response unless the ReadRowsResponse + // message contains request_stats in the last message of the stream. Always + // returned when requested, even when the read request returns an empty + // response. + RequestStats request_stats = 3; +} + +// Request message for Bigtable.SampleRowKeys. +message SampleRowKeysRequest { + // Optional. The unique name of the table from which to sample row keys. + // + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Optional. The unique name of the AuthorizedView from which to sample row + // keys. + // + // Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // Optional. The unique name of the MaterializedView from which to read. + // + // Values are of the form + // `projects//instances//materializedViews/`. + string materialized_view_name = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/MaterializedView" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 2; +} + +// Response message for Bigtable.SampleRowKeys. +message SampleRowKeysResponse { + // Sorted streamed sequence of sample row keys in the table. The table might + // have contents before the first row key in the list and after the last one, + // but a key containing the empty string indicates "end of table" and will be + // the last response given, if present. + // Note that row keys in this list may not have ever been written to or read + // from, and users should therefore not make any assumptions about the row key + // structure that are specific to their use case. + bytes row_key = 1; + + // Approximate total storage space used by all rows in the table which precede + // `row_key`. Buffering the contents of all rows between two subsequent + // samples would require space roughly equal to the difference in their + // `offset_bytes` fields. + int64 offset_bytes = 2; +} + +// Request message for Bigtable.MutateRow. +message MutateRowRequest { + // Optional. The unique name of the table to which the mutation should be + // applied. + // + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Optional. The unique name of the AuthorizedView to which the mutation + // should be applied. + // + // Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 4; + + // Required. The key of the row to which the mutation should be applied. + bytes row_key = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Changes to be atomically applied to the specified row. Entries + // are applied in order, meaning that earlier mutations can be masked by later + // ones. Must contain at least one entry and at most 100000. + repeated Mutation mutations = 3 [(google.api.field_behavior) = REQUIRED]; + + // If set consistently across retries, prevents this mutation from being + // double applied to aggregate column families within a 15m window. + Idempotency idempotency = 8; +} + +// Response message for Bigtable.MutateRow. +message MutateRowResponse {} + +// Request message for BigtableService.MutateRows. +message MutateRowsRequest { + // A mutation for a given row. + message Entry { + // The key of the row to which the `mutations` should be applied. + bytes row_key = 1; + + // Required. Changes to be atomically applied to the specified row. + // Mutations are applied in order, meaning that earlier mutations can be + // masked by later ones. You must specify at least one mutation. + repeated Mutation mutations = 2 [(google.api.field_behavior) = REQUIRED]; + + // If set consistently across retries, prevents this mutation from being + // double applied to aggregate column families within a 15m window. + Idempotency idempotency = 3; + } + + // Optional. The unique name of the table to which the mutations should be + // applied. + // + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Optional. The unique name of the AuthorizedView to which the mutations + // should be applied. + // + // Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 3; + + // Required. The row keys and corresponding mutations to be applied in bulk. + // Each entry is applied as an atomic mutation, but the entries may be + // applied in arbitrary order (even between entries for the same row). + // At least one entry must be specified, and in total the entries can + // contain at most 100000 mutations. + repeated Entry entries = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for BigtableService.MutateRows. +message MutateRowsResponse { + // The result of applying a passed mutation in the original request. + message Entry { + // The index into the original request's `entries` list of the Entry + // for which a result is being reported. + int64 index = 1; + + // The result of the request Entry identified by `index`. + // Depending on how requests are batched during execution, it is possible + // for one Entry to fail due to an error with another Entry. In the event + // that this occurs, the same error will be reported for both entries. + google.rpc.Status status = 2; + } + + // One or more results for Entries from the batch request. + repeated Entry entries = 1; + + // Information about how client should limit the rate (QPS). Primirily used by + // supported official Cloud Bigtable clients. If unset, the rate limit info is + // not provided by the server. + optional RateLimitInfo rate_limit_info = 3; +} + +// Information about how client should adjust the load to Bigtable. +message RateLimitInfo { + // Time that clients should wait before adjusting the target rate again. + // If clients adjust rate too frequently, the impact of the previous + // adjustment may not have been taken into account and may + // over-throttle or under-throttle. If clients adjust rate too slowly, they + // will not be responsive to load changes on server side, and may + // over-throttle or under-throttle. + google.protobuf.Duration period = 1; + + // If it has been at least one `period` since the last load adjustment, the + // client should multiply the current load by this value to get the new target + // load. For example, if the current load is 100 and `factor` is 0.8, the new + // target load should be 80. After adjusting, the client should ignore + // `factor` until another `period` has passed. + // + // The client can measure its load using any unit that's comparable over time. + // For example, QPS can be used as long as each request involves a similar + // amount of work. + double factor = 2; +} + +// Request message for Bigtable.CheckAndMutateRow. +message CheckAndMutateRowRequest { + // Optional. The unique name of the table to which the conditional mutation + // should be applied. + // + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Optional. The unique name of the AuthorizedView to which the conditional + // mutation should be applied. + // + // Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 7; + + // Required. The key of the row to which the conditional mutation should be + // applied. + bytes row_key = 2 [(google.api.field_behavior) = REQUIRED]; + + // The filter to be applied to the contents of the specified row. Depending + // on whether or not any results are yielded, either `true_mutations` or + // `false_mutations` will be executed. If unset, checks that the row contains + // any values at all. + RowFilter predicate_filter = 6; + + // Changes to be atomically applied to the specified row if `predicate_filter` + // yields at least one cell when applied to `row_key`. Entries are applied in + // order, meaning that earlier mutations can be masked by later ones. + // Must contain at least one entry if `false_mutations` is empty, and at most + // 100000. + repeated Mutation true_mutations = 4; + + // Changes to be atomically applied to the specified row if `predicate_filter` + // does not yield any cells when applied to `row_key`. Entries are applied in + // order, meaning that earlier mutations can be masked by later ones. + // Must contain at least one entry if `true_mutations` is empty, and at most + // 100000. + repeated Mutation false_mutations = 5; +} + +// Response message for Bigtable.CheckAndMutateRow. +message CheckAndMutateRowResponse { + // Whether or not the request's `predicate_filter` yielded any results for + // the specified row. + bool predicate_matched = 1; +} + +// Request message for client connection keep-alive and warming. +message PingAndWarmRequest { + // Required. The unique name of the instance to check permissions for as well + // as respond. Values are of the form + // `projects//instances/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 2; +} + +// Response message for Bigtable.PingAndWarm connection keepalive and warming. +message PingAndWarmResponse {} + +// Request message for Bigtable.ReadModifyWriteRow. +message ReadModifyWriteRowRequest { + // Optional. The unique name of the table to which the read/modify/write rules + // should be applied. + // + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Optional. The unique name of the AuthorizedView to which the + // read/modify/write rules should be applied. + // + // Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 4; + + // Required. The key of the row to which the read/modify/write rules should be + // applied. + bytes row_key = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Rules specifying how the specified row's contents are to be + // transformed into writes. Entries are applied in order, meaning that earlier + // rules will affect the results of later ones. At least one entry must be + // specified, and there can be at most 100000 rules. + repeated ReadModifyWriteRule rules = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for Bigtable.ReadModifyWriteRow. +message ReadModifyWriteRowResponse { + // A Row containing the new contents of all cells modified by the request. + Row row = 1; +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// Request message for Bigtable.GenerateInitialChangeStreamPartitions. +message GenerateInitialChangeStreamPartitionsRequest { + // Required. The unique name of the table from which to get change stream + // partitions. Values are of the form + // `projects//instances//tables/
`. + // Change streaming must be enabled on the table. + string table_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + // Single cluster routing must be configured on the profile. + string app_profile_id = 2; +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// Response message for Bigtable.GenerateInitialChangeStreamPartitions. +message GenerateInitialChangeStreamPartitionsResponse { + // A partition of the change stream. + StreamPartition partition = 1; +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// Request message for Bigtable.ReadChangeStream. +message ReadChangeStreamRequest { + // Required. The unique name of the table from which to read a change stream. + // Values are of the form + // `projects//instances//tables/
`. + // Change streaming must be enabled on the table. + string table_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + // Single cluster routing must be configured on the profile. + string app_profile_id = 2; + + // The partition to read changes from. + StreamPartition partition = 3; + + // Options for describing where we want to start reading from the stream. + oneof start_from { + // Start reading the stream at the specified timestamp. This timestamp must + // be within the change stream retention period, less than or equal to the + // current time, and after change stream creation, whichever is greater. + // This value is inclusive and will be truncated to microsecond granularity. + google.protobuf.Timestamp start_time = 4; + + // Tokens that describe how to resume reading a stream where reading + // previously left off. If specified, changes will be read starting at the + // the position. Tokens are delivered on the stream as part of `Heartbeat` + // and `CloseStream` messages. + // + // If a single token is provided, the token's partition must exactly match + // the request's partition. If multiple tokens are provided, as in the case + // of a partition merge, the union of the token partitions must exactly + // cover the request's partition. Otherwise, INVALID_ARGUMENT will be + // returned. + StreamContinuationTokens continuation_tokens = 6; + } + + // If specified, OK will be returned when the stream advances beyond + // this time. Otherwise, changes will be continuously delivered on the stream. + // This value is inclusive and will be truncated to microsecond granularity. + google.protobuf.Timestamp end_time = 5; + + // If specified, the duration between `Heartbeat` messages on the stream. + // Otherwise, defaults to 5 seconds. + google.protobuf.Duration heartbeat_duration = 7; +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// Response message for Bigtable.ReadChangeStream. +message ReadChangeStreamResponse { + // A partial or complete mutation. + message MutationChunk { + // Information about the chunking of this mutation. + // Only `SetCell` mutations can be chunked, and all chunks for a `SetCell` + // will be delivered contiguously with no other mutation types interleaved. + message ChunkInfo { + // The total value size of all the chunks that make up the `SetCell`. + int32 chunked_value_size = 1; + + // The byte offset of this chunk into the total value size of the + // mutation. + int32 chunked_value_offset = 2; + + // When true, this is the last chunk of a chunked `SetCell`. + bool last_chunk = 3; + } + + // If set, then the mutation is a `SetCell` with a chunked value across + // multiple messages. + ChunkInfo chunk_info = 1; + + // If this is a continuation of a chunked message (`chunked_value_offset` > + // 0), ignore all fields except the `SetCell`'s value and merge it with + // the previous message by concatenating the value fields. + Mutation mutation = 2; + } + + // A message corresponding to one or more mutations to the partition + // being streamed. A single logical `DataChange` message may also be split + // across a sequence of multiple individual messages. Messages other than + // the first in a sequence will only have the `type` and `chunks` fields + // populated, with the final message in the sequence also containing `done` + // set to true. + message DataChange { + // The type of mutation. + enum Type { + // The type is unspecified. + TYPE_UNSPECIFIED = 0; + + // A user-initiated mutation. + USER = 1; + + // A system-initiated mutation as part of garbage collection. + // https://cloud.google.com/bigtable/docs/garbage-collection + GARBAGE_COLLECTION = 2; + + // This is a continuation of a multi-message change. + CONTINUATION = 3; + } + + // The type of the mutation. + Type type = 1; + + // The cluster where the mutation was applied. + // Not set when `type` is `GARBAGE_COLLECTION`. + string source_cluster_id = 2; + + // The row key for all mutations that are part of this `DataChange`. + // If the `DataChange` is chunked across multiple messages, then this field + // will only be set for the first message. + bytes row_key = 3; + + // The timestamp at which the mutation was applied on the Bigtable server. + google.protobuf.Timestamp commit_timestamp = 4; + + // A value that lets stream consumers reconstruct Bigtable's + // conflict resolution semantics. + // https://cloud.google.com/bigtable/docs/writes#conflict-resolution + // In the event that the same row key, column family, column qualifier, + // timestamp are modified on different clusters at the same + // `commit_timestamp`, the mutation with the larger `tiebreaker` will be the + // one chosen for the eventually consistent state of the system. + int32 tiebreaker = 5; + + // The mutations associated with this change to the partition. + // May contain complete mutations or chunks of a multi-message chunked + // `DataChange` record. + repeated MutationChunk chunks = 6; + + // When true, indicates that the entire `DataChange` has been read + // and the client can safely process the message. + bool done = 8; + + // An encoded position for this stream's partition to restart reading from. + // This token is for the StreamPartition from the request. + string token = 9; + + // An estimate of the commit timestamp that is usually lower than or equal + // to any timestamp for a record that will be delivered in the future on the + // stream. It is possible that, under particular circumstances that a future + // record has a timestamp that is lower than a previously seen timestamp. + // For an example usage see + // https://beam.apache.org/documentation/basics/#watermarks + google.protobuf.Timestamp estimated_low_watermark = 10; + } + + // A periodic message with information that can be used to checkpoint + // the state of a stream. + message Heartbeat { + // A token that can be provided to a subsequent `ReadChangeStream` call + // to pick up reading at the current stream position. + StreamContinuationToken continuation_token = 1; + + // An estimate of the commit timestamp that is usually lower than or equal + // to any timestamp for a record that will be delivered in the future on the + // stream. It is possible that, under particular circumstances that a future + // record has a timestamp that is lower than a previously seen timestamp. + // For an example usage see + // https://beam.apache.org/documentation/basics/#watermarks + google.protobuf.Timestamp estimated_low_watermark = 2; + } + + // A message indicating that the client should stop reading from the stream. + // If status is OK and `continuation_tokens` & `new_partitions` are empty, the + // stream has finished (for example if there was an `end_time` specified). + // If `continuation_tokens` & `new_partitions` are present, then a change in + // partitioning requires the client to open a new stream for each token to + // resume reading. Example: + // + // [B, D) ends + // | + // v + // new_partitions: [A, C) [C, E) + // continuation_tokens.partitions: [B,C) [C,D) + // ^---^ ^---^ + // ^ ^ + // | | + // | StreamContinuationToken 2 + // | + // StreamContinuationToken 1 + // + // To read the new partition [A,C), supply the continuation tokens whose + // ranges cover the new partition, for example ContinuationToken[A,B) & + // ContinuationToken[B,C). + message CloseStream { + // The status of the stream. + google.rpc.Status status = 1; + + // If non-empty, contains the information needed to resume reading their + // associated partitions. + repeated StreamContinuationToken continuation_tokens = 2; + + // If non-empty, contains the new partitions to start reading from, which + // are related to but not necessarily identical to the partitions for the + // above `continuation_tokens`. + repeated StreamPartition new_partitions = 3; + } + + // The data or control message on the stream. + oneof stream_record { + // A mutation to the partition. + DataChange data_change = 1; + + // A periodic heartbeat message. + Heartbeat heartbeat = 2; + + // An indication that the stream should be closed. + CloseStream close_stream = 3; + } +} + +// Request message for Bigtable.ExecuteQuery +message ExecuteQueryRequest { + // Required. The unique name of the instance against which the query should be + // executed. + // Values are of the form `projects//instances/` + string instance_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Optional. This value specifies routing for replication. If not specified, + // the `default` application profile will be used. + string app_profile_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The query string. + // + // Exactly one of `query` and `prepared_query` is required. Setting both + // or neither is an `INVALID_ARGUMENT`. + string query = 3 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // A prepared query that was returned from `PrepareQueryResponse`. + // + // Exactly one of `query` and `prepared_query` is required. Setting both + // or neither is an `INVALID_ARGUMENT`. + // + // Setting this field also places restrictions on several other fields: + // - `data_format` must be empty. + // - `validate_only` must be false. + // - `params` must match the `param_types` set in the `PrepareQueryRequest`. + bytes prepared_query = 9; + + // Requested data format for the response. + // + // If `prepared_query` is set, then the `data_format` is fixed by the + // `PrepareQueryRequest`, and a non-empty `data_format` in the + // `ExecuteQueryRequest` will be rejected with `INVALID_ARGUMENT`. + oneof data_format { + // Protocol buffer format as described by ProtoSchema and ProtoRows + // messages. + ProtoFormat proto_format = 4 [deprecated = true]; + } + + // Optional. If this request is resuming a previously interrupted query + // execution, `resume_token` should be copied from the last + // PartialResultSet yielded before the interruption. Doing this + // enables the query execution to resume where the last one left + // off. + // The rest of the request parameters must exactly match the + // request that yielded this token. Otherwise the request will fail. + bytes resume_token = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Required. params contains string type keys and Bigtable type values that + // bind to placeholders in the query string. In query string, a parameter + // placeholder consists of the + // `@` character followed by the parameter name (for example, `@firstName`) in + // the query string. + // + // For example, if + // `params["firstName"] = bytes_value: "foo" type {bytes_type {}}` + // then `@firstName` will be replaced with googlesql bytes value "foo" in the + // query string during query evaluation. + // + // If `Value.kind` is not set, the value is treated as a NULL value of the + // given type. For example, if + // `params["firstName"] = type {string_type {}}` + // then `@firstName` will be replaced with googlesql null string. + // + // If `query` is set, any empty `Value.type` in the map will be rejected with + // `INVALID_ARGUMENT`. + // + // If `prepared_query` is set, any empty `Value.type` in the map will be + // inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty + // `Value.type` must match the corresponding `param_types` entry, or be + // rejected with `INVALID_ARGUMENT`. + map params = 7 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for Bigtable.ExecuteQuery +message ExecuteQueryResponse { + // The first response streamed from the server is of type `ResultSetMetadata` + // and includes information about the columns and types of the result set. + // From there on, we stream `PartialResultSet` messages with no additional + // information. `PartialResultSet` will contain `resume_token` to restart the + // response if query interrupts. In case of resumption with `resume_token`, + // the server will not resend the ResultSetMetadata. + oneof response { + // Structure of rows in this response stream. The first (and only the first) + // response streamed from the server will be of this type. + ResultSetMetadata metadata = 1; + + // A partial result set with row data potentially including additional + // instructions on how recent past and future partial responses should be + // interpreted. + PartialResultSet results = 2; + } +} + +// Request message for Bigtable.PrepareQuery +message PrepareQueryRequest { + // Required. The unique name of the instance against which the query should be + // executed. + // Values are of the form `projects//instances/` + string instance_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Optional. This value specifies routing for preparing the query. Note that + // this `app_profile_id` is only used for preparing the query. The actual + // query execution will use the app profile specified in the + // `ExecuteQueryRequest`. If not specified, the `default` application profile + // will be used. + string app_profile_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The query string. + string query = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Requested data format for the response. Note that the selected + // data format is binding for all `ExecuteQuery` rpcs that use the prepared + // query. + oneof data_format { + // Protocol buffer format as described by ProtoSchema and ProtoRows + // messages. + ProtoFormat proto_format = 4; + } + + // Required. `param_types` is a map of parameter identifier strings to their + // `Type`s. + // + // In query string, a parameter placeholder consists of the + // `@` character followed by the parameter name (for example, `@firstName`) in + // the query string. + // + // For example, if param_types["firstName"] = Bytes then @firstName will be a + // query parameter of type Bytes. The specific `Value` to be used for the + // query execution must be sent in `ExecuteQueryRequest` in the `params` map. + map param_types = 6 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for Bigtable.PrepareQueryResponse +message PrepareQueryResponse { + // Structure of rows in the response stream of `ExecuteQueryResponse` for the + // returned `prepared_query`. + ResultSetMetadata metadata = 1; + + // A serialized prepared query. Clients should treat this as an opaque + // blob of bytes to send in `ExecuteQueryRequest`. + bytes prepared_query = 2; + + // The time at which the prepared query token becomes invalid. + // A token may become invalid early due to changes in the data being read, but + // it provides a guideline to refresh query plans asynchronously. + google.protobuf.Timestamp valid_until = 3; +} diff --git a/handwritten/bigtable/protos/google/bigtable/v2/data.proto b/handwritten/bigtable/protos/google/bigtable/v2/data.proto new file mode 100644 index 00000000000..8320a0c22fc --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/v2/data.proto @@ -0,0 +1,856 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.v2; + +import "google/api/field_behavior.proto"; +import "google/bigtable/v2/types.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "DataProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// Specifies the complete (requested) contents of a single row of a table. +// Rows which exceed 256MiB in size cannot be read in full. +message Row { + // The unique key which identifies this row within its table. This is the same + // key that's used to identify the row in, for example, a MutateRowRequest. + // May contain any non-empty byte string up to 4KiB in length. + bytes key = 1; + + // May be empty, but only if the entire row is empty. + // The mutual ordering of column families is not specified. + repeated Family families = 2; +} + +// Specifies (some of) the contents of a single row/column family intersection +// of a table. +message Family { + // The unique key which identifies this family within its row. This is the + // same key that's used to identify the family in, for example, a RowFilter + // which sets its "family_name_regex_filter" field. + // Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may + // produce cells in a sentinel family with an empty name. + // Must be no greater than 64 characters in length. + string name = 1; + + // Must not be empty. Sorted in order of increasing "qualifier". + repeated Column columns = 2; +} + +// Specifies (some of) the contents of a single row/column intersection of a +// table. +message Column { + // The unique key which identifies this column within its family. This is the + // same key that's used to identify the column in, for example, a RowFilter + // which sets its `column_qualifier_regex_filter` field. + // May contain any byte string, including the empty string, up to 16kiB in + // length. + bytes qualifier = 1; + + // Must not be empty. Sorted in order of decreasing "timestamp_micros". + repeated Cell cells = 2; +} + +// Specifies (some of) the contents of a single row/column/timestamp of a table. +message Cell { + // The cell's stored timestamp, which also uniquely identifies it within + // its column. + // Values are always expressed in microseconds, but individual tables may set + // a coarser granularity to further restrict the allowed values. For + // example, a table which specifies millisecond granularity will only allow + // values of `timestamp_micros` which are multiples of 1000. + int64 timestamp_micros = 1; + + // The value stored in the cell. + // May contain any byte string, including the empty string, up to 100MiB in + // length. + bytes value = 2; + + // Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter]. + repeated string labels = 3; +} + +// `Value` represents a dynamically typed value. +// The typed fields in `Value` are used as a transport encoding for the actual +// value (which may be of a more complex type). See the documentation of the +// `Type` message for more details. +message Value { + // The verified `Type` of this `Value`, if it cannot be inferred. + // + // Read results will never specify the encoding for `type` since the value + // will already have been decoded by the server. Furthermore, the `type` will + // be omitted entirely if it can be inferred from a previous response. The + // exact semantics for inferring `type` will vary, and are therefore + // documented separately for each read method. + // + // When using composite types (Struct, Array, Map) only the outermost `Value` + // will specify the `type`. This top-level `type` will define the types for + // any nested `Struct' fields, `Array` elements, or `Map` key/value pairs. + // If a nested `Value` provides a `type` on write, the request will be + // rejected with INVALID_ARGUMENT. + Type type = 7; + + // Options for transporting values within the protobuf type system. A given + // `kind` may support more than one `type` and vice versa. On write, this is + // roughly analogous to a GoogleSQL literal. + // + // The value is `NULL` if none of the fields in `kind` is set. If `type` is + // also omitted on write, we will infer it based on the schema. + oneof kind { + // Represents a raw byte sequence with no type information. + // The `type` field must be omitted. + bytes raw_value = 8; + + // Represents a raw cell timestamp with no type information. + // The `type` field must be omitted. + int64 raw_timestamp_micros = 9; + + // Represents a typed value transported as a byte sequence. + bytes bytes_value = 2; + + // Represents a typed value transported as a string. + string string_value = 3; + + // Represents a typed value transported as an integer. + int64 int_value = 6; + + // Represents a typed value transported as a boolean. + bool bool_value = 10; + + // Represents a typed value transported as a floating point number. + // Does not support NaN or infinities. + double float_value = 11; + + // Represents a typed value transported as a timestamp. + google.protobuf.Timestamp timestamp_value = 12; + + // Represents a typed value transported as a date. + google.type.Date date_value = 13; + + // Represents a typed value transported as a sequence of values. + // To differentiate between `Struct`, `Array`, and `Map`, the outermost + // `Value` must provide an explicit `type` on write. This `type` will + // apply recursively to the nested `Struct` fields, `Array` elements, + // or `Map` key/value pairs, which *must not* supply their own `type`. + ArrayValue array_value = 4; + } +} + +// `ArrayValue` is an ordered list of `Value`. +message ArrayValue { + // The ordered elements in the array. + repeated Value values = 1; +} + +// Specifies a contiguous range of rows. +message RowRange { + // The row key at which to start the range. + // If neither field is set, interpreted as the empty string, inclusive. + oneof start_key { + // Used when giving an inclusive lower bound for the range. + bytes start_key_closed = 1; + + // Used when giving an exclusive lower bound for the range. + bytes start_key_open = 2; + } + + // The row key at which to end the range. + // If neither field is set, interpreted as the infinite row key, exclusive. + oneof end_key { + // Used when giving an exclusive upper bound for the range. + bytes end_key_open = 3; + + // Used when giving an inclusive upper bound for the range. + bytes end_key_closed = 4; + } +} + +// Specifies a non-contiguous set of rows. +message RowSet { + // Single rows included in the set. + repeated bytes row_keys = 1; + + // Contiguous row ranges included in the set. + repeated RowRange row_ranges = 2; +} + +// Specifies a contiguous range of columns within a single column family. +// The range spans from <column_family>:<start_qualifier> to +// <column_family>:<end_qualifier>, where both bounds can be either +// inclusive or exclusive. +message ColumnRange { + // The name of the column family within which this range falls. + string family_name = 1; + + // The column qualifier at which to start the range (within `column_family`). + // If neither field is set, interpreted as the empty string, inclusive. + oneof start_qualifier { + // Used when giving an inclusive lower bound for the range. + bytes start_qualifier_closed = 2; + + // Used when giving an exclusive lower bound for the range. + bytes start_qualifier_open = 3; + } + + // The column qualifier at which to end the range (within `column_family`). + // If neither field is set, interpreted as the infinite string, exclusive. + oneof end_qualifier { + // Used when giving an inclusive upper bound for the range. + bytes end_qualifier_closed = 4; + + // Used when giving an exclusive upper bound for the range. + bytes end_qualifier_open = 5; + } +} + +// Specified a contiguous range of microsecond timestamps. +message TimestampRange { + // Inclusive lower bound. If left empty, interpreted as 0. + int64 start_timestamp_micros = 1; + + // Exclusive upper bound. If left empty, interpreted as infinity. + int64 end_timestamp_micros = 2; +} + +// Specifies a contiguous range of raw byte values. +message ValueRange { + // The value at which to start the range. + // If neither field is set, interpreted as the empty string, inclusive. + oneof start_value { + // Used when giving an inclusive lower bound for the range. + bytes start_value_closed = 1; + + // Used when giving an exclusive lower bound for the range. + bytes start_value_open = 2; + } + + // The value at which to end the range. + // If neither field is set, interpreted as the infinite string, exclusive. + oneof end_value { + // Used when giving an inclusive upper bound for the range. + bytes end_value_closed = 3; + + // Used when giving an exclusive upper bound for the range. + bytes end_value_open = 4; + } +} + +// Takes a row as input and produces an alternate view of the row based on +// specified rules. For example, a RowFilter might trim down a row to include +// just the cells from columns matching a given regular expression, or might +// return all the cells of a row but not their values. More complicated filters +// can be composed out of these components to express requests such as, "within +// every column of a particular family, give just the two most recent cells +// which are older than timestamp X." +// +// There are two broad categories of RowFilters (true filters and transformers), +// as well as two ways to compose simple filters into more complex ones +// (chains and interleaves). They work as follows: +// +// * True filters alter the input row by excluding some of its cells wholesale +// from the output row. An example of a true filter is the `value_regex_filter`, +// which excludes cells whose values don't match the specified pattern. All +// regex true filters use RE2 syntax (https://github.com/google/re2/wiki/Syntax) +// in raw byte mode (RE2::Latin1), and are evaluated as full matches. An +// important point to keep in mind is that `RE2(.)` is equivalent by default to +// `RE2([^\n])`, meaning that it does not match newlines. When attempting to +// match an arbitrary byte, you should therefore use the escape sequence `\C`, +// which may need to be further escaped as `\\C` in your client language. +// +// * Transformers alter the input row by changing the values of some of its +// cells in the output, without excluding them completely. Currently, the only +// supported transformer is the `strip_value_transformer`, which replaces every +// cell's value with the empty string. +// +// * Chains and interleaves are described in more detail in the +// RowFilter.Chain and RowFilter.Interleave documentation. +// +// The total serialized size of a RowFilter message must not +// exceed 20480 bytes, and RowFilters may not be nested within each other +// (in Chains or Interleaves) to a depth of more than 20. +message RowFilter { + // A RowFilter which sends rows through several RowFilters in sequence. + message Chain { + // The elements of "filters" are chained together to process the input row: + // in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row + // The full chain is executed atomically. + repeated RowFilter filters = 1; + } + + // A RowFilter which sends each row to each of several component + // RowFilters and interleaves the results. + message Interleave { + // The elements of "filters" all process a copy of the input row, and the + // results are pooled, sorted, and combined into a single output row. + // If multiple cells are produced with the same column and timestamp, + // they will all appear in the output row in an unspecified mutual order. + // Consider the following example, with three filters: + // + // input row + // | + // ----------------------------------------------------- + // | | | + // f(0) f(1) f(2) + // | | | + // 1: foo,bar,10,x foo,bar,10,z far,bar,7,a + // 2: foo,blah,11,z far,blah,5,x far,blah,5,x + // | | | + // ----------------------------------------------------- + // | + // 1: foo,bar,10,z // could have switched with #2 + // 2: foo,bar,10,x // could have switched with #1 + // 3: foo,blah,11,z + // 4: far,bar,7,a + // 5: far,blah,5,x // identical to #6 + // 6: far,blah,5,x // identical to #5 + // + // All interleaved filters are executed atomically. + repeated RowFilter filters = 1; + } + + // A RowFilter which evaluates one of two possible RowFilters, depending on + // whether or not a predicate RowFilter outputs any cells from the input row. + // + // IMPORTANT NOTE: The predicate filter does not execute atomically with the + // true and false filters, which may lead to inconsistent or unexpected + // results. Additionally, Condition filters have poor performance, especially + // when filters are set for the false condition. + message Condition { + // If `predicate_filter` outputs any cells, then `true_filter` will be + // evaluated on the input row. Otherwise, `false_filter` will be evaluated. + RowFilter predicate_filter = 1; + + // The filter to apply to the input row if `predicate_filter` returns any + // results. If not provided, no results will be returned in the true case. + RowFilter true_filter = 2; + + // The filter to apply to the input row if `predicate_filter` does not + // return any results. If not provided, no results will be returned in the + // false case. + RowFilter false_filter = 3; + } + + // Which of the possible RowFilter types to apply. If none are set, this + // RowFilter returns all cells in the input row. + oneof filter { + // Applies several RowFilters to the data in sequence, progressively + // narrowing the results. + Chain chain = 1; + + // Applies several RowFilters to the data in parallel and combines the + // results. + Interleave interleave = 2; + + // Applies one of two possible RowFilters to the data based on the output of + // a predicate RowFilter. + Condition condition = 3; + + // ADVANCED USE ONLY. + // Hook for introspection into the RowFilter. Outputs all cells directly to + // the output of the read rather than to any parent filter. Consider the + // following example: + // + // Chain( + // FamilyRegex("A"), + // Interleave( + // All(), + // Chain(Label("foo"), Sink()) + // ), + // QualifierRegex("B") + // ) + // + // A,A,1,w + // A,B,2,x + // B,B,4,z + // | + // FamilyRegex("A") + // | + // A,A,1,w + // A,B,2,x + // | + // +------------+-------------+ + // | | + // All() Label(foo) + // | | + // A,A,1,w A,A,1,w,labels:[foo] + // A,B,2,x A,B,2,x,labels:[foo] + // | | + // | Sink() --------------+ + // | | | + // +------------+ x------+ A,A,1,w,labels:[foo] + // | A,B,2,x,labels:[foo] + // A,A,1,w | + // A,B,2,x | + // | | + // QualifierRegex("B") | + // | | + // A,B,2,x | + // | | + // +--------------------------------+ + // | + // A,A,1,w,labels:[foo] + // A,B,2,x,labels:[foo] // could be switched + // A,B,2,x // could be switched + // + // Despite being excluded by the qualifier filter, a copy of every cell + // that reaches the sink is present in the final result. + // + // As with an [Interleave][google.bigtable.v2.RowFilter.Interleave], + // duplicate cells are possible, and appear in an unspecified mutual order. + // In this case we have a duplicate with column "A:B" and timestamp 2, + // because one copy passed through the all filter while the other was + // passed through the label and sink. Note that one copy has label "foo", + // while the other does not. + // + // Cannot be used within the `predicate_filter`, `true_filter`, or + // `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition]. + bool sink = 16; + + // Matches all cells, regardless of input. Functionally equivalent to + // leaving `filter` unset, but included for completeness. + bool pass_all_filter = 17; + + // Does not match any cells, regardless of input. Useful for temporarily + // disabling just part of a filter. + bool block_all_filter = 18; + + // Matches only cells from rows whose keys satisfy the given RE2 regex. In + // other words, passes through the entire row when the key matches, and + // otherwise produces an empty row. + // Note that, since row keys can contain arbitrary bytes, the `\C` escape + // sequence must be used if a true wildcard is desired. The `.` character + // will not match the new line character `\n`, which may be present in a + // binary key. + bytes row_key_regex_filter = 4; + + // Matches all cells from a row with probability p, and matches no cells + // from the row with probability 1-p. + double row_sample_filter = 14; + + // Matches only cells from columns whose families satisfy the given RE2 + // regex. For technical reasons, the regex must not contain the `:` + // character, even if it is not being used as a literal. + // Note that, since column families cannot contain the new line character + // `\n`, it is sufficient to use `.` as a full wildcard when matching + // column family names. + string family_name_regex_filter = 5; + + // Matches only cells from columns whose qualifiers satisfy the given RE2 + // regex. + // Note that, since column qualifiers can contain arbitrary bytes, the `\C` + // escape sequence must be used if a true wildcard is desired. The `.` + // character will not match the new line character `\n`, which may be + // present in a binary qualifier. + bytes column_qualifier_regex_filter = 6; + + // Matches only cells from columns within the given range. + ColumnRange column_range_filter = 7; + + // Matches only cells with timestamps within the given range. + TimestampRange timestamp_range_filter = 8; + + // Matches only cells with values that satisfy the given regular expression. + // Note that, since cell values can contain arbitrary bytes, the `\C` escape + // sequence must be used if a true wildcard is desired. The `.` character + // will not match the new line character `\n`, which may be present in a + // binary value. + bytes value_regex_filter = 9; + + // Matches only cells with values that fall within the given range. + ValueRange value_range_filter = 15; + + // Skips the first N cells of each row, matching all subsequent cells. + // If duplicate cells are present, as is possible when using an Interleave, + // each copy of the cell is counted separately. + int32 cells_per_row_offset_filter = 10; + + // Matches only the first N cells of each row. + // If duplicate cells are present, as is possible when using an Interleave, + // each copy of the cell is counted separately. + int32 cells_per_row_limit_filter = 11; + + // Matches only the most recent N cells within each column. For example, + // if N=2, this filter would match column `foo:bar` at timestamps 10 and 9, + // skip all earlier cells in `foo:bar`, and then begin matching again in + // column `foo:bar2`. + // If duplicate cells are present, as is possible when using an Interleave, + // each copy of the cell is counted separately. + int32 cells_per_column_limit_filter = 12; + + // Replaces each cell's value with the empty string. + bool strip_value_transformer = 13; + + // Applies the given label to all cells in the output row. This allows + // the client to determine which results were produced from which part of + // the filter. + // + // Values must be at most 15 characters in length, and match the RE2 + // pattern `[a-z0-9\\-]+` + // + // Due to a technical limitation, it is not currently possible to apply + // multiple labels to a cell. As a result, a Chain may have no more than + // one sub-filter which contains a `apply_label_transformer`. It is okay for + // an Interleave to contain multiple `apply_label_transformers`, as they + // will be applied to separate copies of the input. This may be relaxed in + // the future. + string apply_label_transformer = 19; + } +} + +// Specifies a particular change to be made to the contents of a row. +message Mutation { + // A Mutation which sets the value of the specified cell. + message SetCell { + // The name of the family into which new data should be written. + // Must match `[-_.a-zA-Z0-9]+` + string family_name = 1; + + // The qualifier of the column into which new data should be written. + // Can be any byte string, including the empty string. + bytes column_qualifier = 2; + + // The timestamp of the cell into which new data should be written. + // Use -1 for current Bigtable server time. + // Otherwise, the client should set this value itself, noting that the + // default value is a timestamp of zero if the field is left unspecified. + // Values must match the granularity of the table (e.g. micros, millis). + int64 timestamp_micros = 3; + + // The value to be written into the specified cell. + bytes value = 4; + } + + // A Mutation which incrementally updates a cell in an `Aggregate` family. + message AddToCell { + // The name of the `Aggregate` family into which new data should be added. + // This must be a family with a `value_type` of `Aggregate`. + // Format: `[-_.a-zA-Z0-9]+` + string family_name = 1; + + // The qualifier of the column into which new data should be added. This + // must be a `raw_value`. + Value column_qualifier = 2; + + // The timestamp of the cell to which new data should be added. This must + // be a `raw_timestamp_micros` that matches the table's `granularity`. + Value timestamp = 3; + + // The input value to be accumulated into the specified cell. This must be + // compatible with the family's `value_type.input_type`. + Value input = 4; + } + + // A Mutation which merges accumulated state into a cell in an `Aggregate` + // family. + message MergeToCell { + // The name of the `Aggregate` family into which new data should be added. + // This must be a family with a `value_type` of `Aggregate`. + // Format: `[-_.a-zA-Z0-9]+` + string family_name = 1; + + // The qualifier of the column into which new data should be added. This + // must be a `raw_value`. + Value column_qualifier = 2; + + // The timestamp of the cell to which new data should be added. This must + // be a `raw_timestamp_micros` that matches the table's `granularity`. + Value timestamp = 3; + + // The input value to be merged into the specified cell. This must be + // compatible with the family's `value_type.state_type`. Merging `NULL` is + // allowed, but has no effect. + Value input = 4; + } + + // A Mutation which deletes cells from the specified column, optionally + // restricting the deletions to a given timestamp range. + message DeleteFromColumn { + // The name of the family from which cells should be deleted. + // Must match `[-_.a-zA-Z0-9]+` + string family_name = 1; + + // The qualifier of the column from which cells should be deleted. + // Can be any byte string, including the empty string. + bytes column_qualifier = 2; + + // The range of timestamps within which cells should be deleted. + TimestampRange time_range = 3; + } + + // A Mutation which deletes all cells from the specified column family. + message DeleteFromFamily { + // The name of the family from which cells should be deleted. + // Must match `[-_.a-zA-Z0-9]+` + string family_name = 1; + } + + // A Mutation which deletes all cells from the containing row. + message DeleteFromRow {} + + // Which of the possible Mutation types to apply. + oneof mutation { + // Set a cell's value. + SetCell set_cell = 1; + + // Incrementally updates an `Aggregate` cell. + AddToCell add_to_cell = 5; + + // Merges accumulated state to an `Aggregate` cell. + MergeToCell merge_to_cell = 6; + + // Deletes cells from a column. + DeleteFromColumn delete_from_column = 2; + + // Deletes cells from a column family. + DeleteFromFamily delete_from_family = 3; + + // Deletes cells from the entire row. + DeleteFromRow delete_from_row = 4; + } +} + +// Specifies an atomic read/modify/write operation on the latest value of the +// specified column. +message ReadModifyWriteRule { + // The name of the family to which the read/modify/write should be applied. + // Must match `[-_.a-zA-Z0-9]+` + string family_name = 1; + + // The qualifier of the column to which the read/modify/write should be + // applied. + // Can be any byte string, including the empty string. + bytes column_qualifier = 2; + + // The rule used to determine the column's new latest value from its current + // latest value. + oneof rule { + // Rule specifying that `append_value` be appended to the existing value. + // If the targeted cell is unset, it will be treated as containing the + // empty string. + bytes append_value = 3; + + // Rule specifying that `increment_amount` be added to the existing value. + // If the targeted cell is unset, it will be treated as containing a zero. + // Otherwise, the targeted cell must contain an 8-byte value (interpreted + // as a 64-bit big-endian signed integer), or the entire request will fail. + int64 increment_amount = 4; + } +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// A partition of a change stream. +message StreamPartition { + // The row range covered by this partition and is specified by + // [`start_key_closed`, `end_key_open`). + RowRange row_range = 1; +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// The information required to continue reading the data from multiple +// `StreamPartitions` from where a previous read left off. +message StreamContinuationTokens { + // List of continuation tokens. + repeated StreamContinuationToken tokens = 1; +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// The information required to continue reading the data from a +// `StreamPartition` from where a previous read left off. +message StreamContinuationToken { + // The partition that this token applies to. + StreamPartition partition = 1; + + // An encoded position in the stream to restart reading from. + string token = 2; +} + +// Protocol buffers format descriptor, as described by Messages ProtoSchema and +// ProtoRows +message ProtoFormat {} + +// Describes a column in a Bigtable Query Language result set. +message ColumnMetadata { + // The name of the column. + string name = 1; + + // The type of the column. + Type type = 2; +} + +// ResultSet schema in proto format +message ProtoSchema { + // The columns in the result set. + repeated ColumnMetadata columns = 1; +} + +// Describes the structure of a Bigtable result set. +message ResultSetMetadata { + // The schema of the ResultSet, contains ordered list of column names + // with types + oneof schema { + // Schema in proto format + ProtoSchema proto_schema = 1; + } +} + +// Rows represented in proto format. +// +// This should be constructed by concatenating the `batch_data` from each +// of the relevant `ProtoRowsBatch` messages and parsing the result as a +// `ProtoRows` message. +message ProtoRows { + // A proto rows message consists of a list of values. Every N complete values + // defines a row, where N is equal to the number of entries in the + // `metadata.proto_schema.columns` value received in the first response. + repeated Value values = 2; +} + +// A part of a serialized `ProtoRows` message. +message ProtoRowsBatch { + // Part of a serialized `ProtoRows` message. + // A complete, parseable ProtoRows message is constructed by + // concatenating `batch_data` from multiple `ProtoRowsBatch` messages. The + // `PartialResultSet` that contains the last part has `complete_batch` set to + // `true`. + bytes batch_data = 1; +} + +// A partial result set from the streaming query API. +// Cloud Bigtable clients buffer partial results received in this message until +// a `resume_token` is received. +// +// The pseudocode below describes how to buffer and parse a stream of +// `PartialResultSet` messages. +// +// Having: +// - queue of row results waiting to be returned `queue` +// - extensible buffer of bytes `buffer` +// - a place to keep track of the most recent `resume_token` +// for each PartialResultSet `p` received { +// if p.reset { +// ensure `queue` is empty +// ensure `buffer` is empty +// } +// if p.estimated_batch_size != 0 { +// (optional) ensure `buffer` is sized to at least `p.estimated_batch_size` +// } +// if `p.proto_rows_batch` is set { +// append `p.proto_rows_batch.bytes` to `buffer` +// } +// if p.batch_checksum is set and `buffer` is not empty { +// validate the checksum matches the contents of `buffer` +// (see comments on `batch_checksum`) +// parse `buffer` as `ProtoRows` message, clearing `buffer` +// add parsed rows to end of `queue` +// } +// if p.resume_token is set { +// release results in `queue` +// save `p.resume_token` in `resume_token` +// } +// } +message PartialResultSet { + // Some rows of the result set in one of the supported formats. + // + // Multiple `PartialResultSet` messages may be sent to represent a complete + // response. The client should buffer data constructed from the fields in + // `partial_rows` until a non-empty `resume_token` is received. Each + // sub-message documents the appropriate way to combine results. + oneof partial_rows { + // Partial rows in serialized ProtoRows format. + ProtoRowsBatch proto_rows_batch = 3; + } + + // CRC32C checksum of concatenated `partial_rows` data for the current batch. + // + // When present, the buffered data from `partial_rows` forms a complete + // parseable message of the appropriate type. + // + // The client should mark the end of a parseable message and prepare to + // receive a new one starting from the next `PartialResultSet` message. + // Clients must verify the checksum of the serialized batch before yielding it + // to the caller. + // + // This does NOT mean the values can be yielded to the callers since a + // `resume_token` is required to safely do so. + // + // If `resume_token` is non-empty and any data has been received since the + // last one, this field is guaranteed to be non-empty. In other words, clients + // may assume that a batch will never cross a `resume_token` boundary. + optional uint32 batch_checksum = 6; + + // An opaque token sent by the server to allow query resumption and signal + // that the buffered values constructed from received `partial_rows` can be + // yielded to the caller. Clients can provide this token in a subsequent + // request to resume the result stream from the current point. + // + // When `resume_token` is non-empty, the buffered values received from + // `partial_rows` since the last non-empty `resume_token` can be yielded to + // the callers, provided that the client keeps the value of `resume_token` and + // uses it on subsequent retries. + // + // A `resume_token` may be sent without information in `partial_rows` to + // checkpoint the progress of a sparse query. Any previous `partial_rows` data + // should still be yielded in this case, and the new `resume_token` should be + // saved for future retries as normal. + // + // A `resume_token` will only be sent on a boundary where there is either no + // ongoing result batch, or `batch_checksum` is also populated. + // + // The server will also send a sentinel `resume_token` when last batch of + // `partial_rows` is sent. If the client retries the ExecuteQueryRequest with + // the sentinel `resume_token`, the server will emit it again without any + // data in `partial_rows`, then return OK. + bytes resume_token = 5; + + // If `true`, any data buffered since the last non-empty `resume_token` must + // be discarded before the other parts of this message, if any, are handled. + bool reset = 7; + + // Estimated size of the buffer required to hold the next batch of results. + // + // This value will be sent with the first `partial_rows` of a batch. That is, + // on the first `partial_rows` received in a stream, on the first message + // after a `batch_checksum` message, and any time `reset` is true. + // + // The client can use this estimate to allocate a buffer for the next batch of + // results. This helps minimize the number of allocations required, though the + // buffer size may still need to be increased if the estimate is too low. + int32 estimated_batch_size = 4; +} + +// Parameters on mutations where clients want to ensure idempotency (i.e. +// at-most-once semantics). This is currently only needed for certain aggregate +// types. +message Idempotency { + // Unique token used to identify replays of this mutation. + // Must be at least 8 bytes long. + bytes token = 1; + + // Client-assigned timestamp when the mutation's first attempt was sent. + // Used to reject mutations that arrive after idempotency protection may + // have expired. May cause spurious rejections if clock skew is too high. + // + // Leave unset or zero to always accept the mutation, at the risk of + // double counting if the protection for previous attempts has expired. + google.protobuf.Timestamp start_time = 2; +} diff --git a/handwritten/bigtable/protos/google/bigtable/v2/feature_flags.proto b/handwritten/bigtable/protos/google/bigtable/v2/feature_flags.proto new file mode 100644 index 00000000000..9bf078e6e86 --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/v2/feature_flags.proto @@ -0,0 +1,73 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.v2; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "FeatureFlagsProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// Feature flags supported or enabled by a client. +// This is intended to be sent as part of request metadata to assure the server +// that certain behaviors are safe to enable. This proto is meant to be +// serialized and websafe-base64 encoded under the `bigtable-features` metadata +// key. The value will remain constant for the lifetime of a client and due to +// HTTP2's HPACK compression, the request overhead will be tiny. +// This is an internal implementation detail and should not be used by end users +// directly. +message FeatureFlags { + // Notify the server that the client supports reverse scans. The server will + // reject ReadRowsRequests with the reverse bit set when this is absent. + bool reverse_scans = 1; + + // Notify the server that the client enables batch write flow control by + // requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons, + // this disables partial retries. + bool mutate_rows_rate_limit = 3; + + // Notify the server that the client enables batch write flow control by + // requesting RateLimitInfo from MutateRowsResponse. With partial retries + // enabled. + bool mutate_rows_rate_limit2 = 5; + + // Notify the server that the client supports the last_scanned_row field + // in ReadRowsResponse for long-running scans. + bool last_scanned_row_responses = 4; + + // Notify the server that the client supports using encoded routing cookie + // strings to retry requests with. + bool routing_cookie = 6; + + // Notify the server that the client supports using retry info back off + // durations to retry requests with. + bool retry_info = 7; + + // Notify the server that the client has client side metrics enabled. + bool client_side_metrics_enabled = 8; + + // Notify the server that the client using Traffic Director endpoint. + bool traffic_director_enabled = 9; + + // Notify the server that the client explicitly opted in for Direct Access. + bool direct_access_requested = 10; + + // If the client can support using BigtablePeerInfo. + bool peer_info = 11; +} diff --git a/handwritten/bigtable/protos/google/bigtable/v2/peer_info.proto b/handwritten/bigtable/protos/google/bigtable/v2/peer_info.proto new file mode 100644 index 00000000000..357af8216ba --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/v2/peer_info.proto @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.v2; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "PeerInfoProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// PeerInfo contains information about the peer that the client is +// connecting to. +message PeerInfo { + // The transport type that the client used to connect to this peer. + enum TransportType { + // The transport type is unknown. + TRANSPORT_TYPE_UNKNOWN = 0; + + // The client connected to this peer via an external network + // (e.g. outside Google Coud). + TRANSPORT_TYPE_EXTERNAL = 1; + + // The client connected to this peer via CloudPath. + TRANSPORT_TYPE_CLOUD_PATH = 2; + + // The client connected to this peer via DirectAccess. + TRANSPORT_TYPE_DIRECT_ACCESS = 3; + + // The client connected to this peer via Bigtable Sessions using an unknown + // transport type. + TRANSPORT_TYPE_SESSION_UNKNOWN = 4; + + // The client connected to this peer via Bigtable Sessions on an external + // network (e.g. outside Google Cloud). + TRANSPORT_TYPE_SESSION_EXTERNAL = 5; + + // The client connected to this peer via Bigtable Sessions using CloudPath. + TRANSPORT_TYPE_SESSION_CLOUD_PATH = 6; + + // The client connected to this peer via Bigtable Sessions using + // DirectAccess. + TRANSPORT_TYPE_SESSION_DIRECT_ACCESS = 7; + } + + // An opaque identifier for the Google Frontend which serviced this request. + // Only set when not using DirectAccess. + int64 google_frontend_id = 1; + + // An opaque identifier for the application frontend which serviced this + // request. + int64 application_frontend_id = 2; + + // The Cloud zone of the application frontend that served this request. + string application_frontend_zone = 3; + + // The subzone of the application frontend that served this request, e.g. an + // identifier for where within the zone the application frontend is. + string application_frontend_subzone = 4; + + TransportType transport_type = 5; +} diff --git a/handwritten/bigtable/protos/google/bigtable/v2/request_stats.proto b/handwritten/bigtable/protos/google/bigtable/v2/request_stats.proto new file mode 100644 index 00000000000..0049f8f73e3 --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/v2/request_stats.proto @@ -0,0 +1,112 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.v2; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "RequestStatsProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// +// Messages related to RequestStats, part of the Query Stats feature, that can +// help understand the performance of requests. +// +// The layout of requests below is as follows: +// * RequestStats serves as the top-level container for statistics and +// measures related to Bigtable requests. This common object is returned as +// part of methods in the Data API. +// * RequestStats contains multiple *views* of related data, chosen by an +// option in the source Data API method. The view that is returned is +// designed to have all submessages (and their submessages, and so on) +// filled-in, to provide a comprehensive selection of statistics and +// measures related to the requested view. + +// ReadIterationStats captures information about the iteration of rows or cells +// over the course of a read, e.g. how many results were scanned in a read +// operation versus the results returned. +message ReadIterationStats { + // The rows seen (scanned) as part of the request. This includes the count of + // rows returned, as captured below. + int64 rows_seen_count = 1; + + // The rows returned as part of the request. + int64 rows_returned_count = 2; + + // The cells seen (scanned) as part of the request. This includes the count of + // cells returned, as captured below. + int64 cells_seen_count = 3; + + // The cells returned as part of the request. + int64 cells_returned_count = 4; +} + +// RequestLatencyStats provides a measurement of the latency of the request as +// it interacts with different systems over its lifetime, e.g. how long the +// request took to execute within a frontend server. +message RequestLatencyStats { + // The latency measured by the frontend server handling this request, from + // when the request was received, to when this value is sent back in the + // response. For more context on the component that is measuring this latency, + // see: https://cloud.google.com/bigtable/docs/overview + // + // Note: This value may be slightly shorter than the value reported into + // aggregate latency metrics in Monitoring for this request + // (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value + // needs to be sent in the response before the latency measurement including + // that transmission is finalized. + // + // Note: This value includes the end-to-end latency of contacting nodes in + // the targeted cluster, e.g. measuring from when the first byte arrives at + // the frontend server, to when this value is sent back as the last value in + // the response, including any latency incurred by contacting nodes, waiting + // for results from nodes, and finally sending results from nodes back to the + // caller. + google.protobuf.Duration frontend_server_latency = 1; +} + +// FullReadStatsView captures all known information about a read. +message FullReadStatsView { + // Iteration stats describe how efficient the read is, e.g. comparing + // rows seen vs. rows returned or cells seen vs cells returned can provide an + // indication of read efficiency (the higher the ratio of seen to retuned the + // better). + ReadIterationStats read_iteration_stats = 1; + + // Request latency stats describe the time taken to complete a request, from + // the server side. + RequestLatencyStats request_latency_stats = 2; +} + +// RequestStats is the container for additional information pertaining to a +// single request, helpful for evaluating the performance of the sent request. +// Currently, the following method is supported: google.bigtable.v2.ReadRows +message RequestStats { + // Information pertaining to each request type received. The type is chosen + // based on the requested view. + // + // See the messages above for additional context. + oneof stats_view { + // Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL + // view, see package google.bigtable.v2. + FullReadStatsView full_read_stats_view = 1; + } +} diff --git a/handwritten/bigtable/protos/google/bigtable/v2/response_params.proto b/handwritten/bigtable/protos/google/bigtable/v2/response_params.proto new file mode 100644 index 00000000000..6eedfdf735d --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/v2/response_params.proto @@ -0,0 +1,38 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.v2; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "ResponseParamsProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// Response metadata proto +message ResponseParams { + // The cloud bigtable zone associated with the cluster. + optional string zone_id = 1; + + // Identifier for a cluster that represents set of + // bigtable resources. + optional string cluster_id = 2; + + // The AFE ID for the AFE that is served this request. + optional int64 afe_id = 3; +} diff --git a/handwritten/bigtable/protos/google/bigtable/v2/types.proto b/handwritten/bigtable/protos/google/bigtable/v2/types.proto new file mode 100644 index 00000000000..607cf2bea9d --- /dev/null +++ b/handwritten/bigtable/protos/google/bigtable/v2/types.proto @@ -0,0 +1,465 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.v2; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "TypesProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// `Type` represents the type of data that is written to, read from, or stored +// in Bigtable. It is heavily based on the GoogleSQL standard to help maintain +// familiarity and consistency across products and features. +// +// For compatibility with Bigtable's existing untyped APIs, each `Type` includes +// an `Encoding` which describes how to convert to or from the underlying data. +// +// Each encoding can operate in one of two modes: +// +// - Sorted: In this mode, Bigtable guarantees that `Encode(X) <= Encode(Y)` +// if and only if `X <= Y`. This is useful anywhere sort order is important, +// for example when encoding keys. +// - Distinct: In this mode, Bigtable guarantees that if `X != Y` then +// `Encode(X) != Encode(Y)`. However, the converse is not guaranteed. For +// example, both `{'foo': '1', 'bar': '2'}` and `{'bar': '2', 'foo': '1'}` +// are valid encodings of the same JSON value. +// +// The API clearly documents which mode is used wherever an encoding can be +// configured. Each encoding also documents which values are supported in which +// modes. For example, when encoding INT64 as a numeric STRING, negative numbers +// cannot be encoded in sorted mode. This is because `INT64(1) > INT64(-1)`, but +// `STRING("-00001") > STRING("00001")`. +message Type { + // Bytes + // Values of type `Bytes` are stored in `Value.bytes_value`. + message Bytes { + // Rules used to convert to or from lower level types. + message Encoding { + // Leaves the value as-is. + // + // Sorted mode: all values are supported. + // + // Distinct mode: all values are supported. + message Raw { + // If set, allows NULL values to be encoded as the empty string "". + // + // The actual empty string, or any value which only contains the + // null byte `0x00`, has one more null byte appended. + bool escape_nulls = 1; + } + + // Which encoding to use. + oneof encoding { + // Use `Raw` encoding. + Raw raw = 1; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // String + // Values of type `String` are stored in `Value.string_value`. + message String { + // Rules used to convert to or from lower level types. + message Encoding { + // Deprecated: prefer the equivalent `Utf8Bytes`. + message Utf8Raw { + option deprecated = true; + } + + // UTF-8 encoding. + // + // Sorted mode: + // - All values are supported. + // - Code point order is preserved. + // + // Distinct mode: all values are supported. + // + // Compatible with: + // + // - BigQuery `TEXT` encoding + // - HBase `Bytes.toBytes` + // - Java `String#getBytes(StandardCharsets.UTF_8)` + message Utf8Bytes { + // Single-character escape sequence used to support NULL values. + // + // If set, allows NULL values to be encoded as the empty string "". + // + // The actual empty string, or any value where every character equals + // `null_escape_char`, has one more `null_escape_char` appended. + // + // If `null_escape_char` is set and does not equal the ASCII null + // character `0x00`, then the encoding will not support sorted mode. + // + // . + string null_escape_char = 1; + } + + // Which encoding to use. + oneof encoding { + // Deprecated: if set, converts to an empty `utf8_bytes`. + Utf8Raw utf8_raw = 1 [deprecated = true]; + + // Use `Utf8Bytes` encoding. + Utf8Bytes utf8_bytes = 2; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // Int64 + // Values of type `Int64` are stored in `Value.int_value`. + message Int64 { + // Rules used to convert to or from lower level types. + message Encoding { + // Encodes the value as an 8-byte big-endian two's complement value. + // + // Sorted mode: non-negative values are supported. + // + // Distinct mode: all values are supported. + // + // Compatible with: + // + // - BigQuery `BINARY` encoding + // - HBase `Bytes.toBytes` + // - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN` + message BigEndianBytes { + // Deprecated: ignored if set. + Bytes bytes_type = 1 [deprecated = true]; + } + + // Encodes the value in a variable length binary format of up to 10 bytes. + // Values that are closer to zero use fewer bytes. + // + // Sorted mode: all values are supported. + // + // Distinct mode: all values are supported. + message OrderedCodeBytes {} + + // Which encoding to use. + oneof encoding { + // Use `BigEndianBytes` encoding. + BigEndianBytes big_endian_bytes = 1; + + // Use `OrderedCodeBytes` encoding. + OrderedCodeBytes ordered_code_bytes = 2; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // bool + // Values of type `Bool` are stored in `Value.bool_value`. + message Bool {} + + // Float32 + // Values of type `Float32` are stored in `Value.float_value`. + message Float32 {} + + // Float64 + // Values of type `Float64` are stored in `Value.float_value`. + message Float64 {} + + // Timestamp + // Values of type `Timestamp` are stored in `Value.timestamp_value`. + message Timestamp { + // Rules used to convert to or from lower level types. + message Encoding { + // Which encoding to use. + oneof encoding { + // Encodes the number of microseconds since the Unix epoch using the + // given `Int64` encoding. Values must be microsecond-aligned. + // + // Compatible with: + // + // - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS` + Int64.Encoding unix_micros_int64 = 1; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // Date + // Values of type `Date` are stored in `Value.date_value`. + message Date {} + + // A structured data value, consisting of fields which map to dynamically + // typed values. + // Values of type `Struct` are stored in `Value.array_value` where entries are + // in the same order and number as `field_types`. + message Struct { + // A struct field and its type. + message Field { + // The field name (optional). Fields without a `field_name` are considered + // anonymous and cannot be referenced by name. + string field_name = 1; + + // The type of values in this field. + Type type = 2; + } + + // Rules used to convert to or from lower level types. + message Encoding { + // Uses the encoding of `fields[0].type` as-is. + // Only valid if `fields.size == 1`. + message Singleton {} + + // Fields are encoded independently and concatenated with a configurable + // `delimiter` in between. + // + // A struct with no fields defined is encoded as a single `delimiter`. + // + // Sorted mode: + // + // - Fields are encoded in sorted mode. + // - Encoded field values must not contain any bytes <= `delimiter[0]` + // - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if + // `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first. + // + // Distinct mode: + // + // - Fields are encoded in distinct mode. + // - Encoded field values must not contain `delimiter[0]`. + message DelimitedBytes { + // Byte sequence used to delimit concatenated fields. The delimiter must + // contain at least 1 character and at most 50 characters. + bytes delimiter = 1; + } + + // Fields are encoded independently and concatenated with the fixed byte + // pair `{0x00, 0x01}` in between. + // + // Any null `(0x00)` byte in an encoded field is replaced by the fixed + // byte pair `{0x00, 0xFF}`. + // + // Fields that encode to the empty string "" have special handling: + // + // - If *every* field encodes to "", or if the STRUCT has no fields + // defined, then the STRUCT is encoded as the fixed byte pair + // `{0x00, 0x00}`. + // - Otherwise, the STRUCT only encodes until the last non-empty field, + // omitting any trailing empty fields. Any empty fields that aren't + // omitted are replaced with the fixed byte pair `{0x00, 0x00}`. + // + // Examples: + // + // ``` + // - STRUCT() -> "\00\00" + // - STRUCT("") -> "\00\00" + // - STRUCT("", "") -> "\00\00" + // - STRUCT("", "B") -> "\00\00" + "\00\01" + "B" + // - STRUCT("A", "") -> "A" + // - STRUCT("", "B", "") -> "\00\00" + "\00\01" + "B" + // - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C" + // ``` + // + // + // Since null bytes are always escaped, this encoding can cause size + // blowup for encodings like `Int64.BigEndianBytes` that are likely to + // produce many such bytes. + // + // Sorted mode: + // + // - Fields are encoded in sorted mode. + // - All values supported by the field encodings are allowed + // - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if + // `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first. + // + // Distinct mode: + // + // - Fields are encoded in distinct mode. + // - All values supported by the field encodings are allowed. + message OrderedCodeBytes {} + + // Which encoding to use. + oneof encoding { + // Use `Singleton` encoding. + Singleton singleton = 1; + + // Use `DelimitedBytes` encoding. + DelimitedBytes delimited_bytes = 2; + + // User `OrderedCodeBytes` encoding. + OrderedCodeBytes ordered_code_bytes = 3; + } + } + + // The names and types of the fields in this struct. + repeated Field fields = 1; + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 2; + } + + // A protobuf message type. + // Values of type `Proto` are stored in `Value.bytes_value`. + message Proto { + // The ID of the schema bundle that this proto is defined in. + string schema_bundle_id = 1; + + // The fully qualified name of the protobuf message, including package. In + // the format of "foo.bar.Message". + string message_name = 2; + } + + // A protobuf enum type. + // Values of type `Enum` are stored in `Value.int_value`. + message Enum { + // The ID of the schema bundle that this enum is defined in. + string schema_bundle_id = 1; + + // The fully qualified name of the protobuf enum message, including package. + // In the format of "foo.bar.EnumMessage". + string enum_name = 2; + } + + // An ordered list of elements of a given type. + // Values of type `Array` are stored in `Value.array_value`. + message Array { + // The type of the elements in the array. This must not be `Array`. + Type element_type = 1; + } + + // A mapping of keys to values of a given type. + // Values of type `Map` are stored in a `Value.array_value` where each entry + // is another `Value.array_value` with two elements (the key and the value, + // in that order). + // Normally encoded Map values won't have repeated keys, however, clients are + // expected to handle the case in which they do. If the same key appears + // multiple times, the _last_ value takes precedence. + message Map { + // The type of a map key. + // Only `Bytes`, `String`, and `Int64` are allowed as key types. + Type key_type = 1; + + // The type of the values in a map. + Type value_type = 2; + } + + // A value that combines incremental updates into a summarized value. + // + // Data is never directly written or read using type `Aggregate`. Writes + // provide either the `input_type` or `state_type`, and reads always return + // the `state_type` . + message Aggregate { + // Computes the sum of the input values. + // Allowed input: `Int64` + // State: same as input + message Sum {} + + // Computes the max of the input values. + // Allowed input: `Int64` + // State: same as input + message Max {} + + // Computes the min of the input values. + // Allowed input: `Int64` + // State: same as input + message Min {} + + // Computes an approximate unique count over the input values. When using + // raw data as input, be careful to use a consistent encoding. Otherwise + // the same value encoded differently could count more than once, or two + // distinct values could count as identical. + // Input: Any, or omit for Raw + // State: TBD + // Special state conversions: `Int64` (the unique count estimate) + message HyperLogLogPlusPlusUniqueCount {} + + // Type of the inputs that are accumulated by this `Aggregate`. + // Use `AddInput` mutations to accumulate new inputs. + Type input_type = 1; + + // Output only. Type that holds the internal accumulator state for the + // `Aggregate`. This is a function of the `input_type` and `aggregator` + // chosen. + Type state_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Which aggregator function to use. The configured types must match. + oneof aggregator { + // Sum aggregator. + Sum sum = 4; + + // HyperLogLogPlusPlusUniqueCount aggregator. + HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + + // Max aggregator. + Max max = 6; + + // Min aggregator. + Min min = 7; + } + } + + // The kind of type that this represents. + oneof kind { + // Bytes + Bytes bytes_type = 1; + + // String + String string_type = 2; + + // Int64 + Int64 int64_type = 5; + + // Float32 + Float32 float32_type = 12; + + // Float64 + Float64 float64_type = 9; + + // Bool + Bool bool_type = 8; + + // Timestamp + Timestamp timestamp_type = 10; + + // Date + Date date_type = 11; + + // Aggregate + Aggregate aggregate_type = 6; + + // Struct + Struct struct_type = 7; + + // Array + Array array_type = 3; + + // Map + Map map_type = 4; + + // Proto + Proto proto_type = 13; + + // Enum + Enum enum_type = 14; + } +} diff --git a/handwritten/bigtable/protos/google/cloud/common_resources.proto b/handwritten/bigtable/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..cd44c547460 --- /dev/null +++ b/handwritten/bigtable/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/handwritten/bigtable/protos/protos.d.ts b/handwritten/bigtable/protos/protos.d.ts new file mode 100644 index 00000000000..7562867abdf --- /dev/null +++ b/handwritten/bigtable/protos/protos.d.ts @@ -0,0 +1,42057 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace bigtable. */ + namespace bigtable { + + /** Namespace admin. */ + namespace admin { + + /** Namespace v2. */ + namespace v2 { + + /** Represents a BigtableInstanceAdmin */ + class BigtableInstanceAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new BigtableInstanceAdmin 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 BigtableInstanceAdmin 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): BigtableInstanceAdmin; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.bigtable.admin.v2.ICreateInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.bigtable.admin.v2.ICreateInstanceRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.bigtable.admin.v2.IGetInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.bigtable.admin.v2.IGetInstanceRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.bigtable.admin.v2.IListInstancesRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.bigtable.admin.v2.IListInstancesRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request Instance message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public updateInstance(request: google.bigtable.admin.v2.IInstance, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request Instance message or plain object + * @returns Promise + */ + public updateInstance(request: google.bigtable.admin.v2.IInstance): Promise; + + /** + * Calls PartialUpdateInstance. + * @param request PartialUpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public partialUpdateInstance(request: google.bigtable.admin.v2.IPartialUpdateInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateInstanceCallback): void; + + /** + * Calls PartialUpdateInstance. + * @param request PartialUpdateInstanceRequest message or plain object + * @returns Promise + */ + public partialUpdateInstance(request: google.bigtable.admin.v2.IPartialUpdateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteInstance(request: google.bigtable.admin.v2.IDeleteInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.bigtable.admin.v2.IDeleteInstanceRequest): Promise; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCluster(request: google.bigtable.admin.v2.ICreateClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateClusterCallback): void; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @returns Promise + */ + public createCluster(request: google.bigtable.admin.v2.ICreateClusterRequest): Promise; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Cluster + */ + public getCluster(request: google.bigtable.admin.v2.IGetClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetClusterCallback): void; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @returns Promise + */ + public getCluster(request: google.bigtable.admin.v2.IGetClusterRequest): Promise; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClustersResponse + */ + public listClusters(request: google.bigtable.admin.v2.IListClustersRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListClustersCallback): void; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @returns Promise + */ + public listClusters(request: google.bigtable.admin.v2.IListClustersRequest): Promise; + + /** + * Calls UpdateCluster. + * @param request Cluster message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCluster(request: google.bigtable.admin.v2.ICluster, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateClusterCallback): void; + + /** + * Calls UpdateCluster. + * @param request Cluster message or plain object + * @returns Promise + */ + public updateCluster(request: google.bigtable.admin.v2.ICluster): Promise; + + /** + * Calls PartialUpdateCluster. + * @param request PartialUpdateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public partialUpdateCluster(request: google.bigtable.admin.v2.IPartialUpdateClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateClusterCallback): void; + + /** + * Calls PartialUpdateCluster. + * @param request PartialUpdateClusterRequest message or plain object + * @returns Promise + */ + public partialUpdateCluster(request: google.bigtable.admin.v2.IPartialUpdateClusterRequest): Promise; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCluster(request: google.bigtable.admin.v2.IDeleteClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteClusterCallback): void; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @returns Promise + */ + public deleteCluster(request: google.bigtable.admin.v2.IDeleteClusterRequest): Promise; + + /** + * Calls CreateAppProfile. + * @param request CreateAppProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AppProfile + */ + public createAppProfile(request: google.bigtable.admin.v2.ICreateAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateAppProfileCallback): void; + + /** + * Calls CreateAppProfile. + * @param request CreateAppProfileRequest message or plain object + * @returns Promise + */ + public createAppProfile(request: google.bigtable.admin.v2.ICreateAppProfileRequest): Promise; + + /** + * Calls GetAppProfile. + * @param request GetAppProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AppProfile + */ + public getAppProfile(request: google.bigtable.admin.v2.IGetAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetAppProfileCallback): void; + + /** + * Calls GetAppProfile. + * @param request GetAppProfileRequest message or plain object + * @returns Promise + */ + public getAppProfile(request: google.bigtable.admin.v2.IGetAppProfileRequest): Promise; + + /** + * Calls ListAppProfiles. + * @param request ListAppProfilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAppProfilesResponse + */ + public listAppProfiles(request: google.bigtable.admin.v2.IListAppProfilesRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListAppProfilesCallback): void; + + /** + * Calls ListAppProfiles. + * @param request ListAppProfilesRequest message or plain object + * @returns Promise + */ + public listAppProfiles(request: google.bigtable.admin.v2.IListAppProfilesRequest): Promise; + + /** + * Calls UpdateAppProfile. + * @param request UpdateAppProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateAppProfile(request: google.bigtable.admin.v2.IUpdateAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateAppProfileCallback): void; + + /** + * Calls UpdateAppProfile. + * @param request UpdateAppProfileRequest message or plain object + * @returns Promise + */ + public updateAppProfile(request: google.bigtable.admin.v2.IUpdateAppProfileRequest): Promise; + + /** + * Calls DeleteAppProfile. + * @param request DeleteAppProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAppProfile(request: google.bigtable.admin.v2.IDeleteAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteAppProfileCallback): void; + + /** + * Calls DeleteAppProfile. + * @param request DeleteAppProfileRequest message or plain object + * @returns Promise + */ + public deleteAppProfile(request: google.bigtable.admin.v2.IDeleteAppProfileRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls ListHotTablets. + * @param request ListHotTabletsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListHotTabletsResponse + */ + public listHotTablets(request: google.bigtable.admin.v2.IListHotTabletsRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListHotTabletsCallback): void; + + /** + * Calls ListHotTablets. + * @param request ListHotTabletsRequest message or plain object + * @returns Promise + */ + public listHotTablets(request: google.bigtable.admin.v2.IListHotTabletsRequest): Promise; + + /** + * Calls CreateLogicalView. + * @param request CreateLogicalViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createLogicalView(request: google.bigtable.admin.v2.ICreateLogicalViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateLogicalViewCallback): void; + + /** + * Calls CreateLogicalView. + * @param request CreateLogicalViewRequest message or plain object + * @returns Promise + */ + public createLogicalView(request: google.bigtable.admin.v2.ICreateLogicalViewRequest): Promise; + + /** + * Calls GetLogicalView. + * @param request GetLogicalViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogicalView + */ + public getLogicalView(request: google.bigtable.admin.v2.IGetLogicalViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetLogicalViewCallback): void; + + /** + * Calls GetLogicalView. + * @param request GetLogicalViewRequest message or plain object + * @returns Promise + */ + public getLogicalView(request: google.bigtable.admin.v2.IGetLogicalViewRequest): Promise; + + /** + * Calls ListLogicalViews. + * @param request ListLogicalViewsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListLogicalViewsResponse + */ + public listLogicalViews(request: google.bigtable.admin.v2.IListLogicalViewsRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListLogicalViewsCallback): void; + + /** + * Calls ListLogicalViews. + * @param request ListLogicalViewsRequest message or plain object + * @returns Promise + */ + public listLogicalViews(request: google.bigtable.admin.v2.IListLogicalViewsRequest): Promise; + + /** + * Calls UpdateLogicalView. + * @param request UpdateLogicalViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateLogicalView(request: google.bigtable.admin.v2.IUpdateLogicalViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateLogicalViewCallback): void; + + /** + * Calls UpdateLogicalView. + * @param request UpdateLogicalViewRequest message or plain object + * @returns Promise + */ + public updateLogicalView(request: google.bigtable.admin.v2.IUpdateLogicalViewRequest): Promise; + + /** + * Calls DeleteLogicalView. + * @param request DeleteLogicalViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteLogicalView(request: google.bigtable.admin.v2.IDeleteLogicalViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteLogicalViewCallback): void; + + /** + * Calls DeleteLogicalView. + * @param request DeleteLogicalViewRequest message or plain object + * @returns Promise + */ + public deleteLogicalView(request: google.bigtable.admin.v2.IDeleteLogicalViewRequest): Promise; + + /** + * Calls CreateMaterializedView. + * @param request CreateMaterializedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createMaterializedView(request: google.bigtable.admin.v2.ICreateMaterializedViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateMaterializedViewCallback): void; + + /** + * Calls CreateMaterializedView. + * @param request CreateMaterializedViewRequest message or plain object + * @returns Promise + */ + public createMaterializedView(request: google.bigtable.admin.v2.ICreateMaterializedViewRequest): Promise; + + /** + * Calls GetMaterializedView. + * @param request GetMaterializedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MaterializedView + */ + public getMaterializedView(request: google.bigtable.admin.v2.IGetMaterializedViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetMaterializedViewCallback): void; + + /** + * Calls GetMaterializedView. + * @param request GetMaterializedViewRequest message or plain object + * @returns Promise + */ + public getMaterializedView(request: google.bigtable.admin.v2.IGetMaterializedViewRequest): Promise; + + /** + * Calls ListMaterializedViews. + * @param request ListMaterializedViewsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMaterializedViewsResponse + */ + public listMaterializedViews(request: google.bigtable.admin.v2.IListMaterializedViewsRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListMaterializedViewsCallback): void; + + /** + * Calls ListMaterializedViews. + * @param request ListMaterializedViewsRequest message or plain object + * @returns Promise + */ + public listMaterializedViews(request: google.bigtable.admin.v2.IListMaterializedViewsRequest): Promise; + + /** + * Calls UpdateMaterializedView. + * @param request UpdateMaterializedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateMaterializedView(request: google.bigtable.admin.v2.IUpdateMaterializedViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateMaterializedViewCallback): void; + + /** + * Calls UpdateMaterializedView. + * @param request UpdateMaterializedViewRequest message or plain object + * @returns Promise + */ + public updateMaterializedView(request: google.bigtable.admin.v2.IUpdateMaterializedViewRequest): Promise; + + /** + * Calls DeleteMaterializedView. + * @param request DeleteMaterializedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteMaterializedView(request: google.bigtable.admin.v2.IDeleteMaterializedViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteMaterializedViewCallback): void; + + /** + * Calls DeleteMaterializedView. + * @param request DeleteMaterializedViewRequest message or plain object + * @returns Promise + */ + public deleteMaterializedView(request: google.bigtable.admin.v2.IDeleteMaterializedViewRequest): Promise; + } + + namespace BigtableInstanceAdmin { + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Instance) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Instance) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|partialUpdateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type PartialUpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteInstance}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getCluster}. + * @param error Error, if any + * @param [response] Cluster + */ + type GetClusterCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Cluster) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse + */ + type ListClustersCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListClustersResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|partialUpdateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type PartialUpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteCluster}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteClusterCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createAppProfile}. + * @param error Error, if any + * @param [response] AppProfile + */ + type CreateAppProfileCallback = (error: (Error|null), response?: google.bigtable.admin.v2.AppProfile) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getAppProfile}. + * @param error Error, if any + * @param [response] AppProfile + */ + type GetAppProfileCallback = (error: (Error|null), response?: google.bigtable.admin.v2.AppProfile) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listAppProfiles}. + * @param error Error, if any + * @param [response] ListAppProfilesResponse + */ + type ListAppProfilesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListAppProfilesResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateAppProfile}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateAppProfileCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteAppProfile}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAppProfileCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listHotTablets}. + * @param error Error, if any + * @param [response] ListHotTabletsResponse + */ + type ListHotTabletsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListHotTabletsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createLogicalView}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateLogicalViewCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getLogicalView}. + * @param error Error, if any + * @param [response] LogicalView + */ + type GetLogicalViewCallback = (error: (Error|null), response?: google.bigtable.admin.v2.LogicalView) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listLogicalViews}. + * @param error Error, if any + * @param [response] ListLogicalViewsResponse + */ + type ListLogicalViewsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListLogicalViewsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateLogicalView}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateLogicalViewCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteLogicalView}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteLogicalViewCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createMaterializedView}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateMaterializedViewCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getMaterializedView}. + * @param error Error, if any + * @param [response] MaterializedView + */ + type GetMaterializedViewCallback = (error: (Error|null), response?: google.bigtable.admin.v2.MaterializedView) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listMaterializedViews}. + * @param error Error, if any + * @param [response] ListMaterializedViewsResponse + */ + type ListMaterializedViewsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListMaterializedViewsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateMaterializedView}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateMaterializedViewCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteMaterializedView}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteMaterializedViewCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.bigtable.admin.v2.IInstance|null); + + /** CreateInstanceRequest clusters */ + clusters?: ({ [k: string]: google.bigtable.admin.v2.ICluster }|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.bigtable.admin.v2.IInstance|null); + + /** CreateInstanceRequest clusters. */ + public clusters: { [k: string]: google.bigtable.admin.v2.ICluster }; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateInstanceRequest): google.bigtable.admin.v2.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetInstanceRequest): google.bigtable.admin.v2.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListInstancesRequest): google.bigtable.admin.v2.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.bigtable.admin.v2.IInstance[]|null); + + /** ListInstancesResponse failedLocations */ + failedLocations?: (string[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.bigtable.admin.v2.IInstance[]; + + /** ListInstancesResponse failedLocations. */ + public failedLocations: string[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListInstancesResponse): google.bigtable.admin.v2.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartialUpdateInstanceRequest. */ + interface IPartialUpdateInstanceRequest { + + /** PartialUpdateInstanceRequest instance */ + instance?: (google.bigtable.admin.v2.IInstance|null); + + /** PartialUpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a PartialUpdateInstanceRequest. */ + class PartialUpdateInstanceRequest implements IPartialUpdateInstanceRequest { + + /** + * Constructs a new PartialUpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IPartialUpdateInstanceRequest); + + /** PartialUpdateInstanceRequest instance. */ + public instance?: (google.bigtable.admin.v2.IInstance|null); + + /** PartialUpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new PartialUpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PartialUpdateInstanceRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IPartialUpdateInstanceRequest): google.bigtable.admin.v2.PartialUpdateInstanceRequest; + + /** + * Encodes the specified PartialUpdateInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateInstanceRequest.verify|verify} messages. + * @param message PartialUpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IPartialUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartialUpdateInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateInstanceRequest.verify|verify} messages. + * @param message PartialUpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IPartialUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartialUpdateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartialUpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.PartialUpdateInstanceRequest; + + /** + * Decodes a PartialUpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartialUpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.PartialUpdateInstanceRequest; + + /** + * Verifies a PartialUpdateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartialUpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartialUpdateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.PartialUpdateInstanceRequest; + + /** + * Creates a plain object from a PartialUpdateInstanceRequest message. Also converts values to other types if specified. + * @param message PartialUpdateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.PartialUpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartialUpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartialUpdateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteInstanceRequest): google.bigtable.admin.v2.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClusterRequest. */ + interface ICreateClusterRequest { + + /** CreateClusterRequest parent */ + parent?: (string|null); + + /** CreateClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateClusterRequest cluster */ + cluster?: (google.bigtable.admin.v2.ICluster|null); + } + + /** Represents a CreateClusterRequest. */ + class CreateClusterRequest implements ICreateClusterRequest { + + /** + * Constructs a new CreateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateClusterRequest); + + /** CreateClusterRequest parent. */ + public parent: string; + + /** CreateClusterRequest clusterId. */ + public clusterId: string; + + /** CreateClusterRequest cluster. */ + public cluster?: (google.bigtable.admin.v2.ICluster|null); + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateClusterRequest): google.bigtable.admin.v2.CreateClusterRequest; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateClusterRequest; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateClusterRequest; + + /** + * Verifies a CreateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateClusterRequest; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @param message CreateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetClusterRequest. */ + interface IGetClusterRequest { + + /** GetClusterRequest name */ + name?: (string|null); + } + + /** Represents a GetClusterRequest. */ + class GetClusterRequest implements IGetClusterRequest { + + /** + * Constructs a new GetClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetClusterRequest); + + /** GetClusterRequest name. */ + public name: string; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClusterRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetClusterRequest): google.bigtable.admin.v2.GetClusterRequest; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetClusterRequest; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetClusterRequest; + + /** + * Verifies a GetClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetClusterRequest; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @param message GetClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersRequest. */ + interface IListClustersRequest { + + /** ListClustersRequest parent */ + parent?: (string|null); + + /** ListClustersRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListClustersRequest. */ + class ListClustersRequest implements IListClustersRequest { + + /** + * Constructs a new ListClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListClustersRequest); + + /** ListClustersRequest parent. */ + public parent: string; + + /** ListClustersRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListClustersRequest): google.bigtable.admin.v2.ListClustersRequest; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListClustersRequest; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListClustersRequest; + + /** + * Verifies a ListClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListClustersRequest; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @param message ListClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersResponse. */ + interface IListClustersResponse { + + /** ListClustersResponse clusters */ + clusters?: (google.bigtable.admin.v2.ICluster[]|null); + + /** ListClustersResponse failedLocations */ + failedLocations?: (string[]|null); + + /** ListClustersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListClustersResponse. */ + class ListClustersResponse implements IListClustersResponse { + + /** + * Constructs a new ListClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListClustersResponse); + + /** ListClustersResponse clusters. */ + public clusters: google.bigtable.admin.v2.ICluster[]; + + /** ListClustersResponse failedLocations. */ + public failedLocations: string[]; + + /** ListClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListClustersResponse): google.bigtable.admin.v2.ListClustersResponse; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListClustersResponse; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListClustersResponse; + + /** + * Verifies a ListClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListClustersResponse; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @param message ListClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteClusterRequest. */ + interface IDeleteClusterRequest { + + /** DeleteClusterRequest name */ + name?: (string|null); + } + + /** Represents a DeleteClusterRequest. */ + class DeleteClusterRequest implements IDeleteClusterRequest { + + /** + * Constructs a new DeleteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteClusterRequest); + + /** DeleteClusterRequest name. */ + public name: string; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteClusterRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteClusterRequest): google.bigtable.admin.v2.DeleteClusterRequest; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteClusterRequest; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteClusterRequest; + + /** + * Verifies a DeleteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteClusterRequest; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @param message DeleteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceMetadata. */ + interface ICreateInstanceMetadata { + + /** CreateInstanceMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateInstanceRequest|null); + + /** CreateInstanceMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateInstanceMetadata. */ + class CreateInstanceMetadata implements ICreateInstanceMetadata { + + /** + * Constructs a new CreateInstanceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateInstanceMetadata); + + /** CreateInstanceMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateInstanceRequest|null); + + /** CreateInstanceMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateInstanceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateInstanceMetadata): google.bigtable.admin.v2.CreateInstanceMetadata; + + /** + * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceMetadata.verify|verify} messages. + * @param message CreateInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceMetadata.verify|verify} messages. + * @param message CreateInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateInstanceMetadata; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateInstanceMetadata; + + /** + * Verifies a CreateInstanceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateInstanceMetadata; + + /** + * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. + * @param message CreateInstanceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceMetadata. */ + interface IUpdateInstanceMetadata { + + /** UpdateInstanceMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null); + + /** UpdateInstanceMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateInstanceMetadata. */ + class UpdateInstanceMetadata implements IUpdateInstanceMetadata { + + /** + * Constructs a new UpdateInstanceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateInstanceMetadata); + + /** UpdateInstanceMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null); + + /** UpdateInstanceMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateInstanceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateInstanceMetadata): google.bigtable.admin.v2.UpdateInstanceMetadata; + + /** + * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateInstanceMetadata.verify|verify} messages. + * @param message UpdateInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateInstanceMetadata.verify|verify} messages. + * @param message UpdateInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateInstanceMetadata; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateInstanceMetadata; + + /** + * Verifies an UpdateInstanceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateInstanceMetadata; + + /** + * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. + * @param message UpdateInstanceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClusterMetadata. */ + interface ICreateClusterMetadata { + + /** CreateClusterMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateClusterRequest|null); + + /** CreateClusterMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateClusterMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + + /** CreateClusterMetadata tables */ + tables?: ({ [k: string]: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress }|null); + } + + /** Represents a CreateClusterMetadata. */ + class CreateClusterMetadata implements ICreateClusterMetadata { + + /** + * Constructs a new CreateClusterMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateClusterMetadata); + + /** CreateClusterMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateClusterRequest|null); + + /** CreateClusterMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateClusterMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** CreateClusterMetadata tables. */ + public tables: { [k: string]: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress }; + + /** + * Creates a new CreateClusterMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateClusterMetadata): google.bigtable.admin.v2.CreateClusterMetadata; + + /** + * Encodes the specified CreateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.verify|verify} messages. + * @param message CreateClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.verify|verify} messages. + * @param message CreateClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClusterMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateClusterMetadata; + + /** + * Decodes a CreateClusterMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateClusterMetadata; + + /** + * Verifies a CreateClusterMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateClusterMetadata; + + /** + * Creates a plain object from a CreateClusterMetadata message. Also converts values to other types if specified. + * @param message CreateClusterMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateClusterMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClusterMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClusterMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CreateClusterMetadata { + + /** Properties of a TableProgress. */ + interface ITableProgress { + + /** TableProgress estimatedSizeBytes */ + estimatedSizeBytes?: (number|Long|string|null); + + /** TableProgress estimatedCopiedBytes */ + estimatedCopiedBytes?: (number|Long|string|null); + + /** TableProgress state */ + state?: (google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State|keyof typeof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State|null); + } + + /** Represents a TableProgress. */ + class TableProgress implements ITableProgress { + + /** + * Constructs a new TableProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress); + + /** TableProgress estimatedSizeBytes. */ + public estimatedSizeBytes: (number|Long|string); + + /** TableProgress estimatedCopiedBytes. */ + public estimatedCopiedBytes: (number|Long|string); + + /** TableProgress state. */ + public state: (google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State|keyof typeof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State); + + /** + * Creates a new TableProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns TableProgress instance + */ + public static create(properties?: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress): google.bigtable.admin.v2.CreateClusterMetadata.TableProgress; + + /** + * Encodes the specified TableProgress message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify|verify} messages. + * @param message TableProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableProgress message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify|verify} messages. + * @param message TableProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateClusterMetadata.TableProgress; + + /** + * Decodes a TableProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateClusterMetadata.TableProgress; + + /** + * Verifies a TableProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableProgress + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateClusterMetadata.TableProgress; + + /** + * Creates a plain object from a TableProgress message. Also converts values to other types if specified. + * @param message TableProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateClusterMetadata.TableProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TableProgress { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + COPYING = 2, + COMPLETED = 3, + CANCELLED = 4 + } + } + } + + /** Properties of an UpdateClusterMetadata. */ + interface IUpdateClusterMetadata { + + /** UpdateClusterMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICluster|null); + + /** UpdateClusterMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateClusterMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateClusterMetadata. */ + class UpdateClusterMetadata implements IUpdateClusterMetadata { + + /** + * Constructs a new UpdateClusterMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateClusterMetadata); + + /** UpdateClusterMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICluster|null); + + /** UpdateClusterMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateClusterMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateClusterMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateClusterMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateClusterMetadata): google.bigtable.admin.v2.UpdateClusterMetadata; + + /** + * Encodes the specified UpdateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateClusterMetadata.verify|verify} messages. + * @param message UpdateClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateClusterMetadata.verify|verify} messages. + * @param message UpdateClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateClusterMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateClusterMetadata; + + /** + * Decodes an UpdateClusterMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateClusterMetadata; + + /** + * Verifies an UpdateClusterMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateClusterMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateClusterMetadata; + + /** + * Creates a plain object from an UpdateClusterMetadata message. Also converts values to other types if specified. + * @param message UpdateClusterMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateClusterMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateClusterMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateClusterMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartialUpdateClusterMetadata. */ + interface IPartialUpdateClusterMetadata { + + /** PartialUpdateClusterMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** PartialUpdateClusterMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + + /** PartialUpdateClusterMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.IPartialUpdateClusterRequest|null); + } + + /** Represents a PartialUpdateClusterMetadata. */ + class PartialUpdateClusterMetadata implements IPartialUpdateClusterMetadata { + + /** + * Constructs a new PartialUpdateClusterMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IPartialUpdateClusterMetadata); + + /** PartialUpdateClusterMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** PartialUpdateClusterMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** PartialUpdateClusterMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.IPartialUpdateClusterRequest|null); + + /** + * Creates a new PartialUpdateClusterMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns PartialUpdateClusterMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IPartialUpdateClusterMetadata): google.bigtable.admin.v2.PartialUpdateClusterMetadata; + + /** + * Encodes the specified PartialUpdateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterMetadata.verify|verify} messages. + * @param message PartialUpdateClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IPartialUpdateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartialUpdateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterMetadata.verify|verify} messages. + * @param message PartialUpdateClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IPartialUpdateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartialUpdateClusterMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartialUpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.PartialUpdateClusterMetadata; + + /** + * Decodes a PartialUpdateClusterMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartialUpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.PartialUpdateClusterMetadata; + + /** + * Verifies a PartialUpdateClusterMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartialUpdateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartialUpdateClusterMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.PartialUpdateClusterMetadata; + + /** + * Creates a plain object from a PartialUpdateClusterMetadata message. Also converts values to other types if specified. + * @param message PartialUpdateClusterMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.PartialUpdateClusterMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartialUpdateClusterMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartialUpdateClusterMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartialUpdateClusterRequest. */ + interface IPartialUpdateClusterRequest { + + /** PartialUpdateClusterRequest cluster */ + cluster?: (google.bigtable.admin.v2.ICluster|null); + + /** PartialUpdateClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a PartialUpdateClusterRequest. */ + class PartialUpdateClusterRequest implements IPartialUpdateClusterRequest { + + /** + * Constructs a new PartialUpdateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IPartialUpdateClusterRequest); + + /** PartialUpdateClusterRequest cluster. */ + public cluster?: (google.bigtable.admin.v2.ICluster|null); + + /** PartialUpdateClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new PartialUpdateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PartialUpdateClusterRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IPartialUpdateClusterRequest): google.bigtable.admin.v2.PartialUpdateClusterRequest; + + /** + * Encodes the specified PartialUpdateClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterRequest.verify|verify} messages. + * @param message PartialUpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IPartialUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartialUpdateClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterRequest.verify|verify} messages. + * @param message PartialUpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IPartialUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartialUpdateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartialUpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.PartialUpdateClusterRequest; + + /** + * Decodes a PartialUpdateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartialUpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.PartialUpdateClusterRequest; + + /** + * Verifies a PartialUpdateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartialUpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartialUpdateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.PartialUpdateClusterRequest; + + /** + * Creates a plain object from a PartialUpdateClusterRequest message. Also converts values to other types if specified. + * @param message PartialUpdateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.PartialUpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartialUpdateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartialUpdateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAppProfileRequest. */ + interface ICreateAppProfileRequest { + + /** CreateAppProfileRequest parent */ + parent?: (string|null); + + /** CreateAppProfileRequest appProfileId */ + appProfileId?: (string|null); + + /** CreateAppProfileRequest appProfile */ + appProfile?: (google.bigtable.admin.v2.IAppProfile|null); + + /** CreateAppProfileRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents a CreateAppProfileRequest. */ + class CreateAppProfileRequest implements ICreateAppProfileRequest { + + /** + * Constructs a new CreateAppProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateAppProfileRequest); + + /** CreateAppProfileRequest parent. */ + public parent: string; + + /** CreateAppProfileRequest appProfileId. */ + public appProfileId: string; + + /** CreateAppProfileRequest appProfile. */ + public appProfile?: (google.bigtable.admin.v2.IAppProfile|null); + + /** CreateAppProfileRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new CreateAppProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAppProfileRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateAppProfileRequest): google.bigtable.admin.v2.CreateAppProfileRequest; + + /** + * Encodes the specified CreateAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateAppProfileRequest.verify|verify} messages. + * @param message CreateAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAppProfileRequest.verify|verify} messages. + * @param message CreateAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAppProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateAppProfileRequest; + + /** + * Decodes a CreateAppProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateAppProfileRequest; + + /** + * Verifies a CreateAppProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAppProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateAppProfileRequest; + + /** + * Creates a plain object from a CreateAppProfileRequest message. Also converts values to other types if specified. + * @param message CreateAppProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAppProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAppProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAppProfileRequest. */ + interface IGetAppProfileRequest { + + /** GetAppProfileRequest name */ + name?: (string|null); + } + + /** Represents a GetAppProfileRequest. */ + class GetAppProfileRequest implements IGetAppProfileRequest { + + /** + * Constructs a new GetAppProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetAppProfileRequest); + + /** GetAppProfileRequest name. */ + public name: string; + + /** + * Creates a new GetAppProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAppProfileRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetAppProfileRequest): google.bigtable.admin.v2.GetAppProfileRequest; + + /** + * Encodes the specified GetAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetAppProfileRequest.verify|verify} messages. + * @param message GetAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetAppProfileRequest.verify|verify} messages. + * @param message GetAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAppProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetAppProfileRequest; + + /** + * Decodes a GetAppProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetAppProfileRequest; + + /** + * Verifies a GetAppProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAppProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetAppProfileRequest; + + /** + * Creates a plain object from a GetAppProfileRequest message. Also converts values to other types if specified. + * @param message GetAppProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAppProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAppProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppProfilesRequest. */ + interface IListAppProfilesRequest { + + /** ListAppProfilesRequest parent */ + parent?: (string|null); + + /** ListAppProfilesRequest pageSize */ + pageSize?: (number|null); + + /** ListAppProfilesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAppProfilesRequest. */ + class ListAppProfilesRequest implements IListAppProfilesRequest { + + /** + * Constructs a new ListAppProfilesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListAppProfilesRequest); + + /** ListAppProfilesRequest parent. */ + public parent: string; + + /** ListAppProfilesRequest pageSize. */ + public pageSize: number; + + /** ListAppProfilesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAppProfilesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppProfilesRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListAppProfilesRequest): google.bigtable.admin.v2.ListAppProfilesRequest; + + /** + * Encodes the specified ListAppProfilesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesRequest.verify|verify} messages. + * @param message ListAppProfilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListAppProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppProfilesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesRequest.verify|verify} messages. + * @param message ListAppProfilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListAppProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppProfilesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListAppProfilesRequest; + + /** + * Decodes a ListAppProfilesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListAppProfilesRequest; + + /** + * Verifies a ListAppProfilesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppProfilesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppProfilesRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListAppProfilesRequest; + + /** + * Creates a plain object from a ListAppProfilesRequest message. Also converts values to other types if specified. + * @param message ListAppProfilesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListAppProfilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppProfilesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppProfilesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppProfilesResponse. */ + interface IListAppProfilesResponse { + + /** ListAppProfilesResponse appProfiles */ + appProfiles?: (google.bigtable.admin.v2.IAppProfile[]|null); + + /** ListAppProfilesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAppProfilesResponse failedLocations */ + failedLocations?: (string[]|null); + } + + /** Represents a ListAppProfilesResponse. */ + class ListAppProfilesResponse implements IListAppProfilesResponse { + + /** + * Constructs a new ListAppProfilesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListAppProfilesResponse); + + /** ListAppProfilesResponse appProfiles. */ + public appProfiles: google.bigtable.admin.v2.IAppProfile[]; + + /** ListAppProfilesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAppProfilesResponse failedLocations. */ + public failedLocations: string[]; + + /** + * Creates a new ListAppProfilesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppProfilesResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListAppProfilesResponse): google.bigtable.admin.v2.ListAppProfilesResponse; + + /** + * Encodes the specified ListAppProfilesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesResponse.verify|verify} messages. + * @param message ListAppProfilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListAppProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppProfilesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesResponse.verify|verify} messages. + * @param message ListAppProfilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListAppProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppProfilesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListAppProfilesResponse; + + /** + * Decodes a ListAppProfilesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListAppProfilesResponse; + + /** + * Verifies a ListAppProfilesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppProfilesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppProfilesResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListAppProfilesResponse; + + /** + * Creates a plain object from a ListAppProfilesResponse message. Also converts values to other types if specified. + * @param message ListAppProfilesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListAppProfilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppProfilesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppProfilesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAppProfileRequest. */ + interface IUpdateAppProfileRequest { + + /** UpdateAppProfileRequest appProfile */ + appProfile?: (google.bigtable.admin.v2.IAppProfile|null); + + /** UpdateAppProfileRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAppProfileRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents an UpdateAppProfileRequest. */ + class UpdateAppProfileRequest implements IUpdateAppProfileRequest { + + /** + * Constructs a new UpdateAppProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateAppProfileRequest); + + /** UpdateAppProfileRequest appProfile. */ + public appProfile?: (google.bigtable.admin.v2.IAppProfile|null); + + /** UpdateAppProfileRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAppProfileRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new UpdateAppProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAppProfileRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateAppProfileRequest): google.bigtable.admin.v2.UpdateAppProfileRequest; + + /** + * Encodes the specified UpdateAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileRequest.verify|verify} messages. + * @param message UpdateAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileRequest.verify|verify} messages. + * @param message UpdateAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAppProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateAppProfileRequest; + + /** + * Decodes an UpdateAppProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateAppProfileRequest; + + /** + * Verifies an UpdateAppProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAppProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateAppProfileRequest; + + /** + * Creates a plain object from an UpdateAppProfileRequest message. Also converts values to other types if specified. + * @param message UpdateAppProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAppProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAppProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAppProfileRequest. */ + interface IDeleteAppProfileRequest { + + /** DeleteAppProfileRequest name */ + name?: (string|null); + + /** DeleteAppProfileRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents a DeleteAppProfileRequest. */ + class DeleteAppProfileRequest implements IDeleteAppProfileRequest { + + /** + * Constructs a new DeleteAppProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteAppProfileRequest); + + /** DeleteAppProfileRequest name. */ + public name: string; + + /** DeleteAppProfileRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new DeleteAppProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAppProfileRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteAppProfileRequest): google.bigtable.admin.v2.DeleteAppProfileRequest; + + /** + * Encodes the specified DeleteAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteAppProfileRequest.verify|verify} messages. + * @param message DeleteAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteAppProfileRequest.verify|verify} messages. + * @param message DeleteAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAppProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteAppProfileRequest; + + /** + * Decodes a DeleteAppProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteAppProfileRequest; + + /** + * Verifies a DeleteAppProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAppProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteAppProfileRequest; + + /** + * Creates a plain object from a DeleteAppProfileRequest message. Also converts values to other types if specified. + * @param message DeleteAppProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAppProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAppProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAppProfileMetadata. */ + interface IUpdateAppProfileMetadata { + } + + /** Represents an UpdateAppProfileMetadata. */ + class UpdateAppProfileMetadata implements IUpdateAppProfileMetadata { + + /** + * Constructs a new UpdateAppProfileMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateAppProfileMetadata); + + /** + * Creates a new UpdateAppProfileMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAppProfileMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateAppProfileMetadata): google.bigtable.admin.v2.UpdateAppProfileMetadata; + + /** + * Encodes the specified UpdateAppProfileMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileMetadata.verify|verify} messages. + * @param message UpdateAppProfileMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateAppProfileMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAppProfileMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileMetadata.verify|verify} messages. + * @param message UpdateAppProfileMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateAppProfileMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAppProfileMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAppProfileMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateAppProfileMetadata; + + /** + * Decodes an UpdateAppProfileMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAppProfileMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateAppProfileMetadata; + + /** + * Verifies an UpdateAppProfileMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAppProfileMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAppProfileMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateAppProfileMetadata; + + /** + * Creates a plain object from an UpdateAppProfileMetadata message. Also converts values to other types if specified. + * @param message UpdateAppProfileMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateAppProfileMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAppProfileMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAppProfileMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListHotTabletsRequest. */ + interface IListHotTabletsRequest { + + /** ListHotTabletsRequest parent */ + parent?: (string|null); + + /** ListHotTabletsRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ListHotTabletsRequest endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ListHotTabletsRequest pageSize */ + pageSize?: (number|null); + + /** ListHotTabletsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListHotTabletsRequest. */ + class ListHotTabletsRequest implements IListHotTabletsRequest { + + /** + * Constructs a new ListHotTabletsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListHotTabletsRequest); + + /** ListHotTabletsRequest parent. */ + public parent: string; + + /** ListHotTabletsRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ListHotTabletsRequest endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ListHotTabletsRequest pageSize. */ + public pageSize: number; + + /** ListHotTabletsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListHotTabletsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHotTabletsRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListHotTabletsRequest): google.bigtable.admin.v2.ListHotTabletsRequest; + + /** + * Encodes the specified ListHotTabletsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsRequest.verify|verify} messages. + * @param message ListHotTabletsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListHotTabletsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHotTabletsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsRequest.verify|verify} messages. + * @param message ListHotTabletsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListHotTabletsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHotTabletsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHotTabletsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListHotTabletsRequest; + + /** + * Decodes a ListHotTabletsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHotTabletsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListHotTabletsRequest; + + /** + * Verifies a ListHotTabletsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHotTabletsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHotTabletsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListHotTabletsRequest; + + /** + * Creates a plain object from a ListHotTabletsRequest message. Also converts values to other types if specified. + * @param message ListHotTabletsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListHotTabletsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHotTabletsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListHotTabletsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListHotTabletsResponse. */ + interface IListHotTabletsResponse { + + /** ListHotTabletsResponse hotTablets */ + hotTablets?: (google.bigtable.admin.v2.IHotTablet[]|null); + + /** ListHotTabletsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListHotTabletsResponse. */ + class ListHotTabletsResponse implements IListHotTabletsResponse { + + /** + * Constructs a new ListHotTabletsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListHotTabletsResponse); + + /** ListHotTabletsResponse hotTablets. */ + public hotTablets: google.bigtable.admin.v2.IHotTablet[]; + + /** ListHotTabletsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListHotTabletsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHotTabletsResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListHotTabletsResponse): google.bigtable.admin.v2.ListHotTabletsResponse; + + /** + * Encodes the specified ListHotTabletsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsResponse.verify|verify} messages. + * @param message ListHotTabletsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListHotTabletsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHotTabletsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsResponse.verify|verify} messages. + * @param message ListHotTabletsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListHotTabletsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHotTabletsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHotTabletsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListHotTabletsResponse; + + /** + * Decodes a ListHotTabletsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHotTabletsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListHotTabletsResponse; + + /** + * Verifies a ListHotTabletsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHotTabletsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHotTabletsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListHotTabletsResponse; + + /** + * Creates a plain object from a ListHotTabletsResponse message. Also converts values to other types if specified. + * @param message ListHotTabletsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListHotTabletsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHotTabletsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListHotTabletsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateLogicalViewRequest. */ + interface ICreateLogicalViewRequest { + + /** CreateLogicalViewRequest parent */ + parent?: (string|null); + + /** CreateLogicalViewRequest logicalViewId */ + logicalViewId?: (string|null); + + /** CreateLogicalViewRequest logicalView */ + logicalView?: (google.bigtable.admin.v2.ILogicalView|null); + } + + /** Represents a CreateLogicalViewRequest. */ + class CreateLogicalViewRequest implements ICreateLogicalViewRequest { + + /** + * Constructs a new CreateLogicalViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateLogicalViewRequest); + + /** CreateLogicalViewRequest parent. */ + public parent: string; + + /** CreateLogicalViewRequest logicalViewId. */ + public logicalViewId: string; + + /** CreateLogicalViewRequest logicalView. */ + public logicalView?: (google.bigtable.admin.v2.ILogicalView|null); + + /** + * Creates a new CreateLogicalViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateLogicalViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateLogicalViewRequest): google.bigtable.admin.v2.CreateLogicalViewRequest; + + /** + * Encodes the specified CreateLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewRequest.verify|verify} messages. + * @param message CreateLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewRequest.verify|verify} messages. + * @param message CreateLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateLogicalViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateLogicalViewRequest; + + /** + * Decodes a CreateLogicalViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateLogicalViewRequest; + + /** + * Verifies a CreateLogicalViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateLogicalViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateLogicalViewRequest; + + /** + * Creates a plain object from a CreateLogicalViewRequest message. Also converts values to other types if specified. + * @param message CreateLogicalViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateLogicalViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateLogicalViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateLogicalViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateLogicalViewMetadata. */ + interface ICreateLogicalViewMetadata { + + /** CreateLogicalViewMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateLogicalViewRequest|null); + + /** CreateLogicalViewMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CreateLogicalViewMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateLogicalViewMetadata. */ + class CreateLogicalViewMetadata implements ICreateLogicalViewMetadata { + + /** + * Constructs a new CreateLogicalViewMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateLogicalViewMetadata); + + /** CreateLogicalViewMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateLogicalViewRequest|null); + + /** CreateLogicalViewMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CreateLogicalViewMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateLogicalViewMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateLogicalViewMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateLogicalViewMetadata): google.bigtable.admin.v2.CreateLogicalViewMetadata; + + /** + * Encodes the specified CreateLogicalViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewMetadata.verify|verify} messages. + * @param message CreateLogicalViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateLogicalViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateLogicalViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewMetadata.verify|verify} messages. + * @param message CreateLogicalViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateLogicalViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateLogicalViewMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateLogicalViewMetadata; + + /** + * Decodes a CreateLogicalViewMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateLogicalViewMetadata; + + /** + * Verifies a CreateLogicalViewMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateLogicalViewMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateLogicalViewMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateLogicalViewMetadata; + + /** + * Creates a plain object from a CreateLogicalViewMetadata message. Also converts values to other types if specified. + * @param message CreateLogicalViewMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateLogicalViewMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateLogicalViewMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateLogicalViewMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetLogicalViewRequest. */ + interface IGetLogicalViewRequest { + + /** GetLogicalViewRequest name */ + name?: (string|null); + } + + /** Represents a GetLogicalViewRequest. */ + class GetLogicalViewRequest implements IGetLogicalViewRequest { + + /** + * Constructs a new GetLogicalViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetLogicalViewRequest); + + /** GetLogicalViewRequest name. */ + public name: string; + + /** + * Creates a new GetLogicalViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetLogicalViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetLogicalViewRequest): google.bigtable.admin.v2.GetLogicalViewRequest; + + /** + * Encodes the specified GetLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetLogicalViewRequest.verify|verify} messages. + * @param message GetLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetLogicalViewRequest.verify|verify} messages. + * @param message GetLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetLogicalViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetLogicalViewRequest; + + /** + * Decodes a GetLogicalViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetLogicalViewRequest; + + /** + * Verifies a GetLogicalViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetLogicalViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetLogicalViewRequest; + + /** + * Creates a plain object from a GetLogicalViewRequest message. Also converts values to other types if specified. + * @param message GetLogicalViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetLogicalViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetLogicalViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetLogicalViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLogicalViewsRequest. */ + interface IListLogicalViewsRequest { + + /** ListLogicalViewsRequest parent */ + parent?: (string|null); + + /** ListLogicalViewsRequest pageSize */ + pageSize?: (number|null); + + /** ListLogicalViewsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListLogicalViewsRequest. */ + class ListLogicalViewsRequest implements IListLogicalViewsRequest { + + /** + * Constructs a new ListLogicalViewsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListLogicalViewsRequest); + + /** ListLogicalViewsRequest parent. */ + public parent: string; + + /** ListLogicalViewsRequest pageSize. */ + public pageSize: number; + + /** ListLogicalViewsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListLogicalViewsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLogicalViewsRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListLogicalViewsRequest): google.bigtable.admin.v2.ListLogicalViewsRequest; + + /** + * Encodes the specified ListLogicalViewsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsRequest.verify|verify} messages. + * @param message ListLogicalViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListLogicalViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLogicalViewsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsRequest.verify|verify} messages. + * @param message ListLogicalViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListLogicalViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLogicalViewsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLogicalViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListLogicalViewsRequest; + + /** + * Decodes a ListLogicalViewsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLogicalViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListLogicalViewsRequest; + + /** + * Verifies a ListLogicalViewsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListLogicalViewsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLogicalViewsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListLogicalViewsRequest; + + /** + * Creates a plain object from a ListLogicalViewsRequest message. Also converts values to other types if specified. + * @param message ListLogicalViewsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListLogicalViewsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLogicalViewsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLogicalViewsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLogicalViewsResponse. */ + interface IListLogicalViewsResponse { + + /** ListLogicalViewsResponse logicalViews */ + logicalViews?: (google.bigtable.admin.v2.ILogicalView[]|null); + + /** ListLogicalViewsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListLogicalViewsResponse. */ + class ListLogicalViewsResponse implements IListLogicalViewsResponse { + + /** + * Constructs a new ListLogicalViewsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListLogicalViewsResponse); + + /** ListLogicalViewsResponse logicalViews. */ + public logicalViews: google.bigtable.admin.v2.ILogicalView[]; + + /** ListLogicalViewsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListLogicalViewsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLogicalViewsResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListLogicalViewsResponse): google.bigtable.admin.v2.ListLogicalViewsResponse; + + /** + * Encodes the specified ListLogicalViewsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsResponse.verify|verify} messages. + * @param message ListLogicalViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListLogicalViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLogicalViewsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsResponse.verify|verify} messages. + * @param message ListLogicalViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListLogicalViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLogicalViewsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLogicalViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListLogicalViewsResponse; + + /** + * Decodes a ListLogicalViewsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLogicalViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListLogicalViewsResponse; + + /** + * Verifies a ListLogicalViewsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListLogicalViewsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLogicalViewsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListLogicalViewsResponse; + + /** + * Creates a plain object from a ListLogicalViewsResponse message. Also converts values to other types if specified. + * @param message ListLogicalViewsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListLogicalViewsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLogicalViewsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLogicalViewsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateLogicalViewRequest. */ + interface IUpdateLogicalViewRequest { + + /** UpdateLogicalViewRequest logicalView */ + logicalView?: (google.bigtable.admin.v2.ILogicalView|null); + + /** UpdateLogicalViewRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateLogicalViewRequest. */ + class UpdateLogicalViewRequest implements IUpdateLogicalViewRequest { + + /** + * Constructs a new UpdateLogicalViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateLogicalViewRequest); + + /** UpdateLogicalViewRequest logicalView. */ + public logicalView?: (google.bigtable.admin.v2.ILogicalView|null); + + /** UpdateLogicalViewRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateLogicalViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateLogicalViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateLogicalViewRequest): google.bigtable.admin.v2.UpdateLogicalViewRequest; + + /** + * Encodes the specified UpdateLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewRequest.verify|verify} messages. + * @param message UpdateLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewRequest.verify|verify} messages. + * @param message UpdateLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateLogicalViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateLogicalViewRequest; + + /** + * Decodes an UpdateLogicalViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateLogicalViewRequest; + + /** + * Verifies an UpdateLogicalViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateLogicalViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateLogicalViewRequest; + + /** + * Creates a plain object from an UpdateLogicalViewRequest message. Also converts values to other types if specified. + * @param message UpdateLogicalViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateLogicalViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateLogicalViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateLogicalViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateLogicalViewMetadata. */ + interface IUpdateLogicalViewMetadata { + + /** UpdateLogicalViewMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.IUpdateLogicalViewRequest|null); + + /** UpdateLogicalViewMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateLogicalViewMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateLogicalViewMetadata. */ + class UpdateLogicalViewMetadata implements IUpdateLogicalViewMetadata { + + /** + * Constructs a new UpdateLogicalViewMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateLogicalViewMetadata); + + /** UpdateLogicalViewMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.IUpdateLogicalViewRequest|null); + + /** UpdateLogicalViewMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateLogicalViewMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateLogicalViewMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateLogicalViewMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateLogicalViewMetadata): google.bigtable.admin.v2.UpdateLogicalViewMetadata; + + /** + * Encodes the specified UpdateLogicalViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewMetadata.verify|verify} messages. + * @param message UpdateLogicalViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateLogicalViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateLogicalViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewMetadata.verify|verify} messages. + * @param message UpdateLogicalViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateLogicalViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateLogicalViewMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateLogicalViewMetadata; + + /** + * Decodes an UpdateLogicalViewMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateLogicalViewMetadata; + + /** + * Verifies an UpdateLogicalViewMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateLogicalViewMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateLogicalViewMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateLogicalViewMetadata; + + /** + * Creates a plain object from an UpdateLogicalViewMetadata message. Also converts values to other types if specified. + * @param message UpdateLogicalViewMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateLogicalViewMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateLogicalViewMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateLogicalViewMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteLogicalViewRequest. */ + interface IDeleteLogicalViewRequest { + + /** DeleteLogicalViewRequest name */ + name?: (string|null); + + /** DeleteLogicalViewRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteLogicalViewRequest. */ + class DeleteLogicalViewRequest implements IDeleteLogicalViewRequest { + + /** + * Constructs a new DeleteLogicalViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteLogicalViewRequest); + + /** DeleteLogicalViewRequest name. */ + public name: string; + + /** DeleteLogicalViewRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteLogicalViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteLogicalViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteLogicalViewRequest): google.bigtable.admin.v2.DeleteLogicalViewRequest; + + /** + * Encodes the specified DeleteLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteLogicalViewRequest.verify|verify} messages. + * @param message DeleteLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteLogicalViewRequest.verify|verify} messages. + * @param message DeleteLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteLogicalViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteLogicalViewRequest; + + /** + * Decodes a DeleteLogicalViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteLogicalViewRequest; + + /** + * Verifies a DeleteLogicalViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteLogicalViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteLogicalViewRequest; + + /** + * Creates a plain object from a DeleteLogicalViewRequest message. Also converts values to other types if specified. + * @param message DeleteLogicalViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteLogicalViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteLogicalViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteLogicalViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMaterializedViewRequest. */ + interface ICreateMaterializedViewRequest { + + /** CreateMaterializedViewRequest parent */ + parent?: (string|null); + + /** CreateMaterializedViewRequest materializedViewId */ + materializedViewId?: (string|null); + + /** CreateMaterializedViewRequest materializedView */ + materializedView?: (google.bigtable.admin.v2.IMaterializedView|null); + } + + /** Represents a CreateMaterializedViewRequest. */ + class CreateMaterializedViewRequest implements ICreateMaterializedViewRequest { + + /** + * Constructs a new CreateMaterializedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateMaterializedViewRequest); + + /** CreateMaterializedViewRequest parent. */ + public parent: string; + + /** CreateMaterializedViewRequest materializedViewId. */ + public materializedViewId: string; + + /** CreateMaterializedViewRequest materializedView. */ + public materializedView?: (google.bigtable.admin.v2.IMaterializedView|null); + + /** + * Creates a new CreateMaterializedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMaterializedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateMaterializedViewRequest): google.bigtable.admin.v2.CreateMaterializedViewRequest; + + /** + * Encodes the specified CreateMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewRequest.verify|verify} messages. + * @param message CreateMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewRequest.verify|verify} messages. + * @param message CreateMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMaterializedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateMaterializedViewRequest; + + /** + * Decodes a CreateMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateMaterializedViewRequest; + + /** + * Verifies a CreateMaterializedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMaterializedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateMaterializedViewRequest; + + /** + * Creates a plain object from a CreateMaterializedViewRequest message. Also converts values to other types if specified. + * @param message CreateMaterializedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateMaterializedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMaterializedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMaterializedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMaterializedViewMetadata. */ + interface ICreateMaterializedViewMetadata { + + /** CreateMaterializedViewMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateMaterializedViewRequest|null); + + /** CreateMaterializedViewMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CreateMaterializedViewMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateMaterializedViewMetadata. */ + class CreateMaterializedViewMetadata implements ICreateMaterializedViewMetadata { + + /** + * Constructs a new CreateMaterializedViewMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateMaterializedViewMetadata); + + /** CreateMaterializedViewMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateMaterializedViewRequest|null); + + /** CreateMaterializedViewMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CreateMaterializedViewMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateMaterializedViewMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMaterializedViewMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateMaterializedViewMetadata): google.bigtable.admin.v2.CreateMaterializedViewMetadata; + + /** + * Encodes the specified CreateMaterializedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewMetadata.verify|verify} messages. + * @param message CreateMaterializedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateMaterializedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMaterializedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewMetadata.verify|verify} messages. + * @param message CreateMaterializedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateMaterializedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMaterializedViewMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateMaterializedViewMetadata; + + /** + * Decodes a CreateMaterializedViewMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateMaterializedViewMetadata; + + /** + * Verifies a CreateMaterializedViewMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMaterializedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMaterializedViewMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateMaterializedViewMetadata; + + /** + * Creates a plain object from a CreateMaterializedViewMetadata message. Also converts values to other types if specified. + * @param message CreateMaterializedViewMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateMaterializedViewMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMaterializedViewMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMaterializedViewMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMaterializedViewRequest. */ + interface IGetMaterializedViewRequest { + + /** GetMaterializedViewRequest name */ + name?: (string|null); + } + + /** Represents a GetMaterializedViewRequest. */ + class GetMaterializedViewRequest implements IGetMaterializedViewRequest { + + /** + * Constructs a new GetMaterializedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetMaterializedViewRequest); + + /** GetMaterializedViewRequest name. */ + public name: string; + + /** + * Creates a new GetMaterializedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMaterializedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetMaterializedViewRequest): google.bigtable.admin.v2.GetMaterializedViewRequest; + + /** + * Encodes the specified GetMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetMaterializedViewRequest.verify|verify} messages. + * @param message GetMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetMaterializedViewRequest.verify|verify} messages. + * @param message GetMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMaterializedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetMaterializedViewRequest; + + /** + * Decodes a GetMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetMaterializedViewRequest; + + /** + * Verifies a GetMaterializedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMaterializedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetMaterializedViewRequest; + + /** + * Creates a plain object from a GetMaterializedViewRequest message. Also converts values to other types if specified. + * @param message GetMaterializedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetMaterializedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMaterializedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMaterializedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMaterializedViewsRequest. */ + interface IListMaterializedViewsRequest { + + /** ListMaterializedViewsRequest parent */ + parent?: (string|null); + + /** ListMaterializedViewsRequest pageSize */ + pageSize?: (number|null); + + /** ListMaterializedViewsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListMaterializedViewsRequest. */ + class ListMaterializedViewsRequest implements IListMaterializedViewsRequest { + + /** + * Constructs a new ListMaterializedViewsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListMaterializedViewsRequest); + + /** ListMaterializedViewsRequest parent. */ + public parent: string; + + /** ListMaterializedViewsRequest pageSize. */ + public pageSize: number; + + /** ListMaterializedViewsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListMaterializedViewsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMaterializedViewsRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListMaterializedViewsRequest): google.bigtable.admin.v2.ListMaterializedViewsRequest; + + /** + * Encodes the specified ListMaterializedViewsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsRequest.verify|verify} messages. + * @param message ListMaterializedViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListMaterializedViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMaterializedViewsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsRequest.verify|verify} messages. + * @param message ListMaterializedViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListMaterializedViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMaterializedViewsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMaterializedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListMaterializedViewsRequest; + + /** + * Decodes a ListMaterializedViewsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMaterializedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListMaterializedViewsRequest; + + /** + * Verifies a ListMaterializedViewsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMaterializedViewsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMaterializedViewsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListMaterializedViewsRequest; + + /** + * Creates a plain object from a ListMaterializedViewsRequest message. Also converts values to other types if specified. + * @param message ListMaterializedViewsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListMaterializedViewsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMaterializedViewsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMaterializedViewsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMaterializedViewsResponse. */ + interface IListMaterializedViewsResponse { + + /** ListMaterializedViewsResponse materializedViews */ + materializedViews?: (google.bigtable.admin.v2.IMaterializedView[]|null); + + /** ListMaterializedViewsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMaterializedViewsResponse. */ + class ListMaterializedViewsResponse implements IListMaterializedViewsResponse { + + /** + * Constructs a new ListMaterializedViewsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListMaterializedViewsResponse); + + /** ListMaterializedViewsResponse materializedViews. */ + public materializedViews: google.bigtable.admin.v2.IMaterializedView[]; + + /** ListMaterializedViewsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMaterializedViewsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMaterializedViewsResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListMaterializedViewsResponse): google.bigtable.admin.v2.ListMaterializedViewsResponse; + + /** + * Encodes the specified ListMaterializedViewsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsResponse.verify|verify} messages. + * @param message ListMaterializedViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListMaterializedViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMaterializedViewsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsResponse.verify|verify} messages. + * @param message ListMaterializedViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListMaterializedViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMaterializedViewsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMaterializedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListMaterializedViewsResponse; + + /** + * Decodes a ListMaterializedViewsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMaterializedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListMaterializedViewsResponse; + + /** + * Verifies a ListMaterializedViewsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMaterializedViewsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMaterializedViewsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListMaterializedViewsResponse; + + /** + * Creates a plain object from a ListMaterializedViewsResponse message. Also converts values to other types if specified. + * @param message ListMaterializedViewsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListMaterializedViewsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMaterializedViewsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMaterializedViewsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMaterializedViewRequest. */ + interface IUpdateMaterializedViewRequest { + + /** UpdateMaterializedViewRequest materializedView */ + materializedView?: (google.bigtable.admin.v2.IMaterializedView|null); + + /** UpdateMaterializedViewRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateMaterializedViewRequest. */ + class UpdateMaterializedViewRequest implements IUpdateMaterializedViewRequest { + + /** + * Constructs a new UpdateMaterializedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateMaterializedViewRequest); + + /** UpdateMaterializedViewRequest materializedView. */ + public materializedView?: (google.bigtable.admin.v2.IMaterializedView|null); + + /** UpdateMaterializedViewRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateMaterializedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMaterializedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateMaterializedViewRequest): google.bigtable.admin.v2.UpdateMaterializedViewRequest; + + /** + * Encodes the specified UpdateMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewRequest.verify|verify} messages. + * @param message UpdateMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewRequest.verify|verify} messages. + * @param message UpdateMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMaterializedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateMaterializedViewRequest; + + /** + * Decodes an UpdateMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateMaterializedViewRequest; + + /** + * Verifies an UpdateMaterializedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMaterializedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateMaterializedViewRequest; + + /** + * Creates a plain object from an UpdateMaterializedViewRequest message. Also converts values to other types if specified. + * @param message UpdateMaterializedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateMaterializedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMaterializedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMaterializedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMaterializedViewMetadata. */ + interface IUpdateMaterializedViewMetadata { + + /** UpdateMaterializedViewMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.IUpdateMaterializedViewRequest|null); + + /** UpdateMaterializedViewMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateMaterializedViewMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateMaterializedViewMetadata. */ + class UpdateMaterializedViewMetadata implements IUpdateMaterializedViewMetadata { + + /** + * Constructs a new UpdateMaterializedViewMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateMaterializedViewMetadata); + + /** UpdateMaterializedViewMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.IUpdateMaterializedViewRequest|null); + + /** UpdateMaterializedViewMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateMaterializedViewMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateMaterializedViewMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMaterializedViewMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateMaterializedViewMetadata): google.bigtable.admin.v2.UpdateMaterializedViewMetadata; + + /** + * Encodes the specified UpdateMaterializedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewMetadata.verify|verify} messages. + * @param message UpdateMaterializedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateMaterializedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMaterializedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewMetadata.verify|verify} messages. + * @param message UpdateMaterializedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateMaterializedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMaterializedViewMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateMaterializedViewMetadata; + + /** + * Decodes an UpdateMaterializedViewMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateMaterializedViewMetadata; + + /** + * Verifies an UpdateMaterializedViewMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateMaterializedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMaterializedViewMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateMaterializedViewMetadata; + + /** + * Creates a plain object from an UpdateMaterializedViewMetadata message. Also converts values to other types if specified. + * @param message UpdateMaterializedViewMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateMaterializedViewMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMaterializedViewMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMaterializedViewMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMaterializedViewRequest. */ + interface IDeleteMaterializedViewRequest { + + /** DeleteMaterializedViewRequest name */ + name?: (string|null); + + /** DeleteMaterializedViewRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteMaterializedViewRequest. */ + class DeleteMaterializedViewRequest implements IDeleteMaterializedViewRequest { + + /** + * Constructs a new DeleteMaterializedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteMaterializedViewRequest); + + /** DeleteMaterializedViewRequest name. */ + public name: string; + + /** DeleteMaterializedViewRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteMaterializedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMaterializedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteMaterializedViewRequest): google.bigtable.admin.v2.DeleteMaterializedViewRequest; + + /** + * Encodes the specified DeleteMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteMaterializedViewRequest.verify|verify} messages. + * @param message DeleteMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteMaterializedViewRequest.verify|verify} messages. + * @param message DeleteMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMaterializedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteMaterializedViewRequest; + + /** + * Decodes a DeleteMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteMaterializedViewRequest; + + /** + * Verifies a DeleteMaterializedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMaterializedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteMaterializedViewRequest; + + /** + * Creates a plain object from a DeleteMaterializedViewRequest message. Also converts values to other types if specified. + * @param message DeleteMaterializedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteMaterializedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMaterializedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMaterializedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance state */ + state?: (google.bigtable.admin.v2.Instance.State|keyof typeof google.bigtable.admin.v2.Instance.State|null); + + /** Instance type */ + type?: (google.bigtable.admin.v2.Instance.Type|keyof typeof google.bigtable.admin.v2.Instance.Type|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Instance satisfiesPzi */ + satisfiesPzi?: (boolean|null); + + /** Instance tags */ + tags?: ({ [k: string]: string }|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance state. */ + public state: (google.bigtable.admin.v2.Instance.State|keyof typeof google.bigtable.admin.v2.Instance.State); + + /** Instance type. */ + public type: (google.bigtable.admin.v2.Instance.Type|keyof typeof google.bigtable.admin.v2.Instance.Type); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance satisfiesPzs. */ + public satisfiesPzs?: (boolean|null); + + /** Instance satisfiesPzi. */ + public satisfiesPzi?: (boolean|null); + + /** Instance tags. */ + public tags: { [k: string]: string }; + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.bigtable.admin.v2.IInstance): google.bigtable.admin.v2.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.bigtable.admin.v2.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** State enum. */ + enum State { + STATE_NOT_KNOWN = 0, + READY = 1, + CREATING = 2 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + PRODUCTION = 1, + DEVELOPMENT = 2 + } + } + + /** Properties of an AutoscalingTargets. */ + interface IAutoscalingTargets { + + /** AutoscalingTargets cpuUtilizationPercent */ + cpuUtilizationPercent?: (number|null); + + /** AutoscalingTargets storageUtilizationGibPerNode */ + storageUtilizationGibPerNode?: (number|null); + } + + /** Represents an AutoscalingTargets. */ + class AutoscalingTargets implements IAutoscalingTargets { + + /** + * Constructs a new AutoscalingTargets. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IAutoscalingTargets); + + /** AutoscalingTargets cpuUtilizationPercent. */ + public cpuUtilizationPercent: number; + + /** AutoscalingTargets storageUtilizationGibPerNode. */ + public storageUtilizationGibPerNode: number; + + /** + * Creates a new AutoscalingTargets instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingTargets instance + */ + public static create(properties?: google.bigtable.admin.v2.IAutoscalingTargets): google.bigtable.admin.v2.AutoscalingTargets; + + /** + * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingTargets.verify|verify} messages. + * @param message AutoscalingTargets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingTargets.verify|verify} messages. + * @param message AutoscalingTargets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AutoscalingTargets; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AutoscalingTargets; + + /** + * Verifies an AutoscalingTargets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingTargets + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AutoscalingTargets; + + /** + * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. + * @param message AutoscalingTargets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AutoscalingTargets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingTargets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingTargets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoscalingLimits. */ + interface IAutoscalingLimits { + + /** AutoscalingLimits minServeNodes */ + minServeNodes?: (number|null); + + /** AutoscalingLimits maxServeNodes */ + maxServeNodes?: (number|null); + } + + /** Represents an AutoscalingLimits. */ + class AutoscalingLimits implements IAutoscalingLimits { + + /** + * Constructs a new AutoscalingLimits. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IAutoscalingLimits); + + /** AutoscalingLimits minServeNodes. */ + public minServeNodes: number; + + /** AutoscalingLimits maxServeNodes. */ + public maxServeNodes: number; + + /** + * Creates a new AutoscalingLimits instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingLimits instance + */ + public static create(properties?: google.bigtable.admin.v2.IAutoscalingLimits): google.bigtable.admin.v2.AutoscalingLimits; + + /** + * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingLimits.verify|verify} messages. + * @param message AutoscalingLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingLimits.verify|verify} messages. + * @param message AutoscalingLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AutoscalingLimits; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AutoscalingLimits; + + /** + * Verifies an AutoscalingLimits message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingLimits + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AutoscalingLimits; + + /** + * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. + * @param message AutoscalingLimits + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AutoscalingLimits, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingLimits to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingLimits + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cluster. */ + interface ICluster { + + /** Cluster name */ + name?: (string|null); + + /** Cluster location */ + location?: (string|null); + + /** Cluster state */ + state?: (google.bigtable.admin.v2.Cluster.State|keyof typeof google.bigtable.admin.v2.Cluster.State|null); + + /** Cluster serveNodes */ + serveNodes?: (number|null); + + /** Cluster nodeScalingFactor */ + nodeScalingFactor?: (google.bigtable.admin.v2.Cluster.NodeScalingFactor|keyof typeof google.bigtable.admin.v2.Cluster.NodeScalingFactor|null); + + /** Cluster clusterConfig */ + clusterConfig?: (google.bigtable.admin.v2.Cluster.IClusterConfig|null); + + /** Cluster defaultStorageType */ + defaultStorageType?: (google.bigtable.admin.v2.StorageType|keyof typeof google.bigtable.admin.v2.StorageType|null); + + /** Cluster encryptionConfig */ + encryptionConfig?: (google.bigtable.admin.v2.Cluster.IEncryptionConfig|null); + } + + /** Represents a Cluster. */ + class Cluster implements ICluster { + + /** + * Constructs a new Cluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICluster); + + /** Cluster name. */ + public name: string; + + /** Cluster location. */ + public location: string; + + /** Cluster state. */ + public state: (google.bigtable.admin.v2.Cluster.State|keyof typeof google.bigtable.admin.v2.Cluster.State); + + /** Cluster serveNodes. */ + public serveNodes: number; + + /** Cluster nodeScalingFactor. */ + public nodeScalingFactor: (google.bigtable.admin.v2.Cluster.NodeScalingFactor|keyof typeof google.bigtable.admin.v2.Cluster.NodeScalingFactor); + + /** Cluster clusterConfig. */ + public clusterConfig?: (google.bigtable.admin.v2.Cluster.IClusterConfig|null); + + /** Cluster defaultStorageType. */ + public defaultStorageType: (google.bigtable.admin.v2.StorageType|keyof typeof google.bigtable.admin.v2.StorageType); + + /** Cluster encryptionConfig. */ + public encryptionConfig?: (google.bigtable.admin.v2.Cluster.IEncryptionConfig|null); + + /** Cluster config. */ + public config?: "clusterConfig"; + + /** + * Creates a new Cluster instance using the specified properties. + * @param [properties] Properties to set + * @returns Cluster instance + */ + public static create(properties?: google.bigtable.admin.v2.ICluster): google.bigtable.admin.v2.Cluster; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Cluster; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Cluster; + + /** + * Verifies a Cluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cluster + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Cluster; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @param message Cluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Cluster { + + /** State enum. */ + enum State { + STATE_NOT_KNOWN = 0, + READY = 1, + CREATING = 2, + RESIZING = 3, + DISABLED = 4 + } + + /** NodeScalingFactor enum. */ + enum NodeScalingFactor { + NODE_SCALING_FACTOR_UNSPECIFIED = 0, + NODE_SCALING_FACTOR_1X = 1, + NODE_SCALING_FACTOR_2X = 2 + } + + /** Properties of a ClusterAutoscalingConfig. */ + interface IClusterAutoscalingConfig { + + /** ClusterAutoscalingConfig autoscalingLimits */ + autoscalingLimits?: (google.bigtable.admin.v2.IAutoscalingLimits|null); + + /** ClusterAutoscalingConfig autoscalingTargets */ + autoscalingTargets?: (google.bigtable.admin.v2.IAutoscalingTargets|null); + } + + /** Represents a ClusterAutoscalingConfig. */ + class ClusterAutoscalingConfig implements IClusterAutoscalingConfig { + + /** + * Constructs a new ClusterAutoscalingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig); + + /** ClusterAutoscalingConfig autoscalingLimits. */ + public autoscalingLimits?: (google.bigtable.admin.v2.IAutoscalingLimits|null); + + /** ClusterAutoscalingConfig autoscalingTargets. */ + public autoscalingTargets?: (google.bigtable.admin.v2.IAutoscalingTargets|null); + + /** + * Creates a new ClusterAutoscalingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterAutoscalingConfig instance + */ + public static create(properties?: google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig): google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig; + + /** + * Encodes the specified ClusterAutoscalingConfig message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.verify|verify} messages. + * @param message ClusterAutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterAutoscalingConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.verify|verify} messages. + * @param message ClusterAutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterAutoscalingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig; + + /** + * Decodes a ClusterAutoscalingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig; + + /** + * Verifies a ClusterAutoscalingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterAutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterAutoscalingConfig + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig; + + /** + * Creates a plain object from a ClusterAutoscalingConfig message. Also converts values to other types if specified. + * @param message ClusterAutoscalingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterAutoscalingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterAutoscalingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClusterConfig. */ + interface IClusterConfig { + + /** ClusterConfig clusterAutoscalingConfig */ + clusterAutoscalingConfig?: (google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig|null); + } + + /** Represents a ClusterConfig. */ + class ClusterConfig implements IClusterConfig { + + /** + * Constructs a new ClusterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Cluster.IClusterConfig); + + /** ClusterConfig clusterAutoscalingConfig. */ + public clusterAutoscalingConfig?: (google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig|null); + + /** + * Creates a new ClusterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterConfig instance + */ + public static create(properties?: google.bigtable.admin.v2.Cluster.IClusterConfig): google.bigtable.admin.v2.Cluster.ClusterConfig; + + /** + * Encodes the specified ClusterConfig message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterConfig.verify|verify} messages. + * @param message ClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Cluster.IClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterConfig.verify|verify} messages. + * @param message ClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Cluster.IClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Cluster.ClusterConfig; + + /** + * Decodes a ClusterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Cluster.ClusterConfig; + + /** + * Verifies a ClusterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterConfig + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Cluster.ClusterConfig; + + /** + * Creates a plain object from a ClusterConfig message. Also converts values to other types if specified. + * @param message ClusterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Cluster.ClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { + + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + } + + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { + + /** + * Constructs a new EncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Cluster.IEncryptionConfig); + + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionConfig instance + */ + public static create(properties?: google.bigtable.admin.v2.Cluster.IEncryptionConfig): google.bigtable.admin.v2.Cluster.EncryptionConfig; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Cluster.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Cluster.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Cluster.EncryptionConfig; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Cluster.EncryptionConfig; + + /** + * Verifies an EncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Cluster.EncryptionConfig; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Cluster.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AppProfile. */ + interface IAppProfile { + + /** AppProfile name */ + name?: (string|null); + + /** AppProfile etag */ + etag?: (string|null); + + /** AppProfile description */ + description?: (string|null); + + /** AppProfile multiClusterRoutingUseAny */ + multiClusterRoutingUseAny?: (google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny|null); + + /** AppProfile singleClusterRouting */ + singleClusterRouting?: (google.bigtable.admin.v2.AppProfile.ISingleClusterRouting|null); + + /** AppProfile priority */ + priority?: (google.bigtable.admin.v2.AppProfile.Priority|keyof typeof google.bigtable.admin.v2.AppProfile.Priority|null); + + /** AppProfile standardIsolation */ + standardIsolation?: (google.bigtable.admin.v2.AppProfile.IStandardIsolation|null); + + /** AppProfile dataBoostIsolationReadOnly */ + dataBoostIsolationReadOnly?: (google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly|null); + } + + /** Represents an AppProfile. */ + class AppProfile implements IAppProfile { + + /** + * Constructs a new AppProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IAppProfile); + + /** AppProfile name. */ + public name: string; + + /** AppProfile etag. */ + public etag: string; + + /** AppProfile description. */ + public description: string; + + /** AppProfile multiClusterRoutingUseAny. */ + public multiClusterRoutingUseAny?: (google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny|null); + + /** AppProfile singleClusterRouting. */ + public singleClusterRouting?: (google.bigtable.admin.v2.AppProfile.ISingleClusterRouting|null); + + /** AppProfile priority. */ + public priority?: (google.bigtable.admin.v2.AppProfile.Priority|keyof typeof google.bigtable.admin.v2.AppProfile.Priority|null); + + /** AppProfile standardIsolation. */ + public standardIsolation?: (google.bigtable.admin.v2.AppProfile.IStandardIsolation|null); + + /** AppProfile dataBoostIsolationReadOnly. */ + public dataBoostIsolationReadOnly?: (google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly|null); + + /** AppProfile routingPolicy. */ + public routingPolicy?: ("multiClusterRoutingUseAny"|"singleClusterRouting"); + + /** AppProfile isolation. */ + public isolation?: ("priority"|"standardIsolation"|"dataBoostIsolationReadOnly"); + + /** + * Creates a new AppProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns AppProfile instance + */ + public static create(properties?: google.bigtable.admin.v2.IAppProfile): google.bigtable.admin.v2.AppProfile; + + /** + * Encodes the specified AppProfile message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.verify|verify} messages. + * @param message AppProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IAppProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppProfile message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.verify|verify} messages. + * @param message AppProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IAppProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile; + + /** + * Decodes an AppProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile; + + /** + * Verifies an AppProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppProfile + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile; + + /** + * Creates a plain object from an AppProfile message. Also converts values to other types if specified. + * @param message AppProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AppProfile { + + /** Properties of a MultiClusterRoutingUseAny. */ + interface IMultiClusterRoutingUseAny { + + /** MultiClusterRoutingUseAny clusterIds */ + clusterIds?: (string[]|null); + + /** MultiClusterRoutingUseAny rowAffinity */ + rowAffinity?: (google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity|null); + } + + /** Represents a MultiClusterRoutingUseAny. */ + class MultiClusterRoutingUseAny implements IMultiClusterRoutingUseAny { + + /** + * Constructs a new MultiClusterRoutingUseAny. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny); + + /** MultiClusterRoutingUseAny clusterIds. */ + public clusterIds: string[]; + + /** MultiClusterRoutingUseAny rowAffinity. */ + public rowAffinity?: (google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity|null); + + /** MultiClusterRoutingUseAny affinity. */ + public affinity?: "rowAffinity"; + + /** + * Creates a new MultiClusterRoutingUseAny instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiClusterRoutingUseAny instance + */ + public static create(properties?: google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny; + + /** + * Encodes the specified MultiClusterRoutingUseAny message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.verify|verify} messages. + * @param message MultiClusterRoutingUseAny message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiClusterRoutingUseAny message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.verify|verify} messages. + * @param message MultiClusterRoutingUseAny message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiClusterRoutingUseAny message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiClusterRoutingUseAny + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny; + + /** + * Decodes a MultiClusterRoutingUseAny message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiClusterRoutingUseAny + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny; + + /** + * Verifies a MultiClusterRoutingUseAny message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MultiClusterRoutingUseAny message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiClusterRoutingUseAny + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny; + + /** + * Creates a plain object from a MultiClusterRoutingUseAny message. Also converts values to other types if specified. + * @param message MultiClusterRoutingUseAny + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiClusterRoutingUseAny to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiClusterRoutingUseAny + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MultiClusterRoutingUseAny { + + /** Properties of a RowAffinity. */ + interface IRowAffinity { + } + + /** Represents a RowAffinity. */ + class RowAffinity implements IRowAffinity { + + /** + * Constructs a new RowAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity); + + /** + * Creates a new RowAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns RowAffinity instance + */ + public static create(properties?: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity; + + /** + * Encodes the specified RowAffinity message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify|verify} messages. + * @param message RowAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowAffinity message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify|verify} messages. + * @param message RowAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity; + + /** + * Decodes a RowAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity; + + /** + * Verifies a RowAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowAffinity + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity; + + /** + * Creates a plain object from a RowAffinity message. Also converts values to other types if specified. + * @param message RowAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowAffinity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SingleClusterRouting. */ + interface ISingleClusterRouting { + + /** SingleClusterRouting clusterId */ + clusterId?: (string|null); + + /** SingleClusterRouting allowTransactionalWrites */ + allowTransactionalWrites?: (boolean|null); + } + + /** Represents a SingleClusterRouting. */ + class SingleClusterRouting implements ISingleClusterRouting { + + /** + * Constructs a new SingleClusterRouting. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.ISingleClusterRouting); + + /** SingleClusterRouting clusterId. */ + public clusterId: string; + + /** SingleClusterRouting allowTransactionalWrites. */ + public allowTransactionalWrites: boolean; + + /** + * Creates a new SingleClusterRouting instance using the specified properties. + * @param [properties] Properties to set + * @returns SingleClusterRouting instance + */ + public static create(properties?: google.bigtable.admin.v2.AppProfile.ISingleClusterRouting): google.bigtable.admin.v2.AppProfile.SingleClusterRouting; + + /** + * Encodes the specified SingleClusterRouting message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.SingleClusterRouting.verify|verify} messages. + * @param message SingleClusterRouting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AppProfile.ISingleClusterRouting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SingleClusterRouting message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.SingleClusterRouting.verify|verify} messages. + * @param message SingleClusterRouting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AppProfile.ISingleClusterRouting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SingleClusterRouting message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SingleClusterRouting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile.SingleClusterRouting; + + /** + * Decodes a SingleClusterRouting message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SingleClusterRouting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile.SingleClusterRouting; + + /** + * Verifies a SingleClusterRouting message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SingleClusterRouting message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SingleClusterRouting + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile.SingleClusterRouting; + + /** + * Creates a plain object from a SingleClusterRouting message. Also converts values to other types if specified. + * @param message SingleClusterRouting + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile.SingleClusterRouting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SingleClusterRouting to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SingleClusterRouting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Priority enum. */ + enum Priority { + PRIORITY_UNSPECIFIED = 0, + PRIORITY_LOW = 1, + PRIORITY_MEDIUM = 2, + PRIORITY_HIGH = 3 + } + + /** Properties of a StandardIsolation. */ + interface IStandardIsolation { + + /** StandardIsolation priority */ + priority?: (google.bigtable.admin.v2.AppProfile.Priority|keyof typeof google.bigtable.admin.v2.AppProfile.Priority|null); + } + + /** Represents a StandardIsolation. */ + class StandardIsolation implements IStandardIsolation { + + /** + * Constructs a new StandardIsolation. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.IStandardIsolation); + + /** StandardIsolation priority. */ + public priority: (google.bigtable.admin.v2.AppProfile.Priority|keyof typeof google.bigtable.admin.v2.AppProfile.Priority); + + /** + * Creates a new StandardIsolation instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardIsolation instance + */ + public static create(properties?: google.bigtable.admin.v2.AppProfile.IStandardIsolation): google.bigtable.admin.v2.AppProfile.StandardIsolation; + + /** + * Encodes the specified StandardIsolation message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.StandardIsolation.verify|verify} messages. + * @param message StandardIsolation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AppProfile.IStandardIsolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardIsolation message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.StandardIsolation.verify|verify} messages. + * @param message StandardIsolation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AppProfile.IStandardIsolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardIsolation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardIsolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile.StandardIsolation; + + /** + * Decodes a StandardIsolation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardIsolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile.StandardIsolation; + + /** + * Verifies a StandardIsolation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardIsolation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardIsolation + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile.StandardIsolation; + + /** + * Creates a plain object from a StandardIsolation message. Also converts values to other types if specified. + * @param message StandardIsolation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile.StandardIsolation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardIsolation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardIsolation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataBoostIsolationReadOnly. */ + interface IDataBoostIsolationReadOnly { + + /** DataBoostIsolationReadOnly computeBillingOwner */ + computeBillingOwner?: (google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner|keyof typeof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner|null); + } + + /** Represents a DataBoostIsolationReadOnly. */ + class DataBoostIsolationReadOnly implements IDataBoostIsolationReadOnly { + + /** + * Constructs a new DataBoostIsolationReadOnly. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly); + + /** DataBoostIsolationReadOnly computeBillingOwner. */ + public computeBillingOwner?: (google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner|keyof typeof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner|null); + + /** + * Creates a new DataBoostIsolationReadOnly instance using the specified properties. + * @param [properties] Properties to set + * @returns DataBoostIsolationReadOnly instance + */ + public static create(properties?: google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly): google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly; + + /** + * Encodes the specified DataBoostIsolationReadOnly message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.verify|verify} messages. + * @param message DataBoostIsolationReadOnly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataBoostIsolationReadOnly message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.verify|verify} messages. + * @param message DataBoostIsolationReadOnly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataBoostIsolationReadOnly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataBoostIsolationReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly; + + /** + * Decodes a DataBoostIsolationReadOnly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataBoostIsolationReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly; + + /** + * Verifies a DataBoostIsolationReadOnly message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataBoostIsolationReadOnly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataBoostIsolationReadOnly + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly; + + /** + * Creates a plain object from a DataBoostIsolationReadOnly message. Also converts values to other types if specified. + * @param message DataBoostIsolationReadOnly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataBoostIsolationReadOnly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataBoostIsolationReadOnly + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataBoostIsolationReadOnly { + + /** ComputeBillingOwner enum. */ + enum ComputeBillingOwner { + COMPUTE_BILLING_OWNER_UNSPECIFIED = 0, + HOST_PAYS = 1 + } + } + } + + /** Properties of a HotTablet. */ + interface IHotTablet { + + /** HotTablet name */ + name?: (string|null); + + /** HotTablet tableName */ + tableName?: (string|null); + + /** HotTablet startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** HotTablet endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** HotTablet startKey */ + startKey?: (string|null); + + /** HotTablet endKey */ + endKey?: (string|null); + + /** HotTablet nodeCpuUsagePercent */ + nodeCpuUsagePercent?: (number|null); + } + + /** Represents a HotTablet. */ + class HotTablet implements IHotTablet { + + /** + * Constructs a new HotTablet. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IHotTablet); + + /** HotTablet name. */ + public name: string; + + /** HotTablet tableName. */ + public tableName: string; + + /** HotTablet startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** HotTablet endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** HotTablet startKey. */ + public startKey: string; + + /** HotTablet endKey. */ + public endKey: string; + + /** HotTablet nodeCpuUsagePercent. */ + public nodeCpuUsagePercent: number; + + /** + * Creates a new HotTablet instance using the specified properties. + * @param [properties] Properties to set + * @returns HotTablet instance + */ + public static create(properties?: google.bigtable.admin.v2.IHotTablet): google.bigtable.admin.v2.HotTablet; + + /** + * Encodes the specified HotTablet message. Does not implicitly {@link google.bigtable.admin.v2.HotTablet.verify|verify} messages. + * @param message HotTablet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IHotTablet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HotTablet message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.HotTablet.verify|verify} messages. + * @param message HotTablet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IHotTablet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HotTablet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HotTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.HotTablet; + + /** + * Decodes a HotTablet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HotTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.HotTablet; + + /** + * Verifies a HotTablet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HotTablet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HotTablet + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.HotTablet; + + /** + * Creates a plain object from a HotTablet message. Also converts values to other types if specified. + * @param message HotTablet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.HotTablet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HotTablet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HotTablet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogicalView. */ + interface ILogicalView { + + /** LogicalView name */ + name?: (string|null); + + /** LogicalView query */ + query?: (string|null); + + /** LogicalView etag */ + etag?: (string|null); + + /** LogicalView deletionProtection */ + deletionProtection?: (boolean|null); + } + + /** Represents a LogicalView. */ + class LogicalView implements ILogicalView { + + /** + * Constructs a new LogicalView. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ILogicalView); + + /** LogicalView name. */ + public name: string; + + /** LogicalView query. */ + public query: string; + + /** LogicalView etag. */ + public etag: string; + + /** LogicalView deletionProtection. */ + public deletionProtection: boolean; + + /** + * Creates a new LogicalView instance using the specified properties. + * @param [properties] Properties to set + * @returns LogicalView instance + */ + public static create(properties?: google.bigtable.admin.v2.ILogicalView): google.bigtable.admin.v2.LogicalView; + + /** + * Encodes the specified LogicalView message. Does not implicitly {@link google.bigtable.admin.v2.LogicalView.verify|verify} messages. + * @param message LogicalView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ILogicalView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogicalView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.LogicalView.verify|verify} messages. + * @param message LogicalView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ILogicalView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogicalView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogicalView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.LogicalView; + + /** + * Decodes a LogicalView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogicalView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.LogicalView; + + /** + * Verifies a LogicalView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogicalView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogicalView + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.LogicalView; + + /** + * Creates a plain object from a LogicalView message. Also converts values to other types if specified. + * @param message LogicalView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.LogicalView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogicalView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogicalView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaterializedView. */ + interface IMaterializedView { + + /** MaterializedView name */ + name?: (string|null); + + /** MaterializedView query */ + query?: (string|null); + + /** MaterializedView etag */ + etag?: (string|null); + + /** MaterializedView deletionProtection */ + deletionProtection?: (boolean|null); + } + + /** Represents a MaterializedView. */ + class MaterializedView implements IMaterializedView { + + /** + * Constructs a new MaterializedView. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IMaterializedView); + + /** MaterializedView name. */ + public name: string; + + /** MaterializedView query. */ + public query: string; + + /** MaterializedView etag. */ + public etag: string; + + /** MaterializedView deletionProtection. */ + public deletionProtection: boolean; + + /** + * Creates a new MaterializedView instance using the specified properties. + * @param [properties] Properties to set + * @returns MaterializedView instance + */ + public static create(properties?: google.bigtable.admin.v2.IMaterializedView): google.bigtable.admin.v2.MaterializedView; + + /** + * Encodes the specified MaterializedView message. Does not implicitly {@link google.bigtable.admin.v2.MaterializedView.verify|verify} messages. + * @param message MaterializedView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IMaterializedView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaterializedView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.MaterializedView.verify|verify} messages. + * @param message MaterializedView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IMaterializedView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaterializedView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaterializedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.MaterializedView; + + /** + * Decodes a MaterializedView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaterializedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.MaterializedView; + + /** + * Verifies a MaterializedView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaterializedView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaterializedView + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.MaterializedView; + + /** + * Creates a plain object from a MaterializedView message. Also converts values to other types if specified. + * @param message MaterializedView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.MaterializedView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaterializedView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaterializedView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** StorageType enum. */ + enum StorageType { + STORAGE_TYPE_UNSPECIFIED = 0, + SSD = 1, + HDD = 2 + } + + /** Properties of an OperationProgress. */ + interface IOperationProgress { + + /** OperationProgress progressPercent */ + progressPercent?: (number|null); + + /** OperationProgress startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** OperationProgress endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationProgress. */ + class OperationProgress implements IOperationProgress { + + /** + * Constructs a new OperationProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IOperationProgress); + + /** OperationProgress progressPercent. */ + public progressPercent: number; + + /** OperationProgress startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** OperationProgress endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OperationProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationProgress instance + */ + public static create(properties?: google.bigtable.admin.v2.IOperationProgress): google.bigtable.admin.v2.OperationProgress; + + /** + * Encodes the specified OperationProgress message. Does not implicitly {@link google.bigtable.admin.v2.OperationProgress.verify|verify} messages. + * @param message OperationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.OperationProgress.verify|verify} messages. + * @param message OperationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.OperationProgress; + + /** + * Decodes an OperationProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.OperationProgress; + + /** + * Verifies an OperationProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationProgress + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.OperationProgress; + + /** + * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. + * @param message OperationProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.OperationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a BigtableTableAdmin */ + class BigtableTableAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new BigtableTableAdmin 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 BigtableTableAdmin 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): BigtableTableAdmin; + + /** + * Calls CreateTable. + * @param request CreateTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table + */ + public createTable(request: google.bigtable.admin.v2.ICreateTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateTableCallback): void; + + /** + * Calls CreateTable. + * @param request CreateTableRequest message or plain object + * @returns Promise + */ + public createTable(request: google.bigtable.admin.v2.ICreateTableRequest): Promise; + + /** + * Calls CreateTableFromSnapshot. + * @param request CreateTableFromSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTableFromSnapshot(request: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshotCallback): void; + + /** + * Calls CreateTableFromSnapshot. + * @param request CreateTableFromSnapshotRequest message or plain object + * @returns Promise + */ + public createTableFromSnapshot(request: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest): Promise; + + /** + * Calls ListTables. + * @param request ListTablesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTablesResponse + */ + public listTables(request: google.bigtable.admin.v2.IListTablesRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ListTablesCallback): void; + + /** + * Calls ListTables. + * @param request ListTablesRequest message or plain object + * @returns Promise + */ + public listTables(request: google.bigtable.admin.v2.IListTablesRequest): Promise; + + /** + * Calls GetTable. + * @param request GetTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table + */ + public getTable(request: google.bigtable.admin.v2.IGetTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetTableCallback): void; + + /** + * Calls GetTable. + * @param request GetTableRequest message or plain object + * @returns Promise + */ + public getTable(request: google.bigtable.admin.v2.IGetTableRequest): Promise; + + /** + * Calls UpdateTable. + * @param request UpdateTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateTable(request: google.bigtable.admin.v2.IUpdateTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.UpdateTableCallback): void; + + /** + * Calls UpdateTable. + * @param request UpdateTableRequest message or plain object + * @returns Promise + */ + public updateTable(request: google.bigtable.admin.v2.IUpdateTableRequest): Promise; + + /** + * Calls DeleteTable. + * @param request DeleteTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTable(request: google.bigtable.admin.v2.IDeleteTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteTableCallback): void; + + /** + * Calls DeleteTable. + * @param request DeleteTableRequest message or plain object + * @returns Promise + */ + public deleteTable(request: google.bigtable.admin.v2.IDeleteTableRequest): Promise; + + /** + * Calls UndeleteTable. + * @param request UndeleteTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeleteTable(request: google.bigtable.admin.v2.IUndeleteTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTableCallback): void; + + /** + * Calls UndeleteTable. + * @param request UndeleteTableRequest message or plain object + * @returns Promise + */ + public undeleteTable(request: google.bigtable.admin.v2.IUndeleteTableRequest): Promise; + + /** + * Calls CreateAuthorizedView. + * @param request CreateAuthorizedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createAuthorizedView(request: google.bigtable.admin.v2.ICreateAuthorizedViewRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedViewCallback): void; + + /** + * Calls CreateAuthorizedView. + * @param request CreateAuthorizedViewRequest message or plain object + * @returns Promise + */ + public createAuthorizedView(request: google.bigtable.admin.v2.ICreateAuthorizedViewRequest): Promise; + + /** + * Calls ListAuthorizedViews. + * @param request ListAuthorizedViewsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAuthorizedViewsResponse + */ + public listAuthorizedViews(request: google.bigtable.admin.v2.IListAuthorizedViewsRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViewsCallback): void; + + /** + * Calls ListAuthorizedViews. + * @param request ListAuthorizedViewsRequest message or plain object + * @returns Promise + */ + public listAuthorizedViews(request: google.bigtable.admin.v2.IListAuthorizedViewsRequest): Promise; + + /** + * Calls GetAuthorizedView. + * @param request GetAuthorizedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AuthorizedView + */ + public getAuthorizedView(request: google.bigtable.admin.v2.IGetAuthorizedViewRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedViewCallback): void; + + /** + * Calls GetAuthorizedView. + * @param request GetAuthorizedViewRequest message or plain object + * @returns Promise + */ + public getAuthorizedView(request: google.bigtable.admin.v2.IGetAuthorizedViewRequest): Promise; + + /** + * Calls UpdateAuthorizedView. + * @param request UpdateAuthorizedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateAuthorizedView(request: google.bigtable.admin.v2.IUpdateAuthorizedViewRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedViewCallback): void; + + /** + * Calls UpdateAuthorizedView. + * @param request UpdateAuthorizedViewRequest message or plain object + * @returns Promise + */ + public updateAuthorizedView(request: google.bigtable.admin.v2.IUpdateAuthorizedViewRequest): Promise; + + /** + * Calls DeleteAuthorizedView. + * @param request DeleteAuthorizedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAuthorizedView(request: google.bigtable.admin.v2.IDeleteAuthorizedViewRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedViewCallback): void; + + /** + * Calls DeleteAuthorizedView. + * @param request DeleteAuthorizedViewRequest message or plain object + * @returns Promise + */ + public deleteAuthorizedView(request: google.bigtable.admin.v2.IDeleteAuthorizedViewRequest): Promise; + + /** + * Calls ModifyColumnFamilies. + * @param request ModifyColumnFamiliesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table + */ + public modifyColumnFamilies(request: google.bigtable.admin.v2.IModifyColumnFamiliesRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamiliesCallback): void; + + /** + * Calls ModifyColumnFamilies. + * @param request ModifyColumnFamiliesRequest message or plain object + * @returns Promise + */ + public modifyColumnFamilies(request: google.bigtable.admin.v2.IModifyColumnFamiliesRequest): Promise; + + /** + * Calls DropRowRange. + * @param request DropRowRangeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public dropRowRange(request: google.bigtable.admin.v2.IDropRowRangeRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DropRowRangeCallback): void; + + /** + * Calls DropRowRange. + * @param request DropRowRangeRequest message or plain object + * @returns Promise + */ + public dropRowRange(request: google.bigtable.admin.v2.IDropRowRangeRequest): Promise; + + /** + * Calls GenerateConsistencyToken. + * @param request GenerateConsistencyTokenRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateConsistencyTokenResponse + */ + public generateConsistencyToken(request: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyTokenCallback): void; + + /** + * Calls GenerateConsistencyToken. + * @param request GenerateConsistencyTokenRequest message or plain object + * @returns Promise + */ + public generateConsistencyToken(request: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest): Promise; + + /** + * Calls CheckConsistency. + * @param request CheckConsistencyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckConsistencyResponse + */ + public checkConsistency(request: google.bigtable.admin.v2.ICheckConsistencyRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistencyCallback): void; + + /** + * Calls CheckConsistency. + * @param request CheckConsistencyRequest message or plain object + * @returns Promise + */ + public checkConsistency(request: google.bigtable.admin.v2.ICheckConsistencyRequest): Promise; + + /** + * Calls SnapshotTable. + * @param request SnapshotTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public snapshotTable(request: google.bigtable.admin.v2.ISnapshotTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTableCallback): void; + + /** + * Calls SnapshotTable. + * @param request SnapshotTableRequest message or plain object + * @returns Promise + */ + public snapshotTable(request: google.bigtable.admin.v2.ISnapshotTableRequest): Promise; + + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public getSnapshot(request: google.bigtable.admin.v2.IGetSnapshotRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshotCallback): void; + + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @returns Promise + */ + public getSnapshot(request: google.bigtable.admin.v2.IGetSnapshotRequest): Promise; + + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSnapshotsResponse + */ + public listSnapshots(request: google.bigtable.admin.v2.IListSnapshotsRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshotsCallback): void; + + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @returns Promise + */ + public listSnapshots(request: google.bigtable.admin.v2.IListSnapshotsRequest): Promise; + + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSnapshot(request: google.bigtable.admin.v2.IDeleteSnapshotRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshotCallback): void; + + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @returns Promise + */ + public deleteSnapshot(request: google.bigtable.admin.v2.IDeleteSnapshotRequest): Promise; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackup(request: google.bigtable.admin.v2.ICreateBackupRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateBackupCallback): void; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @returns Promise + */ + public createBackup(request: google.bigtable.admin.v2.ICreateBackupRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.bigtable.admin.v2.IGetBackupRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.bigtable.admin.v2.IGetBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public updateBackup(request: google.bigtable.admin.v2.IUpdateBackupRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.bigtable.admin.v2.IUpdateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBackup(request: google.bigtable.admin.v2.IDeleteBackupRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.bigtable.admin.v2.IDeleteBackupRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.bigtable.admin.v2.IListBackupsRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.bigtable.admin.v2.IListBackupsRequest): Promise; + + /** + * Calls RestoreTable. + * @param request RestoreTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreTable(request: google.bigtable.admin.v2.IRestoreTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.RestoreTableCallback): void; + + /** + * Calls RestoreTable. + * @param request RestoreTableRequest message or plain object + * @returns Promise + */ + public restoreTable(request: google.bigtable.admin.v2.IRestoreTableRequest): Promise; + + /** + * Calls CopyBackup. + * @param request CopyBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public copyBackup(request: google.bigtable.admin.v2.ICopyBackupRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CopyBackupCallback): void; + + /** + * Calls CopyBackup. + * @param request CopyBackupRequest message or plain object + * @returns Promise + */ + public copyBackup(request: google.bigtable.admin.v2.ICopyBackupRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls CreateSchemaBundle. + * @param request CreateSchemaBundleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSchemaBundle(request: google.bigtable.admin.v2.ICreateSchemaBundleRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundleCallback): void; + + /** + * Calls CreateSchemaBundle. + * @param request CreateSchemaBundleRequest message or plain object + * @returns Promise + */ + public createSchemaBundle(request: google.bigtable.admin.v2.ICreateSchemaBundleRequest): Promise; + + /** + * Calls UpdateSchemaBundle. + * @param request UpdateSchemaBundleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateSchemaBundle(request: google.bigtable.admin.v2.IUpdateSchemaBundleRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundleCallback): void; + + /** + * Calls UpdateSchemaBundle. + * @param request UpdateSchemaBundleRequest message or plain object + * @returns Promise + */ + public updateSchemaBundle(request: google.bigtable.admin.v2.IUpdateSchemaBundleRequest): Promise; + + /** + * Calls GetSchemaBundle. + * @param request GetSchemaBundleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SchemaBundle + */ + public getSchemaBundle(request: google.bigtable.admin.v2.IGetSchemaBundleRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundleCallback): void; + + /** + * Calls GetSchemaBundle. + * @param request GetSchemaBundleRequest message or plain object + * @returns Promise + */ + public getSchemaBundle(request: google.bigtable.admin.v2.IGetSchemaBundleRequest): Promise; + + /** + * Calls ListSchemaBundles. + * @param request ListSchemaBundlesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSchemaBundlesResponse + */ + public listSchemaBundles(request: google.bigtable.admin.v2.IListSchemaBundlesRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundlesCallback): void; + + /** + * Calls ListSchemaBundles. + * @param request ListSchemaBundlesRequest message or plain object + * @returns Promise + */ + public listSchemaBundles(request: google.bigtable.admin.v2.IListSchemaBundlesRequest): Promise; + + /** + * Calls DeleteSchemaBundle. + * @param request DeleteSchemaBundleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSchemaBundle(request: google.bigtable.admin.v2.IDeleteSchemaBundleRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundleCallback): void; + + /** + * Calls DeleteSchemaBundle. + * @param request DeleteSchemaBundleRequest message or plain object + * @returns Promise + */ + public deleteSchemaBundle(request: google.bigtable.admin.v2.IDeleteSchemaBundleRequest): Promise; + } + + namespace BigtableTableAdmin { + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createTable}. + * @param error Error, if any + * @param [response] Table + */ + type CreateTableCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Table) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createTableFromSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTableFromSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listTables}. + * @param error Error, if any + * @param [response] ListTablesResponse + */ + type ListTablesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListTablesResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getTable}. + * @param error Error, if any + * @param [response] Table + */ + type GetTableCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Table) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateTable}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateTableCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteTable}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTableCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|undeleteTable}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeleteTableCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createAuthorizedView}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateAuthorizedViewCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listAuthorizedViews}. + * @param error Error, if any + * @param [response] ListAuthorizedViewsResponse + */ + type ListAuthorizedViewsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListAuthorizedViewsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getAuthorizedView}. + * @param error Error, if any + * @param [response] AuthorizedView + */ + type GetAuthorizedViewCallback = (error: (Error|null), response?: google.bigtable.admin.v2.AuthorizedView) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateAuthorizedView}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateAuthorizedViewCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteAuthorizedView}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAuthorizedViewCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|modifyColumnFamilies}. + * @param error Error, if any + * @param [response] Table + */ + type ModifyColumnFamiliesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Table) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|dropRowRange}. + * @param error Error, if any + * @param [response] Empty + */ + type DropRowRangeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|generateConsistencyToken}. + * @param error Error, if any + * @param [response] GenerateConsistencyTokenResponse + */ + type GenerateConsistencyTokenCallback = (error: (Error|null), response?: google.bigtable.admin.v2.GenerateConsistencyTokenResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|checkConsistency}. + * @param error Error, if any + * @param [response] CheckConsistencyResponse + */ + type CheckConsistencyCallback = (error: (Error|null), response?: google.bigtable.admin.v2.CheckConsistencyResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|snapshotTable}. + * @param error Error, if any + * @param [response] Operation + */ + type SnapshotTableCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type GetSnapshotCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Snapshot) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listSnapshots}. + * @param error Error, if any + * @param [response] ListSnapshotsResponse + */ + type ListSnapshotsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListSnapshotsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteSnapshot}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSnapshotCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Backup) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Backup) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteBackup}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|restoreTable}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreTableCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|copyBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CopyBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createSchemaBundle}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSchemaBundleCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateSchemaBundle}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateSchemaBundleCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getSchemaBundle}. + * @param error Error, if any + * @param [response] SchemaBundle + */ + type GetSchemaBundleCallback = (error: (Error|null), response?: google.bigtable.admin.v2.SchemaBundle) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listSchemaBundles}. + * @param error Error, if any + * @param [response] ListSchemaBundlesResponse + */ + type ListSchemaBundlesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListSchemaBundlesResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteSchemaBundle}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSchemaBundleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a RestoreTableRequest. */ + interface IRestoreTableRequest { + + /** RestoreTableRequest parent */ + parent?: (string|null); + + /** RestoreTableRequest tableId */ + tableId?: (string|null); + + /** RestoreTableRequest backup */ + backup?: (string|null); + } + + /** Represents a RestoreTableRequest. */ + class RestoreTableRequest implements IRestoreTableRequest { + + /** + * Constructs a new RestoreTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IRestoreTableRequest); + + /** RestoreTableRequest parent. */ + public parent: string; + + /** RestoreTableRequest tableId. */ + public tableId: string; + + /** RestoreTableRequest backup. */ + public backup?: (string|null); + + /** RestoreTableRequest source. */ + public source?: "backup"; + + /** + * Creates a new RestoreTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IRestoreTableRequest): google.bigtable.admin.v2.RestoreTableRequest; + + /** + * Encodes the specified RestoreTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableRequest.verify|verify} messages. + * @param message RestoreTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IRestoreTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableRequest.verify|verify} messages. + * @param message RestoreTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IRestoreTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.RestoreTableRequest; + + /** + * Decodes a RestoreTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.RestoreTableRequest; + + /** + * Verifies a RestoreTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.RestoreTableRequest; + + /** + * Creates a plain object from a RestoreTableRequest message. Also converts values to other types if specified. + * @param message RestoreTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.RestoreTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreTableMetadata. */ + interface IRestoreTableMetadata { + + /** RestoreTableMetadata name */ + name?: (string|null); + + /** RestoreTableMetadata sourceType */ + sourceType?: (google.bigtable.admin.v2.RestoreSourceType|keyof typeof google.bigtable.admin.v2.RestoreSourceType|null); + + /** RestoreTableMetadata backupInfo */ + backupInfo?: (google.bigtable.admin.v2.IBackupInfo|null); + + /** RestoreTableMetadata optimizeTableOperationName */ + optimizeTableOperationName?: (string|null); + + /** RestoreTableMetadata progress */ + progress?: (google.bigtable.admin.v2.IOperationProgress|null); + } + + /** Represents a RestoreTableMetadata. */ + class RestoreTableMetadata implements IRestoreTableMetadata { + + /** + * Constructs a new RestoreTableMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IRestoreTableMetadata); + + /** RestoreTableMetadata name. */ + public name: string; + + /** RestoreTableMetadata sourceType. */ + public sourceType: (google.bigtable.admin.v2.RestoreSourceType|keyof typeof google.bigtable.admin.v2.RestoreSourceType); + + /** RestoreTableMetadata backupInfo. */ + public backupInfo?: (google.bigtable.admin.v2.IBackupInfo|null); + + /** RestoreTableMetadata optimizeTableOperationName. */ + public optimizeTableOperationName: string; + + /** RestoreTableMetadata progress. */ + public progress?: (google.bigtable.admin.v2.IOperationProgress|null); + + /** RestoreTableMetadata sourceInfo. */ + public sourceInfo?: "backupInfo"; + + /** + * Creates a new RestoreTableMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreTableMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IRestoreTableMetadata): google.bigtable.admin.v2.RestoreTableMetadata; + + /** + * Encodes the specified RestoreTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableMetadata.verify|verify} messages. + * @param message RestoreTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IRestoreTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableMetadata.verify|verify} messages. + * @param message RestoreTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IRestoreTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreTableMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.RestoreTableMetadata; + + /** + * Decodes a RestoreTableMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.RestoreTableMetadata; + + /** + * Verifies a RestoreTableMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreTableMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreTableMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.RestoreTableMetadata; + + /** + * Creates a plain object from a RestoreTableMetadata message. Also converts values to other types if specified. + * @param message RestoreTableMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.RestoreTableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreTableMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreTableMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OptimizeRestoredTableMetadata. */ + interface IOptimizeRestoredTableMetadata { + + /** OptimizeRestoredTableMetadata name */ + name?: (string|null); + + /** OptimizeRestoredTableMetadata progress */ + progress?: (google.bigtable.admin.v2.IOperationProgress|null); + } + + /** Represents an OptimizeRestoredTableMetadata. */ + class OptimizeRestoredTableMetadata implements IOptimizeRestoredTableMetadata { + + /** + * Constructs a new OptimizeRestoredTableMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IOptimizeRestoredTableMetadata); + + /** OptimizeRestoredTableMetadata name. */ + public name: string; + + /** OptimizeRestoredTableMetadata progress. */ + public progress?: (google.bigtable.admin.v2.IOperationProgress|null); + + /** + * Creates a new OptimizeRestoredTableMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OptimizeRestoredTableMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IOptimizeRestoredTableMetadata): google.bigtable.admin.v2.OptimizeRestoredTableMetadata; + + /** + * Encodes the specified OptimizeRestoredTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.OptimizeRestoredTableMetadata.verify|verify} messages. + * @param message OptimizeRestoredTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IOptimizeRestoredTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OptimizeRestoredTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.OptimizeRestoredTableMetadata.verify|verify} messages. + * @param message OptimizeRestoredTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IOptimizeRestoredTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OptimizeRestoredTableMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OptimizeRestoredTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.OptimizeRestoredTableMetadata; + + /** + * Decodes an OptimizeRestoredTableMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OptimizeRestoredTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.OptimizeRestoredTableMetadata; + + /** + * Verifies an OptimizeRestoredTableMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OptimizeRestoredTableMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OptimizeRestoredTableMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.OptimizeRestoredTableMetadata; + + /** + * Creates a plain object from an OptimizeRestoredTableMetadata message. Also converts values to other types if specified. + * @param message OptimizeRestoredTableMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.OptimizeRestoredTableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OptimizeRestoredTableMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OptimizeRestoredTableMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTableRequest. */ + interface ICreateTableRequest { + + /** CreateTableRequest parent */ + parent?: (string|null); + + /** CreateTableRequest tableId */ + tableId?: (string|null); + + /** CreateTableRequest table */ + table?: (google.bigtable.admin.v2.ITable|null); + + /** CreateTableRequest initialSplits */ + initialSplits?: (google.bigtable.admin.v2.CreateTableRequest.ISplit[]|null); + } + + /** Represents a CreateTableRequest. */ + class CreateTableRequest implements ICreateTableRequest { + + /** + * Constructs a new CreateTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateTableRequest); + + /** CreateTableRequest parent. */ + public parent: string; + + /** CreateTableRequest tableId. */ + public tableId: string; + + /** CreateTableRequest table. */ + public table?: (google.bigtable.admin.v2.ITable|null); + + /** CreateTableRequest initialSplits. */ + public initialSplits: google.bigtable.admin.v2.CreateTableRequest.ISplit[]; + + /** + * Creates a new CreateTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateTableRequest): google.bigtable.admin.v2.CreateTableRequest; + + /** + * Encodes the specified CreateTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.verify|verify} messages. + * @param message CreateTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.verify|verify} messages. + * @param message CreateTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateTableRequest; + + /** + * Decodes a CreateTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateTableRequest; + + /** + * Verifies a CreateTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableRequest; + + /** + * Creates a plain object from a CreateTableRequest message. Also converts values to other types if specified. + * @param message CreateTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CreateTableRequest { + + /** Properties of a Split. */ + interface ISplit { + + /** Split key */ + key?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Split. */ + class Split implements ISplit { + + /** + * Constructs a new Split. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.CreateTableRequest.ISplit); + + /** Split key. */ + public key: (Uint8Array|Buffer|string); + + /** + * Creates a new Split instance using the specified properties. + * @param [properties] Properties to set + * @returns Split instance + */ + public static create(properties?: google.bigtable.admin.v2.CreateTableRequest.ISplit): google.bigtable.admin.v2.CreateTableRequest.Split; + + /** + * Encodes the specified Split message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.Split.verify|verify} messages. + * @param message Split message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.CreateTableRequest.ISplit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Split message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.Split.verify|verify} messages. + * @param message Split message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.CreateTableRequest.ISplit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Split message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Split + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateTableRequest.Split; + + /** + * Decodes a Split message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Split + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateTableRequest.Split; + + /** + * Verifies a Split message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Split message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Split + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableRequest.Split; + + /** + * Creates a plain object from a Split message. Also converts values to other types if specified. + * @param message Split + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateTableRequest.Split, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Split to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Split + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateTableFromSnapshotRequest. */ + interface ICreateTableFromSnapshotRequest { + + /** CreateTableFromSnapshotRequest parent */ + parent?: (string|null); + + /** CreateTableFromSnapshotRequest tableId */ + tableId?: (string|null); + + /** CreateTableFromSnapshotRequest sourceSnapshot */ + sourceSnapshot?: (string|null); + } + + /** Represents a CreateTableFromSnapshotRequest. */ + class CreateTableFromSnapshotRequest implements ICreateTableFromSnapshotRequest { + + /** + * Constructs a new CreateTableFromSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest); + + /** CreateTableFromSnapshotRequest parent. */ + public parent: string; + + /** CreateTableFromSnapshotRequest tableId. */ + public tableId: string; + + /** CreateTableFromSnapshotRequest sourceSnapshot. */ + public sourceSnapshot: string; + + /** + * Creates a new CreateTableFromSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTableFromSnapshotRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; + + /** + * Encodes the specified CreateTableFromSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotRequest.verify|verify} messages. + * @param message CreateTableFromSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTableFromSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotRequest.verify|verify} messages. + * @param message CreateTableFromSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTableFromSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTableFromSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; + + /** + * Decodes a CreateTableFromSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTableFromSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; + + /** + * Verifies a CreateTableFromSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTableFromSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTableFromSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; + + /** + * Creates a plain object from a CreateTableFromSnapshotRequest message. Also converts values to other types if specified. + * @param message CreateTableFromSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateTableFromSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTableFromSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTableFromSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DropRowRangeRequest. */ + interface IDropRowRangeRequest { + + /** DropRowRangeRequest name */ + name?: (string|null); + + /** DropRowRangeRequest rowKeyPrefix */ + rowKeyPrefix?: (Uint8Array|Buffer|string|null); + + /** DropRowRangeRequest deleteAllDataFromTable */ + deleteAllDataFromTable?: (boolean|null); + } + + /** Represents a DropRowRangeRequest. */ + class DropRowRangeRequest implements IDropRowRangeRequest { + + /** + * Constructs a new DropRowRangeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDropRowRangeRequest); + + /** DropRowRangeRequest name. */ + public name: string; + + /** DropRowRangeRequest rowKeyPrefix. */ + public rowKeyPrefix?: (Uint8Array|Buffer|string|null); + + /** DropRowRangeRequest deleteAllDataFromTable. */ + public deleteAllDataFromTable?: (boolean|null); + + /** DropRowRangeRequest target. */ + public target?: ("rowKeyPrefix"|"deleteAllDataFromTable"); + + /** + * Creates a new DropRowRangeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DropRowRangeRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDropRowRangeRequest): google.bigtable.admin.v2.DropRowRangeRequest; + + /** + * Encodes the specified DropRowRangeRequest message. Does not implicitly {@link google.bigtable.admin.v2.DropRowRangeRequest.verify|verify} messages. + * @param message DropRowRangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDropRowRangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DropRowRangeRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DropRowRangeRequest.verify|verify} messages. + * @param message DropRowRangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDropRowRangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DropRowRangeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DropRowRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DropRowRangeRequest; + + /** + * Decodes a DropRowRangeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DropRowRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DropRowRangeRequest; + + /** + * Verifies a DropRowRangeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DropRowRangeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DropRowRangeRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DropRowRangeRequest; + + /** + * Creates a plain object from a DropRowRangeRequest message. Also converts values to other types if specified. + * @param message DropRowRangeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DropRowRangeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DropRowRangeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DropRowRangeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTablesRequest. */ + interface IListTablesRequest { + + /** ListTablesRequest parent */ + parent?: (string|null); + + /** ListTablesRequest view */ + view?: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View|null); + + /** ListTablesRequest pageSize */ + pageSize?: (number|null); + + /** ListTablesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTablesRequest. */ + class ListTablesRequest implements IListTablesRequest { + + /** + * Constructs a new ListTablesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListTablesRequest); + + /** ListTablesRequest parent. */ + public parent: string; + + /** ListTablesRequest view. */ + public view: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View); + + /** ListTablesRequest pageSize. */ + public pageSize: number; + + /** ListTablesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTablesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTablesRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListTablesRequest): google.bigtable.admin.v2.ListTablesRequest; + + /** + * Encodes the specified ListTablesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListTablesRequest.verify|verify} messages. + * @param message ListTablesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListTablesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTablesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListTablesRequest.verify|verify} messages. + * @param message ListTablesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListTablesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTablesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListTablesRequest; + + /** + * Decodes a ListTablesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListTablesRequest; + + /** + * Verifies a ListTablesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTablesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTablesRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListTablesRequest; + + /** + * Creates a plain object from a ListTablesRequest message. Also converts values to other types if specified. + * @param message ListTablesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListTablesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTablesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTablesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTablesResponse. */ + interface IListTablesResponse { + + /** ListTablesResponse tables */ + tables?: (google.bigtable.admin.v2.ITable[]|null); + + /** ListTablesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTablesResponse. */ + class ListTablesResponse implements IListTablesResponse { + + /** + * Constructs a new ListTablesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListTablesResponse); + + /** ListTablesResponse tables. */ + public tables: google.bigtable.admin.v2.ITable[]; + + /** ListTablesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTablesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTablesResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListTablesResponse): google.bigtable.admin.v2.ListTablesResponse; + + /** + * Encodes the specified ListTablesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListTablesResponse.verify|verify} messages. + * @param message ListTablesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListTablesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTablesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListTablesResponse.verify|verify} messages. + * @param message ListTablesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListTablesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTablesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTablesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListTablesResponse; + + /** + * Decodes a ListTablesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTablesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListTablesResponse; + + /** + * Verifies a ListTablesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTablesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTablesResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListTablesResponse; + + /** + * Creates a plain object from a ListTablesResponse message. Also converts values to other types if specified. + * @param message ListTablesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListTablesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTablesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTablesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTableRequest. */ + interface IGetTableRequest { + + /** GetTableRequest name */ + name?: (string|null); + + /** GetTableRequest view */ + view?: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View|null); + } + + /** Represents a GetTableRequest. */ + class GetTableRequest implements IGetTableRequest { + + /** + * Constructs a new GetTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetTableRequest); + + /** GetTableRequest name. */ + public name: string; + + /** GetTableRequest view. */ + public view: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View); + + /** + * Creates a new GetTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetTableRequest): google.bigtable.admin.v2.GetTableRequest; + + /** + * Encodes the specified GetTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetTableRequest.verify|verify} messages. + * @param message GetTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetTableRequest.verify|verify} messages. + * @param message GetTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetTableRequest; + + /** + * Decodes a GetTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetTableRequest; + + /** + * Verifies a GetTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetTableRequest; + + /** + * Creates a plain object from a GetTableRequest message. Also converts values to other types if specified. + * @param message GetTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTableRequest. */ + interface IUpdateTableRequest { + + /** UpdateTableRequest table */ + table?: (google.bigtable.admin.v2.ITable|null); + + /** UpdateTableRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTableRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents an UpdateTableRequest. */ + class UpdateTableRequest implements IUpdateTableRequest { + + /** + * Constructs a new UpdateTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateTableRequest); + + /** UpdateTableRequest table. */ + public table?: (google.bigtable.admin.v2.ITable|null); + + /** UpdateTableRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTableRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new UpdateTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateTableRequest): google.bigtable.admin.v2.UpdateTableRequest; + + /** + * Encodes the specified UpdateTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableRequest.verify|verify} messages. + * @param message UpdateTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableRequest.verify|verify} messages. + * @param message UpdateTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateTableRequest; + + /** + * Decodes an UpdateTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateTableRequest; + + /** + * Verifies an UpdateTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateTableRequest; + + /** + * Creates a plain object from an UpdateTableRequest message. Also converts values to other types if specified. + * @param message UpdateTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTableMetadata. */ + interface IUpdateTableMetadata { + + /** UpdateTableMetadata name */ + name?: (string|null); + + /** UpdateTableMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateTableMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateTableMetadata. */ + class UpdateTableMetadata implements IUpdateTableMetadata { + + /** + * Constructs a new UpdateTableMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateTableMetadata); + + /** UpdateTableMetadata name. */ + public name: string; + + /** UpdateTableMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateTableMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateTableMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTableMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateTableMetadata): google.bigtable.admin.v2.UpdateTableMetadata; + + /** + * Encodes the specified UpdateTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableMetadata.verify|verify} messages. + * @param message UpdateTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableMetadata.verify|verify} messages. + * @param message UpdateTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTableMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateTableMetadata; + + /** + * Decodes an UpdateTableMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateTableMetadata; + + /** + * Verifies an UpdateTableMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateTableMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTableMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateTableMetadata; + + /** + * Creates a plain object from an UpdateTableMetadata message. Also converts values to other types if specified. + * @param message UpdateTableMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateTableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTableMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTableMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTableRequest. */ + interface IDeleteTableRequest { + + /** DeleteTableRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTableRequest. */ + class DeleteTableRequest implements IDeleteTableRequest { + + /** + * Constructs a new DeleteTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteTableRequest); + + /** DeleteTableRequest name. */ + public name: string; + + /** + * Creates a new DeleteTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteTableRequest): google.bigtable.admin.v2.DeleteTableRequest; + + /** + * Encodes the specified DeleteTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteTableRequest.verify|verify} messages. + * @param message DeleteTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteTableRequest.verify|verify} messages. + * @param message DeleteTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteTableRequest; + + /** + * Decodes a DeleteTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteTableRequest; + + /** + * Verifies a DeleteTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteTableRequest; + + /** + * Creates a plain object from a DeleteTableRequest message. Also converts values to other types if specified. + * @param message DeleteTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteTableRequest. */ + interface IUndeleteTableRequest { + + /** UndeleteTableRequest name */ + name?: (string|null); + } + + /** Represents an UndeleteTableRequest. */ + class UndeleteTableRequest implements IUndeleteTableRequest { + + /** + * Constructs a new UndeleteTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUndeleteTableRequest); + + /** UndeleteTableRequest name. */ + public name: string; + + /** + * Creates a new UndeleteTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUndeleteTableRequest): google.bigtable.admin.v2.UndeleteTableRequest; + + /** + * Encodes the specified UndeleteTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableRequest.verify|verify} messages. + * @param message UndeleteTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUndeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableRequest.verify|verify} messages. + * @param message UndeleteTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUndeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UndeleteTableRequest; + + /** + * Decodes an UndeleteTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UndeleteTableRequest; + + /** + * Verifies an UndeleteTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UndeleteTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UndeleteTableRequest; + + /** + * Creates a plain object from an UndeleteTableRequest message. Also converts values to other types if specified. + * @param message UndeleteTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UndeleteTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteTableMetadata. */ + interface IUndeleteTableMetadata { + + /** UndeleteTableMetadata name */ + name?: (string|null); + + /** UndeleteTableMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UndeleteTableMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UndeleteTableMetadata. */ + class UndeleteTableMetadata implements IUndeleteTableMetadata { + + /** + * Constructs a new UndeleteTableMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUndeleteTableMetadata); + + /** UndeleteTableMetadata name. */ + public name: string; + + /** UndeleteTableMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UndeleteTableMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UndeleteTableMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteTableMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUndeleteTableMetadata): google.bigtable.admin.v2.UndeleteTableMetadata; + + /** + * Encodes the specified UndeleteTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableMetadata.verify|verify} messages. + * @param message UndeleteTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUndeleteTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableMetadata.verify|verify} messages. + * @param message UndeleteTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUndeleteTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteTableMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UndeleteTableMetadata; + + /** + * Decodes an UndeleteTableMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UndeleteTableMetadata; + + /** + * Verifies an UndeleteTableMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UndeleteTableMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteTableMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UndeleteTableMetadata; + + /** + * Creates a plain object from an UndeleteTableMetadata message. Also converts values to other types if specified. + * @param message UndeleteTableMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UndeleteTableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteTableMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteTableMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModifyColumnFamiliesRequest. */ + interface IModifyColumnFamiliesRequest { + + /** ModifyColumnFamiliesRequest name */ + name?: (string|null); + + /** ModifyColumnFamiliesRequest modifications */ + modifications?: (google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification[]|null); + + /** ModifyColumnFamiliesRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents a ModifyColumnFamiliesRequest. */ + class ModifyColumnFamiliesRequest implements IModifyColumnFamiliesRequest { + + /** + * Constructs a new ModifyColumnFamiliesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IModifyColumnFamiliesRequest); + + /** ModifyColumnFamiliesRequest name. */ + public name: string; + + /** ModifyColumnFamiliesRequest modifications. */ + public modifications: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification[]; + + /** ModifyColumnFamiliesRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new ModifyColumnFamiliesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ModifyColumnFamiliesRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IModifyColumnFamiliesRequest): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; + + /** + * Encodes the specified ModifyColumnFamiliesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.verify|verify} messages. + * @param message ModifyColumnFamiliesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IModifyColumnFamiliesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModifyColumnFamiliesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.verify|verify} messages. + * @param message ModifyColumnFamiliesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IModifyColumnFamiliesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModifyColumnFamiliesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; + + /** + * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModifyColumnFamiliesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; + + /** + * Verifies a ModifyColumnFamiliesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModifyColumnFamiliesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModifyColumnFamiliesRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; + + /** + * Creates a plain object from a ModifyColumnFamiliesRequest message. Also converts values to other types if specified. + * @param message ModifyColumnFamiliesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ModifyColumnFamiliesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModifyColumnFamiliesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModifyColumnFamiliesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ModifyColumnFamiliesRequest { + + /** Properties of a Modification. */ + interface IModification { + + /** Modification id */ + id?: (string|null); + + /** Modification create */ + create?: (google.bigtable.admin.v2.IColumnFamily|null); + + /** Modification update */ + update?: (google.bigtable.admin.v2.IColumnFamily|null); + + /** Modification drop */ + drop?: (boolean|null); + + /** Modification updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a Modification. */ + class Modification implements IModification { + + /** + * Constructs a new Modification. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification); + + /** Modification id. */ + public id: string; + + /** Modification create. */ + public create?: (google.bigtable.admin.v2.IColumnFamily|null); + + /** Modification update. */ + public update?: (google.bigtable.admin.v2.IColumnFamily|null); + + /** Modification drop. */ + public drop?: (boolean|null); + + /** Modification updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** Modification mod. */ + public mod?: ("create"|"update"|"drop"); + + /** + * Creates a new Modification instance using the specified properties. + * @param [properties] Properties to set + * @returns Modification instance + */ + public static create(properties?: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification): google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification; + + /** + * Encodes the specified Modification message. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.verify|verify} messages. + * @param message Modification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Modification message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.verify|verify} messages. + * @param message Modification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Modification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Modification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification; + + /** + * Decodes a Modification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Modification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification; + + /** + * Verifies a Modification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Modification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Modification + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification; + + /** + * Creates a plain object from a Modification message. Also converts values to other types if specified. + * @param message Modification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Modification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Modification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GenerateConsistencyTokenRequest. */ + interface IGenerateConsistencyTokenRequest { + + /** GenerateConsistencyTokenRequest name */ + name?: (string|null); + } + + /** Represents a GenerateConsistencyTokenRequest. */ + class GenerateConsistencyTokenRequest implements IGenerateConsistencyTokenRequest { + + /** + * Constructs a new GenerateConsistencyTokenRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest); + + /** GenerateConsistencyTokenRequest name. */ + public name: string; + + /** + * Creates a new GenerateConsistencyTokenRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateConsistencyTokenRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; + + /** + * Encodes the specified GenerateConsistencyTokenRequest message. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenRequest.verify|verify} messages. + * @param message GenerateConsistencyTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateConsistencyTokenRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenRequest.verify|verify} messages. + * @param message GenerateConsistencyTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateConsistencyTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; + + /** + * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateConsistencyTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; + + /** + * Verifies a GenerateConsistencyTokenRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateConsistencyTokenRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateConsistencyTokenRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; + + /** + * Creates a plain object from a GenerateConsistencyTokenRequest message. Also converts values to other types if specified. + * @param message GenerateConsistencyTokenRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GenerateConsistencyTokenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateConsistencyTokenRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateConsistencyTokenRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateConsistencyTokenResponse. */ + interface IGenerateConsistencyTokenResponse { + + /** GenerateConsistencyTokenResponse consistencyToken */ + consistencyToken?: (string|null); + } + + /** Represents a GenerateConsistencyTokenResponse. */ + class GenerateConsistencyTokenResponse implements IGenerateConsistencyTokenResponse { + + /** + * Constructs a new GenerateConsistencyTokenResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse); + + /** GenerateConsistencyTokenResponse consistencyToken. */ + public consistencyToken: string; + + /** + * Creates a new GenerateConsistencyTokenResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateConsistencyTokenResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; + + /** + * Encodes the specified GenerateConsistencyTokenResponse message. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse.verify|verify} messages. + * @param message GenerateConsistencyTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateConsistencyTokenResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse.verify|verify} messages. + * @param message GenerateConsistencyTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateConsistencyTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; + + /** + * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateConsistencyTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; + + /** + * Verifies a GenerateConsistencyTokenResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateConsistencyTokenResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateConsistencyTokenResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; + + /** + * Creates a plain object from a GenerateConsistencyTokenResponse message. Also converts values to other types if specified. + * @param message GenerateConsistencyTokenResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GenerateConsistencyTokenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateConsistencyTokenResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateConsistencyTokenResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckConsistencyRequest. */ + interface ICheckConsistencyRequest { + + /** CheckConsistencyRequest name */ + name?: (string|null); + + /** CheckConsistencyRequest consistencyToken */ + consistencyToken?: (string|null); + + /** CheckConsistencyRequest standardReadRemoteWrites */ + standardReadRemoteWrites?: (google.bigtable.admin.v2.IStandardReadRemoteWrites|null); + + /** CheckConsistencyRequest dataBoostReadLocalWrites */ + dataBoostReadLocalWrites?: (google.bigtable.admin.v2.IDataBoostReadLocalWrites|null); + } + + /** Represents a CheckConsistencyRequest. */ + class CheckConsistencyRequest implements ICheckConsistencyRequest { + + /** + * Constructs a new CheckConsistencyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICheckConsistencyRequest); + + /** CheckConsistencyRequest name. */ + public name: string; + + /** CheckConsistencyRequest consistencyToken. */ + public consistencyToken: string; + + /** CheckConsistencyRequest standardReadRemoteWrites. */ + public standardReadRemoteWrites?: (google.bigtable.admin.v2.IStandardReadRemoteWrites|null); + + /** CheckConsistencyRequest dataBoostReadLocalWrites. */ + public dataBoostReadLocalWrites?: (google.bigtable.admin.v2.IDataBoostReadLocalWrites|null); + + /** CheckConsistencyRequest mode. */ + public mode?: ("standardReadRemoteWrites"|"dataBoostReadLocalWrites"); + + /** + * Creates a new CheckConsistencyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckConsistencyRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICheckConsistencyRequest): google.bigtable.admin.v2.CheckConsistencyRequest; + + /** + * Encodes the specified CheckConsistencyRequest message. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyRequest.verify|verify} messages. + * @param message CheckConsistencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICheckConsistencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckConsistencyRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyRequest.verify|verify} messages. + * @param message CheckConsistencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICheckConsistencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckConsistencyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckConsistencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CheckConsistencyRequest; + + /** + * Decodes a CheckConsistencyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckConsistencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CheckConsistencyRequest; + + /** + * Verifies a CheckConsistencyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckConsistencyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckConsistencyRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CheckConsistencyRequest; + + /** + * Creates a plain object from a CheckConsistencyRequest message. Also converts values to other types if specified. + * @param message CheckConsistencyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CheckConsistencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckConsistencyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckConsistencyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StandardReadRemoteWrites. */ + interface IStandardReadRemoteWrites { + } + + /** Represents a StandardReadRemoteWrites. */ + class StandardReadRemoteWrites implements IStandardReadRemoteWrites { + + /** + * Constructs a new StandardReadRemoteWrites. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IStandardReadRemoteWrites); + + /** + * Creates a new StandardReadRemoteWrites instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardReadRemoteWrites instance + */ + public static create(properties?: google.bigtable.admin.v2.IStandardReadRemoteWrites): google.bigtable.admin.v2.StandardReadRemoteWrites; + + /** + * Encodes the specified StandardReadRemoteWrites message. Does not implicitly {@link google.bigtable.admin.v2.StandardReadRemoteWrites.verify|verify} messages. + * @param message StandardReadRemoteWrites message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IStandardReadRemoteWrites, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardReadRemoteWrites message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.StandardReadRemoteWrites.verify|verify} messages. + * @param message StandardReadRemoteWrites message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IStandardReadRemoteWrites, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardReadRemoteWrites message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardReadRemoteWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.StandardReadRemoteWrites; + + /** + * Decodes a StandardReadRemoteWrites message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardReadRemoteWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.StandardReadRemoteWrites; + + /** + * Verifies a StandardReadRemoteWrites message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardReadRemoteWrites message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardReadRemoteWrites + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.StandardReadRemoteWrites; + + /** + * Creates a plain object from a StandardReadRemoteWrites message. Also converts values to other types if specified. + * @param message StandardReadRemoteWrites + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.StandardReadRemoteWrites, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardReadRemoteWrites to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardReadRemoteWrites + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataBoostReadLocalWrites. */ + interface IDataBoostReadLocalWrites { + } + + /** Represents a DataBoostReadLocalWrites. */ + class DataBoostReadLocalWrites implements IDataBoostReadLocalWrites { + + /** + * Constructs a new DataBoostReadLocalWrites. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDataBoostReadLocalWrites); + + /** + * Creates a new DataBoostReadLocalWrites instance using the specified properties. + * @param [properties] Properties to set + * @returns DataBoostReadLocalWrites instance + */ + public static create(properties?: google.bigtable.admin.v2.IDataBoostReadLocalWrites): google.bigtable.admin.v2.DataBoostReadLocalWrites; + + /** + * Encodes the specified DataBoostReadLocalWrites message. Does not implicitly {@link google.bigtable.admin.v2.DataBoostReadLocalWrites.verify|verify} messages. + * @param message DataBoostReadLocalWrites message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDataBoostReadLocalWrites, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataBoostReadLocalWrites message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DataBoostReadLocalWrites.verify|verify} messages. + * @param message DataBoostReadLocalWrites message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDataBoostReadLocalWrites, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataBoostReadLocalWrites message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataBoostReadLocalWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DataBoostReadLocalWrites; + + /** + * Decodes a DataBoostReadLocalWrites message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataBoostReadLocalWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DataBoostReadLocalWrites; + + /** + * Verifies a DataBoostReadLocalWrites message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataBoostReadLocalWrites message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataBoostReadLocalWrites + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DataBoostReadLocalWrites; + + /** + * Creates a plain object from a DataBoostReadLocalWrites message. Also converts values to other types if specified. + * @param message DataBoostReadLocalWrites + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DataBoostReadLocalWrites, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataBoostReadLocalWrites to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataBoostReadLocalWrites + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckConsistencyResponse. */ + interface ICheckConsistencyResponse { + + /** CheckConsistencyResponse consistent */ + consistent?: (boolean|null); + } + + /** Represents a CheckConsistencyResponse. */ + class CheckConsistencyResponse implements ICheckConsistencyResponse { + + /** + * Constructs a new CheckConsistencyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICheckConsistencyResponse); + + /** CheckConsistencyResponse consistent. */ + public consistent: boolean; + + /** + * Creates a new CheckConsistencyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckConsistencyResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.ICheckConsistencyResponse): google.bigtable.admin.v2.CheckConsistencyResponse; + + /** + * Encodes the specified CheckConsistencyResponse message. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyResponse.verify|verify} messages. + * @param message CheckConsistencyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICheckConsistencyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckConsistencyResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyResponse.verify|verify} messages. + * @param message CheckConsistencyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICheckConsistencyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckConsistencyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckConsistencyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CheckConsistencyResponse; + + /** + * Decodes a CheckConsistencyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckConsistencyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CheckConsistencyResponse; + + /** + * Verifies a CheckConsistencyResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckConsistencyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckConsistencyResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CheckConsistencyResponse; + + /** + * Creates a plain object from a CheckConsistencyResponse message. Also converts values to other types if specified. + * @param message CheckConsistencyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CheckConsistencyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckConsistencyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckConsistencyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SnapshotTableRequest. */ + interface ISnapshotTableRequest { + + /** SnapshotTableRequest name */ + name?: (string|null); + + /** SnapshotTableRequest cluster */ + cluster?: (string|null); + + /** SnapshotTableRequest snapshotId */ + snapshotId?: (string|null); + + /** SnapshotTableRequest ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** SnapshotTableRequest description */ + description?: (string|null); + } + + /** Represents a SnapshotTableRequest. */ + class SnapshotTableRequest implements ISnapshotTableRequest { + + /** + * Constructs a new SnapshotTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ISnapshotTableRequest); + + /** SnapshotTableRequest name. */ + public name: string; + + /** SnapshotTableRequest cluster. */ + public cluster: string; + + /** SnapshotTableRequest snapshotId. */ + public snapshotId: string; + + /** SnapshotTableRequest ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** SnapshotTableRequest description. */ + public description: string; + + /** + * Creates a new SnapshotTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SnapshotTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ISnapshotTableRequest): google.bigtable.admin.v2.SnapshotTableRequest; + + /** + * Encodes the specified SnapshotTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableRequest.verify|verify} messages. + * @param message SnapshotTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ISnapshotTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SnapshotTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableRequest.verify|verify} messages. + * @param message SnapshotTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ISnapshotTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SnapshotTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SnapshotTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.SnapshotTableRequest; + + /** + * Decodes a SnapshotTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SnapshotTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.SnapshotTableRequest; + + /** + * Verifies a SnapshotTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SnapshotTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SnapshotTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.SnapshotTableRequest; + + /** + * Creates a plain object from a SnapshotTableRequest message. Also converts values to other types if specified. + * @param message SnapshotTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.SnapshotTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SnapshotTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SnapshotTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSnapshotRequest. */ + interface IGetSnapshotRequest { + + /** GetSnapshotRequest name */ + name?: (string|null); + } + + /** Represents a GetSnapshotRequest. */ + class GetSnapshotRequest implements IGetSnapshotRequest { + + /** + * Constructs a new GetSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetSnapshotRequest); + + /** GetSnapshotRequest name. */ + public name: string; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSnapshotRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetSnapshotRequest): google.bigtable.admin.v2.GetSnapshotRequest; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetSnapshotRequest; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetSnapshotRequest; + + /** + * Verifies a GetSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetSnapshotRequest; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @param message GetSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSnapshotsRequest. */ + interface IListSnapshotsRequest { + + /** ListSnapshotsRequest parent */ + parent?: (string|null); + + /** ListSnapshotsRequest pageSize */ + pageSize?: (number|null); + + /** ListSnapshotsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSnapshotsRequest. */ + class ListSnapshotsRequest implements IListSnapshotsRequest { + + /** + * Constructs a new ListSnapshotsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListSnapshotsRequest); + + /** ListSnapshotsRequest parent. */ + public parent: string; + + /** ListSnapshotsRequest pageSize. */ + public pageSize: number; + + /** ListSnapshotsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListSnapshotsRequest): google.bigtable.admin.v2.ListSnapshotsRequest; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListSnapshotsRequest; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListSnapshotsRequest; + + /** + * Verifies a ListSnapshotsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListSnapshotsRequest; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @param message ListSnapshotsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSnapshotsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSnapshotsResponse. */ + interface IListSnapshotsResponse { + + /** ListSnapshotsResponse snapshots */ + snapshots?: (google.bigtable.admin.v2.ISnapshot[]|null); + + /** ListSnapshotsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSnapshotsResponse. */ + class ListSnapshotsResponse implements IListSnapshotsResponse { + + /** + * Constructs a new ListSnapshotsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListSnapshotsResponse); + + /** ListSnapshotsResponse snapshots. */ + public snapshots: google.bigtable.admin.v2.ISnapshot[]; + + /** ListSnapshotsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSnapshotsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListSnapshotsResponse): google.bigtable.admin.v2.ListSnapshotsResponse; + + /** + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListSnapshotsResponse; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListSnapshotsResponse; + + /** + * Verifies a ListSnapshotsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListSnapshotsResponse; + + /** + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @param message ListSnapshotsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSnapshotsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSnapshotRequest. */ + interface IDeleteSnapshotRequest { + + /** DeleteSnapshotRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSnapshotRequest. */ + class DeleteSnapshotRequest implements IDeleteSnapshotRequest { + + /** + * Constructs a new DeleteSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteSnapshotRequest); + + /** DeleteSnapshotRequest name. */ + public name: string; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSnapshotRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteSnapshotRequest): google.bigtable.admin.v2.DeleteSnapshotRequest; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteSnapshotRequest; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteSnapshotRequest; + + /** + * Verifies a DeleteSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteSnapshotRequest; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @param message DeleteSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SnapshotTableMetadata. */ + interface ISnapshotTableMetadata { + + /** SnapshotTableMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ISnapshotTableRequest|null); + + /** SnapshotTableMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** SnapshotTableMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SnapshotTableMetadata. */ + class SnapshotTableMetadata implements ISnapshotTableMetadata { + + /** + * Constructs a new SnapshotTableMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ISnapshotTableMetadata); + + /** SnapshotTableMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ISnapshotTableRequest|null); + + /** SnapshotTableMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** SnapshotTableMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SnapshotTableMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns SnapshotTableMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ISnapshotTableMetadata): google.bigtable.admin.v2.SnapshotTableMetadata; + + /** + * Encodes the specified SnapshotTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableMetadata.verify|verify} messages. + * @param message SnapshotTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ISnapshotTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SnapshotTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableMetadata.verify|verify} messages. + * @param message SnapshotTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ISnapshotTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SnapshotTableMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SnapshotTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.SnapshotTableMetadata; + + /** + * Decodes a SnapshotTableMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SnapshotTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.SnapshotTableMetadata; + + /** + * Verifies a SnapshotTableMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SnapshotTableMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SnapshotTableMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.SnapshotTableMetadata; + + /** + * Creates a plain object from a SnapshotTableMetadata message. Also converts values to other types if specified. + * @param message SnapshotTableMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.SnapshotTableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SnapshotTableMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SnapshotTableMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTableFromSnapshotMetadata. */ + interface ICreateTableFromSnapshotMetadata { + + /** CreateTableFromSnapshotMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateTableFromSnapshotRequest|null); + + /** CreateTableFromSnapshotMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateTableFromSnapshotMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateTableFromSnapshotMetadata. */ + class CreateTableFromSnapshotMetadata implements ICreateTableFromSnapshotMetadata { + + /** + * Constructs a new CreateTableFromSnapshotMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata); + + /** CreateTableFromSnapshotMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateTableFromSnapshotRequest|null); + + /** CreateTableFromSnapshotMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateTableFromSnapshotMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateTableFromSnapshotMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTableFromSnapshotMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; + + /** + * Encodes the specified CreateTableFromSnapshotMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.verify|verify} messages. + * @param message CreateTableFromSnapshotMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTableFromSnapshotMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.verify|verify} messages. + * @param message CreateTableFromSnapshotMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTableFromSnapshotMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; + + /** + * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTableFromSnapshotMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; + + /** + * Verifies a CreateTableFromSnapshotMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTableFromSnapshotMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTableFromSnapshotMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; + + /** + * Creates a plain object from a CreateTableFromSnapshotMetadata message. Also converts values to other types if specified. + * @param message CreateTableFromSnapshotMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateTableFromSnapshotMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTableFromSnapshotMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTableFromSnapshotMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupRequest. */ + interface ICreateBackupRequest { + + /** CreateBackupRequest parent */ + parent?: (string|null); + + /** CreateBackupRequest backupId */ + backupId?: (string|null); + + /** CreateBackupRequest backup */ + backup?: (google.bigtable.admin.v2.IBackup|null); + } + + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { + + /** + * Constructs a new CreateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateBackupRequest); + + /** CreateBackupRequest parent. */ + public parent: string; + + /** CreateBackupRequest backupId. */ + public backupId: string; + + /** CreateBackupRequest backup. */ + public backup?: (google.bigtable.admin.v2.IBackup|null); + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateBackupRequest): google.bigtable.admin.v2.CreateBackupRequest; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateBackupRequest; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateBackupRequest; + + /** + * Verifies a CreateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateBackupRequest; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupMetadata. */ + interface ICreateBackupMetadata { + + /** CreateBackupMetadata name */ + name?: (string|null); + + /** CreateBackupMetadata sourceTable */ + sourceTable?: (string|null); + + /** CreateBackupMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CreateBackupMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateBackupMetadata. */ + class CreateBackupMetadata implements ICreateBackupMetadata { + + /** + * Constructs a new CreateBackupMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateBackupMetadata); + + /** CreateBackupMetadata name. */ + public name: string; + + /** CreateBackupMetadata sourceTable. */ + public sourceTable: string; + + /** CreateBackupMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CreateBackupMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateBackupMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateBackupMetadata): google.bigtable.admin.v2.CreateBackupMetadata; + + /** + * Encodes the specified CreateBackupMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupMetadata.verify|verify} messages. + * @param message CreateBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupMetadata.verify|verify} messages. + * @param message CreateBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateBackupMetadata; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateBackupMetadata; + + /** + * Verifies a CreateBackupMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateBackupMetadata; + + /** + * Creates a plain object from a CreateBackupMetadata message. Also converts values to other types if specified. + * @param message CreateBackupMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateBackupMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest backup */ + backup?: (google.bigtable.admin.v2.IBackup|null); + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateBackupRequest); + + /** UpdateBackupRequest backup. */ + public backup?: (google.bigtable.admin.v2.IBackup|null); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateBackupRequest): google.bigtable.admin.v2.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetBackupRequest): google.bigtable.admin.v2.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteBackupRequest): google.bigtable.admin.v2.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListBackupsRequest): google.bigtable.admin.v2.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListBackupsRequest; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.bigtable.admin.v2.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.bigtable.admin.v2.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListBackupsResponse): google.bigtable.admin.v2.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListBackupsResponse; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListBackupsResponse; + + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListBackupsResponse; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyBackupRequest. */ + interface ICopyBackupRequest { + + /** CopyBackupRequest parent */ + parent?: (string|null); + + /** CopyBackupRequest backupId */ + backupId?: (string|null); + + /** CopyBackupRequest sourceBackup */ + sourceBackup?: (string|null); + + /** CopyBackupRequest expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CopyBackupRequest. */ + class CopyBackupRequest implements ICopyBackupRequest { + + /** + * Constructs a new CopyBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICopyBackupRequest); + + /** CopyBackupRequest parent. */ + public parent: string; + + /** CopyBackupRequest backupId. */ + public backupId: string; + + /** CopyBackupRequest sourceBackup. */ + public sourceBackup: string; + + /** CopyBackupRequest expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CopyBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyBackupRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICopyBackupRequest): google.bigtable.admin.v2.CopyBackupRequest; + + /** + * Encodes the specified CopyBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupRequest.verify|verify} messages. + * @param message CopyBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICopyBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CopyBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupRequest.verify|verify} messages. + * @param message CopyBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICopyBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CopyBackupRequest; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CopyBackupRequest; + + /** + * Verifies a CopyBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CopyBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CopyBackupRequest; + + /** + * Creates a plain object from a CopyBackupRequest message. Also converts values to other types if specified. + * @param message CopyBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CopyBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyBackupMetadata. */ + interface ICopyBackupMetadata { + + /** CopyBackupMetadata name */ + name?: (string|null); + + /** CopyBackupMetadata sourceBackupInfo */ + sourceBackupInfo?: (google.bigtable.admin.v2.IBackupInfo|null); + + /** CopyBackupMetadata progress */ + progress?: (google.bigtable.admin.v2.IOperationProgress|null); + } + + /** Represents a CopyBackupMetadata. */ + class CopyBackupMetadata implements ICopyBackupMetadata { + + /** + * Constructs a new CopyBackupMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICopyBackupMetadata); + + /** CopyBackupMetadata name. */ + public name: string; + + /** CopyBackupMetadata sourceBackupInfo. */ + public sourceBackupInfo?: (google.bigtable.admin.v2.IBackupInfo|null); + + /** CopyBackupMetadata progress. */ + public progress?: (google.bigtable.admin.v2.IOperationProgress|null); + + /** + * Creates a new CopyBackupMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyBackupMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICopyBackupMetadata): google.bigtable.admin.v2.CopyBackupMetadata; + + /** + * Encodes the specified CopyBackupMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupMetadata.verify|verify} messages. + * @param message CopyBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICopyBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CopyBackupMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupMetadata.verify|verify} messages. + * @param message CopyBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICopyBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CopyBackupMetadata; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CopyBackupMetadata; + + /** + * Verifies a CopyBackupMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CopyBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyBackupMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CopyBackupMetadata; + + /** + * Creates a plain object from a CopyBackupMetadata message. Also converts values to other types if specified. + * @param message CopyBackupMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CopyBackupMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyBackupMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyBackupMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAuthorizedViewRequest. */ + interface ICreateAuthorizedViewRequest { + + /** CreateAuthorizedViewRequest parent */ + parent?: (string|null); + + /** CreateAuthorizedViewRequest authorizedViewId */ + authorizedViewId?: (string|null); + + /** CreateAuthorizedViewRequest authorizedView */ + authorizedView?: (google.bigtable.admin.v2.IAuthorizedView|null); + } + + /** Represents a CreateAuthorizedViewRequest. */ + class CreateAuthorizedViewRequest implements ICreateAuthorizedViewRequest { + + /** + * Constructs a new CreateAuthorizedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateAuthorizedViewRequest); + + /** CreateAuthorizedViewRequest parent. */ + public parent: string; + + /** CreateAuthorizedViewRequest authorizedViewId. */ + public authorizedViewId: string; + + /** CreateAuthorizedViewRequest authorizedView. */ + public authorizedView?: (google.bigtable.admin.v2.IAuthorizedView|null); + + /** + * Creates a new CreateAuthorizedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAuthorizedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateAuthorizedViewRequest): google.bigtable.admin.v2.CreateAuthorizedViewRequest; + + /** + * Encodes the specified CreateAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewRequest.verify|verify} messages. + * @param message CreateAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewRequest.verify|verify} messages. + * @param message CreateAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAuthorizedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateAuthorizedViewRequest; + + /** + * Decodes a CreateAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateAuthorizedViewRequest; + + /** + * Verifies a CreateAuthorizedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAuthorizedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateAuthorizedViewRequest; + + /** + * Creates a plain object from a CreateAuthorizedViewRequest message. Also converts values to other types if specified. + * @param message CreateAuthorizedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateAuthorizedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAuthorizedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAuthorizedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAuthorizedViewMetadata. */ + interface ICreateAuthorizedViewMetadata { + + /** CreateAuthorizedViewMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateAuthorizedViewRequest|null); + + /** CreateAuthorizedViewMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateAuthorizedViewMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateAuthorizedViewMetadata. */ + class CreateAuthorizedViewMetadata implements ICreateAuthorizedViewMetadata { + + /** + * Constructs a new CreateAuthorizedViewMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateAuthorizedViewMetadata); + + /** CreateAuthorizedViewMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateAuthorizedViewRequest|null); + + /** CreateAuthorizedViewMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateAuthorizedViewMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateAuthorizedViewMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAuthorizedViewMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateAuthorizedViewMetadata): google.bigtable.admin.v2.CreateAuthorizedViewMetadata; + + /** + * Encodes the specified CreateAuthorizedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewMetadata.verify|verify} messages. + * @param message CreateAuthorizedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateAuthorizedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAuthorizedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewMetadata.verify|verify} messages. + * @param message CreateAuthorizedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateAuthorizedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAuthorizedViewMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateAuthorizedViewMetadata; + + /** + * Decodes a CreateAuthorizedViewMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateAuthorizedViewMetadata; + + /** + * Verifies a CreateAuthorizedViewMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAuthorizedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAuthorizedViewMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateAuthorizedViewMetadata; + + /** + * Creates a plain object from a CreateAuthorizedViewMetadata message. Also converts values to other types if specified. + * @param message CreateAuthorizedViewMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateAuthorizedViewMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAuthorizedViewMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAuthorizedViewMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAuthorizedViewsRequest. */ + interface IListAuthorizedViewsRequest { + + /** ListAuthorizedViewsRequest parent */ + parent?: (string|null); + + /** ListAuthorizedViewsRequest pageSize */ + pageSize?: (number|null); + + /** ListAuthorizedViewsRequest pageToken */ + pageToken?: (string|null); + + /** ListAuthorizedViewsRequest view */ + view?: (google.bigtable.admin.v2.AuthorizedView.ResponseView|keyof typeof google.bigtable.admin.v2.AuthorizedView.ResponseView|null); + } + + /** Represents a ListAuthorizedViewsRequest. */ + class ListAuthorizedViewsRequest implements IListAuthorizedViewsRequest { + + /** + * Constructs a new ListAuthorizedViewsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListAuthorizedViewsRequest); + + /** ListAuthorizedViewsRequest parent. */ + public parent: string; + + /** ListAuthorizedViewsRequest pageSize. */ + public pageSize: number; + + /** ListAuthorizedViewsRequest pageToken. */ + public pageToken: string; + + /** ListAuthorizedViewsRequest view. */ + public view: (google.bigtable.admin.v2.AuthorizedView.ResponseView|keyof typeof google.bigtable.admin.v2.AuthorizedView.ResponseView); + + /** + * Creates a new ListAuthorizedViewsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAuthorizedViewsRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListAuthorizedViewsRequest): google.bigtable.admin.v2.ListAuthorizedViewsRequest; + + /** + * Encodes the specified ListAuthorizedViewsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsRequest.verify|verify} messages. + * @param message ListAuthorizedViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListAuthorizedViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAuthorizedViewsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsRequest.verify|verify} messages. + * @param message ListAuthorizedViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListAuthorizedViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAuthorizedViewsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAuthorizedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListAuthorizedViewsRequest; + + /** + * Decodes a ListAuthorizedViewsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAuthorizedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListAuthorizedViewsRequest; + + /** + * Verifies a ListAuthorizedViewsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAuthorizedViewsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAuthorizedViewsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListAuthorizedViewsRequest; + + /** + * Creates a plain object from a ListAuthorizedViewsRequest message. Also converts values to other types if specified. + * @param message ListAuthorizedViewsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListAuthorizedViewsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAuthorizedViewsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAuthorizedViewsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAuthorizedViewsResponse. */ + interface IListAuthorizedViewsResponse { + + /** ListAuthorizedViewsResponse authorizedViews */ + authorizedViews?: (google.bigtable.admin.v2.IAuthorizedView[]|null); + + /** ListAuthorizedViewsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAuthorizedViewsResponse. */ + class ListAuthorizedViewsResponse implements IListAuthorizedViewsResponse { + + /** + * Constructs a new ListAuthorizedViewsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListAuthorizedViewsResponse); + + /** ListAuthorizedViewsResponse authorizedViews. */ + public authorizedViews: google.bigtable.admin.v2.IAuthorizedView[]; + + /** ListAuthorizedViewsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAuthorizedViewsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAuthorizedViewsResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListAuthorizedViewsResponse): google.bigtable.admin.v2.ListAuthorizedViewsResponse; + + /** + * Encodes the specified ListAuthorizedViewsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsResponse.verify|verify} messages. + * @param message ListAuthorizedViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListAuthorizedViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAuthorizedViewsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsResponse.verify|verify} messages. + * @param message ListAuthorizedViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListAuthorizedViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAuthorizedViewsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAuthorizedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListAuthorizedViewsResponse; + + /** + * Decodes a ListAuthorizedViewsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAuthorizedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListAuthorizedViewsResponse; + + /** + * Verifies a ListAuthorizedViewsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAuthorizedViewsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAuthorizedViewsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListAuthorizedViewsResponse; + + /** + * Creates a plain object from a ListAuthorizedViewsResponse message. Also converts values to other types if specified. + * @param message ListAuthorizedViewsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListAuthorizedViewsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAuthorizedViewsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAuthorizedViewsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAuthorizedViewRequest. */ + interface IGetAuthorizedViewRequest { + + /** GetAuthorizedViewRequest name */ + name?: (string|null); + + /** GetAuthorizedViewRequest view */ + view?: (google.bigtable.admin.v2.AuthorizedView.ResponseView|keyof typeof google.bigtable.admin.v2.AuthorizedView.ResponseView|null); + } + + /** Represents a GetAuthorizedViewRequest. */ + class GetAuthorizedViewRequest implements IGetAuthorizedViewRequest { + + /** + * Constructs a new GetAuthorizedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetAuthorizedViewRequest); + + /** GetAuthorizedViewRequest name. */ + public name: string; + + /** GetAuthorizedViewRequest view. */ + public view: (google.bigtable.admin.v2.AuthorizedView.ResponseView|keyof typeof google.bigtable.admin.v2.AuthorizedView.ResponseView); + + /** + * Creates a new GetAuthorizedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAuthorizedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetAuthorizedViewRequest): google.bigtable.admin.v2.GetAuthorizedViewRequest; + + /** + * Encodes the specified GetAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetAuthorizedViewRequest.verify|verify} messages. + * @param message GetAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetAuthorizedViewRequest.verify|verify} messages. + * @param message GetAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAuthorizedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetAuthorizedViewRequest; + + /** + * Decodes a GetAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetAuthorizedViewRequest; + + /** + * Verifies a GetAuthorizedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAuthorizedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetAuthorizedViewRequest; + + /** + * Creates a plain object from a GetAuthorizedViewRequest message. Also converts values to other types if specified. + * @param message GetAuthorizedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetAuthorizedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAuthorizedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAuthorizedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAuthorizedViewRequest. */ + interface IUpdateAuthorizedViewRequest { + + /** UpdateAuthorizedViewRequest authorizedView */ + authorizedView?: (google.bigtable.admin.v2.IAuthorizedView|null); + + /** UpdateAuthorizedViewRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAuthorizedViewRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents an UpdateAuthorizedViewRequest. */ + class UpdateAuthorizedViewRequest implements IUpdateAuthorizedViewRequest { + + /** + * Constructs a new UpdateAuthorizedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateAuthorizedViewRequest); + + /** UpdateAuthorizedViewRequest authorizedView. */ + public authorizedView?: (google.bigtable.admin.v2.IAuthorizedView|null); + + /** UpdateAuthorizedViewRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAuthorizedViewRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new UpdateAuthorizedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAuthorizedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateAuthorizedViewRequest): google.bigtable.admin.v2.UpdateAuthorizedViewRequest; + + /** + * Encodes the specified UpdateAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewRequest.verify|verify} messages. + * @param message UpdateAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewRequest.verify|verify} messages. + * @param message UpdateAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAuthorizedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateAuthorizedViewRequest; + + /** + * Decodes an UpdateAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateAuthorizedViewRequest; + + /** + * Verifies an UpdateAuthorizedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAuthorizedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateAuthorizedViewRequest; + + /** + * Creates a plain object from an UpdateAuthorizedViewRequest message. Also converts values to other types if specified. + * @param message UpdateAuthorizedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateAuthorizedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAuthorizedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAuthorizedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAuthorizedViewMetadata. */ + interface IUpdateAuthorizedViewMetadata { + + /** UpdateAuthorizedViewMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.IUpdateAuthorizedViewRequest|null); + + /** UpdateAuthorizedViewMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateAuthorizedViewMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateAuthorizedViewMetadata. */ + class UpdateAuthorizedViewMetadata implements IUpdateAuthorizedViewMetadata { + + /** + * Constructs a new UpdateAuthorizedViewMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata); + + /** UpdateAuthorizedViewMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.IUpdateAuthorizedViewRequest|null); + + /** UpdateAuthorizedViewMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateAuthorizedViewMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateAuthorizedViewMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAuthorizedViewMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata): google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; + + /** + * Encodes the specified UpdateAuthorizedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.verify|verify} messages. + * @param message UpdateAuthorizedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAuthorizedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.verify|verify} messages. + * @param message UpdateAuthorizedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAuthorizedViewMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; + + /** + * Decodes an UpdateAuthorizedViewMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; + + /** + * Verifies an UpdateAuthorizedViewMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAuthorizedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAuthorizedViewMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; + + /** + * Creates a plain object from an UpdateAuthorizedViewMetadata message. Also converts values to other types if specified. + * @param message UpdateAuthorizedViewMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateAuthorizedViewMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAuthorizedViewMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAuthorizedViewMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAuthorizedViewRequest. */ + interface IDeleteAuthorizedViewRequest { + + /** DeleteAuthorizedViewRequest name */ + name?: (string|null); + + /** DeleteAuthorizedViewRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteAuthorizedViewRequest. */ + class DeleteAuthorizedViewRequest implements IDeleteAuthorizedViewRequest { + + /** + * Constructs a new DeleteAuthorizedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteAuthorizedViewRequest); + + /** DeleteAuthorizedViewRequest name. */ + public name: string; + + /** DeleteAuthorizedViewRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteAuthorizedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAuthorizedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteAuthorizedViewRequest): google.bigtable.admin.v2.DeleteAuthorizedViewRequest; + + /** + * Encodes the specified DeleteAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteAuthorizedViewRequest.verify|verify} messages. + * @param message DeleteAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteAuthorizedViewRequest.verify|verify} messages. + * @param message DeleteAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAuthorizedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteAuthorizedViewRequest; + + /** + * Decodes a DeleteAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteAuthorizedViewRequest; + + /** + * Verifies a DeleteAuthorizedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAuthorizedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteAuthorizedViewRequest; + + /** + * Creates a plain object from a DeleteAuthorizedViewRequest message. Also converts values to other types if specified. + * @param message DeleteAuthorizedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteAuthorizedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAuthorizedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAuthorizedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSchemaBundleRequest. */ + interface ICreateSchemaBundleRequest { + + /** CreateSchemaBundleRequest parent */ + parent?: (string|null); + + /** CreateSchemaBundleRequest schemaBundleId */ + schemaBundleId?: (string|null); + + /** CreateSchemaBundleRequest schemaBundle */ + schemaBundle?: (google.bigtable.admin.v2.ISchemaBundle|null); + } + + /** Represents a CreateSchemaBundleRequest. */ + class CreateSchemaBundleRequest implements ICreateSchemaBundleRequest { + + /** + * Constructs a new CreateSchemaBundleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateSchemaBundleRequest); + + /** CreateSchemaBundleRequest parent. */ + public parent: string; + + /** CreateSchemaBundleRequest schemaBundleId. */ + public schemaBundleId: string; + + /** CreateSchemaBundleRequest schemaBundle. */ + public schemaBundle?: (google.bigtable.admin.v2.ISchemaBundle|null); + + /** + * Creates a new CreateSchemaBundleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSchemaBundleRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateSchemaBundleRequest): google.bigtable.admin.v2.CreateSchemaBundleRequest; + + /** + * Encodes the specified CreateSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleRequest.verify|verify} messages. + * @param message CreateSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleRequest.verify|verify} messages. + * @param message CreateSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSchemaBundleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateSchemaBundleRequest; + + /** + * Decodes a CreateSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateSchemaBundleRequest; + + /** + * Verifies a CreateSchemaBundleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSchemaBundleRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateSchemaBundleRequest; + + /** + * Creates a plain object from a CreateSchemaBundleRequest message. Also converts values to other types if specified. + * @param message CreateSchemaBundleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateSchemaBundleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSchemaBundleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSchemaBundleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSchemaBundleMetadata. */ + interface ICreateSchemaBundleMetadata { + + /** CreateSchemaBundleMetadata name */ + name?: (string|null); + + /** CreateSchemaBundleMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CreateSchemaBundleMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateSchemaBundleMetadata. */ + class CreateSchemaBundleMetadata implements ICreateSchemaBundleMetadata { + + /** + * Constructs a new CreateSchemaBundleMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateSchemaBundleMetadata); + + /** CreateSchemaBundleMetadata name. */ + public name: string; + + /** CreateSchemaBundleMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CreateSchemaBundleMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateSchemaBundleMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSchemaBundleMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateSchemaBundleMetadata): google.bigtable.admin.v2.CreateSchemaBundleMetadata; + + /** + * Encodes the specified CreateSchemaBundleMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleMetadata.verify|verify} messages. + * @param message CreateSchemaBundleMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateSchemaBundleMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSchemaBundleMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleMetadata.verify|verify} messages. + * @param message CreateSchemaBundleMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateSchemaBundleMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSchemaBundleMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateSchemaBundleMetadata; + + /** + * Decodes a CreateSchemaBundleMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateSchemaBundleMetadata; + + /** + * Verifies a CreateSchemaBundleMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSchemaBundleMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSchemaBundleMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateSchemaBundleMetadata; + + /** + * Creates a plain object from a CreateSchemaBundleMetadata message. Also converts values to other types if specified. + * @param message CreateSchemaBundleMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateSchemaBundleMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSchemaBundleMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSchemaBundleMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSchemaBundleRequest. */ + interface IUpdateSchemaBundleRequest { + + /** UpdateSchemaBundleRequest schemaBundle */ + schemaBundle?: (google.bigtable.admin.v2.ISchemaBundle|null); + + /** UpdateSchemaBundleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSchemaBundleRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents an UpdateSchemaBundleRequest. */ + class UpdateSchemaBundleRequest implements IUpdateSchemaBundleRequest { + + /** + * Constructs a new UpdateSchemaBundleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateSchemaBundleRequest); + + /** UpdateSchemaBundleRequest schemaBundle. */ + public schemaBundle?: (google.bigtable.admin.v2.ISchemaBundle|null); + + /** UpdateSchemaBundleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSchemaBundleRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new UpdateSchemaBundleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSchemaBundleRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateSchemaBundleRequest): google.bigtable.admin.v2.UpdateSchemaBundleRequest; + + /** + * Encodes the specified UpdateSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleRequest.verify|verify} messages. + * @param message UpdateSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleRequest.verify|verify} messages. + * @param message UpdateSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSchemaBundleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateSchemaBundleRequest; + + /** + * Decodes an UpdateSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateSchemaBundleRequest; + + /** + * Verifies an UpdateSchemaBundleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSchemaBundleRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateSchemaBundleRequest; + + /** + * Creates a plain object from an UpdateSchemaBundleRequest message. Also converts values to other types if specified. + * @param message UpdateSchemaBundleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateSchemaBundleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSchemaBundleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSchemaBundleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSchemaBundleMetadata. */ + interface IUpdateSchemaBundleMetadata { + + /** UpdateSchemaBundleMetadata name */ + name?: (string|null); + + /** UpdateSchemaBundleMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateSchemaBundleMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateSchemaBundleMetadata. */ + class UpdateSchemaBundleMetadata implements IUpdateSchemaBundleMetadata { + + /** + * Constructs a new UpdateSchemaBundleMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateSchemaBundleMetadata); + + /** UpdateSchemaBundleMetadata name. */ + public name: string; + + /** UpdateSchemaBundleMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateSchemaBundleMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateSchemaBundleMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSchemaBundleMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateSchemaBundleMetadata): google.bigtable.admin.v2.UpdateSchemaBundleMetadata; + + /** + * Encodes the specified UpdateSchemaBundleMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleMetadata.verify|verify} messages. + * @param message UpdateSchemaBundleMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateSchemaBundleMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSchemaBundleMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleMetadata.verify|verify} messages. + * @param message UpdateSchemaBundleMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateSchemaBundleMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSchemaBundleMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateSchemaBundleMetadata; + + /** + * Decodes an UpdateSchemaBundleMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateSchemaBundleMetadata; + + /** + * Verifies an UpdateSchemaBundleMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSchemaBundleMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSchemaBundleMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateSchemaBundleMetadata; + + /** + * Creates a plain object from an UpdateSchemaBundleMetadata message. Also converts values to other types if specified. + * @param message UpdateSchemaBundleMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateSchemaBundleMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSchemaBundleMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSchemaBundleMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSchemaBundleRequest. */ + interface IGetSchemaBundleRequest { + + /** GetSchemaBundleRequest name */ + name?: (string|null); + } + + /** Represents a GetSchemaBundleRequest. */ + class GetSchemaBundleRequest implements IGetSchemaBundleRequest { + + /** + * Constructs a new GetSchemaBundleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetSchemaBundleRequest); + + /** GetSchemaBundleRequest name. */ + public name: string; + + /** + * Creates a new GetSchemaBundleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSchemaBundleRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetSchemaBundleRequest): google.bigtable.admin.v2.GetSchemaBundleRequest; + + /** + * Encodes the specified GetSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetSchemaBundleRequest.verify|verify} messages. + * @param message GetSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetSchemaBundleRequest.verify|verify} messages. + * @param message GetSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSchemaBundleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetSchemaBundleRequest; + + /** + * Decodes a GetSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetSchemaBundleRequest; + + /** + * Verifies a GetSchemaBundleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSchemaBundleRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetSchemaBundleRequest; + + /** + * Creates a plain object from a GetSchemaBundleRequest message. Also converts values to other types if specified. + * @param message GetSchemaBundleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetSchemaBundleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSchemaBundleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSchemaBundleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemaBundlesRequest. */ + interface IListSchemaBundlesRequest { + + /** ListSchemaBundlesRequest parent */ + parent?: (string|null); + + /** ListSchemaBundlesRequest pageSize */ + pageSize?: (number|null); + + /** ListSchemaBundlesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSchemaBundlesRequest. */ + class ListSchemaBundlesRequest implements IListSchemaBundlesRequest { + + /** + * Constructs a new ListSchemaBundlesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListSchemaBundlesRequest); + + /** ListSchemaBundlesRequest parent. */ + public parent: string; + + /** ListSchemaBundlesRequest pageSize. */ + public pageSize: number; + + /** ListSchemaBundlesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSchemaBundlesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemaBundlesRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListSchemaBundlesRequest): google.bigtable.admin.v2.ListSchemaBundlesRequest; + + /** + * Encodes the specified ListSchemaBundlesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesRequest.verify|verify} messages. + * @param message ListSchemaBundlesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListSchemaBundlesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemaBundlesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesRequest.verify|verify} messages. + * @param message ListSchemaBundlesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListSchemaBundlesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemaBundlesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemaBundlesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListSchemaBundlesRequest; + + /** + * Decodes a ListSchemaBundlesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemaBundlesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListSchemaBundlesRequest; + + /** + * Verifies a ListSchemaBundlesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSchemaBundlesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemaBundlesRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListSchemaBundlesRequest; + + /** + * Creates a plain object from a ListSchemaBundlesRequest message. Also converts values to other types if specified. + * @param message ListSchemaBundlesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListSchemaBundlesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemaBundlesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemaBundlesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemaBundlesResponse. */ + interface IListSchemaBundlesResponse { + + /** ListSchemaBundlesResponse schemaBundles */ + schemaBundles?: (google.bigtable.admin.v2.ISchemaBundle[]|null); + + /** ListSchemaBundlesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSchemaBundlesResponse. */ + class ListSchemaBundlesResponse implements IListSchemaBundlesResponse { + + /** + * Constructs a new ListSchemaBundlesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListSchemaBundlesResponse); + + /** ListSchemaBundlesResponse schemaBundles. */ + public schemaBundles: google.bigtable.admin.v2.ISchemaBundle[]; + + /** ListSchemaBundlesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSchemaBundlesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemaBundlesResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListSchemaBundlesResponse): google.bigtable.admin.v2.ListSchemaBundlesResponse; + + /** + * Encodes the specified ListSchemaBundlesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesResponse.verify|verify} messages. + * @param message ListSchemaBundlesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListSchemaBundlesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemaBundlesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesResponse.verify|verify} messages. + * @param message ListSchemaBundlesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListSchemaBundlesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemaBundlesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemaBundlesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListSchemaBundlesResponse; + + /** + * Decodes a ListSchemaBundlesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemaBundlesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListSchemaBundlesResponse; + + /** + * Verifies a ListSchemaBundlesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSchemaBundlesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemaBundlesResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListSchemaBundlesResponse; + + /** + * Creates a plain object from a ListSchemaBundlesResponse message. Also converts values to other types if specified. + * @param message ListSchemaBundlesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListSchemaBundlesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemaBundlesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemaBundlesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSchemaBundleRequest. */ + interface IDeleteSchemaBundleRequest { + + /** DeleteSchemaBundleRequest name */ + name?: (string|null); + + /** DeleteSchemaBundleRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteSchemaBundleRequest. */ + class DeleteSchemaBundleRequest implements IDeleteSchemaBundleRequest { + + /** + * Constructs a new DeleteSchemaBundleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteSchemaBundleRequest); + + /** DeleteSchemaBundleRequest name. */ + public name: string; + + /** DeleteSchemaBundleRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteSchemaBundleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSchemaBundleRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteSchemaBundleRequest): google.bigtable.admin.v2.DeleteSchemaBundleRequest; + + /** + * Encodes the specified DeleteSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteSchemaBundleRequest.verify|verify} messages. + * @param message DeleteSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteSchemaBundleRequest.verify|verify} messages. + * @param message DeleteSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSchemaBundleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteSchemaBundleRequest; + + /** + * Decodes a DeleteSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteSchemaBundleRequest; + + /** + * Verifies a DeleteSchemaBundleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSchemaBundleRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteSchemaBundleRequest; + + /** + * Creates a plain object from a DeleteSchemaBundleRequest message. Also converts values to other types if specified. + * @param message DeleteSchemaBundleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteSchemaBundleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSchemaBundleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSchemaBundleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreInfo. */ + interface IRestoreInfo { + + /** RestoreInfo sourceType */ + sourceType?: (google.bigtable.admin.v2.RestoreSourceType|keyof typeof google.bigtable.admin.v2.RestoreSourceType|null); + + /** RestoreInfo backupInfo */ + backupInfo?: (google.bigtable.admin.v2.IBackupInfo|null); + } + + /** Represents a RestoreInfo. */ + class RestoreInfo implements IRestoreInfo { + + /** + * Constructs a new RestoreInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IRestoreInfo); + + /** RestoreInfo sourceType. */ + public sourceType: (google.bigtable.admin.v2.RestoreSourceType|keyof typeof google.bigtable.admin.v2.RestoreSourceType); + + /** RestoreInfo backupInfo. */ + public backupInfo?: (google.bigtable.admin.v2.IBackupInfo|null); + + /** RestoreInfo sourceInfo. */ + public sourceInfo?: "backupInfo"; + + /** + * Creates a new RestoreInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreInfo instance + */ + public static create(properties?: google.bigtable.admin.v2.IRestoreInfo): google.bigtable.admin.v2.RestoreInfo; + + /** + * Encodes the specified RestoreInfo message. Does not implicitly {@link google.bigtable.admin.v2.RestoreInfo.verify|verify} messages. + * @param message RestoreInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IRestoreInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreInfo message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.RestoreInfo.verify|verify} messages. + * @param message RestoreInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IRestoreInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.RestoreInfo; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.RestoreInfo; + + /** + * Verifies a RestoreInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreInfo + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.RestoreInfo; + + /** + * Creates a plain object from a RestoreInfo message. Also converts values to other types if specified. + * @param message RestoreInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.RestoreInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChangeStreamConfig. */ + interface IChangeStreamConfig { + + /** ChangeStreamConfig retentionPeriod */ + retentionPeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a ChangeStreamConfig. */ + class ChangeStreamConfig implements IChangeStreamConfig { + + /** + * Constructs a new ChangeStreamConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IChangeStreamConfig); + + /** ChangeStreamConfig retentionPeriod. */ + public retentionPeriod?: (google.protobuf.IDuration|null); + + /** + * Creates a new ChangeStreamConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ChangeStreamConfig instance + */ + public static create(properties?: google.bigtable.admin.v2.IChangeStreamConfig): google.bigtable.admin.v2.ChangeStreamConfig; + + /** + * Encodes the specified ChangeStreamConfig message. Does not implicitly {@link google.bigtable.admin.v2.ChangeStreamConfig.verify|verify} messages. + * @param message ChangeStreamConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IChangeStreamConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChangeStreamConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ChangeStreamConfig.verify|verify} messages. + * @param message ChangeStreamConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IChangeStreamConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChangeStreamConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChangeStreamConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ChangeStreamConfig; + + /** + * Decodes a ChangeStreamConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChangeStreamConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ChangeStreamConfig; + + /** + * Verifies a ChangeStreamConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChangeStreamConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChangeStreamConfig + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ChangeStreamConfig; + + /** + * Creates a plain object from a ChangeStreamConfig message. Also converts values to other types if specified. + * @param message ChangeStreamConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ChangeStreamConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChangeStreamConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChangeStreamConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Table. */ + interface ITable { + + /** Table name */ + name?: (string|null); + + /** Table clusterStates */ + clusterStates?: ({ [k: string]: google.bigtable.admin.v2.Table.IClusterState }|null); + + /** Table columnFamilies */ + columnFamilies?: ({ [k: string]: google.bigtable.admin.v2.IColumnFamily }|null); + + /** Table granularity */ + granularity?: (google.bigtable.admin.v2.Table.TimestampGranularity|keyof typeof google.bigtable.admin.v2.Table.TimestampGranularity|null); + + /** Table restoreInfo */ + restoreInfo?: (google.bigtable.admin.v2.IRestoreInfo|null); + + /** Table changeStreamConfig */ + changeStreamConfig?: (google.bigtable.admin.v2.IChangeStreamConfig|null); + + /** Table deletionProtection */ + deletionProtection?: (boolean|null); + + /** Table automatedBackupPolicy */ + automatedBackupPolicy?: (google.bigtable.admin.v2.Table.IAutomatedBackupPolicy|null); + + /** Table rowKeySchema */ + rowKeySchema?: (google.bigtable.admin.v2.Type.IStruct|null); + } + + /** Represents a Table. */ + class Table implements ITable { + + /** + * Constructs a new Table. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ITable); + + /** Table name. */ + public name: string; + + /** Table clusterStates. */ + public clusterStates: { [k: string]: google.bigtable.admin.v2.Table.IClusterState }; + + /** Table columnFamilies. */ + public columnFamilies: { [k: string]: google.bigtable.admin.v2.IColumnFamily }; + + /** Table granularity. */ + public granularity: (google.bigtable.admin.v2.Table.TimestampGranularity|keyof typeof google.bigtable.admin.v2.Table.TimestampGranularity); + + /** Table restoreInfo. */ + public restoreInfo?: (google.bigtable.admin.v2.IRestoreInfo|null); + + /** Table changeStreamConfig. */ + public changeStreamConfig?: (google.bigtable.admin.v2.IChangeStreamConfig|null); + + /** Table deletionProtection. */ + public deletionProtection: boolean; + + /** Table automatedBackupPolicy. */ + public automatedBackupPolicy?: (google.bigtable.admin.v2.Table.IAutomatedBackupPolicy|null); + + /** Table rowKeySchema. */ + public rowKeySchema?: (google.bigtable.admin.v2.Type.IStruct|null); + + /** Table automatedBackupConfig. */ + public automatedBackupConfig?: "automatedBackupPolicy"; + + /** + * Creates a new Table instance using the specified properties. + * @param [properties] Properties to set + * @returns Table instance + */ + public static create(properties?: google.bigtable.admin.v2.ITable): google.bigtable.admin.v2.Table; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.bigtable.admin.v2.Table.verify|verify} messages. + * @param message Table message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Table.verify|verify} messages. + * @param message Table message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Table message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Table; + + /** + * Decodes a Table message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Table; + + /** + * Verifies a Table message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Table message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Table + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Table; + + /** + * Creates a plain object from a Table message. Also converts values to other types if specified. + * @param message Table + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Table, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Table to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Table + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Table { + + /** Properties of a ClusterState. */ + interface IClusterState { + + /** ClusterState replicationState */ + replicationState?: (google.bigtable.admin.v2.Table.ClusterState.ReplicationState|keyof typeof google.bigtable.admin.v2.Table.ClusterState.ReplicationState|null); + + /** ClusterState encryptionInfo */ + encryptionInfo?: (google.bigtable.admin.v2.IEncryptionInfo[]|null); + } + + /** Represents a ClusterState. */ + class ClusterState implements IClusterState { + + /** + * Constructs a new ClusterState. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Table.IClusterState); + + /** ClusterState replicationState. */ + public replicationState: (google.bigtable.admin.v2.Table.ClusterState.ReplicationState|keyof typeof google.bigtable.admin.v2.Table.ClusterState.ReplicationState); + + /** ClusterState encryptionInfo. */ + public encryptionInfo: google.bigtable.admin.v2.IEncryptionInfo[]; + + /** + * Creates a new ClusterState instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterState instance + */ + public static create(properties?: google.bigtable.admin.v2.Table.IClusterState): google.bigtable.admin.v2.Table.ClusterState; + + /** + * Encodes the specified ClusterState message. Does not implicitly {@link google.bigtable.admin.v2.Table.ClusterState.verify|verify} messages. + * @param message ClusterState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Table.IClusterState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterState message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Table.ClusterState.verify|verify} messages. + * @param message ClusterState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Table.IClusterState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Table.ClusterState; + + /** + * Decodes a ClusterState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Table.ClusterState; + + /** + * Verifies a ClusterState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterState + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Table.ClusterState; + + /** + * Creates a plain object from a ClusterState message. Also converts values to other types if specified. + * @param message ClusterState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Table.ClusterState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClusterState { + + /** ReplicationState enum. */ + enum ReplicationState { + STATE_NOT_KNOWN = 0, + INITIALIZING = 1, + PLANNED_MAINTENANCE = 2, + UNPLANNED_MAINTENANCE = 3, + READY = 4, + READY_OPTIMIZING = 5 + } + } + + /** TimestampGranularity enum. */ + enum TimestampGranularity { + TIMESTAMP_GRANULARITY_UNSPECIFIED = 0, + MILLIS = 1 + } + + /** View enum. */ + enum View { + VIEW_UNSPECIFIED = 0, + NAME_ONLY = 1, + SCHEMA_VIEW = 2, + REPLICATION_VIEW = 3, + ENCRYPTION_VIEW = 5, + FULL = 4 + } + + /** Properties of an AutomatedBackupPolicy. */ + interface IAutomatedBackupPolicy { + + /** AutomatedBackupPolicy retentionPeriod */ + retentionPeriod?: (google.protobuf.IDuration|null); + + /** AutomatedBackupPolicy frequency */ + frequency?: (google.protobuf.IDuration|null); + } + + /** Represents an AutomatedBackupPolicy. */ + class AutomatedBackupPolicy implements IAutomatedBackupPolicy { + + /** + * Constructs a new AutomatedBackupPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Table.IAutomatedBackupPolicy); + + /** AutomatedBackupPolicy retentionPeriod. */ + public retentionPeriod?: (google.protobuf.IDuration|null); + + /** AutomatedBackupPolicy frequency. */ + public frequency?: (google.protobuf.IDuration|null); + + /** + * Creates a new AutomatedBackupPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AutomatedBackupPolicy instance + */ + public static create(properties?: google.bigtable.admin.v2.Table.IAutomatedBackupPolicy): google.bigtable.admin.v2.Table.AutomatedBackupPolicy; + + /** + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.bigtable.admin.v2.Table.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Table.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Table.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Table.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Table.AutomatedBackupPolicy; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Table.AutomatedBackupPolicy; + + /** + * Verifies an AutomatedBackupPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutomatedBackupPolicy + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Table.AutomatedBackupPolicy; + + /** + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @param message AutomatedBackupPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Table.AutomatedBackupPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutomatedBackupPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutomatedBackupPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AuthorizedView. */ + interface IAuthorizedView { + + /** AuthorizedView name */ + name?: (string|null); + + /** AuthorizedView subsetView */ + subsetView?: (google.bigtable.admin.v2.AuthorizedView.ISubsetView|null); + + /** AuthorizedView etag */ + etag?: (string|null); + + /** AuthorizedView deletionProtection */ + deletionProtection?: (boolean|null); + } + + /** Represents an AuthorizedView. */ + class AuthorizedView implements IAuthorizedView { + + /** + * Constructs a new AuthorizedView. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IAuthorizedView); + + /** AuthorizedView name. */ + public name: string; + + /** AuthorizedView subsetView. */ + public subsetView?: (google.bigtable.admin.v2.AuthorizedView.ISubsetView|null); + + /** AuthorizedView etag. */ + public etag: string; + + /** AuthorizedView deletionProtection. */ + public deletionProtection: boolean; + + /** AuthorizedView authorizedView. */ + public authorizedView?: "subsetView"; + + /** + * Creates a new AuthorizedView instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizedView instance + */ + public static create(properties?: google.bigtable.admin.v2.IAuthorizedView): google.bigtable.admin.v2.AuthorizedView; + + /** + * Encodes the specified AuthorizedView message. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.verify|verify} messages. + * @param message AuthorizedView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IAuthorizedView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizedView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.verify|verify} messages. + * @param message AuthorizedView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IAuthorizedView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizedView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AuthorizedView; + + /** + * Decodes an AuthorizedView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AuthorizedView; + + /** + * Verifies an AuthorizedView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuthorizedView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizedView + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AuthorizedView; + + /** + * Creates a plain object from an AuthorizedView message. Also converts values to other types if specified. + * @param message AuthorizedView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AuthorizedView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizedView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizedView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuthorizedView { + + /** Properties of a FamilySubsets. */ + interface IFamilySubsets { + + /** FamilySubsets qualifiers */ + qualifiers?: (Uint8Array[]|null); + + /** FamilySubsets qualifierPrefixes */ + qualifierPrefixes?: (Uint8Array[]|null); + } + + /** Represents a FamilySubsets. */ + class FamilySubsets implements IFamilySubsets { + + /** + * Constructs a new FamilySubsets. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AuthorizedView.IFamilySubsets); + + /** FamilySubsets qualifiers. */ + public qualifiers: Uint8Array[]; + + /** FamilySubsets qualifierPrefixes. */ + public qualifierPrefixes: Uint8Array[]; + + /** + * Creates a new FamilySubsets instance using the specified properties. + * @param [properties] Properties to set + * @returns FamilySubsets instance + */ + public static create(properties?: google.bigtable.admin.v2.AuthorizedView.IFamilySubsets): google.bigtable.admin.v2.AuthorizedView.FamilySubsets; + + /** + * Encodes the specified FamilySubsets message. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.FamilySubsets.verify|verify} messages. + * @param message FamilySubsets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AuthorizedView.IFamilySubsets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FamilySubsets message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.FamilySubsets.verify|verify} messages. + * @param message FamilySubsets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AuthorizedView.IFamilySubsets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FamilySubsets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FamilySubsets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AuthorizedView.FamilySubsets; + + /** + * Decodes a FamilySubsets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FamilySubsets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AuthorizedView.FamilySubsets; + + /** + * Verifies a FamilySubsets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FamilySubsets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FamilySubsets + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AuthorizedView.FamilySubsets; + + /** + * Creates a plain object from a FamilySubsets message. Also converts values to other types if specified. + * @param message FamilySubsets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AuthorizedView.FamilySubsets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FamilySubsets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FamilySubsets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubsetView. */ + interface ISubsetView { + + /** SubsetView rowPrefixes */ + rowPrefixes?: (Uint8Array[]|null); + + /** SubsetView familySubsets */ + familySubsets?: ({ [k: string]: google.bigtable.admin.v2.AuthorizedView.IFamilySubsets }|null); + } + + /** Represents a SubsetView. */ + class SubsetView implements ISubsetView { + + /** + * Constructs a new SubsetView. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AuthorizedView.ISubsetView); + + /** SubsetView rowPrefixes. */ + public rowPrefixes: Uint8Array[]; + + /** SubsetView familySubsets. */ + public familySubsets: { [k: string]: google.bigtable.admin.v2.AuthorizedView.IFamilySubsets }; + + /** + * Creates a new SubsetView instance using the specified properties. + * @param [properties] Properties to set + * @returns SubsetView instance + */ + public static create(properties?: google.bigtable.admin.v2.AuthorizedView.ISubsetView): google.bigtable.admin.v2.AuthorizedView.SubsetView; + + /** + * Encodes the specified SubsetView message. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.SubsetView.verify|verify} messages. + * @param message SubsetView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AuthorizedView.ISubsetView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubsetView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.SubsetView.verify|verify} messages. + * @param message SubsetView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AuthorizedView.ISubsetView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubsetView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubsetView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AuthorizedView.SubsetView; + + /** + * Decodes a SubsetView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubsetView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AuthorizedView.SubsetView; + + /** + * Verifies a SubsetView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubsetView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubsetView + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AuthorizedView.SubsetView; + + /** + * Creates a plain object from a SubsetView message. Also converts values to other types if specified. + * @param message SubsetView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AuthorizedView.SubsetView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubsetView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubsetView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ResponseView enum. */ + enum ResponseView { + RESPONSE_VIEW_UNSPECIFIED = 0, + NAME_ONLY = 1, + BASIC = 2, + FULL = 3 + } + } + + /** Properties of a ColumnFamily. */ + interface IColumnFamily { + + /** ColumnFamily gcRule */ + gcRule?: (google.bigtable.admin.v2.IGcRule|null); + + /** ColumnFamily valueType */ + valueType?: (google.bigtable.admin.v2.IType|null); + } + + /** Represents a ColumnFamily. */ + class ColumnFamily implements IColumnFamily { + + /** + * Constructs a new ColumnFamily. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IColumnFamily); + + /** ColumnFamily gcRule. */ + public gcRule?: (google.bigtable.admin.v2.IGcRule|null); + + /** ColumnFamily valueType. */ + public valueType?: (google.bigtable.admin.v2.IType|null); + + /** + * Creates a new ColumnFamily instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnFamily instance + */ + public static create(properties?: google.bigtable.admin.v2.IColumnFamily): google.bigtable.admin.v2.ColumnFamily; + + /** + * Encodes the specified ColumnFamily message. Does not implicitly {@link google.bigtable.admin.v2.ColumnFamily.verify|verify} messages. + * @param message ColumnFamily message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IColumnFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnFamily message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ColumnFamily.verify|verify} messages. + * @param message ColumnFamily message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IColumnFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnFamily message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ColumnFamily; + + /** + * Decodes a ColumnFamily message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ColumnFamily; + + /** + * Verifies a ColumnFamily message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnFamily message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnFamily + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ColumnFamily; + + /** + * Creates a plain object from a ColumnFamily message. Also converts values to other types if specified. + * @param message ColumnFamily + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ColumnFamily, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnFamily to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnFamily + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcRule. */ + interface IGcRule { + + /** GcRule maxNumVersions */ + maxNumVersions?: (number|null); + + /** GcRule maxAge */ + maxAge?: (google.protobuf.IDuration|null); + + /** GcRule intersection */ + intersection?: (google.bigtable.admin.v2.GcRule.IIntersection|null); + + /** GcRule union */ + union?: (google.bigtable.admin.v2.GcRule.IUnion|null); + } + + /** Represents a GcRule. */ + class GcRule implements IGcRule { + + /** + * Constructs a new GcRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGcRule); + + /** GcRule maxNumVersions. */ + public maxNumVersions?: (number|null); + + /** GcRule maxAge. */ + public maxAge?: (google.protobuf.IDuration|null); + + /** GcRule intersection. */ + public intersection?: (google.bigtable.admin.v2.GcRule.IIntersection|null); + + /** GcRule union. */ + public union?: (google.bigtable.admin.v2.GcRule.IUnion|null); + + /** GcRule rule. */ + public rule?: ("maxNumVersions"|"maxAge"|"intersection"|"union"); + + /** + * Creates a new GcRule instance using the specified properties. + * @param [properties] Properties to set + * @returns GcRule instance + */ + public static create(properties?: google.bigtable.admin.v2.IGcRule): google.bigtable.admin.v2.GcRule; + + /** + * Encodes the specified GcRule message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.verify|verify} messages. + * @param message GcRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGcRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcRule message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.verify|verify} messages. + * @param message GcRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGcRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GcRule; + + /** + * Decodes a GcRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GcRule; + + /** + * Verifies a GcRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcRule + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GcRule; + + /** + * Creates a plain object from a GcRule message. Also converts values to other types if specified. + * @param message GcRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GcRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GcRule { + + /** Properties of an Intersection. */ + interface IIntersection { + + /** Intersection rules */ + rules?: (google.bigtable.admin.v2.IGcRule[]|null); + } + + /** Represents an Intersection. */ + class Intersection implements IIntersection { + + /** + * Constructs a new Intersection. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.GcRule.IIntersection); + + /** Intersection rules. */ + public rules: google.bigtable.admin.v2.IGcRule[]; + + /** + * Creates a new Intersection instance using the specified properties. + * @param [properties] Properties to set + * @returns Intersection instance + */ + public static create(properties?: google.bigtable.admin.v2.GcRule.IIntersection): google.bigtable.admin.v2.GcRule.Intersection; + + /** + * Encodes the specified Intersection message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Intersection.verify|verify} messages. + * @param message Intersection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.GcRule.IIntersection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Intersection message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Intersection.verify|verify} messages. + * @param message Intersection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.GcRule.IIntersection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Intersection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Intersection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GcRule.Intersection; + + /** + * Decodes an Intersection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Intersection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GcRule.Intersection; + + /** + * Verifies an Intersection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Intersection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Intersection + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GcRule.Intersection; + + /** + * Creates a plain object from an Intersection message. Also converts values to other types if specified. + * @param message Intersection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GcRule.Intersection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Intersection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Intersection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Union. */ + interface IUnion { + + /** Union rules */ + rules?: (google.bigtable.admin.v2.IGcRule[]|null); + } + + /** Represents an Union. */ + class Union implements IUnion { + + /** + * Constructs a new Union. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.GcRule.IUnion); + + /** Union rules. */ + public rules: google.bigtable.admin.v2.IGcRule[]; + + /** + * Creates a new Union instance using the specified properties. + * @param [properties] Properties to set + * @returns Union instance + */ + public static create(properties?: google.bigtable.admin.v2.GcRule.IUnion): google.bigtable.admin.v2.GcRule.Union; + + /** + * Encodes the specified Union message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Union.verify|verify} messages. + * @param message Union message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.GcRule.IUnion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Union message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Union.verify|verify} messages. + * @param message Union message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.GcRule.IUnion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Union message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Union + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GcRule.Union; + + /** + * Decodes an Union message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Union + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GcRule.Union; + + /** + * Verifies an Union message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Union message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Union + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GcRule.Union; + + /** + * Creates a plain object from an Union message. Also converts values to other types if specified. + * @param message Union + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GcRule.Union, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Union to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Union + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EncryptionInfo. */ + interface IEncryptionInfo { + + /** EncryptionInfo encryptionType */ + encryptionType?: (google.bigtable.admin.v2.EncryptionInfo.EncryptionType|keyof typeof google.bigtable.admin.v2.EncryptionInfo.EncryptionType|null); + + /** EncryptionInfo encryptionStatus */ + encryptionStatus?: (google.rpc.IStatus|null); + + /** EncryptionInfo kmsKeyVersion */ + kmsKeyVersion?: (string|null); + } + + /** Represents an EncryptionInfo. */ + class EncryptionInfo implements IEncryptionInfo { + + /** + * Constructs a new EncryptionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IEncryptionInfo); + + /** EncryptionInfo encryptionType. */ + public encryptionType: (google.bigtable.admin.v2.EncryptionInfo.EncryptionType|keyof typeof google.bigtable.admin.v2.EncryptionInfo.EncryptionType); + + /** EncryptionInfo encryptionStatus. */ + public encryptionStatus?: (google.rpc.IStatus|null); + + /** EncryptionInfo kmsKeyVersion. */ + public kmsKeyVersion: string; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionInfo instance + */ + public static create(properties?: google.bigtable.admin.v2.IEncryptionInfo): google.bigtable.admin.v2.EncryptionInfo; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.bigtable.admin.v2.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.EncryptionInfo; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.EncryptionInfo; + + /** + * Verifies an EncryptionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionInfo + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.EncryptionInfo; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @param message EncryptionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EncryptionInfo { + + /** EncryptionType enum. */ + enum EncryptionType { + ENCRYPTION_TYPE_UNSPECIFIED = 0, + GOOGLE_DEFAULT_ENCRYPTION = 1, + CUSTOMER_MANAGED_ENCRYPTION = 2 + } + } + + /** Properties of a Snapshot. */ + interface ISnapshot { + + /** Snapshot name */ + name?: (string|null); + + /** Snapshot sourceTable */ + sourceTable?: (google.bigtable.admin.v2.ITable|null); + + /** Snapshot dataSizeBytes */ + dataSizeBytes?: (number|Long|string|null); + + /** Snapshot createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot state */ + state?: (google.bigtable.admin.v2.Snapshot.State|keyof typeof google.bigtable.admin.v2.Snapshot.State|null); + + /** Snapshot description */ + description?: (string|null); + } + + /** Represents a Snapshot. */ + class Snapshot implements ISnapshot { + + /** + * Constructs a new Snapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ISnapshot); + + /** Snapshot name. */ + public name: string; + + /** Snapshot sourceTable. */ + public sourceTable?: (google.bigtable.admin.v2.ITable|null); + + /** Snapshot dataSizeBytes. */ + public dataSizeBytes: (number|Long|string); + + /** Snapshot createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot state. */ + public state: (google.bigtable.admin.v2.Snapshot.State|keyof typeof google.bigtable.admin.v2.Snapshot.State); + + /** Snapshot description. */ + public description: string; + + /** + * Creates a new Snapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns Snapshot instance + */ + public static create(properties?: google.bigtable.admin.v2.ISnapshot): google.bigtable.admin.v2.Snapshot; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.bigtable.admin.v2.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Snapshot; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Snapshot; + + /** + * Verifies a Snapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Snapshot + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Snapshot; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @param message Snapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Snapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Snapshot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Snapshot { + + /** State enum. */ + enum State { + STATE_NOT_KNOWN = 0, + READY = 1, + CREATING = 2 + } + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup sourceTable */ + sourceTable?: (string|null); + + /** Backup sourceBackup */ + sourceBackup?: (string|null); + + /** Backup expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Backup endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Backup sizeBytes */ + sizeBytes?: (number|Long|string|null); + + /** Backup state */ + state?: (google.bigtable.admin.v2.Backup.State|keyof typeof google.bigtable.admin.v2.Backup.State|null); + + /** Backup encryptionInfo */ + encryptionInfo?: (google.bigtable.admin.v2.IEncryptionInfo|null); + + /** Backup backupType */ + backupType?: (google.bigtable.admin.v2.Backup.BackupType|keyof typeof google.bigtable.admin.v2.Backup.BackupType|null); + + /** Backup hotToStandardTime */ + hotToStandardTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup sourceTable. */ + public sourceTable: string; + + /** Backup sourceBackup. */ + public sourceBackup: string; + + /** Backup expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Backup endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Backup sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** Backup state. */ + public state: (google.bigtable.admin.v2.Backup.State|keyof typeof google.bigtable.admin.v2.Backup.State); + + /** Backup encryptionInfo. */ + public encryptionInfo?: (google.bigtable.admin.v2.IEncryptionInfo|null); + + /** Backup backupType. */ + public backupType: (google.bigtable.admin.v2.Backup.BackupType|keyof typeof google.bigtable.admin.v2.Backup.BackupType); + + /** Backup hotToStandardTime. */ + public hotToStandardTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.bigtable.admin.v2.IBackup): google.bigtable.admin.v2.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.bigtable.admin.v2.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Backup { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2 + } + + /** BackupType enum. */ + enum BackupType { + BACKUP_TYPE_UNSPECIFIED = 0, + STANDARD = 1, + HOT = 2 + } + } + + /** Properties of a BackupInfo. */ + interface IBackupInfo { + + /** BackupInfo backup */ + backup?: (string|null); + + /** BackupInfo startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo sourceTable */ + sourceTable?: (string|null); + + /** BackupInfo sourceBackup */ + sourceBackup?: (string|null); + } + + /** Represents a BackupInfo. */ + class BackupInfo implements IBackupInfo { + + /** + * Constructs a new BackupInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IBackupInfo); + + /** BackupInfo backup. */ + public backup: string; + + /** BackupInfo startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo sourceTable. */ + public sourceTable: string; + + /** BackupInfo sourceBackup. */ + public sourceBackup: string; + + /** + * Creates a new BackupInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupInfo instance + */ + public static create(properties?: google.bigtable.admin.v2.IBackupInfo): google.bigtable.admin.v2.BackupInfo; + + /** + * Encodes the specified BackupInfo message. Does not implicitly {@link google.bigtable.admin.v2.BackupInfo.verify|verify} messages. + * @param message BackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupInfo message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.BackupInfo.verify|verify} messages. + * @param message BackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.BackupInfo; + + /** + * Decodes a BackupInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.BackupInfo; + + /** + * Verifies a BackupInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupInfo + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.BackupInfo; + + /** + * Creates a plain object from a BackupInfo message. Also converts values to other types if specified. + * @param message BackupInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.BackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RestoreSourceType enum. */ + enum RestoreSourceType { + RESTORE_SOURCE_TYPE_UNSPECIFIED = 0, + BACKUP = 1 + } + + /** Properties of a ProtoSchema. */ + interface IProtoSchema { + + /** ProtoSchema protoDescriptors */ + protoDescriptors?: (Uint8Array|Buffer|string|null); + } + + /** Represents a ProtoSchema. */ + class ProtoSchema implements IProtoSchema { + + /** + * Constructs a new ProtoSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IProtoSchema); + + /** ProtoSchema protoDescriptors. */ + public protoDescriptors: (Uint8Array|Buffer|string); + + /** + * Creates a new ProtoSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoSchema instance + */ + public static create(properties?: google.bigtable.admin.v2.IProtoSchema): google.bigtable.admin.v2.ProtoSchema; + + /** + * Encodes the specified ProtoSchema message. Does not implicitly {@link google.bigtable.admin.v2.ProtoSchema.verify|verify} messages. + * @param message ProtoSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IProtoSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoSchema message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ProtoSchema.verify|verify} messages. + * @param message ProtoSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IProtoSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ProtoSchema; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ProtoSchema; + + /** + * Verifies a ProtoSchema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoSchema + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ProtoSchema; + + /** + * Creates a plain object from a ProtoSchema message. Also converts values to other types if specified. + * @param message ProtoSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ProtoSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SchemaBundle. */ + interface ISchemaBundle { + + /** SchemaBundle name */ + name?: (string|null); + + /** SchemaBundle protoSchema */ + protoSchema?: (google.bigtable.admin.v2.IProtoSchema|null); + + /** SchemaBundle etag */ + etag?: (string|null); + } + + /** Represents a SchemaBundle. */ + class SchemaBundle implements ISchemaBundle { + + /** + * Constructs a new SchemaBundle. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ISchemaBundle); + + /** SchemaBundle name. */ + public name: string; + + /** SchemaBundle protoSchema. */ + public protoSchema?: (google.bigtable.admin.v2.IProtoSchema|null); + + /** SchemaBundle etag. */ + public etag: string; + + /** SchemaBundle type. */ + public type?: "protoSchema"; + + /** + * Creates a new SchemaBundle instance using the specified properties. + * @param [properties] Properties to set + * @returns SchemaBundle instance + */ + public static create(properties?: google.bigtable.admin.v2.ISchemaBundle): google.bigtable.admin.v2.SchemaBundle; + + /** + * Encodes the specified SchemaBundle message. Does not implicitly {@link google.bigtable.admin.v2.SchemaBundle.verify|verify} messages. + * @param message SchemaBundle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ISchemaBundle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchemaBundle message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SchemaBundle.verify|verify} messages. + * @param message SchemaBundle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ISchemaBundle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchemaBundle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchemaBundle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.SchemaBundle; + + /** + * Decodes a SchemaBundle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchemaBundle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.SchemaBundle; + + /** + * Verifies a SchemaBundle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SchemaBundle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchemaBundle + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.SchemaBundle; + + /** + * Creates a plain object from a SchemaBundle message. Also converts values to other types if specified. + * @param message SchemaBundle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.SchemaBundle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchemaBundle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchemaBundle + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Type. */ + interface IType { + + /** Type bytesType */ + bytesType?: (google.bigtable.admin.v2.Type.IBytes|null); + + /** Type stringType */ + stringType?: (google.bigtable.admin.v2.Type.IString|null); + + /** Type int64Type */ + int64Type?: (google.bigtable.admin.v2.Type.IInt64|null); + + /** Type float32Type */ + float32Type?: (google.bigtable.admin.v2.Type.IFloat32|null); + + /** Type float64Type */ + float64Type?: (google.bigtable.admin.v2.Type.IFloat64|null); + + /** Type boolType */ + boolType?: (google.bigtable.admin.v2.Type.IBool|null); + + /** Type timestampType */ + timestampType?: (google.bigtable.admin.v2.Type.ITimestamp|null); + + /** Type dateType */ + dateType?: (google.bigtable.admin.v2.Type.IDate|null); + + /** Type aggregateType */ + aggregateType?: (google.bigtable.admin.v2.Type.IAggregate|null); + + /** Type structType */ + structType?: (google.bigtable.admin.v2.Type.IStruct|null); + + /** Type arrayType */ + arrayType?: (google.bigtable.admin.v2.Type.IArray|null); + + /** Type mapType */ + mapType?: (google.bigtable.admin.v2.Type.IMap|null); + + /** Type protoType */ + protoType?: (google.bigtable.admin.v2.Type.IProto|null); + + /** Type enumType */ + enumType?: (google.bigtable.admin.v2.Type.IEnum|null); + } + + /** Represents a Type. */ + class Type implements IType { + + /** + * Constructs a new Type. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IType); + + /** Type bytesType. */ + public bytesType?: (google.bigtable.admin.v2.Type.IBytes|null); + + /** Type stringType. */ + public stringType?: (google.bigtable.admin.v2.Type.IString|null); + + /** Type int64Type. */ + public int64Type?: (google.bigtable.admin.v2.Type.IInt64|null); + + /** Type float32Type. */ + public float32Type?: (google.bigtable.admin.v2.Type.IFloat32|null); + + /** Type float64Type. */ + public float64Type?: (google.bigtable.admin.v2.Type.IFloat64|null); + + /** Type boolType. */ + public boolType?: (google.bigtable.admin.v2.Type.IBool|null); + + /** Type timestampType. */ + public timestampType?: (google.bigtable.admin.v2.Type.ITimestamp|null); + + /** Type dateType. */ + public dateType?: (google.bigtable.admin.v2.Type.IDate|null); + + /** Type aggregateType. */ + public aggregateType?: (google.bigtable.admin.v2.Type.IAggregate|null); + + /** Type structType. */ + public structType?: (google.bigtable.admin.v2.Type.IStruct|null); + + /** Type arrayType. */ + public arrayType?: (google.bigtable.admin.v2.Type.IArray|null); + + /** Type mapType. */ + public mapType?: (google.bigtable.admin.v2.Type.IMap|null); + + /** Type protoType. */ + public protoType?: (google.bigtable.admin.v2.Type.IProto|null); + + /** Type enumType. */ + public enumType?: (google.bigtable.admin.v2.Type.IEnum|null); + + /** Type kind. */ + public kind?: ("bytesType"|"stringType"|"int64Type"|"float32Type"|"float64Type"|"boolType"|"timestampType"|"dateType"|"aggregateType"|"structType"|"arrayType"|"mapType"|"protoType"|"enumType"); + + /** + * Creates a new Type instance using the specified properties. + * @param [properties] Properties to set + * @returns Type instance + */ + public static create(properties?: google.bigtable.admin.v2.IType): google.bigtable.admin.v2.Type; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.bigtable.admin.v2.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Type message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type; + + /** + * Verifies a Type message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Type + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @param message Type + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Type to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Type + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Type { + + /** Properties of a Bytes. */ + interface IBytes { + + /** Bytes encoding */ + encoding?: (google.bigtable.admin.v2.Type.Bytes.IEncoding|null); + } + + /** Represents a Bytes. */ + class Bytes implements IBytes { + + /** + * Constructs a new Bytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IBytes); + + /** Bytes encoding. */ + public encoding?: (google.bigtable.admin.v2.Type.Bytes.IEncoding|null); + + /** + * Creates a new Bytes instance using the specified properties. + * @param [properties] Properties to set + * @returns Bytes instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IBytes): google.bigtable.admin.v2.Type.Bytes; + + /** + * Encodes the specified Bytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.verify|verify} messages. + * @param message Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Bytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.verify|verify} messages. + * @param message Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Bytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Bytes; + + /** + * Decodes a Bytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Bytes; + + /** + * Verifies a Bytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Bytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Bytes; + + /** + * Creates a plain object from a Bytes message. Also converts values to other types if specified. + * @param message Bytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Bytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Bytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Bytes { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding raw */ + raw?: (google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Bytes.IEncoding); + + /** Encoding raw. */ + public raw?: (google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw|null); + + /** Encoding encoding. */ + public encoding?: "raw"; + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Bytes.IEncoding): google.bigtable.admin.v2.Type.Bytes.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Bytes.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Bytes.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Bytes.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Bytes.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Bytes.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Bytes.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of a Raw. */ + interface IRaw { + } + + /** Represents a Raw. */ + class Raw implements IRaw { + + /** + * Constructs a new Raw. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw); + + /** + * Creates a new Raw instance using the specified properties. + * @param [properties] Properties to set + * @returns Raw instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw): google.bigtable.admin.v2.Type.Bytes.Encoding.Raw; + + /** + * Encodes the specified Raw message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @param message Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Raw message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @param message Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Raw message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Bytes.Encoding.Raw; + + /** + * Decodes a Raw message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Bytes.Encoding.Raw; + + /** + * Verifies a Raw message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Raw message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Raw + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Bytes.Encoding.Raw; + + /** + * Creates a plain object from a Raw message. Also converts values to other types if specified. + * @param message Raw + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Bytes.Encoding.Raw, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Raw to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Raw + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a String. */ + interface IString { + + /** String encoding */ + encoding?: (google.bigtable.admin.v2.Type.String.IEncoding|null); + } + + /** Represents a String. */ + class String implements IString { + + /** + * Constructs a new String. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IString); + + /** String encoding. */ + public encoding?: (google.bigtable.admin.v2.Type.String.IEncoding|null); + + /** + * Creates a new String instance using the specified properties. + * @param [properties] Properties to set + * @returns String instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IString): google.bigtable.admin.v2.Type.String; + + /** + * Encodes the specified String message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.verify|verify} messages. + * @param message String message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IString, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified String message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.verify|verify} messages. + * @param message String message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IString, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a String message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.String; + + /** + * Decodes a String message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.String; + + /** + * Verifies a String message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a String message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns String + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.String; + + /** + * Creates a plain object from a String message. Also converts values to other types if specified. + * @param message String + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.String, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this String to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for String + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace String { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding utf8Raw */ + utf8Raw?: (google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw|null); + + /** Encoding utf8Bytes */ + utf8Bytes?: (google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.String.IEncoding); + + /** Encoding utf8Raw. */ + public utf8Raw?: (google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw|null); + + /** Encoding utf8Bytes. */ + public utf8Bytes?: (google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes|null); + + /** Encoding encoding. */ + public encoding?: ("utf8Raw"|"utf8Bytes"); + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.String.IEncoding): google.bigtable.admin.v2.Type.String.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.String.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.String.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.String.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.String.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.String.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.String.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of an Utf8Raw. */ + interface IUtf8Raw { + } + + /** Represents an Utf8Raw. */ + class Utf8Raw implements IUtf8Raw { + + /** + * Constructs a new Utf8Raw. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw); + + /** + * Creates a new Utf8Raw instance using the specified properties. + * @param [properties] Properties to set + * @returns Utf8Raw instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw): google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw; + + /** + * Encodes the specified Utf8Raw message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @param message Utf8Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Utf8Raw message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @param message Utf8Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw; + + /** + * Verifies an Utf8Raw message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Utf8Raw message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Utf8Raw + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw; + + /** + * Creates a plain object from an Utf8Raw message. Also converts values to other types if specified. + * @param message Utf8Raw + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Utf8Raw to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Utf8Raw + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Utf8Bytes. */ + interface IUtf8Bytes { + } + + /** Represents an Utf8Bytes. */ + class Utf8Bytes implements IUtf8Bytes { + + /** + * Constructs a new Utf8Bytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes); + + /** + * Creates a new Utf8Bytes instance using the specified properties. + * @param [properties] Properties to set + * @returns Utf8Bytes instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes): google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Encodes the specified Utf8Bytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @param message Utf8Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Utf8Bytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @param message Utf8Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Verifies an Utf8Bytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Utf8Bytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Utf8Bytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Creates a plain object from an Utf8Bytes message. Also converts values to other types if specified. + * @param message Utf8Bytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Utf8Bytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Utf8Bytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an Int64. */ + interface IInt64 { + + /** Int64 encoding */ + encoding?: (google.bigtable.admin.v2.Type.Int64.IEncoding|null); + } + + /** Represents an Int64. */ + class Int64 implements IInt64 { + + /** + * Constructs a new Int64. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IInt64); + + /** Int64 encoding. */ + public encoding?: (google.bigtable.admin.v2.Type.Int64.IEncoding|null); + + /** + * Creates a new Int64 instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64 instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IInt64): google.bigtable.admin.v2.Type.Int64; + + /** + * Encodes the specified Int64 message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.verify|verify} messages. + * @param message Int64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IInt64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64 message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.verify|verify} messages. + * @param message Int64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IInt64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Int64; + + /** + * Decodes an Int64 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Int64; + + /** + * Verifies an Int64 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64 + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Int64; + + /** + * Creates a plain object from an Int64 message. Also converts values to other types if specified. + * @param message Int64 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Int64, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Int64 { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding bigEndianBytes */ + bigEndianBytes?: (google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes|null); + + /** Encoding orderedCodeBytes */ + orderedCodeBytes?: (google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Int64.IEncoding); + + /** Encoding bigEndianBytes. */ + public bigEndianBytes?: (google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes|null); + + /** Encoding orderedCodeBytes. */ + public orderedCodeBytes?: (google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes|null); + + /** Encoding encoding. */ + public encoding?: ("bigEndianBytes"|"orderedCodeBytes"); + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Int64.IEncoding): google.bigtable.admin.v2.Type.Int64.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Int64.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Int64.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Int64.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Int64.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Int64.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Int64.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of a BigEndianBytes. */ + interface IBigEndianBytes { + + /** BigEndianBytes bytesType */ + bytesType?: (google.bigtable.admin.v2.Type.IBytes|null); + } + + /** Represents a BigEndianBytes. */ + class BigEndianBytes implements IBigEndianBytes { + + /** + * Constructs a new BigEndianBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes); + + /** BigEndianBytes bytesType. */ + public bytesType?: (google.bigtable.admin.v2.Type.IBytes|null); + + /** + * Creates a new BigEndianBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns BigEndianBytes instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes): google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Encodes the specified BigEndianBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @param message BigEndianBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigEndianBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @param message BigEndianBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Verifies a BigEndianBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigEndianBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigEndianBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Creates a plain object from a BigEndianBytes message. Also converts values to other types if specified. + * @param message BigEndianBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigEndianBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigEndianBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrderedCodeBytes. */ + interface IOrderedCodeBytes { + } + + /** Represents an OrderedCodeBytes. */ + class OrderedCodeBytes implements IOrderedCodeBytes { + + /** + * Constructs a new OrderedCodeBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes); + + /** + * Creates a new OrderedCodeBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns OrderedCodeBytes instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes): google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Verifies an OrderedCodeBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrderedCodeBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @param message OrderedCodeBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrderedCodeBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Bool. */ + interface IBool { + } + + /** Represents a Bool. */ + class Bool implements IBool { + + /** + * Constructs a new Bool. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IBool); + + /** + * Creates a new Bool instance using the specified properties. + * @param [properties] Properties to set + * @returns Bool instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IBool): google.bigtable.admin.v2.Type.Bool; + + /** + * Encodes the specified Bool message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bool.verify|verify} messages. + * @param message Bool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IBool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Bool message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bool.verify|verify} messages. + * @param message Bool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IBool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Bool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Bool; + + /** + * Decodes a Bool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Bool; + + /** + * Verifies a Bool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Bool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bool + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Bool; + + /** + * Creates a plain object from a Bool message. Also converts values to other types if specified. + * @param message Bool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Bool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Bool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Float32. */ + interface IFloat32 { + } + + /** Represents a Float32. */ + class Float32 implements IFloat32 { + + /** + * Constructs a new Float32. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IFloat32); + + /** + * Creates a new Float32 instance using the specified properties. + * @param [properties] Properties to set + * @returns Float32 instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IFloat32): google.bigtable.admin.v2.Type.Float32; + + /** + * Encodes the specified Float32 message. Does not implicitly {@link google.bigtable.admin.v2.Type.Float32.verify|verify} messages. + * @param message Float32 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IFloat32, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Float32 message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Float32.verify|verify} messages. + * @param message Float32 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IFloat32, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Float32 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Float32; + + /** + * Decodes a Float32 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Float32; + + /** + * Verifies a Float32 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Float32 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Float32 + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Float32; + + /** + * Creates a plain object from a Float32 message. Also converts values to other types if specified. + * @param message Float32 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Float32, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Float32 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Float32 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Float64. */ + interface IFloat64 { + } + + /** Represents a Float64. */ + class Float64 implements IFloat64 { + + /** + * Constructs a new Float64. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IFloat64); + + /** + * Creates a new Float64 instance using the specified properties. + * @param [properties] Properties to set + * @returns Float64 instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IFloat64): google.bigtable.admin.v2.Type.Float64; + + /** + * Encodes the specified Float64 message. Does not implicitly {@link google.bigtable.admin.v2.Type.Float64.verify|verify} messages. + * @param message Float64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IFloat64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Float64 message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Float64.verify|verify} messages. + * @param message Float64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IFloat64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Float64 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Float64; + + /** + * Decodes a Float64 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Float64; + + /** + * Verifies a Float64 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Float64 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Float64 + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Float64; + + /** + * Creates a plain object from a Float64 message. Also converts values to other types if specified. + * @param message Float64 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Float64, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Float64 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Float64 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp encoding */ + encoding?: (google.bigtable.admin.v2.Type.Timestamp.IEncoding|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.ITimestamp); + + /** Timestamp encoding. */ + public encoding?: (google.bigtable.admin.v2.Type.Timestamp.IEncoding|null); + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.ITimestamp): google.bigtable.admin.v2.Type.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Timestamp { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding unixMicrosInt64 */ + unixMicrosInt64?: (google.bigtable.admin.v2.Type.Int64.IEncoding|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Timestamp.IEncoding); + + /** Encoding unixMicrosInt64. */ + public unixMicrosInt64?: (google.bigtable.admin.v2.Type.Int64.IEncoding|null); + + /** Encoding encoding. */ + public encoding?: "unixMicrosInt64"; + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Timestamp.IEncoding): google.bigtable.admin.v2.Type.Timestamp.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Timestamp.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Timestamp.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Timestamp.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Timestamp.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Timestamp.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Timestamp.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Date. */ + interface IDate { + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IDate); + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IDate): google.bigtable.admin.v2.Type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.bigtable.admin.v2.Type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: (google.bigtable.admin.v2.Type.Struct.IField[]|null); + + /** Struct encoding */ + encoding?: (google.bigtable.admin.v2.Type.Struct.IEncoding|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IStruct); + + /** Struct fields. */ + public fields: google.bigtable.admin.v2.Type.Struct.IField[]; + + /** Struct encoding. */ + public encoding?: (google.bigtable.admin.v2.Type.Struct.IEncoding|null); + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IStruct): google.bigtable.admin.v2.Type.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Struct { + + /** Properties of a Field. */ + interface IField { + + /** Field fieldName */ + fieldName?: (string|null); + + /** Field type */ + type?: (google.bigtable.admin.v2.IType|null); + } + + /** Represents a Field. */ + class Field implements IField { + + /** + * Constructs a new Field. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Struct.IField); + + /** Field fieldName. */ + public fieldName: string; + + /** Field type. */ + public type?: (google.bigtable.admin.v2.IType|null); + + /** + * Creates a new Field instance using the specified properties. + * @param [properties] Properties to set + * @returns Field instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Struct.IField): google.bigtable.admin.v2.Type.Struct.Field; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Struct.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Struct.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Field message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Struct.Field; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Struct.Field; + + /** + * Verifies a Field message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Field + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Struct.Field; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @param message Field + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Struct.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Field to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Field + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding singleton */ + singleton?: (google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton|null); + + /** Encoding delimitedBytes */ + delimitedBytes?: (google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes|null); + + /** Encoding orderedCodeBytes */ + orderedCodeBytes?: (google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Struct.IEncoding); + + /** Encoding singleton. */ + public singleton?: (google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton|null); + + /** Encoding delimitedBytes. */ + public delimitedBytes?: (google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes|null); + + /** Encoding orderedCodeBytes. */ + public orderedCodeBytes?: (google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes|null); + + /** Encoding encoding. */ + public encoding?: ("singleton"|"delimitedBytes"|"orderedCodeBytes"); + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Struct.IEncoding): google.bigtable.admin.v2.Type.Struct.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Struct.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Struct.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Struct.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Struct.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Struct.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Struct.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of a Singleton. */ + interface ISingleton { + } + + /** Represents a Singleton. */ + class Singleton implements ISingleton { + + /** + * Constructs a new Singleton. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton); + + /** + * Creates a new Singleton instance using the specified properties. + * @param [properties] Properties to set + * @returns Singleton instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton): google.bigtable.admin.v2.Type.Struct.Encoding.Singleton; + + /** + * Encodes the specified Singleton message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @param message Singleton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Singleton message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @param message Singleton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Singleton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Struct.Encoding.Singleton; + + /** + * Decodes a Singleton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Struct.Encoding.Singleton; + + /** + * Verifies a Singleton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Singleton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Singleton + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Struct.Encoding.Singleton; + + /** + * Creates a plain object from a Singleton message. Also converts values to other types if specified. + * @param message Singleton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Struct.Encoding.Singleton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Singleton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Singleton + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DelimitedBytes. */ + interface IDelimitedBytes { + + /** DelimitedBytes delimiter */ + delimiter?: (Uint8Array|Buffer|string|null); + } + + /** Represents a DelimitedBytes. */ + class DelimitedBytes implements IDelimitedBytes { + + /** + * Constructs a new DelimitedBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes); + + /** DelimitedBytes delimiter. */ + public delimiter: (Uint8Array|Buffer|string); + + /** + * Creates a new DelimitedBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns DelimitedBytes instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes): google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Encodes the specified DelimitedBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @param message DelimitedBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DelimitedBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @param message DelimitedBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Verifies a DelimitedBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DelimitedBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DelimitedBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Creates a plain object from a DelimitedBytes message. Also converts values to other types if specified. + * @param message DelimitedBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DelimitedBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DelimitedBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrderedCodeBytes. */ + interface IOrderedCodeBytes { + } + + /** Represents an OrderedCodeBytes. */ + class OrderedCodeBytes implements IOrderedCodeBytes { + + /** + * Constructs a new OrderedCodeBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes); + + /** + * Creates a new OrderedCodeBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns OrderedCodeBytes instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes): google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Verifies an OrderedCodeBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrderedCodeBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @param message OrderedCodeBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrderedCodeBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Proto. */ + interface IProto { + + /** Proto schemaBundleId */ + schemaBundleId?: (string|null); + + /** Proto messageName */ + messageName?: (string|null); + } + + /** Represents a Proto. */ + class Proto implements IProto { + + /** + * Constructs a new Proto. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IProto); + + /** Proto schemaBundleId. */ + public schemaBundleId: string; + + /** Proto messageName. */ + public messageName: string; + + /** + * Creates a new Proto instance using the specified properties. + * @param [properties] Properties to set + * @returns Proto instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IProto): google.bigtable.admin.v2.Type.Proto; + + /** + * Encodes the specified Proto message. Does not implicitly {@link google.bigtable.admin.v2.Type.Proto.verify|verify} messages. + * @param message Proto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Proto message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Proto.verify|verify} messages. + * @param message Proto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Proto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Proto; + + /** + * Decodes a Proto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Proto; + + /** + * Verifies a Proto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Proto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Proto + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Proto; + + /** + * Creates a plain object from a Proto message. Also converts values to other types if specified. + * @param message Proto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Proto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Proto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Proto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Enum. */ + interface IEnum { + + /** Enum schemaBundleId */ + schemaBundleId?: (string|null); + + /** Enum enumName */ + enumName?: (string|null); + } + + /** Represents an Enum. */ + class Enum implements IEnum { + + /** + * Constructs a new Enum. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IEnum); + + /** Enum schemaBundleId. */ + public schemaBundleId: string; + + /** Enum enumName. */ + public enumName: string; + + /** + * Creates a new Enum instance using the specified properties. + * @param [properties] Properties to set + * @returns Enum instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IEnum): google.bigtable.admin.v2.Type.Enum; + + /** + * Encodes the specified Enum message. Does not implicitly {@link google.bigtable.admin.v2.Type.Enum.verify|verify} messages. + * @param message Enum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Enum.verify|verify} messages. + * @param message Enum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Enum message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Enum; + + /** + * Decodes an Enum message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Enum; + + /** + * Verifies an Enum message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Enum message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Enum + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Enum; + + /** + * Creates a plain object from an Enum message. Also converts values to other types if specified. + * @param message Enum + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Enum, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Enum to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Enum + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Array. */ + interface IArray { + + /** Array elementType */ + elementType?: (google.bigtable.admin.v2.IType|null); + } + + /** Represents an Array. */ + class Array implements IArray { + + /** + * Constructs a new Array. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IArray); + + /** Array elementType. */ + public elementType?: (google.bigtable.admin.v2.IType|null); + + /** + * Creates a new Array instance using the specified properties. + * @param [properties] Properties to set + * @returns Array instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IArray): google.bigtable.admin.v2.Type.Array; + + /** + * Encodes the specified Array message. Does not implicitly {@link google.bigtable.admin.v2.Type.Array.verify|verify} messages. + * @param message Array message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Array message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Array.verify|verify} messages. + * @param message Array message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Array message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Array; + + /** + * Decodes an Array message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Array; + + /** + * Verifies an Array message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Array message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Array + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Array; + + /** + * Creates a plain object from an Array message. Also converts values to other types if specified. + * @param message Array + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Array, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Array to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Array + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Map. */ + interface IMap { + + /** Map keyType */ + keyType?: (google.bigtable.admin.v2.IType|null); + + /** Map valueType */ + valueType?: (google.bigtable.admin.v2.IType|null); + } + + /** Represents a Map. */ + class Map implements IMap { + + /** + * Constructs a new Map. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IMap); + + /** Map keyType. */ + public keyType?: (google.bigtable.admin.v2.IType|null); + + /** Map valueType. */ + public valueType?: (google.bigtable.admin.v2.IType|null); + + /** + * Creates a new Map instance using the specified properties. + * @param [properties] Properties to set + * @returns Map instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IMap): google.bigtable.admin.v2.Type.Map; + + /** + * Encodes the specified Map message. Does not implicitly {@link google.bigtable.admin.v2.Type.Map.verify|verify} messages. + * @param message Map message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Map message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Map.verify|verify} messages. + * @param message Map message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Map message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Map; + + /** + * Decodes a Map message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Map; + + /** + * Verifies a Map message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Map message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Map + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Map; + + /** + * Creates a plain object from a Map message. Also converts values to other types if specified. + * @param message Map + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Map, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Map to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Map + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Aggregate. */ + interface IAggregate { + + /** Aggregate inputType */ + inputType?: (google.bigtable.admin.v2.IType|null); + + /** Aggregate stateType */ + stateType?: (google.bigtable.admin.v2.IType|null); + + /** Aggregate sum */ + sum?: (google.bigtable.admin.v2.Type.Aggregate.ISum|null); + + /** Aggregate hllppUniqueCount */ + hllppUniqueCount?: (google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null); + + /** Aggregate max */ + max?: (google.bigtable.admin.v2.Type.Aggregate.IMax|null); + + /** Aggregate min */ + min?: (google.bigtable.admin.v2.Type.Aggregate.IMin|null); + } + + /** Represents an Aggregate. */ + class Aggregate implements IAggregate { + + /** + * Constructs a new Aggregate. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IAggregate); + + /** Aggregate inputType. */ + public inputType?: (google.bigtable.admin.v2.IType|null); + + /** Aggregate stateType. */ + public stateType?: (google.bigtable.admin.v2.IType|null); + + /** Aggregate sum. */ + public sum?: (google.bigtable.admin.v2.Type.Aggregate.ISum|null); + + /** Aggregate hllppUniqueCount. */ + public hllppUniqueCount?: (google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null); + + /** Aggregate max. */ + public max?: (google.bigtable.admin.v2.Type.Aggregate.IMax|null); + + /** Aggregate min. */ + public min?: (google.bigtable.admin.v2.Type.Aggregate.IMin|null); + + /** Aggregate aggregator. */ + public aggregator?: ("sum"|"hllppUniqueCount"|"max"|"min"); + + /** + * Creates a new Aggregate instance using the specified properties. + * @param [properties] Properties to set + * @returns Aggregate instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IAggregate): google.bigtable.admin.v2.Type.Aggregate; + + /** + * Encodes the specified Aggregate message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.verify|verify} messages. + * @param message Aggregate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IAggregate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Aggregate message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.verify|verify} messages. + * @param message Aggregate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IAggregate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Aggregate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Aggregate; + + /** + * Decodes an Aggregate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Aggregate; + + /** + * Verifies an Aggregate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Aggregate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Aggregate + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Aggregate; + + /** + * Creates a plain object from an Aggregate message. Also converts values to other types if specified. + * @param message Aggregate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Aggregate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Aggregate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Aggregate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Aggregate { + + /** Properties of a Sum. */ + interface ISum { + } + + /** Represents a Sum. */ + class Sum implements ISum { + + /** + * Constructs a new Sum. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Aggregate.ISum); + + /** + * Creates a new Sum instance using the specified properties. + * @param [properties] Properties to set + * @returns Sum instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Aggregate.ISum): google.bigtable.admin.v2.Type.Aggregate.Sum; + + /** + * Encodes the specified Sum message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Sum.verify|verify} messages. + * @param message Sum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Aggregate.ISum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Sum.verify|verify} messages. + * @param message Sum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Aggregate.ISum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sum message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Aggregate.Sum; + + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Aggregate.Sum; + + /** + * Verifies a Sum message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sum + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Aggregate.Sum; + + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @param message Sum + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Aggregate.Sum, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Sum to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Sum + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Max. */ + interface IMax { + } + + /** Represents a Max. */ + class Max implements IMax { + + /** + * Constructs a new Max. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Aggregate.IMax); + + /** + * Creates a new Max instance using the specified properties. + * @param [properties] Properties to set + * @returns Max instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Aggregate.IMax): google.bigtable.admin.v2.Type.Aggregate.Max; + + /** + * Encodes the specified Max message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Max.verify|verify} messages. + * @param message Max message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Aggregate.IMax, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Max message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Max.verify|verify} messages. + * @param message Max message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Aggregate.IMax, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Max message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Aggregate.Max; + + /** + * Decodes a Max message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Aggregate.Max; + + /** + * Verifies a Max message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Max message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Max + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Aggregate.Max; + + /** + * Creates a plain object from a Max message. Also converts values to other types if specified. + * @param message Max + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Aggregate.Max, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Max to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Max + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Min. */ + interface IMin { + } + + /** Represents a Min. */ + class Min implements IMin { + + /** + * Constructs a new Min. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Aggregate.IMin); + + /** + * Creates a new Min instance using the specified properties. + * @param [properties] Properties to set + * @returns Min instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Aggregate.IMin): google.bigtable.admin.v2.Type.Aggregate.Min; + + /** + * Encodes the specified Min message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Min.verify|verify} messages. + * @param message Min message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Aggregate.IMin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Min message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Min.verify|verify} messages. + * @param message Min message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Aggregate.IMin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Min message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Aggregate.Min; + + /** + * Decodes a Min message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Aggregate.Min; + + /** + * Verifies a Min message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Min message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Min + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Aggregate.Min; + + /** + * Creates a plain object from a Min message. Also converts values to other types if specified. + * @param message Min + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Aggregate.Min, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Min to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Min + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HyperLogLogPlusPlusUniqueCount. */ + interface IHyperLogLogPlusPlusUniqueCount { + } + + /** Represents a HyperLogLogPlusPlusUniqueCount. */ + class HyperLogLogPlusPlusUniqueCount implements IHyperLogLogPlusPlusUniqueCount { + + /** + * Constructs a new HyperLogLogPlusPlusUniqueCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount); + + /** + * Creates a new HyperLogLogPlusPlusUniqueCount instance using the specified properties. + * @param [properties] Properties to set + * @returns HyperLogLogPlusPlusUniqueCount instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount): google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @param message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @param message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Verifies a HyperLogLogPlusPlusUniqueCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HyperLogLogPlusPlusUniqueCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HyperLogLogPlusPlusUniqueCount + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Creates a plain object from a HyperLogLogPlusPlusUniqueCount message. Also converts values to other types if specified. + * @param message HyperLogLogPlusPlusUniqueCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HyperLogLogPlusPlusUniqueCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HyperLogLogPlusPlusUniqueCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } + + /** Namespace v2. */ + namespace v2 { + + /** Represents a Bigtable */ + class Bigtable extends $protobuf.rpc.Service { + + /** + * Constructs a new Bigtable 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 Bigtable 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): Bigtable; + + /** + * 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.bigtable.v2.IReadRowsRequest, callback: google.bigtable.v2.Bigtable.ReadRowsCallback): void; + + /** + * Calls ReadRows. + * @param request ReadRowsRequest message or plain object + * @returns Promise + */ + public readRows(request: google.bigtable.v2.IReadRowsRequest): Promise; + + /** + * Calls SampleRowKeys. + * @param request SampleRowKeysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SampleRowKeysResponse + */ + public sampleRowKeys(request: google.bigtable.v2.ISampleRowKeysRequest, callback: google.bigtable.v2.Bigtable.SampleRowKeysCallback): void; + + /** + * Calls SampleRowKeys. + * @param request SampleRowKeysRequest message or plain object + * @returns Promise + */ + public sampleRowKeys(request: google.bigtable.v2.ISampleRowKeysRequest): Promise; + + /** + * Calls MutateRow. + * @param request MutateRowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MutateRowResponse + */ + public mutateRow(request: google.bigtable.v2.IMutateRowRequest, callback: google.bigtable.v2.Bigtable.MutateRowCallback): void; + + /** + * Calls MutateRow. + * @param request MutateRowRequest message or plain object + * @returns Promise + */ + public mutateRow(request: google.bigtable.v2.IMutateRowRequest): Promise; + + /** + * Calls MutateRows. + * @param request MutateRowsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MutateRowsResponse + */ + public mutateRows(request: google.bigtable.v2.IMutateRowsRequest, callback: google.bigtable.v2.Bigtable.MutateRowsCallback): void; + + /** + * Calls MutateRows. + * @param request MutateRowsRequest message or plain object + * @returns Promise + */ + public mutateRows(request: google.bigtable.v2.IMutateRowsRequest): Promise; + + /** + * Calls CheckAndMutateRow. + * @param request CheckAndMutateRowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckAndMutateRowResponse + */ + public checkAndMutateRow(request: google.bigtable.v2.ICheckAndMutateRowRequest, callback: google.bigtable.v2.Bigtable.CheckAndMutateRowCallback): void; + + /** + * Calls CheckAndMutateRow. + * @param request CheckAndMutateRowRequest message or plain object + * @returns Promise + */ + public checkAndMutateRow(request: google.bigtable.v2.ICheckAndMutateRowRequest): Promise; + + /** + * Calls PingAndWarm. + * @param request PingAndWarmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PingAndWarmResponse + */ + public pingAndWarm(request: google.bigtable.v2.IPingAndWarmRequest, callback: google.bigtable.v2.Bigtable.PingAndWarmCallback): void; + + /** + * Calls PingAndWarm. + * @param request PingAndWarmRequest message or plain object + * @returns Promise + */ + public pingAndWarm(request: google.bigtable.v2.IPingAndWarmRequest): Promise; + + /** + * Calls ReadModifyWriteRow. + * @param request ReadModifyWriteRowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadModifyWriteRowResponse + */ + public readModifyWriteRow(request: google.bigtable.v2.IReadModifyWriteRowRequest, callback: google.bigtable.v2.Bigtable.ReadModifyWriteRowCallback): void; + + /** + * Calls ReadModifyWriteRow. + * @param request ReadModifyWriteRowRequest message or plain object + * @returns Promise + */ + public readModifyWriteRow(request: google.bigtable.v2.IReadModifyWriteRowRequest): Promise; + + /** + * Calls GenerateInitialChangeStreamPartitions. + * @param request GenerateInitialChangeStreamPartitionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateInitialChangeStreamPartitionsResponse + */ + public generateInitialChangeStreamPartitions(request: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest, callback: google.bigtable.v2.Bigtable.GenerateInitialChangeStreamPartitionsCallback): void; + + /** + * Calls GenerateInitialChangeStreamPartitions. + * @param request GenerateInitialChangeStreamPartitionsRequest message or plain object + * @returns Promise + */ + public generateInitialChangeStreamPartitions(request: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest): Promise; + + /** + * Calls ReadChangeStream. + * @param request ReadChangeStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadChangeStreamResponse + */ + public readChangeStream(request: google.bigtable.v2.IReadChangeStreamRequest, callback: google.bigtable.v2.Bigtable.ReadChangeStreamCallback): void; + + /** + * Calls ReadChangeStream. + * @param request ReadChangeStreamRequest message or plain object + * @returns Promise + */ + public readChangeStream(request: google.bigtable.v2.IReadChangeStreamRequest): Promise; + + /** + * Calls PrepareQuery. + * @param request PrepareQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PrepareQueryResponse + */ + public prepareQuery(request: google.bigtable.v2.IPrepareQueryRequest, callback: google.bigtable.v2.Bigtable.PrepareQueryCallback): void; + + /** + * Calls PrepareQuery. + * @param request PrepareQueryRequest message or plain object + * @returns Promise + */ + public prepareQuery(request: google.bigtable.v2.IPrepareQueryRequest): Promise; + + /** + * Calls ExecuteQuery. + * @param request ExecuteQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteQueryResponse + */ + public executeQuery(request: google.bigtable.v2.IExecuteQueryRequest, callback: google.bigtable.v2.Bigtable.ExecuteQueryCallback): void; + + /** + * Calls ExecuteQuery. + * @param request ExecuteQueryRequest message or plain object + * @returns Promise + */ + public executeQuery(request: google.bigtable.v2.IExecuteQueryRequest): Promise; + } + + namespace Bigtable { + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|readRows}. + * @param error Error, if any + * @param [response] ReadRowsResponse + */ + type ReadRowsCallback = (error: (Error|null), response?: google.bigtable.v2.ReadRowsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|sampleRowKeys}. + * @param error Error, if any + * @param [response] SampleRowKeysResponse + */ + type SampleRowKeysCallback = (error: (Error|null), response?: google.bigtable.v2.SampleRowKeysResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|mutateRow}. + * @param error Error, if any + * @param [response] MutateRowResponse + */ + type MutateRowCallback = (error: (Error|null), response?: google.bigtable.v2.MutateRowResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|mutateRows}. + * @param error Error, if any + * @param [response] MutateRowsResponse + */ + type MutateRowsCallback = (error: (Error|null), response?: google.bigtable.v2.MutateRowsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|checkAndMutateRow}. + * @param error Error, if any + * @param [response] CheckAndMutateRowResponse + */ + type CheckAndMutateRowCallback = (error: (Error|null), response?: google.bigtable.v2.CheckAndMutateRowResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|pingAndWarm}. + * @param error Error, if any + * @param [response] PingAndWarmResponse + */ + type PingAndWarmCallback = (error: (Error|null), response?: google.bigtable.v2.PingAndWarmResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|readModifyWriteRow}. + * @param error Error, if any + * @param [response] ReadModifyWriteRowResponse + */ + type ReadModifyWriteRowCallback = (error: (Error|null), response?: google.bigtable.v2.ReadModifyWriteRowResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|generateInitialChangeStreamPartitions}. + * @param error Error, if any + * @param [response] GenerateInitialChangeStreamPartitionsResponse + */ + type GenerateInitialChangeStreamPartitionsCallback = (error: (Error|null), response?: google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|readChangeStream}. + * @param error Error, if any + * @param [response] ReadChangeStreamResponse + */ + type ReadChangeStreamCallback = (error: (Error|null), response?: google.bigtable.v2.ReadChangeStreamResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|prepareQuery}. + * @param error Error, if any + * @param [response] PrepareQueryResponse + */ + type PrepareQueryCallback = (error: (Error|null), response?: google.bigtable.v2.PrepareQueryResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|executeQuery}. + * @param error Error, if any + * @param [response] ExecuteQueryResponse + */ + type ExecuteQueryCallback = (error: (Error|null), response?: google.bigtable.v2.ExecuteQueryResponse) => void; + } + + /** Properties of a ReadRowsRequest. */ + interface IReadRowsRequest { + + /** ReadRowsRequest tableName */ + tableName?: (string|null); + + /** ReadRowsRequest authorizedViewName */ + authorizedViewName?: (string|null); + + /** ReadRowsRequest materializedViewName */ + materializedViewName?: (string|null); + + /** ReadRowsRequest appProfileId */ + appProfileId?: (string|null); + + /** ReadRowsRequest rows */ + rows?: (google.bigtable.v2.IRowSet|null); + + /** ReadRowsRequest filter */ + filter?: (google.bigtable.v2.IRowFilter|null); + + /** ReadRowsRequest rowsLimit */ + rowsLimit?: (number|Long|string|null); + + /** ReadRowsRequest requestStatsView */ + requestStatsView?: (google.bigtable.v2.ReadRowsRequest.RequestStatsView|keyof typeof google.bigtable.v2.ReadRowsRequest.RequestStatsView|null); + + /** ReadRowsRequest reversed */ + reversed?: (boolean|null); + } + + /** Represents a ReadRowsRequest. */ + class ReadRowsRequest implements IReadRowsRequest { + + /** + * Constructs a new ReadRowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadRowsRequest); + + /** ReadRowsRequest tableName. */ + public tableName: string; + + /** ReadRowsRequest authorizedViewName. */ + public authorizedViewName: string; + + /** ReadRowsRequest materializedViewName. */ + public materializedViewName: string; + + /** ReadRowsRequest appProfileId. */ + public appProfileId: string; + + /** ReadRowsRequest rows. */ + public rows?: (google.bigtable.v2.IRowSet|null); + + /** ReadRowsRequest filter. */ + public filter?: (google.bigtable.v2.IRowFilter|null); + + /** ReadRowsRequest rowsLimit. */ + public rowsLimit: (number|Long|string); + + /** ReadRowsRequest requestStatsView. */ + public requestStatsView: (google.bigtable.v2.ReadRowsRequest.RequestStatsView|keyof typeof google.bigtable.v2.ReadRowsRequest.RequestStatsView); + + /** ReadRowsRequest reversed. */ + public reversed: boolean; + + /** + * Creates a new ReadRowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRowsRequest instance + */ + public static create(properties?: google.bigtable.v2.IReadRowsRequest): google.bigtable.v2.ReadRowsRequest; + + /** + * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.bigtable.v2.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.bigtable.v2.IReadRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.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.bigtable.v2.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.bigtable.v2.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.bigtable.v2.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.bigtable.v2.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.bigtable.v2.ReadRowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadRowsRequest { + + /** RequestStatsView enum. */ + enum RequestStatsView { + REQUEST_STATS_VIEW_UNSPECIFIED = 0, + REQUEST_STATS_NONE = 1, + REQUEST_STATS_FULL = 2 + } + } + + /** Properties of a ReadRowsResponse. */ + interface IReadRowsResponse { + + /** ReadRowsResponse chunks */ + chunks?: (google.bigtable.v2.ReadRowsResponse.ICellChunk[]|null); + + /** ReadRowsResponse lastScannedRowKey */ + lastScannedRowKey?: (Uint8Array|Buffer|string|null); + + /** ReadRowsResponse requestStats */ + requestStats?: (google.bigtable.v2.IRequestStats|null); + } + + /** Represents a ReadRowsResponse. */ + class ReadRowsResponse implements IReadRowsResponse { + + /** + * Constructs a new ReadRowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadRowsResponse); + + /** ReadRowsResponse chunks. */ + public chunks: google.bigtable.v2.ReadRowsResponse.ICellChunk[]; + + /** ReadRowsResponse lastScannedRowKey. */ + public lastScannedRowKey: (Uint8Array|Buffer|string); + + /** ReadRowsResponse requestStats. */ + public requestStats?: (google.bigtable.v2.IRequestStats|null); + + /** + * Creates a new ReadRowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRowsResponse instance + */ + public static create(properties?: google.bigtable.v2.IReadRowsResponse): google.bigtable.v2.ReadRowsResponse; + + /** + * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.bigtable.v2.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.bigtable.v2.IReadRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRowsResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.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.bigtable.v2.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.bigtable.v2.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.bigtable.v2.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.bigtable.v2.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.bigtable.v2.ReadRowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadRowsResponse { + + /** Properties of a CellChunk. */ + interface ICellChunk { + + /** CellChunk rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** CellChunk familyName */ + familyName?: (google.protobuf.IStringValue|null); + + /** CellChunk qualifier */ + qualifier?: (google.protobuf.IBytesValue|null); + + /** CellChunk timestampMicros */ + timestampMicros?: (number|Long|string|null); + + /** CellChunk labels */ + labels?: (string[]|null); + + /** CellChunk value */ + value?: (Uint8Array|Buffer|string|null); + + /** CellChunk valueSize */ + valueSize?: (number|null); + + /** CellChunk resetRow */ + resetRow?: (boolean|null); + + /** CellChunk commitRow */ + commitRow?: (boolean|null); + } + + /** Represents a CellChunk. */ + class CellChunk implements ICellChunk { + + /** + * Constructs a new CellChunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ReadRowsResponse.ICellChunk); + + /** CellChunk rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** CellChunk familyName. */ + public familyName?: (google.protobuf.IStringValue|null); + + /** CellChunk qualifier. */ + public qualifier?: (google.protobuf.IBytesValue|null); + + /** CellChunk timestampMicros. */ + public timestampMicros: (number|Long|string); + + /** CellChunk labels. */ + public labels: string[]; + + /** CellChunk value. */ + public value: (Uint8Array|Buffer|string); + + /** CellChunk valueSize. */ + public valueSize: number; + + /** CellChunk resetRow. */ + public resetRow?: (boolean|null); + + /** CellChunk commitRow. */ + public commitRow?: (boolean|null); + + /** CellChunk rowStatus. */ + public rowStatus?: ("resetRow"|"commitRow"); + + /** + * Creates a new CellChunk instance using the specified properties. + * @param [properties] Properties to set + * @returns CellChunk instance + */ + public static create(properties?: google.bigtable.v2.ReadRowsResponse.ICellChunk): google.bigtable.v2.ReadRowsResponse.CellChunk; + + /** + * Encodes the specified CellChunk message. Does not implicitly {@link google.bigtable.v2.ReadRowsResponse.CellChunk.verify|verify} messages. + * @param message CellChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ReadRowsResponse.ICellChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CellChunk message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadRowsResponse.CellChunk.verify|verify} messages. + * @param message CellChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ReadRowsResponse.ICellChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CellChunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CellChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadRowsResponse.CellChunk; + + /** + * Decodes a CellChunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CellChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadRowsResponse.CellChunk; + + /** + * Verifies a CellChunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CellChunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CellChunk + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadRowsResponse.CellChunk; + + /** + * Creates a plain object from a CellChunk message. Also converts values to other types if specified. + * @param message CellChunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadRowsResponse.CellChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CellChunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CellChunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SampleRowKeysRequest. */ + interface ISampleRowKeysRequest { + + /** SampleRowKeysRequest tableName */ + tableName?: (string|null); + + /** SampleRowKeysRequest authorizedViewName */ + authorizedViewName?: (string|null); + + /** SampleRowKeysRequest materializedViewName */ + materializedViewName?: (string|null); + + /** SampleRowKeysRequest appProfileId */ + appProfileId?: (string|null); + } + + /** Represents a SampleRowKeysRequest. */ + class SampleRowKeysRequest implements ISampleRowKeysRequest { + + /** + * Constructs a new SampleRowKeysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ISampleRowKeysRequest); + + /** SampleRowKeysRequest tableName. */ + public tableName: string; + + /** SampleRowKeysRequest authorizedViewName. */ + public authorizedViewName: string; + + /** SampleRowKeysRequest materializedViewName. */ + public materializedViewName: string; + + /** SampleRowKeysRequest appProfileId. */ + public appProfileId: string; + + /** + * Creates a new SampleRowKeysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SampleRowKeysRequest instance + */ + public static create(properties?: google.bigtable.v2.ISampleRowKeysRequest): google.bigtable.v2.SampleRowKeysRequest; + + /** + * Encodes the specified SampleRowKeysRequest message. Does not implicitly {@link google.bigtable.v2.SampleRowKeysRequest.verify|verify} messages. + * @param message SampleRowKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ISampleRowKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SampleRowKeysRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.SampleRowKeysRequest.verify|verify} messages. + * @param message SampleRowKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ISampleRowKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SampleRowKeysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SampleRowKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.SampleRowKeysRequest; + + /** + * Decodes a SampleRowKeysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SampleRowKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.SampleRowKeysRequest; + + /** + * Verifies a SampleRowKeysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SampleRowKeysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SampleRowKeysRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.SampleRowKeysRequest; + + /** + * Creates a plain object from a SampleRowKeysRequest message. Also converts values to other types if specified. + * @param message SampleRowKeysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.SampleRowKeysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SampleRowKeysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SampleRowKeysRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SampleRowKeysResponse. */ + interface ISampleRowKeysResponse { + + /** SampleRowKeysResponse rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** SampleRowKeysResponse offsetBytes */ + offsetBytes?: (number|Long|string|null); + } + + /** Represents a SampleRowKeysResponse. */ + class SampleRowKeysResponse implements ISampleRowKeysResponse { + + /** + * Constructs a new SampleRowKeysResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ISampleRowKeysResponse); + + /** SampleRowKeysResponse rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** SampleRowKeysResponse offsetBytes. */ + public offsetBytes: (number|Long|string); + + /** + * Creates a new SampleRowKeysResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SampleRowKeysResponse instance + */ + public static create(properties?: google.bigtable.v2.ISampleRowKeysResponse): google.bigtable.v2.SampleRowKeysResponse; + + /** + * Encodes the specified SampleRowKeysResponse message. Does not implicitly {@link google.bigtable.v2.SampleRowKeysResponse.verify|verify} messages. + * @param message SampleRowKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ISampleRowKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SampleRowKeysResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.SampleRowKeysResponse.verify|verify} messages. + * @param message SampleRowKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ISampleRowKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SampleRowKeysResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SampleRowKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.SampleRowKeysResponse; + + /** + * Decodes a SampleRowKeysResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SampleRowKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.SampleRowKeysResponse; + + /** + * Verifies a SampleRowKeysResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SampleRowKeysResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SampleRowKeysResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.SampleRowKeysResponse; + + /** + * Creates a plain object from a SampleRowKeysResponse message. Also converts values to other types if specified. + * @param message SampleRowKeysResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.SampleRowKeysResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SampleRowKeysResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SampleRowKeysResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateRowRequest. */ + interface IMutateRowRequest { + + /** MutateRowRequest tableName */ + tableName?: (string|null); + + /** MutateRowRequest authorizedViewName */ + authorizedViewName?: (string|null); + + /** MutateRowRequest appProfileId */ + appProfileId?: (string|null); + + /** MutateRowRequest rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** MutateRowRequest mutations */ + mutations?: (google.bigtable.v2.IMutation[]|null); + + /** MutateRowRequest idempotency */ + idempotency?: (google.bigtable.v2.IIdempotency|null); + } + + /** Represents a MutateRowRequest. */ + class MutateRowRequest implements IMutateRowRequest { + + /** + * Constructs a new MutateRowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IMutateRowRequest); + + /** MutateRowRequest tableName. */ + public tableName: string; + + /** MutateRowRequest authorizedViewName. */ + public authorizedViewName: string; + + /** MutateRowRequest appProfileId. */ + public appProfileId: string; + + /** MutateRowRequest rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** MutateRowRequest mutations. */ + public mutations: google.bigtable.v2.IMutation[]; + + /** MutateRowRequest idempotency. */ + public idempotency?: (google.bigtable.v2.IIdempotency|null); + + /** + * Creates a new MutateRowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateRowRequest instance + */ + public static create(properties?: google.bigtable.v2.IMutateRowRequest): google.bigtable.v2.MutateRowRequest; + + /** + * Encodes the specified MutateRowRequest message. Does not implicitly {@link google.bigtable.v2.MutateRowRequest.verify|verify} messages. + * @param message MutateRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IMutateRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateRowRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowRequest.verify|verify} messages. + * @param message MutateRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IMutateRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateRowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.MutateRowRequest; + + /** + * Decodes a MutateRowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.MutateRowRequest; + + /** + * Verifies a MutateRowRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateRowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateRowRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.MutateRowRequest; + + /** + * Creates a plain object from a MutateRowRequest message. Also converts values to other types if specified. + * @param message MutateRowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.MutateRowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateRowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateRowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateRowResponse. */ + interface IMutateRowResponse { + } + + /** Represents a MutateRowResponse. */ + class MutateRowResponse implements IMutateRowResponse { + + /** + * Constructs a new MutateRowResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IMutateRowResponse); + + /** + * Creates a new MutateRowResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateRowResponse instance + */ + public static create(properties?: google.bigtable.v2.IMutateRowResponse): google.bigtable.v2.MutateRowResponse; + + /** + * Encodes the specified MutateRowResponse message. Does not implicitly {@link google.bigtable.v2.MutateRowResponse.verify|verify} messages. + * @param message MutateRowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IMutateRowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateRowResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowResponse.verify|verify} messages. + * @param message MutateRowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IMutateRowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateRowResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.MutateRowResponse; + + /** + * Decodes a MutateRowResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.MutateRowResponse; + + /** + * Verifies a MutateRowResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateRowResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateRowResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.MutateRowResponse; + + /** + * Creates a plain object from a MutateRowResponse message. Also converts values to other types if specified. + * @param message MutateRowResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.MutateRowResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateRowResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateRowResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateRowsRequest. */ + interface IMutateRowsRequest { + + /** MutateRowsRequest tableName */ + tableName?: (string|null); + + /** MutateRowsRequest authorizedViewName */ + authorizedViewName?: (string|null); + + /** MutateRowsRequest appProfileId */ + appProfileId?: (string|null); + + /** MutateRowsRequest entries */ + entries?: (google.bigtable.v2.MutateRowsRequest.IEntry[]|null); + } + + /** Represents a MutateRowsRequest. */ + class MutateRowsRequest implements IMutateRowsRequest { + + /** + * Constructs a new MutateRowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IMutateRowsRequest); + + /** MutateRowsRequest tableName. */ + public tableName: string; + + /** MutateRowsRequest authorizedViewName. */ + public authorizedViewName: string; + + /** MutateRowsRequest appProfileId. */ + public appProfileId: string; + + /** MutateRowsRequest entries. */ + public entries: google.bigtable.v2.MutateRowsRequest.IEntry[]; + + /** + * Creates a new MutateRowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateRowsRequest instance + */ + public static create(properties?: google.bigtable.v2.IMutateRowsRequest): google.bigtable.v2.MutateRowsRequest; + + /** + * Encodes the specified MutateRowsRequest message. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.verify|verify} messages. + * @param message MutateRowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IMutateRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateRowsRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.verify|verify} messages. + * @param message MutateRowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IMutateRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateRowsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.MutateRowsRequest; + + /** + * Decodes a MutateRowsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.MutateRowsRequest; + + /** + * Verifies a MutateRowsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateRowsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateRowsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.MutateRowsRequest; + + /** + * Creates a plain object from a MutateRowsRequest message. Also converts values to other types if specified. + * @param message MutateRowsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.MutateRowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateRowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateRowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MutateRowsRequest { + + /** Properties of an Entry. */ + interface IEntry { + + /** Entry rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** Entry mutations */ + mutations?: (google.bigtable.v2.IMutation[]|null); + + /** Entry idempotency */ + idempotency?: (google.bigtable.v2.IIdempotency|null); + } + + /** Represents an Entry. */ + class Entry implements IEntry { + + /** + * Constructs a new Entry. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.MutateRowsRequest.IEntry); + + /** Entry rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** Entry mutations. */ + public mutations: google.bigtable.v2.IMutation[]; + + /** Entry idempotency. */ + public idempotency?: (google.bigtable.v2.IIdempotency|null); + + /** + * Creates a new Entry instance using the specified properties. + * @param [properties] Properties to set + * @returns Entry instance + */ + public static create(properties?: google.bigtable.v2.MutateRowsRequest.IEntry): google.bigtable.v2.MutateRowsRequest.Entry; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.MutateRowsRequest.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.MutateRowsRequest.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.MutateRowsRequest.Entry; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.MutateRowsRequest.Entry; + + /** + * Verifies an Entry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entry + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.MutateRowsRequest.Entry; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @param message Entry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.MutateRowsRequest.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a MutateRowsResponse. */ + interface IMutateRowsResponse { + + /** MutateRowsResponse entries */ + entries?: (google.bigtable.v2.MutateRowsResponse.IEntry[]|null); + + /** MutateRowsResponse rateLimitInfo */ + rateLimitInfo?: (google.bigtable.v2.IRateLimitInfo|null); + } + + /** Represents a MutateRowsResponse. */ + class MutateRowsResponse implements IMutateRowsResponse { + + /** + * Constructs a new MutateRowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IMutateRowsResponse); + + /** MutateRowsResponse entries. */ + public entries: google.bigtable.v2.MutateRowsResponse.IEntry[]; + + /** MutateRowsResponse rateLimitInfo. */ + public rateLimitInfo?: (google.bigtable.v2.IRateLimitInfo|null); + + /** + * Creates a new MutateRowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateRowsResponse instance + */ + public static create(properties?: google.bigtable.v2.IMutateRowsResponse): google.bigtable.v2.MutateRowsResponse; + + /** + * Encodes the specified MutateRowsResponse message. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.verify|verify} messages. + * @param message MutateRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IMutateRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateRowsResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.verify|verify} messages. + * @param message MutateRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IMutateRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateRowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.MutateRowsResponse; + + /** + * Decodes a MutateRowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.MutateRowsResponse; + + /** + * Verifies a MutateRowsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateRowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateRowsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.MutateRowsResponse; + + /** + * Creates a plain object from a MutateRowsResponse message. Also converts values to other types if specified. + * @param message MutateRowsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.MutateRowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateRowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateRowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MutateRowsResponse { + + /** Properties of an Entry. */ + interface IEntry { + + /** Entry index */ + index?: (number|Long|string|null); + + /** Entry status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents an Entry. */ + class Entry implements IEntry { + + /** + * Constructs a new Entry. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.MutateRowsResponse.IEntry); + + /** Entry index. */ + public index: (number|Long|string); + + /** Entry status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new Entry instance using the specified properties. + * @param [properties] Properties to set + * @returns Entry instance + */ + public static create(properties?: google.bigtable.v2.MutateRowsResponse.IEntry): google.bigtable.v2.MutateRowsResponse.Entry; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.MutateRowsResponse.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.MutateRowsResponse.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.MutateRowsResponse.Entry; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.MutateRowsResponse.Entry; + + /** + * Verifies an Entry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entry + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.MutateRowsResponse.Entry; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @param message Entry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.MutateRowsResponse.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RateLimitInfo. */ + interface IRateLimitInfo { + + /** RateLimitInfo period */ + period?: (google.protobuf.IDuration|null); + + /** RateLimitInfo factor */ + factor?: (number|null); + } + + /** Represents a RateLimitInfo. */ + class RateLimitInfo implements IRateLimitInfo { + + /** + * Constructs a new RateLimitInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRateLimitInfo); + + /** RateLimitInfo period. */ + public period?: (google.protobuf.IDuration|null); + + /** RateLimitInfo factor. */ + public factor: number; + + /** + * Creates a new RateLimitInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RateLimitInfo instance + */ + public static create(properties?: google.bigtable.v2.IRateLimitInfo): google.bigtable.v2.RateLimitInfo; + + /** + * Encodes the specified RateLimitInfo message. Does not implicitly {@link google.bigtable.v2.RateLimitInfo.verify|verify} messages. + * @param message RateLimitInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRateLimitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RateLimitInfo message, length delimited. Does not implicitly {@link google.bigtable.v2.RateLimitInfo.verify|verify} messages. + * @param message RateLimitInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRateLimitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RateLimitInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RateLimitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RateLimitInfo; + + /** + * Decodes a RateLimitInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RateLimitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RateLimitInfo; + + /** + * Verifies a RateLimitInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RateLimitInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RateLimitInfo + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RateLimitInfo; + + /** + * Creates a plain object from a RateLimitInfo message. Also converts values to other types if specified. + * @param message RateLimitInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RateLimitInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RateLimitInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RateLimitInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckAndMutateRowRequest. */ + interface ICheckAndMutateRowRequest { + + /** CheckAndMutateRowRequest tableName */ + tableName?: (string|null); + + /** CheckAndMutateRowRequest authorizedViewName */ + authorizedViewName?: (string|null); + + /** CheckAndMutateRowRequest appProfileId */ + appProfileId?: (string|null); + + /** CheckAndMutateRowRequest rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** CheckAndMutateRowRequest predicateFilter */ + predicateFilter?: (google.bigtable.v2.IRowFilter|null); + + /** CheckAndMutateRowRequest trueMutations */ + trueMutations?: (google.bigtable.v2.IMutation[]|null); + + /** CheckAndMutateRowRequest falseMutations */ + falseMutations?: (google.bigtable.v2.IMutation[]|null); + } + + /** Represents a CheckAndMutateRowRequest. */ + class CheckAndMutateRowRequest implements ICheckAndMutateRowRequest { + + /** + * Constructs a new CheckAndMutateRowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ICheckAndMutateRowRequest); + + /** CheckAndMutateRowRequest tableName. */ + public tableName: string; + + /** CheckAndMutateRowRequest authorizedViewName. */ + public authorizedViewName: string; + + /** CheckAndMutateRowRequest appProfileId. */ + public appProfileId: string; + + /** CheckAndMutateRowRequest rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** CheckAndMutateRowRequest predicateFilter. */ + public predicateFilter?: (google.bigtable.v2.IRowFilter|null); + + /** CheckAndMutateRowRequest trueMutations. */ + public trueMutations: google.bigtable.v2.IMutation[]; + + /** CheckAndMutateRowRequest falseMutations. */ + public falseMutations: google.bigtable.v2.IMutation[]; + + /** + * Creates a new CheckAndMutateRowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckAndMutateRowRequest instance + */ + public static create(properties?: google.bigtable.v2.ICheckAndMutateRowRequest): google.bigtable.v2.CheckAndMutateRowRequest; + + /** + * Encodes the specified CheckAndMutateRowRequest message. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowRequest.verify|verify} messages. + * @param message CheckAndMutateRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ICheckAndMutateRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckAndMutateRowRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowRequest.verify|verify} messages. + * @param message CheckAndMutateRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ICheckAndMutateRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckAndMutateRowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckAndMutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.CheckAndMutateRowRequest; + + /** + * Decodes a CheckAndMutateRowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckAndMutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.CheckAndMutateRowRequest; + + /** + * Verifies a CheckAndMutateRowRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckAndMutateRowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckAndMutateRowRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.CheckAndMutateRowRequest; + + /** + * Creates a plain object from a CheckAndMutateRowRequest message. Also converts values to other types if specified. + * @param message CheckAndMutateRowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.CheckAndMutateRowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckAndMutateRowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckAndMutateRowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckAndMutateRowResponse. */ + interface ICheckAndMutateRowResponse { + + /** CheckAndMutateRowResponse predicateMatched */ + predicateMatched?: (boolean|null); + } + + /** Represents a CheckAndMutateRowResponse. */ + class CheckAndMutateRowResponse implements ICheckAndMutateRowResponse { + + /** + * Constructs a new CheckAndMutateRowResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ICheckAndMutateRowResponse); + + /** CheckAndMutateRowResponse predicateMatched. */ + public predicateMatched: boolean; + + /** + * Creates a new CheckAndMutateRowResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckAndMutateRowResponse instance + */ + public static create(properties?: google.bigtable.v2.ICheckAndMutateRowResponse): google.bigtable.v2.CheckAndMutateRowResponse; + + /** + * Encodes the specified CheckAndMutateRowResponse message. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowResponse.verify|verify} messages. + * @param message CheckAndMutateRowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ICheckAndMutateRowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckAndMutateRowResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowResponse.verify|verify} messages. + * @param message CheckAndMutateRowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ICheckAndMutateRowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckAndMutateRowResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckAndMutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.CheckAndMutateRowResponse; + + /** + * Decodes a CheckAndMutateRowResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckAndMutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.CheckAndMutateRowResponse; + + /** + * Verifies a CheckAndMutateRowResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckAndMutateRowResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckAndMutateRowResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.CheckAndMutateRowResponse; + + /** + * Creates a plain object from a CheckAndMutateRowResponse message. Also converts values to other types if specified. + * @param message CheckAndMutateRowResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.CheckAndMutateRowResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckAndMutateRowResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckAndMutateRowResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PingAndWarmRequest. */ + interface IPingAndWarmRequest { + + /** PingAndWarmRequest name */ + name?: (string|null); + + /** PingAndWarmRequest appProfileId */ + appProfileId?: (string|null); + } + + /** Represents a PingAndWarmRequest. */ + class PingAndWarmRequest implements IPingAndWarmRequest { + + /** + * Constructs a new PingAndWarmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IPingAndWarmRequest); + + /** PingAndWarmRequest name. */ + public name: string; + + /** PingAndWarmRequest appProfileId. */ + public appProfileId: string; + + /** + * Creates a new PingAndWarmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PingAndWarmRequest instance + */ + public static create(properties?: google.bigtable.v2.IPingAndWarmRequest): google.bigtable.v2.PingAndWarmRequest; + + /** + * Encodes the specified PingAndWarmRequest message. Does not implicitly {@link google.bigtable.v2.PingAndWarmRequest.verify|verify} messages. + * @param message PingAndWarmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IPingAndWarmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PingAndWarmRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.PingAndWarmRequest.verify|verify} messages. + * @param message PingAndWarmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IPingAndWarmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PingAndWarmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PingAndWarmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.PingAndWarmRequest; + + /** + * Decodes a PingAndWarmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PingAndWarmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.PingAndWarmRequest; + + /** + * Verifies a PingAndWarmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PingAndWarmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PingAndWarmRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.PingAndWarmRequest; + + /** + * Creates a plain object from a PingAndWarmRequest message. Also converts values to other types if specified. + * @param message PingAndWarmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.PingAndWarmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PingAndWarmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PingAndWarmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PingAndWarmResponse. */ + interface IPingAndWarmResponse { + } + + /** Represents a PingAndWarmResponse. */ + class PingAndWarmResponse implements IPingAndWarmResponse { + + /** + * Constructs a new PingAndWarmResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IPingAndWarmResponse); + + /** + * Creates a new PingAndWarmResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PingAndWarmResponse instance + */ + public static create(properties?: google.bigtable.v2.IPingAndWarmResponse): google.bigtable.v2.PingAndWarmResponse; + + /** + * Encodes the specified PingAndWarmResponse message. Does not implicitly {@link google.bigtable.v2.PingAndWarmResponse.verify|verify} messages. + * @param message PingAndWarmResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IPingAndWarmResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PingAndWarmResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.PingAndWarmResponse.verify|verify} messages. + * @param message PingAndWarmResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IPingAndWarmResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PingAndWarmResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PingAndWarmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.PingAndWarmResponse; + + /** + * Decodes a PingAndWarmResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PingAndWarmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.PingAndWarmResponse; + + /** + * Verifies a PingAndWarmResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PingAndWarmResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PingAndWarmResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.PingAndWarmResponse; + + /** + * Creates a plain object from a PingAndWarmResponse message. Also converts values to other types if specified. + * @param message PingAndWarmResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.PingAndWarmResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PingAndWarmResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PingAndWarmResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadModifyWriteRowRequest. */ + interface IReadModifyWriteRowRequest { + + /** ReadModifyWriteRowRequest tableName */ + tableName?: (string|null); + + /** ReadModifyWriteRowRequest authorizedViewName */ + authorizedViewName?: (string|null); + + /** ReadModifyWriteRowRequest appProfileId */ + appProfileId?: (string|null); + + /** ReadModifyWriteRowRequest rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** ReadModifyWriteRowRequest rules */ + rules?: (google.bigtable.v2.IReadModifyWriteRule[]|null); + } + + /** Represents a ReadModifyWriteRowRequest. */ + class ReadModifyWriteRowRequest implements IReadModifyWriteRowRequest { + + /** + * Constructs a new ReadModifyWriteRowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadModifyWriteRowRequest); + + /** ReadModifyWriteRowRequest tableName. */ + public tableName: string; + + /** ReadModifyWriteRowRequest authorizedViewName. */ + public authorizedViewName: string; + + /** ReadModifyWriteRowRequest appProfileId. */ + public appProfileId: string; + + /** ReadModifyWriteRowRequest rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** ReadModifyWriteRowRequest rules. */ + public rules: google.bigtable.v2.IReadModifyWriteRule[]; + + /** + * Creates a new ReadModifyWriteRowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadModifyWriteRowRequest instance + */ + public static create(properties?: google.bigtable.v2.IReadModifyWriteRowRequest): google.bigtable.v2.ReadModifyWriteRowRequest; + + /** + * Encodes the specified ReadModifyWriteRowRequest message. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowRequest.verify|verify} messages. + * @param message ReadModifyWriteRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadModifyWriteRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadModifyWriteRowRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowRequest.verify|verify} messages. + * @param message ReadModifyWriteRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadModifyWriteRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadModifyWriteRowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadModifyWriteRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadModifyWriteRowRequest; + + /** + * Decodes a ReadModifyWriteRowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadModifyWriteRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadModifyWriteRowRequest; + + /** + * Verifies a ReadModifyWriteRowRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadModifyWriteRowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadModifyWriteRowRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadModifyWriteRowRequest; + + /** + * Creates a plain object from a ReadModifyWriteRowRequest message. Also converts values to other types if specified. + * @param message ReadModifyWriteRowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadModifyWriteRowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadModifyWriteRowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadModifyWriteRowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadModifyWriteRowResponse. */ + interface IReadModifyWriteRowResponse { + + /** ReadModifyWriteRowResponse row */ + row?: (google.bigtable.v2.IRow|null); + } + + /** Represents a ReadModifyWriteRowResponse. */ + class ReadModifyWriteRowResponse implements IReadModifyWriteRowResponse { + + /** + * Constructs a new ReadModifyWriteRowResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadModifyWriteRowResponse); + + /** ReadModifyWriteRowResponse row. */ + public row?: (google.bigtable.v2.IRow|null); + + /** + * Creates a new ReadModifyWriteRowResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadModifyWriteRowResponse instance + */ + public static create(properties?: google.bigtable.v2.IReadModifyWriteRowResponse): google.bigtable.v2.ReadModifyWriteRowResponse; + + /** + * Encodes the specified ReadModifyWriteRowResponse message. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowResponse.verify|verify} messages. + * @param message ReadModifyWriteRowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadModifyWriteRowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadModifyWriteRowResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowResponse.verify|verify} messages. + * @param message ReadModifyWriteRowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadModifyWriteRowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadModifyWriteRowResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadModifyWriteRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadModifyWriteRowResponse; + + /** + * Decodes a ReadModifyWriteRowResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadModifyWriteRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadModifyWriteRowResponse; + + /** + * Verifies a ReadModifyWriteRowResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadModifyWriteRowResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadModifyWriteRowResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadModifyWriteRowResponse; + + /** + * Creates a plain object from a ReadModifyWriteRowResponse message. Also converts values to other types if specified. + * @param message ReadModifyWriteRowResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadModifyWriteRowResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadModifyWriteRowResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadModifyWriteRowResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateInitialChangeStreamPartitionsRequest. */ + interface IGenerateInitialChangeStreamPartitionsRequest { + + /** GenerateInitialChangeStreamPartitionsRequest tableName */ + tableName?: (string|null); + + /** GenerateInitialChangeStreamPartitionsRequest appProfileId */ + appProfileId?: (string|null); + } + + /** Represents a GenerateInitialChangeStreamPartitionsRequest. */ + class GenerateInitialChangeStreamPartitionsRequest implements IGenerateInitialChangeStreamPartitionsRequest { + + /** + * Constructs a new GenerateInitialChangeStreamPartitionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest); + + /** GenerateInitialChangeStreamPartitionsRequest tableName. */ + public tableName: string; + + /** GenerateInitialChangeStreamPartitionsRequest appProfileId. */ + public appProfileId: string; + + /** + * Creates a new GenerateInitialChangeStreamPartitionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateInitialChangeStreamPartitionsRequest instance + */ + public static create(properties?: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest): google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsRequest message. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.verify|verify} messages. + * @param message GenerateInitialChangeStreamPartitionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.verify|verify} messages. + * @param message GenerateInitialChangeStreamPartitionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateInitialChangeStreamPartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateInitialChangeStreamPartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; + + /** + * Verifies a GenerateInitialChangeStreamPartitionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateInitialChangeStreamPartitionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateInitialChangeStreamPartitionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; + + /** + * Creates a plain object from a GenerateInitialChangeStreamPartitionsRequest message. Also converts values to other types if specified. + * @param message GenerateInitialChangeStreamPartitionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateInitialChangeStreamPartitionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateInitialChangeStreamPartitionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateInitialChangeStreamPartitionsResponse. */ + interface IGenerateInitialChangeStreamPartitionsResponse { + + /** GenerateInitialChangeStreamPartitionsResponse partition */ + partition?: (google.bigtable.v2.IStreamPartition|null); + } + + /** Represents a GenerateInitialChangeStreamPartitionsResponse. */ + class GenerateInitialChangeStreamPartitionsResponse implements IGenerateInitialChangeStreamPartitionsResponse { + + /** + * Constructs a new GenerateInitialChangeStreamPartitionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse); + + /** GenerateInitialChangeStreamPartitionsResponse partition. */ + public partition?: (google.bigtable.v2.IStreamPartition|null); + + /** + * Creates a new GenerateInitialChangeStreamPartitionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateInitialChangeStreamPartitionsResponse instance + */ + public static create(properties?: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse): google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsResponse message. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.verify|verify} messages. + * @param message GenerateInitialChangeStreamPartitionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.verify|verify} messages. + * @param message GenerateInitialChangeStreamPartitionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateInitialChangeStreamPartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateInitialChangeStreamPartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; + + /** + * Verifies a GenerateInitialChangeStreamPartitionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateInitialChangeStreamPartitionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateInitialChangeStreamPartitionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; + + /** + * Creates a plain object from a GenerateInitialChangeStreamPartitionsResponse message. Also converts values to other types if specified. + * @param message GenerateInitialChangeStreamPartitionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateInitialChangeStreamPartitionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateInitialChangeStreamPartitionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadChangeStreamRequest. */ + interface IReadChangeStreamRequest { + + /** ReadChangeStreamRequest tableName */ + tableName?: (string|null); + + /** ReadChangeStreamRequest appProfileId */ + appProfileId?: (string|null); + + /** ReadChangeStreamRequest partition */ + partition?: (google.bigtable.v2.IStreamPartition|null); + + /** ReadChangeStreamRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ReadChangeStreamRequest continuationTokens */ + continuationTokens?: (google.bigtable.v2.IStreamContinuationTokens|null); + + /** ReadChangeStreamRequest endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ReadChangeStreamRequest heartbeatDuration */ + heartbeatDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a ReadChangeStreamRequest. */ + class ReadChangeStreamRequest implements IReadChangeStreamRequest { + + /** + * Constructs a new ReadChangeStreamRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadChangeStreamRequest); + + /** ReadChangeStreamRequest tableName. */ + public tableName: string; + + /** ReadChangeStreamRequest appProfileId. */ + public appProfileId: string; + + /** ReadChangeStreamRequest partition. */ + public partition?: (google.bigtable.v2.IStreamPartition|null); + + /** ReadChangeStreamRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ReadChangeStreamRequest continuationTokens. */ + public continuationTokens?: (google.bigtable.v2.IStreamContinuationTokens|null); + + /** ReadChangeStreamRequest endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ReadChangeStreamRequest heartbeatDuration. */ + public heartbeatDuration?: (google.protobuf.IDuration|null); + + /** ReadChangeStreamRequest startFrom. */ + public startFrom?: ("startTime"|"continuationTokens"); + + /** + * Creates a new ReadChangeStreamRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadChangeStreamRequest instance + */ + public static create(properties?: google.bigtable.v2.IReadChangeStreamRequest): google.bigtable.v2.ReadChangeStreamRequest; + + /** + * Encodes the specified ReadChangeStreamRequest message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamRequest.verify|verify} messages. + * @param message ReadChangeStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadChangeStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadChangeStreamRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamRequest.verify|verify} messages. + * @param message ReadChangeStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadChangeStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadChangeStreamRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadChangeStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamRequest; + + /** + * Decodes a ReadChangeStreamRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadChangeStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamRequest; + + /** + * Verifies a ReadChangeStreamRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadChangeStreamRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadChangeStreamRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamRequest; + + /** + * Creates a plain object from a ReadChangeStreamRequest message. Also converts values to other types if specified. + * @param message ReadChangeStreamRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadChangeStreamRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadChangeStreamRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadChangeStreamResponse. */ + interface IReadChangeStreamResponse { + + /** ReadChangeStreamResponse dataChange */ + dataChange?: (google.bigtable.v2.ReadChangeStreamResponse.IDataChange|null); + + /** ReadChangeStreamResponse heartbeat */ + heartbeat?: (google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat|null); + + /** ReadChangeStreamResponse closeStream */ + closeStream?: (google.bigtable.v2.ReadChangeStreamResponse.ICloseStream|null); + } + + /** Represents a ReadChangeStreamResponse. */ + class ReadChangeStreamResponse implements IReadChangeStreamResponse { + + /** + * Constructs a new ReadChangeStreamResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadChangeStreamResponse); + + /** ReadChangeStreamResponse dataChange. */ + public dataChange?: (google.bigtable.v2.ReadChangeStreamResponse.IDataChange|null); + + /** ReadChangeStreamResponse heartbeat. */ + public heartbeat?: (google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat|null); + + /** ReadChangeStreamResponse closeStream. */ + public closeStream?: (google.bigtable.v2.ReadChangeStreamResponse.ICloseStream|null); + + /** ReadChangeStreamResponse streamRecord. */ + public streamRecord?: ("dataChange"|"heartbeat"|"closeStream"); + + /** + * Creates a new ReadChangeStreamResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadChangeStreamResponse instance + */ + public static create(properties?: google.bigtable.v2.IReadChangeStreamResponse): google.bigtable.v2.ReadChangeStreamResponse; + + /** + * Encodes the specified ReadChangeStreamResponse message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.verify|verify} messages. + * @param message ReadChangeStreamResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadChangeStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadChangeStreamResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.verify|verify} messages. + * @param message ReadChangeStreamResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadChangeStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadChangeStreamResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadChangeStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamResponse; + + /** + * Decodes a ReadChangeStreamResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadChangeStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamResponse; + + /** + * Verifies a ReadChangeStreamResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadChangeStreamResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadChangeStreamResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamResponse; + + /** + * Creates a plain object from a ReadChangeStreamResponse message. Also converts values to other types if specified. + * @param message ReadChangeStreamResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadChangeStreamResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadChangeStreamResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadChangeStreamResponse { + + /** Properties of a MutationChunk. */ + interface IMutationChunk { + + /** MutationChunk chunkInfo */ + chunkInfo?: (google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo|null); + + /** MutationChunk mutation */ + mutation?: (google.bigtable.v2.IMutation|null); + } + + /** Represents a MutationChunk. */ + class MutationChunk implements IMutationChunk { + + /** + * Constructs a new MutationChunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk); + + /** MutationChunk chunkInfo. */ + public chunkInfo?: (google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo|null); + + /** MutationChunk mutation. */ + public mutation?: (google.bigtable.v2.IMutation|null); + + /** + * Creates a new MutationChunk instance using the specified properties. + * @param [properties] Properties to set + * @returns MutationChunk instance + */ + public static create(properties?: google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk; + + /** + * Encodes the specified MutationChunk message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.verify|verify} messages. + * @param message MutationChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutationChunk message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.verify|verify} messages. + * @param message MutationChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutationChunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutationChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk; + + /** + * Decodes a MutationChunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutationChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk; + + /** + * Verifies a MutationChunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutationChunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutationChunk + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk; + + /** + * Creates a plain object from a MutationChunk message. Also converts values to other types if specified. + * @param message MutationChunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamResponse.MutationChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutationChunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutationChunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MutationChunk { + + /** Properties of a ChunkInfo. */ + interface IChunkInfo { + + /** ChunkInfo chunkedValueSize */ + chunkedValueSize?: (number|null); + + /** ChunkInfo chunkedValueOffset */ + chunkedValueOffset?: (number|null); + + /** ChunkInfo lastChunk */ + lastChunk?: (boolean|null); + } + + /** Represents a ChunkInfo. */ + class ChunkInfo implements IChunkInfo { + + /** + * Constructs a new ChunkInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo); + + /** ChunkInfo chunkedValueSize. */ + public chunkedValueSize: number; + + /** ChunkInfo chunkedValueOffset. */ + public chunkedValueOffset: number; + + /** ChunkInfo lastChunk. */ + public lastChunk: boolean; + + /** + * Creates a new ChunkInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkInfo instance + */ + public static create(properties?: google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo; + + /** + * Encodes the specified ChunkInfo message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.verify|verify} messages. + * @param message ChunkInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkInfo message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.verify|verify} messages. + * @param message ChunkInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo; + + /** + * Decodes a ChunkInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo; + + /** + * Verifies a ChunkInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChunkInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkInfo + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo; + + /** + * Creates a plain object from a ChunkInfo message. Also converts values to other types if specified. + * @param message ChunkInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DataChange. */ + interface IDataChange { + + /** DataChange type */ + type?: (google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type|keyof typeof google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type|null); + + /** DataChange sourceClusterId */ + sourceClusterId?: (string|null); + + /** DataChange rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** DataChange commitTimestamp */ + commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** DataChange tiebreaker */ + tiebreaker?: (number|null); + + /** DataChange chunks */ + chunks?: (google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk[]|null); + + /** DataChange done */ + done?: (boolean|null); + + /** DataChange token */ + token?: (string|null); + + /** DataChange estimatedLowWatermark */ + estimatedLowWatermark?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DataChange. */ + class DataChange implements IDataChange { + + /** + * Constructs a new DataChange. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ReadChangeStreamResponse.IDataChange); + + /** DataChange type. */ + public type: (google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type|keyof typeof google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type); + + /** DataChange sourceClusterId. */ + public sourceClusterId: string; + + /** DataChange rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** DataChange commitTimestamp. */ + public commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** DataChange tiebreaker. */ + public tiebreaker: number; + + /** DataChange chunks. */ + public chunks: google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk[]; + + /** DataChange done. */ + public done: boolean; + + /** DataChange token. */ + public token: string; + + /** DataChange estimatedLowWatermark. */ + public estimatedLowWatermark?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DataChange instance using the specified properties. + * @param [properties] Properties to set + * @returns DataChange instance + */ + public static create(properties?: google.bigtable.v2.ReadChangeStreamResponse.IDataChange): google.bigtable.v2.ReadChangeStreamResponse.DataChange; + + /** + * Encodes the specified DataChange message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.DataChange.verify|verify} messages. + * @param message DataChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ReadChangeStreamResponse.IDataChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataChange message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.DataChange.verify|verify} messages. + * @param message DataChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ReadChangeStreamResponse.IDataChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataChange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamResponse.DataChange; + + /** + * Decodes a DataChange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamResponse.DataChange; + + /** + * Verifies a DataChange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataChange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataChange + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamResponse.DataChange; + + /** + * Creates a plain object from a DataChange message. Also converts values to other types if specified. + * @param message DataChange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamResponse.DataChange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataChange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataChange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataChange { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + USER = 1, + GARBAGE_COLLECTION = 2, + CONTINUATION = 3 + } + } + + /** Properties of a Heartbeat. */ + interface IHeartbeat { + + /** Heartbeat continuationToken */ + continuationToken?: (google.bigtable.v2.IStreamContinuationToken|null); + + /** Heartbeat estimatedLowWatermark */ + estimatedLowWatermark?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Heartbeat. */ + class Heartbeat implements IHeartbeat { + + /** + * Constructs a new Heartbeat. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat); + + /** Heartbeat continuationToken. */ + public continuationToken?: (google.bigtable.v2.IStreamContinuationToken|null); + + /** Heartbeat estimatedLowWatermark. */ + public estimatedLowWatermark?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Heartbeat instance using the specified properties. + * @param [properties] Properties to set + * @returns Heartbeat instance + */ + public static create(properties?: google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat): google.bigtable.v2.ReadChangeStreamResponse.Heartbeat; + + /** + * Encodes the specified Heartbeat message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.verify|verify} messages. + * @param message Heartbeat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Heartbeat message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.verify|verify} messages. + * @param message Heartbeat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Heartbeat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Heartbeat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamResponse.Heartbeat; + + /** + * Decodes a Heartbeat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Heartbeat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamResponse.Heartbeat; + + /** + * Verifies a Heartbeat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Heartbeat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Heartbeat + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamResponse.Heartbeat; + + /** + * Creates a plain object from a Heartbeat message. Also converts values to other types if specified. + * @param message Heartbeat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamResponse.Heartbeat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Heartbeat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Heartbeat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloseStream. */ + interface ICloseStream { + + /** CloseStream status */ + status?: (google.rpc.IStatus|null); + + /** CloseStream continuationTokens */ + continuationTokens?: (google.bigtable.v2.IStreamContinuationToken[]|null); + + /** CloseStream newPartitions */ + newPartitions?: (google.bigtable.v2.IStreamPartition[]|null); + } + + /** Represents a CloseStream. */ + class CloseStream implements ICloseStream { + + /** + * Constructs a new CloseStream. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ReadChangeStreamResponse.ICloseStream); + + /** CloseStream status. */ + public status?: (google.rpc.IStatus|null); + + /** CloseStream continuationTokens. */ + public continuationTokens: google.bigtable.v2.IStreamContinuationToken[]; + + /** CloseStream newPartitions. */ + public newPartitions: google.bigtable.v2.IStreamPartition[]; + + /** + * Creates a new CloseStream instance using the specified properties. + * @param [properties] Properties to set + * @returns CloseStream instance + */ + public static create(properties?: google.bigtable.v2.ReadChangeStreamResponse.ICloseStream): google.bigtable.v2.ReadChangeStreamResponse.CloseStream; + + /** + * Encodes the specified CloseStream message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.CloseStream.verify|verify} messages. + * @param message CloseStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ReadChangeStreamResponse.ICloseStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloseStream message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.CloseStream.verify|verify} messages. + * @param message CloseStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ReadChangeStreamResponse.ICloseStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloseStream message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloseStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamResponse.CloseStream; + + /** + * Decodes a CloseStream message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloseStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamResponse.CloseStream; + + /** + * Verifies a CloseStream message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloseStream message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloseStream + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamResponse.CloseStream; + + /** + * Creates a plain object from a CloseStream message. Also converts values to other types if specified. + * @param message CloseStream + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamResponse.CloseStream, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloseStream to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloseStream + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExecuteQueryRequest. */ + interface IExecuteQueryRequest { + + /** ExecuteQueryRequest instanceName */ + instanceName?: (string|null); + + /** ExecuteQueryRequest appProfileId */ + appProfileId?: (string|null); + + /** ExecuteQueryRequest query */ + query?: (string|null); + + /** ExecuteQueryRequest preparedQuery */ + preparedQuery?: (Uint8Array|Buffer|string|null); + + /** ExecuteQueryRequest protoFormat */ + protoFormat?: (google.bigtable.v2.IProtoFormat|null); + + /** ExecuteQueryRequest resumeToken */ + resumeToken?: (Uint8Array|Buffer|string|null); + + /** ExecuteQueryRequest params */ + params?: ({ [k: string]: google.bigtable.v2.IValue }|null); + } + + /** Represents an ExecuteQueryRequest. */ + class ExecuteQueryRequest implements IExecuteQueryRequest { + + /** + * Constructs a new ExecuteQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IExecuteQueryRequest); + + /** ExecuteQueryRequest instanceName. */ + public instanceName: string; + + /** ExecuteQueryRequest appProfileId. */ + public appProfileId: string; + + /** ExecuteQueryRequest query. */ + public query: string; + + /** ExecuteQueryRequest preparedQuery. */ + public preparedQuery: (Uint8Array|Buffer|string); + + /** ExecuteQueryRequest protoFormat. */ + public protoFormat?: (google.bigtable.v2.IProtoFormat|null); + + /** ExecuteQueryRequest resumeToken. */ + public resumeToken: (Uint8Array|Buffer|string); + + /** ExecuteQueryRequest params. */ + public params: { [k: string]: google.bigtable.v2.IValue }; + + /** ExecuteQueryRequest dataFormat. */ + public dataFormat?: "protoFormat"; + + /** + * Creates a new ExecuteQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteQueryRequest instance + */ + public static create(properties?: google.bigtable.v2.IExecuteQueryRequest): google.bigtable.v2.ExecuteQueryRequest; + + /** + * Encodes the specified ExecuteQueryRequest message. Does not implicitly {@link google.bigtable.v2.ExecuteQueryRequest.verify|verify} messages. + * @param message ExecuteQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IExecuteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteQueryRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ExecuteQueryRequest.verify|verify} messages. + * @param message ExecuteQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IExecuteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ExecuteQueryRequest; + + /** + * Decodes an ExecuteQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ExecuteQueryRequest; + + /** + * Verifies an ExecuteQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ExecuteQueryRequest; + + /** + * Creates a plain object from an ExecuteQueryRequest message. Also converts values to other types if specified. + * @param message ExecuteQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ExecuteQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteQueryResponse. */ + interface IExecuteQueryResponse { + + /** ExecuteQueryResponse metadata */ + metadata?: (google.bigtable.v2.IResultSetMetadata|null); + + /** ExecuteQueryResponse results */ + results?: (google.bigtable.v2.IPartialResultSet|null); + } + + /** Represents an ExecuteQueryResponse. */ + class ExecuteQueryResponse implements IExecuteQueryResponse { + + /** + * Constructs a new ExecuteQueryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IExecuteQueryResponse); + + /** ExecuteQueryResponse metadata. */ + public metadata?: (google.bigtable.v2.IResultSetMetadata|null); + + /** ExecuteQueryResponse results. */ + public results?: (google.bigtable.v2.IPartialResultSet|null); + + /** ExecuteQueryResponse response. */ + public response?: ("metadata"|"results"); + + /** + * Creates a new ExecuteQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteQueryResponse instance + */ + public static create(properties?: google.bigtable.v2.IExecuteQueryResponse): google.bigtable.v2.ExecuteQueryResponse; + + /** + * Encodes the specified ExecuteQueryResponse message. Does not implicitly {@link google.bigtable.v2.ExecuteQueryResponse.verify|verify} messages. + * @param message ExecuteQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IExecuteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteQueryResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ExecuteQueryResponse.verify|verify} messages. + * @param message ExecuteQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IExecuteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ExecuteQueryResponse; + + /** + * Decodes an ExecuteQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ExecuteQueryResponse; + + /** + * Verifies an ExecuteQueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteQueryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteQueryResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ExecuteQueryResponse; + + /** + * Creates a plain object from an ExecuteQueryResponse message. Also converts values to other types if specified. + * @param message ExecuteQueryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ExecuteQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteQueryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteQueryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrepareQueryRequest. */ + interface IPrepareQueryRequest { + + /** PrepareQueryRequest instanceName */ + instanceName?: (string|null); + + /** PrepareQueryRequest appProfileId */ + appProfileId?: (string|null); + + /** PrepareQueryRequest query */ + query?: (string|null); + + /** PrepareQueryRequest protoFormat */ + protoFormat?: (google.bigtable.v2.IProtoFormat|null); + + /** PrepareQueryRequest paramTypes */ + paramTypes?: ({ [k: string]: google.bigtable.v2.IType }|null); + } + + /** Represents a PrepareQueryRequest. */ + class PrepareQueryRequest implements IPrepareQueryRequest { + + /** + * Constructs a new PrepareQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IPrepareQueryRequest); + + /** PrepareQueryRequest instanceName. */ + public instanceName: string; + + /** PrepareQueryRequest appProfileId. */ + public appProfileId: string; + + /** PrepareQueryRequest query. */ + public query: string; + + /** PrepareQueryRequest protoFormat. */ + public protoFormat?: (google.bigtable.v2.IProtoFormat|null); + + /** PrepareQueryRequest paramTypes. */ + public paramTypes: { [k: string]: google.bigtable.v2.IType }; + + /** PrepareQueryRequest dataFormat. */ + public dataFormat?: "protoFormat"; + + /** + * Creates a new PrepareQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PrepareQueryRequest instance + */ + public static create(properties?: google.bigtable.v2.IPrepareQueryRequest): google.bigtable.v2.PrepareQueryRequest; + + /** + * Encodes the specified PrepareQueryRequest message. Does not implicitly {@link google.bigtable.v2.PrepareQueryRequest.verify|verify} messages. + * @param message PrepareQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IPrepareQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrepareQueryRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.PrepareQueryRequest.verify|verify} messages. + * @param message PrepareQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IPrepareQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrepareQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrepareQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.PrepareQueryRequest; + + /** + * Decodes a PrepareQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrepareQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.PrepareQueryRequest; + + /** + * Verifies a PrepareQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrepareQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrepareQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.PrepareQueryRequest; + + /** + * Creates a plain object from a PrepareQueryRequest message. Also converts values to other types if specified. + * @param message PrepareQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.PrepareQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrepareQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrepareQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrepareQueryResponse. */ + interface IPrepareQueryResponse { + + /** PrepareQueryResponse metadata */ + metadata?: (google.bigtable.v2.IResultSetMetadata|null); + + /** PrepareQueryResponse preparedQuery */ + preparedQuery?: (Uint8Array|Buffer|string|null); + + /** PrepareQueryResponse validUntil */ + validUntil?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PrepareQueryResponse. */ + class PrepareQueryResponse implements IPrepareQueryResponse { + + /** + * Constructs a new PrepareQueryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IPrepareQueryResponse); + + /** PrepareQueryResponse metadata. */ + public metadata?: (google.bigtable.v2.IResultSetMetadata|null); + + /** PrepareQueryResponse preparedQuery. */ + public preparedQuery: (Uint8Array|Buffer|string); + + /** PrepareQueryResponse validUntil. */ + public validUntil?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PrepareQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PrepareQueryResponse instance + */ + public static create(properties?: google.bigtable.v2.IPrepareQueryResponse): google.bigtable.v2.PrepareQueryResponse; + + /** + * Encodes the specified PrepareQueryResponse message. Does not implicitly {@link google.bigtable.v2.PrepareQueryResponse.verify|verify} messages. + * @param message PrepareQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IPrepareQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrepareQueryResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.PrepareQueryResponse.verify|verify} messages. + * @param message PrepareQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IPrepareQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrepareQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrepareQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.PrepareQueryResponse; + + /** + * Decodes a PrepareQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrepareQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.PrepareQueryResponse; + + /** + * Verifies a PrepareQueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrepareQueryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrepareQueryResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.PrepareQueryResponse; + + /** + * Creates a plain object from a PrepareQueryResponse message. Also converts values to other types if specified. + * @param message PrepareQueryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.PrepareQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrepareQueryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrepareQueryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Row. */ + interface IRow { + + /** Row key */ + key?: (Uint8Array|Buffer|string|null); + + /** Row families */ + families?: (google.bigtable.v2.IFamily[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRow); + + /** Row key. */ + public key: (Uint8Array|Buffer|string); + + /** Row families. */ + public families: google.bigtable.v2.IFamily[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.bigtable.v2.IRow): google.bigtable.v2.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.bigtable.v2.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.bigtable.v2.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Row; + + /** + * Verifies a Row message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Family. */ + interface IFamily { + + /** Family name */ + name?: (string|null); + + /** Family columns */ + columns?: (google.bigtable.v2.IColumn[]|null); + } + + /** Represents a Family. */ + class Family implements IFamily { + + /** + * Constructs a new Family. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IFamily); + + /** Family name. */ + public name: string; + + /** Family columns. */ + public columns: google.bigtable.v2.IColumn[]; + + /** + * Creates a new Family instance using the specified properties. + * @param [properties] Properties to set + * @returns Family instance + */ + public static create(properties?: google.bigtable.v2.IFamily): google.bigtable.v2.Family; + + /** + * Encodes the specified Family message. Does not implicitly {@link google.bigtable.v2.Family.verify|verify} messages. + * @param message Family message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Family message, length delimited. Does not implicitly {@link google.bigtable.v2.Family.verify|verify} messages. + * @param message Family message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Family message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Family + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Family; + + /** + * Decodes a Family message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Family + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Family; + + /** + * Verifies a Family message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Family message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Family + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Family; + + /** + * Creates a plain object from a Family message. Also converts values to other types if specified. + * @param message Family + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Family, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Family to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Family + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Column. */ + interface IColumn { + + /** Column qualifier */ + qualifier?: (Uint8Array|Buffer|string|null); + + /** Column cells */ + cells?: (google.bigtable.v2.ICell[]|null); + } + + /** Represents a Column. */ + class Column implements IColumn { + + /** + * Constructs a new Column. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IColumn); + + /** Column qualifier. */ + public qualifier: (Uint8Array|Buffer|string); + + /** Column cells. */ + public cells: google.bigtable.v2.ICell[]; + + /** + * Creates a new Column instance using the specified properties. + * @param [properties] Properties to set + * @returns Column instance + */ + public static create(properties?: google.bigtable.v2.IColumn): google.bigtable.v2.Column; + + /** + * Encodes the specified Column message. Does not implicitly {@link google.bigtable.v2.Column.verify|verify} messages. + * @param message Column message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Column message, length delimited. Does not implicitly {@link google.bigtable.v2.Column.verify|verify} messages. + * @param message Column message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Column message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Column; + + /** + * Decodes a Column message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Column; + + /** + * Verifies a Column message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Column message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Column + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Column; + + /** + * Creates a plain object from a Column message. Also converts values to other types if specified. + * @param message Column + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Column, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Column to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Column + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cell. */ + interface ICell { + + /** Cell timestampMicros */ + timestampMicros?: (number|Long|string|null); + + /** Cell value */ + value?: (Uint8Array|Buffer|string|null); + + /** Cell labels */ + labels?: (string[]|null); + } + + /** Represents a Cell. */ + class Cell implements ICell { + + /** + * Constructs a new Cell. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ICell); + + /** Cell timestampMicros. */ + public timestampMicros: (number|Long|string); + + /** Cell value. */ + public value: (Uint8Array|Buffer|string); + + /** Cell labels. */ + public labels: string[]; + + /** + * Creates a new Cell instance using the specified properties. + * @param [properties] Properties to set + * @returns Cell instance + */ + public static create(properties?: google.bigtable.v2.ICell): google.bigtable.v2.Cell; + + /** + * Encodes the specified Cell message. Does not implicitly {@link google.bigtable.v2.Cell.verify|verify} messages. + * @param message Cell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ICell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cell message, length delimited. Does not implicitly {@link google.bigtable.v2.Cell.verify|verify} messages. + * @param message Cell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ICell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cell message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Cell; + + /** + * Decodes a Cell message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Cell; + + /** + * Verifies a Cell message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cell message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cell + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Cell; + + /** + * Creates a plain object from a Cell message. Also converts values to other types if specified. + * @param message Cell + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Cell, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cell + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value type */ + type?: (google.bigtable.v2.IType|null); + + /** Value rawValue */ + rawValue?: (Uint8Array|Buffer|string|null); + + /** Value rawTimestampMicros */ + rawTimestampMicros?: (number|Long|string|null); + + /** Value bytesValue */ + bytesValue?: (Uint8Array|Buffer|string|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value intValue */ + intValue?: (number|Long|string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value floatValue */ + floatValue?: (number|null); + + /** Value timestampValue */ + timestampValue?: (google.protobuf.ITimestamp|null); + + /** Value dateValue */ + dateValue?: (google.type.IDate|null); + + /** Value arrayValue */ + arrayValue?: (google.bigtable.v2.IArrayValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IValue); + + /** Value type. */ + public type?: (google.bigtable.v2.IType|null); + + /** Value rawValue. */ + public rawValue?: (Uint8Array|Buffer|string|null); + + /** Value rawTimestampMicros. */ + public rawTimestampMicros?: (number|Long|string|null); + + /** Value bytesValue. */ + public bytesValue?: (Uint8Array|Buffer|string|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value intValue. */ + public intValue?: (number|Long|string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value floatValue. */ + public floatValue?: (number|null); + + /** Value timestampValue. */ + public timestampValue?: (google.protobuf.ITimestamp|null); + + /** Value dateValue. */ + public dateValue?: (google.type.IDate|null); + + /** Value arrayValue. */ + public arrayValue?: (google.bigtable.v2.IArrayValue|null); + + /** Value kind. */ + public kind?: ("rawValue"|"rawTimestampMicros"|"bytesValue"|"stringValue"|"intValue"|"boolValue"|"floatValue"|"timestampValue"|"dateValue"|"arrayValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.bigtable.v2.IValue): google.bigtable.v2.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.bigtable.v2.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.bigtable.v2.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ArrayValue. */ + interface IArrayValue { + + /** ArrayValue values */ + values?: (google.bigtable.v2.IValue[]|null); + } + + /** Represents an ArrayValue. */ + class ArrayValue implements IArrayValue { + + /** + * Constructs a new ArrayValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IArrayValue); + + /** ArrayValue values. */ + public values: google.bigtable.v2.IValue[]; + + /** + * Creates a new ArrayValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ArrayValue instance + */ + public static create(properties?: google.bigtable.v2.IArrayValue): google.bigtable.v2.ArrayValue; + + /** + * Encodes the specified ArrayValue message. Does not implicitly {@link google.bigtable.v2.ArrayValue.verify|verify} messages. + * @param message ArrayValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IArrayValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.bigtable.v2.ArrayValue.verify|verify} messages. + * @param message ArrayValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IArrayValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArrayValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ArrayValue; + + /** + * Decodes an ArrayValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ArrayValue; + + /** + * Verifies an ArrayValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArrayValue + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ArrayValue; + + /** + * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. + * @param message ArrayValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ArrayValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArrayValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArrayValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RowRange. */ + interface IRowRange { + + /** RowRange startKeyClosed */ + startKeyClosed?: (Uint8Array|Buffer|string|null); + + /** RowRange startKeyOpen */ + startKeyOpen?: (Uint8Array|Buffer|string|null); + + /** RowRange endKeyOpen */ + endKeyOpen?: (Uint8Array|Buffer|string|null); + + /** RowRange endKeyClosed */ + endKeyClosed?: (Uint8Array|Buffer|string|null); + } + + /** Represents a RowRange. */ + class RowRange implements IRowRange { + + /** + * Constructs a new RowRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRowRange); + + /** RowRange startKeyClosed. */ + public startKeyClosed?: (Uint8Array|Buffer|string|null); + + /** RowRange startKeyOpen. */ + public startKeyOpen?: (Uint8Array|Buffer|string|null); + + /** RowRange endKeyOpen. */ + public endKeyOpen?: (Uint8Array|Buffer|string|null); + + /** RowRange endKeyClosed. */ + public endKeyClosed?: (Uint8Array|Buffer|string|null); + + /** RowRange startKey. */ + public startKey?: ("startKeyClosed"|"startKeyOpen"); + + /** RowRange endKey. */ + public endKey?: ("endKeyOpen"|"endKeyClosed"); + + /** + * Creates a new RowRange instance using the specified properties. + * @param [properties] Properties to set + * @returns RowRange instance + */ + public static create(properties?: google.bigtable.v2.IRowRange): google.bigtable.v2.RowRange; + + /** + * Encodes the specified RowRange message. Does not implicitly {@link google.bigtable.v2.RowRange.verify|verify} messages. + * @param message RowRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRowRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowRange message, length delimited. Does not implicitly {@link google.bigtable.v2.RowRange.verify|verify} messages. + * @param message RowRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRowRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RowRange; + + /** + * Decodes a RowRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RowRange; + + /** + * Verifies a RowRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowRange + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RowRange; + + /** + * Creates a plain object from a RowRange message. Also converts values to other types if specified. + * @param message RowRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RowRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RowSet. */ + interface IRowSet { + + /** RowSet rowKeys */ + rowKeys?: (Uint8Array[]|null); + + /** RowSet rowRanges */ + rowRanges?: (google.bigtable.v2.IRowRange[]|null); + } + + /** Represents a RowSet. */ + class RowSet implements IRowSet { + + /** + * Constructs a new RowSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRowSet); + + /** RowSet rowKeys. */ + public rowKeys: Uint8Array[]; + + /** RowSet rowRanges. */ + public rowRanges: google.bigtable.v2.IRowRange[]; + + /** + * Creates a new RowSet instance using the specified properties. + * @param [properties] Properties to set + * @returns RowSet instance + */ + public static create(properties?: google.bigtable.v2.IRowSet): google.bigtable.v2.RowSet; + + /** + * Encodes the specified RowSet message. Does not implicitly {@link google.bigtable.v2.RowSet.verify|verify} messages. + * @param message RowSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRowSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowSet message, length delimited. Does not implicitly {@link google.bigtable.v2.RowSet.verify|verify} messages. + * @param message RowSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRowSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RowSet; + + /** + * Decodes a RowSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RowSet; + + /** + * Verifies a RowSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowSet + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RowSet; + + /** + * Creates a plain object from a RowSet message. Also converts values to other types if specified. + * @param message RowSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RowSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ColumnRange. */ + interface IColumnRange { + + /** ColumnRange familyName */ + familyName?: (string|null); + + /** ColumnRange startQualifierClosed */ + startQualifierClosed?: (Uint8Array|Buffer|string|null); + + /** ColumnRange startQualifierOpen */ + startQualifierOpen?: (Uint8Array|Buffer|string|null); + + /** ColumnRange endQualifierClosed */ + endQualifierClosed?: (Uint8Array|Buffer|string|null); + + /** ColumnRange endQualifierOpen */ + endQualifierOpen?: (Uint8Array|Buffer|string|null); + } + + /** Represents a ColumnRange. */ + class ColumnRange implements IColumnRange { + + /** + * Constructs a new ColumnRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IColumnRange); + + /** ColumnRange familyName. */ + public familyName: string; + + /** ColumnRange startQualifierClosed. */ + public startQualifierClosed?: (Uint8Array|Buffer|string|null); + + /** ColumnRange startQualifierOpen. */ + public startQualifierOpen?: (Uint8Array|Buffer|string|null); + + /** ColumnRange endQualifierClosed. */ + public endQualifierClosed?: (Uint8Array|Buffer|string|null); + + /** ColumnRange endQualifierOpen. */ + public endQualifierOpen?: (Uint8Array|Buffer|string|null); + + /** ColumnRange startQualifier. */ + public startQualifier?: ("startQualifierClosed"|"startQualifierOpen"); + + /** ColumnRange endQualifier. */ + public endQualifier?: ("endQualifierClosed"|"endQualifierOpen"); + + /** + * Creates a new ColumnRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnRange instance + */ + public static create(properties?: google.bigtable.v2.IColumnRange): google.bigtable.v2.ColumnRange; + + /** + * Encodes the specified ColumnRange message. Does not implicitly {@link google.bigtable.v2.ColumnRange.verify|verify} messages. + * @param message ColumnRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IColumnRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnRange message, length delimited. Does not implicitly {@link google.bigtable.v2.ColumnRange.verify|verify} messages. + * @param message ColumnRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IColumnRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ColumnRange; + + /** + * Decodes a ColumnRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ColumnRange; + + /** + * Verifies a ColumnRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnRange + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ColumnRange; + + /** + * Creates a plain object from a ColumnRange message. Also converts values to other types if specified. + * @param message ColumnRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ColumnRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampRange. */ + interface ITimestampRange { + + /** TimestampRange startTimestampMicros */ + startTimestampMicros?: (number|Long|string|null); + + /** TimestampRange endTimestampMicros */ + endTimestampMicros?: (number|Long|string|null); + } + + /** Represents a TimestampRange. */ + class TimestampRange implements ITimestampRange { + + /** + * Constructs a new TimestampRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ITimestampRange); + + /** TimestampRange startTimestampMicros. */ + public startTimestampMicros: (number|Long|string); + + /** TimestampRange endTimestampMicros. */ + public endTimestampMicros: (number|Long|string); + + /** + * Creates a new TimestampRange instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampRange instance + */ + public static create(properties?: google.bigtable.v2.ITimestampRange): google.bigtable.v2.TimestampRange; + + /** + * Encodes the specified TimestampRange message. Does not implicitly {@link google.bigtable.v2.TimestampRange.verify|verify} messages. + * @param message TimestampRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ITimestampRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimestampRange message, length delimited. Does not implicitly {@link google.bigtable.v2.TimestampRange.verify|verify} messages. + * @param message TimestampRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ITimestampRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.TimestampRange; + + /** + * Decodes a TimestampRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.TimestampRange; + + /** + * Verifies a TimestampRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimestampRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimestampRange + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.TimestampRange; + + /** + * Creates a plain object from a TimestampRange message. Also converts values to other types if specified. + * @param message TimestampRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.TimestampRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimestampRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimestampRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValueRange. */ + interface IValueRange { + + /** ValueRange startValueClosed */ + startValueClosed?: (Uint8Array|Buffer|string|null); + + /** ValueRange startValueOpen */ + startValueOpen?: (Uint8Array|Buffer|string|null); + + /** ValueRange endValueClosed */ + endValueClosed?: (Uint8Array|Buffer|string|null); + + /** ValueRange endValueOpen */ + endValueOpen?: (Uint8Array|Buffer|string|null); + } + + /** Represents a ValueRange. */ + class ValueRange implements IValueRange { + + /** + * Constructs a new ValueRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IValueRange); + + /** ValueRange startValueClosed. */ + public startValueClosed?: (Uint8Array|Buffer|string|null); + + /** ValueRange startValueOpen. */ + public startValueOpen?: (Uint8Array|Buffer|string|null); + + /** ValueRange endValueClosed. */ + public endValueClosed?: (Uint8Array|Buffer|string|null); + + /** ValueRange endValueOpen. */ + public endValueOpen?: (Uint8Array|Buffer|string|null); + + /** ValueRange startValue. */ + public startValue?: ("startValueClosed"|"startValueOpen"); + + /** ValueRange endValue. */ + public endValue?: ("endValueClosed"|"endValueOpen"); + + /** + * Creates a new ValueRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ValueRange instance + */ + public static create(properties?: google.bigtable.v2.IValueRange): google.bigtable.v2.ValueRange; + + /** + * Encodes the specified ValueRange message. Does not implicitly {@link google.bigtable.v2.ValueRange.verify|verify} messages. + * @param message ValueRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IValueRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValueRange message, length delimited. Does not implicitly {@link google.bigtable.v2.ValueRange.verify|verify} messages. + * @param message ValueRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IValueRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValueRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValueRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ValueRange; + + /** + * Decodes a ValueRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValueRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ValueRange; + + /** + * Verifies a ValueRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValueRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValueRange + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ValueRange; + + /** + * Creates a plain object from a ValueRange message. Also converts values to other types if specified. + * @param message ValueRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ValueRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValueRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValueRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RowFilter. */ + interface IRowFilter { + + /** RowFilter chain */ + chain?: (google.bigtable.v2.RowFilter.IChain|null); + + /** RowFilter interleave */ + interleave?: (google.bigtable.v2.RowFilter.IInterleave|null); + + /** RowFilter condition */ + condition?: (google.bigtable.v2.RowFilter.ICondition|null); + + /** RowFilter sink */ + sink?: (boolean|null); + + /** RowFilter passAllFilter */ + passAllFilter?: (boolean|null); + + /** RowFilter blockAllFilter */ + blockAllFilter?: (boolean|null); + + /** RowFilter rowKeyRegexFilter */ + rowKeyRegexFilter?: (Uint8Array|Buffer|string|null); + + /** RowFilter rowSampleFilter */ + rowSampleFilter?: (number|null); + + /** RowFilter familyNameRegexFilter */ + familyNameRegexFilter?: (string|null); + + /** RowFilter columnQualifierRegexFilter */ + columnQualifierRegexFilter?: (Uint8Array|Buffer|string|null); + + /** RowFilter columnRangeFilter */ + columnRangeFilter?: (google.bigtable.v2.IColumnRange|null); + + /** RowFilter timestampRangeFilter */ + timestampRangeFilter?: (google.bigtable.v2.ITimestampRange|null); + + /** RowFilter valueRegexFilter */ + valueRegexFilter?: (Uint8Array|Buffer|string|null); + + /** RowFilter valueRangeFilter */ + valueRangeFilter?: (google.bigtable.v2.IValueRange|null); + + /** RowFilter cellsPerRowOffsetFilter */ + cellsPerRowOffsetFilter?: (number|null); + + /** RowFilter cellsPerRowLimitFilter */ + cellsPerRowLimitFilter?: (number|null); + + /** RowFilter cellsPerColumnLimitFilter */ + cellsPerColumnLimitFilter?: (number|null); + + /** RowFilter stripValueTransformer */ + stripValueTransformer?: (boolean|null); + + /** RowFilter applyLabelTransformer */ + applyLabelTransformer?: (string|null); + } + + /** Represents a RowFilter. */ + class RowFilter implements IRowFilter { + + /** + * Constructs a new RowFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRowFilter); + + /** RowFilter chain. */ + public chain?: (google.bigtable.v2.RowFilter.IChain|null); + + /** RowFilter interleave. */ + public interleave?: (google.bigtable.v2.RowFilter.IInterleave|null); + + /** RowFilter condition. */ + public condition?: (google.bigtable.v2.RowFilter.ICondition|null); + + /** RowFilter sink. */ + public sink?: (boolean|null); + + /** RowFilter passAllFilter. */ + public passAllFilter?: (boolean|null); + + /** RowFilter blockAllFilter. */ + public blockAllFilter?: (boolean|null); + + /** RowFilter rowKeyRegexFilter. */ + public rowKeyRegexFilter?: (Uint8Array|Buffer|string|null); + + /** RowFilter rowSampleFilter. */ + public rowSampleFilter?: (number|null); + + /** RowFilter familyNameRegexFilter. */ + public familyNameRegexFilter?: (string|null); + + /** RowFilter columnQualifierRegexFilter. */ + public columnQualifierRegexFilter?: (Uint8Array|Buffer|string|null); + + /** RowFilter columnRangeFilter. */ + public columnRangeFilter?: (google.bigtable.v2.IColumnRange|null); + + /** RowFilter timestampRangeFilter. */ + public timestampRangeFilter?: (google.bigtable.v2.ITimestampRange|null); + + /** RowFilter valueRegexFilter. */ + public valueRegexFilter?: (Uint8Array|Buffer|string|null); + + /** RowFilter valueRangeFilter. */ + public valueRangeFilter?: (google.bigtable.v2.IValueRange|null); + + /** RowFilter cellsPerRowOffsetFilter. */ + public cellsPerRowOffsetFilter?: (number|null); + + /** RowFilter cellsPerRowLimitFilter. */ + public cellsPerRowLimitFilter?: (number|null); + + /** RowFilter cellsPerColumnLimitFilter. */ + public cellsPerColumnLimitFilter?: (number|null); + + /** RowFilter stripValueTransformer. */ + public stripValueTransformer?: (boolean|null); + + /** RowFilter applyLabelTransformer. */ + public applyLabelTransformer?: (string|null); + + /** RowFilter filter. */ + public filter?: ("chain"|"interleave"|"condition"|"sink"|"passAllFilter"|"blockAllFilter"|"rowKeyRegexFilter"|"rowSampleFilter"|"familyNameRegexFilter"|"columnQualifierRegexFilter"|"columnRangeFilter"|"timestampRangeFilter"|"valueRegexFilter"|"valueRangeFilter"|"cellsPerRowOffsetFilter"|"cellsPerRowLimitFilter"|"cellsPerColumnLimitFilter"|"stripValueTransformer"|"applyLabelTransformer"); + + /** + * Creates a new RowFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns RowFilter instance + */ + public static create(properties?: google.bigtable.v2.IRowFilter): google.bigtable.v2.RowFilter; + + /** + * Encodes the specified RowFilter message. Does not implicitly {@link google.bigtable.v2.RowFilter.verify|verify} messages. + * @param message RowFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRowFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowFilter message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.verify|verify} messages. + * @param message RowFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRowFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RowFilter; + + /** + * Decodes a RowFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RowFilter; + + /** + * Verifies a RowFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowFilter + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RowFilter; + + /** + * Creates a plain object from a RowFilter message. Also converts values to other types if specified. + * @param message RowFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RowFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RowFilter { + + /** Properties of a Chain. */ + interface IChain { + + /** Chain filters */ + filters?: (google.bigtable.v2.IRowFilter[]|null); + } + + /** Represents a Chain. */ + class Chain implements IChain { + + /** + * Constructs a new Chain. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.RowFilter.IChain); + + /** Chain filters. */ + public filters: google.bigtable.v2.IRowFilter[]; + + /** + * Creates a new Chain instance using the specified properties. + * @param [properties] Properties to set + * @returns Chain instance + */ + public static create(properties?: google.bigtable.v2.RowFilter.IChain): google.bigtable.v2.RowFilter.Chain; + + /** + * Encodes the specified Chain message. Does not implicitly {@link google.bigtable.v2.RowFilter.Chain.verify|verify} messages. + * @param message Chain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.RowFilter.IChain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chain message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.Chain.verify|verify} messages. + * @param message Chain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.RowFilter.IChain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Chain message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RowFilter.Chain; + + /** + * Decodes a Chain message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RowFilter.Chain; + + /** + * Verifies a Chain message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Chain message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chain + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RowFilter.Chain; + + /** + * Creates a plain object from a Chain message. Also converts values to other types if specified. + * @param message Chain + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RowFilter.Chain, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Chain to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Chain + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Interleave. */ + interface IInterleave { + + /** Interleave filters */ + filters?: (google.bigtable.v2.IRowFilter[]|null); + } + + /** Represents an Interleave. */ + class Interleave implements IInterleave { + + /** + * Constructs a new Interleave. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.RowFilter.IInterleave); + + /** Interleave filters. */ + public filters: google.bigtable.v2.IRowFilter[]; + + /** + * Creates a new Interleave instance using the specified properties. + * @param [properties] Properties to set + * @returns Interleave instance + */ + public static create(properties?: google.bigtable.v2.RowFilter.IInterleave): google.bigtable.v2.RowFilter.Interleave; + + /** + * Encodes the specified Interleave message. Does not implicitly {@link google.bigtable.v2.RowFilter.Interleave.verify|verify} messages. + * @param message Interleave message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.RowFilter.IInterleave, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interleave message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.Interleave.verify|verify} messages. + * @param message Interleave message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.RowFilter.IInterleave, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interleave message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interleave + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RowFilter.Interleave; + + /** + * Decodes an Interleave message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interleave + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RowFilter.Interleave; + + /** + * Verifies an Interleave message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Interleave message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interleave + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RowFilter.Interleave; + + /** + * Creates a plain object from an Interleave message. Also converts values to other types if specified. + * @param message Interleave + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RowFilter.Interleave, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interleave to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Interleave + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition predicateFilter */ + predicateFilter?: (google.bigtable.v2.IRowFilter|null); + + /** Condition trueFilter */ + trueFilter?: (google.bigtable.v2.IRowFilter|null); + + /** Condition falseFilter */ + falseFilter?: (google.bigtable.v2.IRowFilter|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.RowFilter.ICondition); + + /** Condition predicateFilter. */ + public predicateFilter?: (google.bigtable.v2.IRowFilter|null); + + /** Condition trueFilter. */ + public trueFilter?: (google.bigtable.v2.IRowFilter|null); + + /** Condition falseFilter. */ + public falseFilter?: (google.bigtable.v2.IRowFilter|null); + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.bigtable.v2.RowFilter.ICondition): google.bigtable.v2.RowFilter.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.bigtable.v2.RowFilter.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.RowFilter.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.RowFilter.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RowFilter.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RowFilter.Condition; + + /** + * Verifies a Condition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RowFilter.Condition; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RowFilter.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Condition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Mutation. */ + interface IMutation { + + /** Mutation setCell */ + setCell?: (google.bigtable.v2.Mutation.ISetCell|null); + + /** Mutation addToCell */ + addToCell?: (google.bigtable.v2.Mutation.IAddToCell|null); + + /** Mutation mergeToCell */ + mergeToCell?: (google.bigtable.v2.Mutation.IMergeToCell|null); + + /** Mutation deleteFromColumn */ + deleteFromColumn?: (google.bigtable.v2.Mutation.IDeleteFromColumn|null); + + /** Mutation deleteFromFamily */ + deleteFromFamily?: (google.bigtable.v2.Mutation.IDeleteFromFamily|null); + + /** Mutation deleteFromRow */ + deleteFromRow?: (google.bigtable.v2.Mutation.IDeleteFromRow|null); + } + + /** Represents a Mutation. */ + class Mutation implements IMutation { + + /** + * Constructs a new Mutation. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IMutation); + + /** Mutation setCell. */ + public setCell?: (google.bigtable.v2.Mutation.ISetCell|null); + + /** Mutation addToCell. */ + public addToCell?: (google.bigtable.v2.Mutation.IAddToCell|null); + + /** Mutation mergeToCell. */ + public mergeToCell?: (google.bigtable.v2.Mutation.IMergeToCell|null); + + /** Mutation deleteFromColumn. */ + public deleteFromColumn?: (google.bigtable.v2.Mutation.IDeleteFromColumn|null); + + /** Mutation deleteFromFamily. */ + public deleteFromFamily?: (google.bigtable.v2.Mutation.IDeleteFromFamily|null); + + /** Mutation deleteFromRow. */ + public deleteFromRow?: (google.bigtable.v2.Mutation.IDeleteFromRow|null); + + /** Mutation mutation. */ + public mutation?: ("setCell"|"addToCell"|"mergeToCell"|"deleteFromColumn"|"deleteFromFamily"|"deleteFromRow"); + + /** + * Creates a new Mutation instance using the specified properties. + * @param [properties] Properties to set + * @returns Mutation instance + */ + public static create(properties?: google.bigtable.v2.IMutation): google.bigtable.v2.Mutation; + + /** + * Encodes the specified Mutation message. Does not implicitly {@link google.bigtable.v2.Mutation.verify|verify} messages. + * @param message Mutation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.verify|verify} messages. + * @param message Mutation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Mutation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation; + + /** + * Decodes a Mutation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation; + + /** + * Verifies a Mutation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Mutation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Mutation + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation; + + /** + * Creates a plain object from a Mutation message. Also converts values to other types if specified. + * @param message Mutation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Mutation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Mutation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Mutation { + + /** Properties of a SetCell. */ + interface ISetCell { + + /** SetCell familyName */ + familyName?: (string|null); + + /** SetCell columnQualifier */ + columnQualifier?: (Uint8Array|Buffer|string|null); + + /** SetCell timestampMicros */ + timestampMicros?: (number|Long|string|null); + + /** SetCell value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a SetCell. */ + class SetCell implements ISetCell { + + /** + * Constructs a new SetCell. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Mutation.ISetCell); + + /** SetCell familyName. */ + public familyName: string; + + /** SetCell columnQualifier. */ + public columnQualifier: (Uint8Array|Buffer|string); + + /** SetCell timestampMicros. */ + public timestampMicros: (number|Long|string); + + /** SetCell value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new SetCell instance using the specified properties. + * @param [properties] Properties to set + * @returns SetCell instance + */ + public static create(properties?: google.bigtable.v2.Mutation.ISetCell): google.bigtable.v2.Mutation.SetCell; + + /** + * Encodes the specified SetCell message. Does not implicitly {@link google.bigtable.v2.Mutation.SetCell.verify|verify} messages. + * @param message SetCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Mutation.ISetCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetCell message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.SetCell.verify|verify} messages. + * @param message SetCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Mutation.ISetCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetCell message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation.SetCell; + + /** + * Decodes a SetCell message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation.SetCell; + + /** + * Verifies a SetCell message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetCell message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetCell + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation.SetCell; + + /** + * Creates a plain object from a SetCell message. Also converts values to other types if specified. + * @param message SetCell + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation.SetCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetCell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetCell + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddToCell. */ + interface IAddToCell { + + /** AddToCell familyName */ + familyName?: (string|null); + + /** AddToCell columnQualifier */ + columnQualifier?: (google.bigtable.v2.IValue|null); + + /** AddToCell timestamp */ + timestamp?: (google.bigtable.v2.IValue|null); + + /** AddToCell input */ + input?: (google.bigtable.v2.IValue|null); + } + + /** Represents an AddToCell. */ + class AddToCell implements IAddToCell { + + /** + * Constructs a new AddToCell. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Mutation.IAddToCell); + + /** AddToCell familyName. */ + public familyName: string; + + /** AddToCell columnQualifier. */ + public columnQualifier?: (google.bigtable.v2.IValue|null); + + /** AddToCell timestamp. */ + public timestamp?: (google.bigtable.v2.IValue|null); + + /** AddToCell input. */ + public input?: (google.bigtable.v2.IValue|null); + + /** + * Creates a new AddToCell instance using the specified properties. + * @param [properties] Properties to set + * @returns AddToCell instance + */ + public static create(properties?: google.bigtable.v2.Mutation.IAddToCell): google.bigtable.v2.Mutation.AddToCell; + + /** + * Encodes the specified AddToCell message. Does not implicitly {@link google.bigtable.v2.Mutation.AddToCell.verify|verify} messages. + * @param message AddToCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Mutation.IAddToCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddToCell message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.AddToCell.verify|verify} messages. + * @param message AddToCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Mutation.IAddToCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddToCell message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation.AddToCell; + + /** + * Decodes an AddToCell message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation.AddToCell; + + /** + * Verifies an AddToCell message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddToCell message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddToCell + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation.AddToCell; + + /** + * Creates a plain object from an AddToCell message. Also converts values to other types if specified. + * @param message AddToCell + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation.AddToCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddToCell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddToCell + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MergeToCell. */ + interface IMergeToCell { + + /** MergeToCell familyName */ + familyName?: (string|null); + + /** MergeToCell columnQualifier */ + columnQualifier?: (google.bigtable.v2.IValue|null); + + /** MergeToCell timestamp */ + timestamp?: (google.bigtable.v2.IValue|null); + + /** MergeToCell input */ + input?: (google.bigtable.v2.IValue|null); + } + + /** Represents a MergeToCell. */ + class MergeToCell implements IMergeToCell { + + /** + * Constructs a new MergeToCell. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Mutation.IMergeToCell); + + /** MergeToCell familyName. */ + public familyName: string; + + /** MergeToCell columnQualifier. */ + public columnQualifier?: (google.bigtable.v2.IValue|null); + + /** MergeToCell timestamp. */ + public timestamp?: (google.bigtable.v2.IValue|null); + + /** MergeToCell input. */ + public input?: (google.bigtable.v2.IValue|null); + + /** + * Creates a new MergeToCell instance using the specified properties. + * @param [properties] Properties to set + * @returns MergeToCell instance + */ + public static create(properties?: google.bigtable.v2.Mutation.IMergeToCell): google.bigtable.v2.Mutation.MergeToCell; + + /** + * Encodes the specified MergeToCell message. Does not implicitly {@link google.bigtable.v2.Mutation.MergeToCell.verify|verify} messages. + * @param message MergeToCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Mutation.IMergeToCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MergeToCell message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.MergeToCell.verify|verify} messages. + * @param message MergeToCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Mutation.IMergeToCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MergeToCell message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MergeToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation.MergeToCell; + + /** + * Decodes a MergeToCell message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MergeToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation.MergeToCell; + + /** + * Verifies a MergeToCell message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MergeToCell message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MergeToCell + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation.MergeToCell; + + /** + * Creates a plain object from a MergeToCell message. Also converts values to other types if specified. + * @param message MergeToCell + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation.MergeToCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MergeToCell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MergeToCell + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFromColumn. */ + interface IDeleteFromColumn { + + /** DeleteFromColumn familyName */ + familyName?: (string|null); + + /** DeleteFromColumn columnQualifier */ + columnQualifier?: (Uint8Array|Buffer|string|null); + + /** DeleteFromColumn timeRange */ + timeRange?: (google.bigtable.v2.ITimestampRange|null); + } + + /** Represents a DeleteFromColumn. */ + class DeleteFromColumn implements IDeleteFromColumn { + + /** + * Constructs a new DeleteFromColumn. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Mutation.IDeleteFromColumn); + + /** DeleteFromColumn familyName. */ + public familyName: string; + + /** DeleteFromColumn columnQualifier. */ + public columnQualifier: (Uint8Array|Buffer|string); + + /** DeleteFromColumn timeRange. */ + public timeRange?: (google.bigtable.v2.ITimestampRange|null); + + /** + * Creates a new DeleteFromColumn instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFromColumn instance + */ + public static create(properties?: google.bigtable.v2.Mutation.IDeleteFromColumn): google.bigtable.v2.Mutation.DeleteFromColumn; + + /** + * Encodes the specified DeleteFromColumn message. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromColumn.verify|verify} messages. + * @param message DeleteFromColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Mutation.IDeleteFromColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFromColumn message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromColumn.verify|verify} messages. + * @param message DeleteFromColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Mutation.IDeleteFromColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFromColumn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFromColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation.DeleteFromColumn; + + /** + * Decodes a DeleteFromColumn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFromColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation.DeleteFromColumn; + + /** + * Verifies a DeleteFromColumn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFromColumn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFromColumn + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation.DeleteFromColumn; + + /** + * Creates a plain object from a DeleteFromColumn message. Also converts values to other types if specified. + * @param message DeleteFromColumn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation.DeleteFromColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFromColumn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFromColumn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFromFamily. */ + interface IDeleteFromFamily { + + /** DeleteFromFamily familyName */ + familyName?: (string|null); + } + + /** Represents a DeleteFromFamily. */ + class DeleteFromFamily implements IDeleteFromFamily { + + /** + * Constructs a new DeleteFromFamily. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Mutation.IDeleteFromFamily); + + /** DeleteFromFamily familyName. */ + public familyName: string; + + /** + * Creates a new DeleteFromFamily instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFromFamily instance + */ + public static create(properties?: google.bigtable.v2.Mutation.IDeleteFromFamily): google.bigtable.v2.Mutation.DeleteFromFamily; + + /** + * Encodes the specified DeleteFromFamily message. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromFamily.verify|verify} messages. + * @param message DeleteFromFamily message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Mutation.IDeleteFromFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFromFamily message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromFamily.verify|verify} messages. + * @param message DeleteFromFamily message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Mutation.IDeleteFromFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFromFamily message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFromFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation.DeleteFromFamily; + + /** + * Decodes a DeleteFromFamily message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFromFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation.DeleteFromFamily; + + /** + * Verifies a DeleteFromFamily message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFromFamily message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFromFamily + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation.DeleteFromFamily; + + /** + * Creates a plain object from a DeleteFromFamily message. Also converts values to other types if specified. + * @param message DeleteFromFamily + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation.DeleteFromFamily, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFromFamily to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFromFamily + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFromRow. */ + interface IDeleteFromRow { + } + + /** Represents a DeleteFromRow. */ + class DeleteFromRow implements IDeleteFromRow { + + /** + * Constructs a new DeleteFromRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Mutation.IDeleteFromRow); + + /** + * Creates a new DeleteFromRow instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFromRow instance + */ + public static create(properties?: google.bigtable.v2.Mutation.IDeleteFromRow): google.bigtable.v2.Mutation.DeleteFromRow; + + /** + * Encodes the specified DeleteFromRow message. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromRow.verify|verify} messages. + * @param message DeleteFromRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Mutation.IDeleteFromRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFromRow message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromRow.verify|verify} messages. + * @param message DeleteFromRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Mutation.IDeleteFromRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFromRow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFromRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation.DeleteFromRow; + + /** + * Decodes a DeleteFromRow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFromRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation.DeleteFromRow; + + /** + * Verifies a DeleteFromRow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFromRow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFromRow + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation.DeleteFromRow; + + /** + * Creates a plain object from a DeleteFromRow message. Also converts values to other types if specified. + * @param message DeleteFromRow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation.DeleteFromRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFromRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFromRow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ReadModifyWriteRule. */ + interface IReadModifyWriteRule { + + /** ReadModifyWriteRule familyName */ + familyName?: (string|null); + + /** ReadModifyWriteRule columnQualifier */ + columnQualifier?: (Uint8Array|Buffer|string|null); + + /** ReadModifyWriteRule appendValue */ + appendValue?: (Uint8Array|Buffer|string|null); + + /** ReadModifyWriteRule incrementAmount */ + incrementAmount?: (number|Long|string|null); + } + + /** Represents a ReadModifyWriteRule. */ + class ReadModifyWriteRule implements IReadModifyWriteRule { + + /** + * Constructs a new ReadModifyWriteRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadModifyWriteRule); + + /** ReadModifyWriteRule familyName. */ + public familyName: string; + + /** ReadModifyWriteRule columnQualifier. */ + public columnQualifier: (Uint8Array|Buffer|string); + + /** ReadModifyWriteRule appendValue. */ + public appendValue?: (Uint8Array|Buffer|string|null); + + /** ReadModifyWriteRule incrementAmount. */ + public incrementAmount?: (number|Long|string|null); + + /** ReadModifyWriteRule rule. */ + public rule?: ("appendValue"|"incrementAmount"); + + /** + * Creates a new ReadModifyWriteRule instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadModifyWriteRule instance + */ + public static create(properties?: google.bigtable.v2.IReadModifyWriteRule): google.bigtable.v2.ReadModifyWriteRule; + + /** + * Encodes the specified ReadModifyWriteRule message. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRule.verify|verify} messages. + * @param message ReadModifyWriteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadModifyWriteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadModifyWriteRule message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRule.verify|verify} messages. + * @param message ReadModifyWriteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadModifyWriteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadModifyWriteRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadModifyWriteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadModifyWriteRule; + + /** + * Decodes a ReadModifyWriteRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadModifyWriteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadModifyWriteRule; + + /** + * Verifies a ReadModifyWriteRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadModifyWriteRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadModifyWriteRule + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadModifyWriteRule; + + /** + * Creates a plain object from a ReadModifyWriteRule message. Also converts values to other types if specified. + * @param message ReadModifyWriteRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadModifyWriteRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadModifyWriteRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadModifyWriteRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamPartition. */ + interface IStreamPartition { + + /** StreamPartition rowRange */ + rowRange?: (google.bigtable.v2.IRowRange|null); + } + + /** Represents a StreamPartition. */ + class StreamPartition implements IStreamPartition { + + /** + * Constructs a new StreamPartition. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IStreamPartition); + + /** StreamPartition rowRange. */ + public rowRange?: (google.bigtable.v2.IRowRange|null); + + /** + * Creates a new StreamPartition instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamPartition instance + */ + public static create(properties?: google.bigtable.v2.IStreamPartition): google.bigtable.v2.StreamPartition; + + /** + * Encodes the specified StreamPartition message. Does not implicitly {@link google.bigtable.v2.StreamPartition.verify|verify} messages. + * @param message StreamPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IStreamPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamPartition message, length delimited. Does not implicitly {@link google.bigtable.v2.StreamPartition.verify|verify} messages. + * @param message StreamPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IStreamPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamPartition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.StreamPartition; + + /** + * Decodes a StreamPartition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.StreamPartition; + + /** + * Verifies a StreamPartition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamPartition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamPartition + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.StreamPartition; + + /** + * Creates a plain object from a StreamPartition message. Also converts values to other types if specified. + * @param message StreamPartition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.StreamPartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamPartition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamPartition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamContinuationTokens. */ + interface IStreamContinuationTokens { + + /** StreamContinuationTokens tokens */ + tokens?: (google.bigtable.v2.IStreamContinuationToken[]|null); + } + + /** Represents a StreamContinuationTokens. */ + class StreamContinuationTokens implements IStreamContinuationTokens { + + /** + * Constructs a new StreamContinuationTokens. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IStreamContinuationTokens); + + /** StreamContinuationTokens tokens. */ + public tokens: google.bigtable.v2.IStreamContinuationToken[]; + + /** + * Creates a new StreamContinuationTokens instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamContinuationTokens instance + */ + public static create(properties?: google.bigtable.v2.IStreamContinuationTokens): google.bigtable.v2.StreamContinuationTokens; + + /** + * Encodes the specified StreamContinuationTokens message. Does not implicitly {@link google.bigtable.v2.StreamContinuationTokens.verify|verify} messages. + * @param message StreamContinuationTokens message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IStreamContinuationTokens, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamContinuationTokens message, length delimited. Does not implicitly {@link google.bigtable.v2.StreamContinuationTokens.verify|verify} messages. + * @param message StreamContinuationTokens message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IStreamContinuationTokens, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamContinuationTokens message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamContinuationTokens + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.StreamContinuationTokens; + + /** + * Decodes a StreamContinuationTokens message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamContinuationTokens + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.StreamContinuationTokens; + + /** + * Verifies a StreamContinuationTokens message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamContinuationTokens message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamContinuationTokens + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.StreamContinuationTokens; + + /** + * Creates a plain object from a StreamContinuationTokens message. Also converts values to other types if specified. + * @param message StreamContinuationTokens + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.StreamContinuationTokens, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamContinuationTokens to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamContinuationTokens + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamContinuationToken. */ + interface IStreamContinuationToken { + + /** StreamContinuationToken partition */ + partition?: (google.bigtable.v2.IStreamPartition|null); + + /** StreamContinuationToken token */ + token?: (string|null); + } + + /** Represents a StreamContinuationToken. */ + class StreamContinuationToken implements IStreamContinuationToken { + + /** + * Constructs a new StreamContinuationToken. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IStreamContinuationToken); + + /** StreamContinuationToken partition. */ + public partition?: (google.bigtable.v2.IStreamPartition|null); + + /** StreamContinuationToken token. */ + public token: string; + + /** + * Creates a new StreamContinuationToken instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamContinuationToken instance + */ + public static create(properties?: google.bigtable.v2.IStreamContinuationToken): google.bigtable.v2.StreamContinuationToken; + + /** + * Encodes the specified StreamContinuationToken message. Does not implicitly {@link google.bigtable.v2.StreamContinuationToken.verify|verify} messages. + * @param message StreamContinuationToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IStreamContinuationToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamContinuationToken message, length delimited. Does not implicitly {@link google.bigtable.v2.StreamContinuationToken.verify|verify} messages. + * @param message StreamContinuationToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IStreamContinuationToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamContinuationToken message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamContinuationToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.StreamContinuationToken; + + /** + * Decodes a StreamContinuationToken message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamContinuationToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.StreamContinuationToken; + + /** + * Verifies a StreamContinuationToken message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamContinuationToken message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamContinuationToken + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.StreamContinuationToken; + + /** + * Creates a plain object from a StreamContinuationToken message. Also converts values to other types if specified. + * @param message StreamContinuationToken + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.StreamContinuationToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamContinuationToken to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamContinuationToken + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProtoFormat. */ + interface IProtoFormat { + } + + /** Represents a ProtoFormat. */ + class ProtoFormat implements IProtoFormat { + + /** + * Constructs a new ProtoFormat. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IProtoFormat); + + /** + * Creates a new ProtoFormat instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoFormat instance + */ + public static create(properties?: google.bigtable.v2.IProtoFormat): google.bigtable.v2.ProtoFormat; + + /** + * Encodes the specified ProtoFormat message. Does not implicitly {@link google.bigtable.v2.ProtoFormat.verify|verify} messages. + * @param message ProtoFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IProtoFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoFormat message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoFormat.verify|verify} messages. + * @param message ProtoFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IProtoFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoFormat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ProtoFormat; + + /** + * Decodes a ProtoFormat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ProtoFormat; + + /** + * Verifies a ProtoFormat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoFormat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoFormat + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ProtoFormat; + + /** + * Creates a plain object from a ProtoFormat message. Also converts values to other types if specified. + * @param message ProtoFormat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ProtoFormat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoFormat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoFormat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ColumnMetadata. */ + interface IColumnMetadata { + + /** ColumnMetadata name */ + name?: (string|null); + + /** ColumnMetadata type */ + type?: (google.bigtable.v2.IType|null); + } + + /** Represents a ColumnMetadata. */ + class ColumnMetadata implements IColumnMetadata { + + /** + * Constructs a new ColumnMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IColumnMetadata); + + /** ColumnMetadata name. */ + public name: string; + + /** ColumnMetadata type. */ + public type?: (google.bigtable.v2.IType|null); + + /** + * Creates a new ColumnMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnMetadata instance + */ + public static create(properties?: google.bigtable.v2.IColumnMetadata): google.bigtable.v2.ColumnMetadata; + + /** + * Encodes the specified ColumnMetadata message. Does not implicitly {@link google.bigtable.v2.ColumnMetadata.verify|verify} messages. + * @param message ColumnMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IColumnMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnMetadata message, length delimited. Does not implicitly {@link google.bigtable.v2.ColumnMetadata.verify|verify} messages. + * @param message ColumnMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IColumnMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ColumnMetadata; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ColumnMetadata; + + /** + * Verifies a ColumnMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ColumnMetadata; + + /** + * Creates a plain object from a ColumnMetadata message. Also converts values to other types if specified. + * @param message ColumnMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ColumnMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProtoSchema. */ + interface IProtoSchema { + + /** ProtoSchema columns */ + columns?: (google.bigtable.v2.IColumnMetadata[]|null); + } + + /** Represents a ProtoSchema. */ + class ProtoSchema implements IProtoSchema { + + /** + * Constructs a new ProtoSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IProtoSchema); + + /** ProtoSchema columns. */ + public columns: google.bigtable.v2.IColumnMetadata[]; + + /** + * Creates a new ProtoSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoSchema instance + */ + public static create(properties?: google.bigtable.v2.IProtoSchema): google.bigtable.v2.ProtoSchema; + + /** + * Encodes the specified ProtoSchema message. Does not implicitly {@link google.bigtable.v2.ProtoSchema.verify|verify} messages. + * @param message ProtoSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IProtoSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoSchema message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoSchema.verify|verify} messages. + * @param message ProtoSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IProtoSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ProtoSchema; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ProtoSchema; + + /** + * Verifies a ProtoSchema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoSchema + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ProtoSchema; + + /** + * Creates a plain object from a ProtoSchema message. Also converts values to other types if specified. + * @param message ProtoSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ProtoSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResultSetMetadata. */ + interface IResultSetMetadata { + + /** ResultSetMetadata protoSchema */ + protoSchema?: (google.bigtable.v2.IProtoSchema|null); + } + + /** Represents a ResultSetMetadata. */ + class ResultSetMetadata implements IResultSetMetadata { + + /** + * Constructs a new ResultSetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IResultSetMetadata); + + /** ResultSetMetadata protoSchema. */ + public protoSchema?: (google.bigtable.v2.IProtoSchema|null); + + /** ResultSetMetadata schema. */ + public schema?: "protoSchema"; + + /** + * Creates a new ResultSetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ResultSetMetadata instance + */ + public static create(properties?: google.bigtable.v2.IResultSetMetadata): google.bigtable.v2.ResultSetMetadata; + + /** + * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.bigtable.v2.ResultSetMetadata.verify|verify} messages. + * @param message ResultSetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.bigtable.v2.ResultSetMetadata.verify|verify} messages. + * @param message ResultSetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ResultSetMetadata; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ResultSetMetadata; + + /** + * Verifies a ResultSetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultSetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ResultSetMetadata; + + /** + * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. + * @param message ResultSetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ResultSetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultSetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultSetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProtoRows. */ + interface IProtoRows { + + /** ProtoRows values */ + values?: (google.bigtable.v2.IValue[]|null); + } + + /** Represents a ProtoRows. */ + class ProtoRows implements IProtoRows { + + /** + * Constructs a new ProtoRows. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IProtoRows); + + /** ProtoRows values. */ + public values: google.bigtable.v2.IValue[]; + + /** + * Creates a new ProtoRows instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoRows instance + */ + public static create(properties?: google.bigtable.v2.IProtoRows): google.bigtable.v2.ProtoRows; + + /** + * Encodes the specified ProtoRows message. Does not implicitly {@link google.bigtable.v2.ProtoRows.verify|verify} messages. + * @param message ProtoRows message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IProtoRows, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoRows message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoRows.verify|verify} messages. + * @param message ProtoRows message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IProtoRows, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoRows message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ProtoRows; + + /** + * Decodes a ProtoRows message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ProtoRows; + + /** + * Verifies a ProtoRows message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoRows message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoRows + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ProtoRows; + + /** + * Creates a plain object from a ProtoRows message. Also converts values to other types if specified. + * @param message ProtoRows + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ProtoRows, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoRows to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoRows + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProtoRowsBatch. */ + interface IProtoRowsBatch { + + /** ProtoRowsBatch batchData */ + batchData?: (Uint8Array|Buffer|string|null); + } + + /** Represents a ProtoRowsBatch. */ + class ProtoRowsBatch implements IProtoRowsBatch { + + /** + * Constructs a new ProtoRowsBatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IProtoRowsBatch); + + /** ProtoRowsBatch batchData. */ + public batchData: (Uint8Array|Buffer|string); + + /** + * Creates a new ProtoRowsBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoRowsBatch instance + */ + public static create(properties?: google.bigtable.v2.IProtoRowsBatch): google.bigtable.v2.ProtoRowsBatch; + + /** + * Encodes the specified ProtoRowsBatch message. Does not implicitly {@link google.bigtable.v2.ProtoRowsBatch.verify|verify} messages. + * @param message ProtoRowsBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IProtoRowsBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoRowsBatch message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoRowsBatch.verify|verify} messages. + * @param message ProtoRowsBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IProtoRowsBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoRowsBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoRowsBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ProtoRowsBatch; + + /** + * Decodes a ProtoRowsBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoRowsBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ProtoRowsBatch; + + /** + * Verifies a ProtoRowsBatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoRowsBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoRowsBatch + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ProtoRowsBatch; + + /** + * Creates a plain object from a ProtoRowsBatch message. Also converts values to other types if specified. + * @param message ProtoRowsBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ProtoRowsBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoRowsBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoRowsBatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartialResultSet. */ + interface IPartialResultSet { + + /** PartialResultSet protoRowsBatch */ + protoRowsBatch?: (google.bigtable.v2.IProtoRowsBatch|null); + + /** PartialResultSet batchChecksum */ + batchChecksum?: (number|null); + + /** PartialResultSet resumeToken */ + resumeToken?: (Uint8Array|Buffer|string|null); + + /** PartialResultSet reset */ + reset?: (boolean|null); + + /** PartialResultSet estimatedBatchSize */ + estimatedBatchSize?: (number|null); + } + + /** Represents a PartialResultSet. */ + class PartialResultSet implements IPartialResultSet { + + /** + * Constructs a new PartialResultSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IPartialResultSet); + + /** PartialResultSet protoRowsBatch. */ + public protoRowsBatch?: (google.bigtable.v2.IProtoRowsBatch|null); + + /** PartialResultSet batchChecksum. */ + public batchChecksum?: (number|null); + + /** PartialResultSet resumeToken. */ + public resumeToken: (Uint8Array|Buffer|string); + + /** PartialResultSet reset. */ + public reset: boolean; + + /** PartialResultSet estimatedBatchSize. */ + public estimatedBatchSize: number; + + /** PartialResultSet partialRows. */ + public partialRows?: "protoRowsBatch"; + + /** + * Creates a new PartialResultSet instance using the specified properties. + * @param [properties] Properties to set + * @returns PartialResultSet instance + */ + public static create(properties?: google.bigtable.v2.IPartialResultSet): google.bigtable.v2.PartialResultSet; + + /** + * Encodes the specified PartialResultSet message. Does not implicitly {@link google.bigtable.v2.PartialResultSet.verify|verify} messages. + * @param message PartialResultSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IPartialResultSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartialResultSet message, length delimited. Does not implicitly {@link google.bigtable.v2.PartialResultSet.verify|verify} messages. + * @param message PartialResultSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IPartialResultSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.PartialResultSet; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.PartialResultSet; + + /** + * Verifies a PartialResultSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartialResultSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartialResultSet + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.PartialResultSet; + + /** + * Creates a plain object from a PartialResultSet message. Also converts values to other types if specified. + * @param message PartialResultSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.PartialResultSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartialResultSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartialResultSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Idempotency. */ + interface IIdempotency { + + /** Idempotency token */ + token?: (Uint8Array|Buffer|string|null); + + /** Idempotency startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Idempotency. */ + class Idempotency implements IIdempotency { + + /** + * Constructs a new Idempotency. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IIdempotency); + + /** Idempotency token. */ + public token: (Uint8Array|Buffer|string); + + /** Idempotency startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Idempotency instance using the specified properties. + * @param [properties] Properties to set + * @returns Idempotency instance + */ + public static create(properties?: google.bigtable.v2.IIdempotency): google.bigtable.v2.Idempotency; + + /** + * Encodes the specified Idempotency message. Does not implicitly {@link google.bigtable.v2.Idempotency.verify|verify} messages. + * @param message Idempotency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IIdempotency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Idempotency message, length delimited. Does not implicitly {@link google.bigtable.v2.Idempotency.verify|verify} messages. + * @param message Idempotency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IIdempotency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Idempotency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Idempotency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Idempotency; + + /** + * Decodes an Idempotency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Idempotency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Idempotency; + + /** + * Verifies an Idempotency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Idempotency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Idempotency + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Idempotency; + + /** + * Creates a plain object from an Idempotency message. Also converts values to other types if specified. + * @param message Idempotency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Idempotency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Idempotency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Idempotency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Type. */ + interface IType { + + /** Type bytesType */ + bytesType?: (google.bigtable.v2.Type.IBytes|null); + + /** Type stringType */ + stringType?: (google.bigtable.v2.Type.IString|null); + + /** Type int64Type */ + int64Type?: (google.bigtable.v2.Type.IInt64|null); + + /** Type float32Type */ + float32Type?: (google.bigtable.v2.Type.IFloat32|null); + + /** Type float64Type */ + float64Type?: (google.bigtable.v2.Type.IFloat64|null); + + /** Type boolType */ + boolType?: (google.bigtable.v2.Type.IBool|null); + + /** Type timestampType */ + timestampType?: (google.bigtable.v2.Type.ITimestamp|null); + + /** Type dateType */ + dateType?: (google.bigtable.v2.Type.IDate|null); + + /** Type aggregateType */ + aggregateType?: (google.bigtable.v2.Type.IAggregate|null); + + /** Type structType */ + structType?: (google.bigtable.v2.Type.IStruct|null); + + /** Type arrayType */ + arrayType?: (google.bigtable.v2.Type.IArray|null); + + /** Type mapType */ + mapType?: (google.bigtable.v2.Type.IMap|null); + + /** Type protoType */ + protoType?: (google.bigtable.v2.Type.IProto|null); + + /** Type enumType */ + enumType?: (google.bigtable.v2.Type.IEnum|null); + } + + /** Represents a Type. */ + class Type implements IType { + + /** + * Constructs a new Type. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IType); + + /** Type bytesType. */ + public bytesType?: (google.bigtable.v2.Type.IBytes|null); + + /** Type stringType. */ + public stringType?: (google.bigtable.v2.Type.IString|null); + + /** Type int64Type. */ + public int64Type?: (google.bigtable.v2.Type.IInt64|null); + + /** Type float32Type. */ + public float32Type?: (google.bigtable.v2.Type.IFloat32|null); + + /** Type float64Type. */ + public float64Type?: (google.bigtable.v2.Type.IFloat64|null); + + /** Type boolType. */ + public boolType?: (google.bigtable.v2.Type.IBool|null); + + /** Type timestampType. */ + public timestampType?: (google.bigtable.v2.Type.ITimestamp|null); + + /** Type dateType. */ + public dateType?: (google.bigtable.v2.Type.IDate|null); + + /** Type aggregateType. */ + public aggregateType?: (google.bigtable.v2.Type.IAggregate|null); + + /** Type structType. */ + public structType?: (google.bigtable.v2.Type.IStruct|null); + + /** Type arrayType. */ + public arrayType?: (google.bigtable.v2.Type.IArray|null); + + /** Type mapType. */ + public mapType?: (google.bigtable.v2.Type.IMap|null); + + /** Type protoType. */ + public protoType?: (google.bigtable.v2.Type.IProto|null); + + /** Type enumType. */ + public enumType?: (google.bigtable.v2.Type.IEnum|null); + + /** Type kind. */ + public kind?: ("bytesType"|"stringType"|"int64Type"|"float32Type"|"float64Type"|"boolType"|"timestampType"|"dateType"|"aggregateType"|"structType"|"arrayType"|"mapType"|"protoType"|"enumType"); + + /** + * Creates a new Type instance using the specified properties. + * @param [properties] Properties to set + * @returns Type instance + */ + public static create(properties?: google.bigtable.v2.IType): google.bigtable.v2.Type; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.bigtable.v2.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Type message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type; + + /** + * Verifies a Type message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Type + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @param message Type + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Type to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Type + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Type { + + /** Properties of a Bytes. */ + interface IBytes { + + /** Bytes encoding */ + encoding?: (google.bigtable.v2.Type.Bytes.IEncoding|null); + } + + /** Represents a Bytes. */ + class Bytes implements IBytes { + + /** + * Constructs a new Bytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IBytes); + + /** Bytes encoding. */ + public encoding?: (google.bigtable.v2.Type.Bytes.IEncoding|null); + + /** + * Creates a new Bytes instance using the specified properties. + * @param [properties] Properties to set + * @returns Bytes instance + */ + public static create(properties?: google.bigtable.v2.Type.IBytes): google.bigtable.v2.Type.Bytes; + + /** + * Encodes the specified Bytes message. Does not implicitly {@link google.bigtable.v2.Type.Bytes.verify|verify} messages. + * @param message Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Bytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bytes.verify|verify} messages. + * @param message Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Bytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Bytes; + + /** + * Decodes a Bytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Bytes; + + /** + * Verifies a Bytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Bytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Bytes; + + /** + * Creates a plain object from a Bytes message. Also converts values to other types if specified. + * @param message Bytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Bytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Bytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Bytes { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding raw */ + raw?: (google.bigtable.v2.Type.Bytes.Encoding.IRaw|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Bytes.IEncoding); + + /** Encoding raw. */ + public raw?: (google.bigtable.v2.Type.Bytes.Encoding.IRaw|null); + + /** Encoding encoding. */ + public encoding?: "raw"; + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.v2.Type.Bytes.IEncoding): google.bigtable.v2.Type.Bytes.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Bytes.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Bytes.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Bytes.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Bytes.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Bytes.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Bytes.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of a Raw. */ + interface IRaw { + + /** Raw escapeNulls */ + escapeNulls?: (boolean|null); + } + + /** Represents a Raw. */ + class Raw implements IRaw { + + /** + * Constructs a new Raw. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Bytes.Encoding.IRaw); + + /** Raw escapeNulls. */ + public escapeNulls: boolean; + + /** + * Creates a new Raw instance using the specified properties. + * @param [properties] Properties to set + * @returns Raw instance + */ + public static create(properties?: google.bigtable.v2.Type.Bytes.Encoding.IRaw): google.bigtable.v2.Type.Bytes.Encoding.Raw; + + /** + * Encodes the specified Raw message. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @param message Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Bytes.Encoding.IRaw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Raw message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @param message Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Bytes.Encoding.IRaw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Raw message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Bytes.Encoding.Raw; + + /** + * Decodes a Raw message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Bytes.Encoding.Raw; + + /** + * Verifies a Raw message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Raw message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Raw + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Bytes.Encoding.Raw; + + /** + * Creates a plain object from a Raw message. Also converts values to other types if specified. + * @param message Raw + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Bytes.Encoding.Raw, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Raw to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Raw + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a String. */ + interface IString { + + /** String encoding */ + encoding?: (google.bigtable.v2.Type.String.IEncoding|null); + } + + /** Represents a String. */ + class String implements IString { + + /** + * Constructs a new String. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IString); + + /** String encoding. */ + public encoding?: (google.bigtable.v2.Type.String.IEncoding|null); + + /** + * Creates a new String instance using the specified properties. + * @param [properties] Properties to set + * @returns String instance + */ + public static create(properties?: google.bigtable.v2.Type.IString): google.bigtable.v2.Type.String; + + /** + * Encodes the specified String message. Does not implicitly {@link google.bigtable.v2.Type.String.verify|verify} messages. + * @param message String message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IString, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified String message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.verify|verify} messages. + * @param message String message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IString, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a String message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.String; + + /** + * Decodes a String message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.String; + + /** + * Verifies a String message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a String message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns String + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.String; + + /** + * Creates a plain object from a String message. Also converts values to other types if specified. + * @param message String + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.String, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this String to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for String + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace String { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding utf8Raw */ + utf8Raw?: (google.bigtable.v2.Type.String.Encoding.IUtf8Raw|null); + + /** Encoding utf8Bytes */ + utf8Bytes?: (google.bigtable.v2.Type.String.Encoding.IUtf8Bytes|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.String.IEncoding); + + /** Encoding utf8Raw. */ + public utf8Raw?: (google.bigtable.v2.Type.String.Encoding.IUtf8Raw|null); + + /** Encoding utf8Bytes. */ + public utf8Bytes?: (google.bigtable.v2.Type.String.Encoding.IUtf8Bytes|null); + + /** Encoding encoding. */ + public encoding?: ("utf8Raw"|"utf8Bytes"); + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.v2.Type.String.IEncoding): google.bigtable.v2.Type.String.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.String.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.String.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.String.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.String.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.String.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.String.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of an Utf8Raw. */ + interface IUtf8Raw { + } + + /** Represents an Utf8Raw. */ + class Utf8Raw implements IUtf8Raw { + + /** + * Constructs a new Utf8Raw. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.String.Encoding.IUtf8Raw); + + /** + * Creates a new Utf8Raw instance using the specified properties. + * @param [properties] Properties to set + * @returns Utf8Raw instance + */ + public static create(properties?: google.bigtable.v2.Type.String.Encoding.IUtf8Raw): google.bigtable.v2.Type.String.Encoding.Utf8Raw; + + /** + * Encodes the specified Utf8Raw message. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @param message Utf8Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.String.Encoding.IUtf8Raw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Utf8Raw message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @param message Utf8Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.String.Encoding.IUtf8Raw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.String.Encoding.Utf8Raw; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.String.Encoding.Utf8Raw; + + /** + * Verifies an Utf8Raw message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Utf8Raw message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Utf8Raw + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.String.Encoding.Utf8Raw; + + /** + * Creates a plain object from an Utf8Raw message. Also converts values to other types if specified. + * @param message Utf8Raw + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.String.Encoding.Utf8Raw, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Utf8Raw to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Utf8Raw + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Utf8Bytes. */ + interface IUtf8Bytes { + + /** Utf8Bytes nullEscapeChar */ + nullEscapeChar?: (string|null); + } + + /** Represents an Utf8Bytes. */ + class Utf8Bytes implements IUtf8Bytes { + + /** + * Constructs a new Utf8Bytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.String.Encoding.IUtf8Bytes); + + /** Utf8Bytes nullEscapeChar. */ + public nullEscapeChar: string; + + /** + * Creates a new Utf8Bytes instance using the specified properties. + * @param [properties] Properties to set + * @returns Utf8Bytes instance + */ + public static create(properties?: google.bigtable.v2.Type.String.Encoding.IUtf8Bytes): google.bigtable.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Encodes the specified Utf8Bytes message. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @param message Utf8Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.String.Encoding.IUtf8Bytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Utf8Bytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @param message Utf8Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.String.Encoding.IUtf8Bytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Verifies an Utf8Bytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Utf8Bytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Utf8Bytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Creates a plain object from an Utf8Bytes message. Also converts values to other types if specified. + * @param message Utf8Bytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.String.Encoding.Utf8Bytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Utf8Bytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Utf8Bytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an Int64. */ + interface IInt64 { + + /** Int64 encoding */ + encoding?: (google.bigtable.v2.Type.Int64.IEncoding|null); + } + + /** Represents an Int64. */ + class Int64 implements IInt64 { + + /** + * Constructs a new Int64. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IInt64); + + /** Int64 encoding. */ + public encoding?: (google.bigtable.v2.Type.Int64.IEncoding|null); + + /** + * Creates a new Int64 instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64 instance + */ + public static create(properties?: google.bigtable.v2.Type.IInt64): google.bigtable.v2.Type.Int64; + + /** + * Encodes the specified Int64 message. Does not implicitly {@link google.bigtable.v2.Type.Int64.verify|verify} messages. + * @param message Int64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IInt64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64 message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.verify|verify} messages. + * @param message Int64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IInt64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Int64; + + /** + * Decodes an Int64 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Int64; + + /** + * Verifies an Int64 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64 + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Int64; + + /** + * Creates a plain object from an Int64 message. Also converts values to other types if specified. + * @param message Int64 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Int64, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Int64 { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding bigEndianBytes */ + bigEndianBytes?: (google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes|null); + + /** Encoding orderedCodeBytes */ + orderedCodeBytes?: (google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Int64.IEncoding); + + /** Encoding bigEndianBytes. */ + public bigEndianBytes?: (google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes|null); + + /** Encoding orderedCodeBytes. */ + public orderedCodeBytes?: (google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes|null); + + /** Encoding encoding. */ + public encoding?: ("bigEndianBytes"|"orderedCodeBytes"); + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.v2.Type.Int64.IEncoding): google.bigtable.v2.Type.Int64.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Int64.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Int64.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Int64.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Int64.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Int64.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Int64.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of a BigEndianBytes. */ + interface IBigEndianBytes { + + /** BigEndianBytes bytesType */ + bytesType?: (google.bigtable.v2.Type.IBytes|null); + } + + /** Represents a BigEndianBytes. */ + class BigEndianBytes implements IBigEndianBytes { + + /** + * Constructs a new BigEndianBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes); + + /** BigEndianBytes bytesType. */ + public bytesType?: (google.bigtable.v2.Type.IBytes|null); + + /** + * Creates a new BigEndianBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns BigEndianBytes instance + */ + public static create(properties?: google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes): google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Encodes the specified BigEndianBytes message. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @param message BigEndianBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigEndianBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @param message BigEndianBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Verifies a BigEndianBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigEndianBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigEndianBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Creates a plain object from a BigEndianBytes message. Also converts values to other types if specified. + * @param message BigEndianBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigEndianBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigEndianBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrderedCodeBytes. */ + interface IOrderedCodeBytes { + } + + /** Represents an OrderedCodeBytes. */ + class OrderedCodeBytes implements IOrderedCodeBytes { + + /** + * Constructs a new OrderedCodeBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes); + + /** + * Creates a new OrderedCodeBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns OrderedCodeBytes instance + */ + public static create(properties?: google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes): google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Verifies an OrderedCodeBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrderedCodeBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @param message OrderedCodeBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrderedCodeBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Bool. */ + interface IBool { + } + + /** Represents a Bool. */ + class Bool implements IBool { + + /** + * Constructs a new Bool. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IBool); + + /** + * Creates a new Bool instance using the specified properties. + * @param [properties] Properties to set + * @returns Bool instance + */ + public static create(properties?: google.bigtable.v2.Type.IBool): google.bigtable.v2.Type.Bool; + + /** + * Encodes the specified Bool message. Does not implicitly {@link google.bigtable.v2.Type.Bool.verify|verify} messages. + * @param message Bool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IBool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Bool message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bool.verify|verify} messages. + * @param message Bool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IBool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Bool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Bool; + + /** + * Decodes a Bool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Bool; + + /** + * Verifies a Bool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Bool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bool + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Bool; + + /** + * Creates a plain object from a Bool message. Also converts values to other types if specified. + * @param message Bool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Bool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Bool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Float32. */ + interface IFloat32 { + } + + /** Represents a Float32. */ + class Float32 implements IFloat32 { + + /** + * Constructs a new Float32. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IFloat32); + + /** + * Creates a new Float32 instance using the specified properties. + * @param [properties] Properties to set + * @returns Float32 instance + */ + public static create(properties?: google.bigtable.v2.Type.IFloat32): google.bigtable.v2.Type.Float32; + + /** + * Encodes the specified Float32 message. Does not implicitly {@link google.bigtable.v2.Type.Float32.verify|verify} messages. + * @param message Float32 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IFloat32, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Float32 message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Float32.verify|verify} messages. + * @param message Float32 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IFloat32, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Float32 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Float32; + + /** + * Decodes a Float32 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Float32; + + /** + * Verifies a Float32 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Float32 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Float32 + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Float32; + + /** + * Creates a plain object from a Float32 message. Also converts values to other types if specified. + * @param message Float32 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Float32, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Float32 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Float32 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Float64. */ + interface IFloat64 { + } + + /** Represents a Float64. */ + class Float64 implements IFloat64 { + + /** + * Constructs a new Float64. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IFloat64); + + /** + * Creates a new Float64 instance using the specified properties. + * @param [properties] Properties to set + * @returns Float64 instance + */ + public static create(properties?: google.bigtable.v2.Type.IFloat64): google.bigtable.v2.Type.Float64; + + /** + * Encodes the specified Float64 message. Does not implicitly {@link google.bigtable.v2.Type.Float64.verify|verify} messages. + * @param message Float64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IFloat64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Float64 message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Float64.verify|verify} messages. + * @param message Float64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IFloat64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Float64 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Float64; + + /** + * Decodes a Float64 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Float64; + + /** + * Verifies a Float64 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Float64 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Float64 + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Float64; + + /** + * Creates a plain object from a Float64 message. Also converts values to other types if specified. + * @param message Float64 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Float64, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Float64 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Float64 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp encoding */ + encoding?: (google.bigtable.v2.Type.Timestamp.IEncoding|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.ITimestamp); + + /** Timestamp encoding. */ + public encoding?: (google.bigtable.v2.Type.Timestamp.IEncoding|null); + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.bigtable.v2.Type.ITimestamp): google.bigtable.v2.Type.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.bigtable.v2.Type.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.bigtable.v2.Type.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.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.bigtable.v2.Type.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.bigtable.v2.Type.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.bigtable.v2.Type.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.bigtable.v2.Type.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.bigtable.v2.Type.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Timestamp { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding unixMicrosInt64 */ + unixMicrosInt64?: (google.bigtable.v2.Type.Int64.IEncoding|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Timestamp.IEncoding); + + /** Encoding unixMicrosInt64. */ + public unixMicrosInt64?: (google.bigtable.v2.Type.Int64.IEncoding|null); + + /** Encoding encoding. */ + public encoding?: "unixMicrosInt64"; + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.v2.Type.Timestamp.IEncoding): google.bigtable.v2.Type.Timestamp.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Timestamp.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Timestamp.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Timestamp.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Timestamp.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Timestamp.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Timestamp.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Date. */ + interface IDate { + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IDate); + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.bigtable.v2.Type.IDate): google.bigtable.v2.Type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.bigtable.v2.Type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: (google.bigtable.v2.Type.Struct.IField[]|null); + + /** Struct encoding */ + encoding?: (google.bigtable.v2.Type.Struct.IEncoding|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IStruct); + + /** Struct fields. */ + public fields: google.bigtable.v2.Type.Struct.IField[]; + + /** Struct encoding. */ + public encoding?: (google.bigtable.v2.Type.Struct.IEncoding|null); + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.bigtable.v2.Type.IStruct): google.bigtable.v2.Type.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.bigtable.v2.Type.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Struct { + + /** Properties of a Field. */ + interface IField { + + /** Field fieldName */ + fieldName?: (string|null); + + /** Field type */ + type?: (google.bigtable.v2.IType|null); + } + + /** Represents a Field. */ + class Field implements IField { + + /** + * Constructs a new Field. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Struct.IField); + + /** Field fieldName. */ + public fieldName: string; + + /** Field type. */ + public type?: (google.bigtable.v2.IType|null); + + /** + * Creates a new Field instance using the specified properties. + * @param [properties] Properties to set + * @returns Field instance + */ + public static create(properties?: google.bigtable.v2.Type.Struct.IField): google.bigtable.v2.Type.Struct.Field; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Struct.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Struct.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Field message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Struct.Field; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Struct.Field; + + /** + * Verifies a Field message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Field + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Struct.Field; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @param message Field + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Struct.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Field to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Field + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding singleton */ + singleton?: (google.bigtable.v2.Type.Struct.Encoding.ISingleton|null); + + /** Encoding delimitedBytes */ + delimitedBytes?: (google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes|null); + + /** Encoding orderedCodeBytes */ + orderedCodeBytes?: (google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Struct.IEncoding); + + /** Encoding singleton. */ + public singleton?: (google.bigtable.v2.Type.Struct.Encoding.ISingleton|null); + + /** Encoding delimitedBytes. */ + public delimitedBytes?: (google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes|null); + + /** Encoding orderedCodeBytes. */ + public orderedCodeBytes?: (google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes|null); + + /** Encoding encoding. */ + public encoding?: ("singleton"|"delimitedBytes"|"orderedCodeBytes"); + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.v2.Type.Struct.IEncoding): google.bigtable.v2.Type.Struct.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Struct.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Struct.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Struct.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Struct.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Struct.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Struct.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of a Singleton. */ + interface ISingleton { + } + + /** Represents a Singleton. */ + class Singleton implements ISingleton { + + /** + * Constructs a new Singleton. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Struct.Encoding.ISingleton); + + /** + * Creates a new Singleton instance using the specified properties. + * @param [properties] Properties to set + * @returns Singleton instance + */ + public static create(properties?: google.bigtable.v2.Type.Struct.Encoding.ISingleton): google.bigtable.v2.Type.Struct.Encoding.Singleton; + + /** + * Encodes the specified Singleton message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @param message Singleton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Struct.Encoding.ISingleton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Singleton message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @param message Singleton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Struct.Encoding.ISingleton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Singleton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Struct.Encoding.Singleton; + + /** + * Decodes a Singleton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Struct.Encoding.Singleton; + + /** + * Verifies a Singleton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Singleton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Singleton + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Struct.Encoding.Singleton; + + /** + * Creates a plain object from a Singleton message. Also converts values to other types if specified. + * @param message Singleton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Struct.Encoding.Singleton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Singleton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Singleton + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DelimitedBytes. */ + interface IDelimitedBytes { + + /** DelimitedBytes delimiter */ + delimiter?: (Uint8Array|Buffer|string|null); + } + + /** Represents a DelimitedBytes. */ + class DelimitedBytes implements IDelimitedBytes { + + /** + * Constructs a new DelimitedBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes); + + /** DelimitedBytes delimiter. */ + public delimiter: (Uint8Array|Buffer|string); + + /** + * Creates a new DelimitedBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns DelimitedBytes instance + */ + public static create(properties?: google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes): google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Encodes the specified DelimitedBytes message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @param message DelimitedBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DelimitedBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @param message DelimitedBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Verifies a DelimitedBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DelimitedBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DelimitedBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Creates a plain object from a DelimitedBytes message. Also converts values to other types if specified. + * @param message DelimitedBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DelimitedBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DelimitedBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrderedCodeBytes. */ + interface IOrderedCodeBytes { + } + + /** Represents an OrderedCodeBytes. */ + class OrderedCodeBytes implements IOrderedCodeBytes { + + /** + * Constructs a new OrderedCodeBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes); + + /** + * Creates a new OrderedCodeBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns OrderedCodeBytes instance + */ + public static create(properties?: google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes): google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Verifies an OrderedCodeBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrderedCodeBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @param message OrderedCodeBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrderedCodeBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Proto. */ + interface IProto { + + /** Proto schemaBundleId */ + schemaBundleId?: (string|null); + + /** Proto messageName */ + messageName?: (string|null); + } + + /** Represents a Proto. */ + class Proto implements IProto { + + /** + * Constructs a new Proto. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IProto); + + /** Proto schemaBundleId. */ + public schemaBundleId: string; + + /** Proto messageName. */ + public messageName: string; + + /** + * Creates a new Proto instance using the specified properties. + * @param [properties] Properties to set + * @returns Proto instance + */ + public static create(properties?: google.bigtable.v2.Type.IProto): google.bigtable.v2.Type.Proto; + + /** + * Encodes the specified Proto message. Does not implicitly {@link google.bigtable.v2.Type.Proto.verify|verify} messages. + * @param message Proto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Proto message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Proto.verify|verify} messages. + * @param message Proto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Proto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Proto; + + /** + * Decodes a Proto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Proto; + + /** + * Verifies a Proto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Proto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Proto + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Proto; + + /** + * Creates a plain object from a Proto message. Also converts values to other types if specified. + * @param message Proto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Proto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Proto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Proto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Enum. */ + interface IEnum { + + /** Enum schemaBundleId */ + schemaBundleId?: (string|null); + + /** Enum enumName */ + enumName?: (string|null); + } + + /** Represents an Enum. */ + class Enum implements IEnum { + + /** + * Constructs a new Enum. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IEnum); + + /** Enum schemaBundleId. */ + public schemaBundleId: string; + + /** Enum enumName. */ + public enumName: string; + + /** + * Creates a new Enum instance using the specified properties. + * @param [properties] Properties to set + * @returns Enum instance + */ + public static create(properties?: google.bigtable.v2.Type.IEnum): google.bigtable.v2.Type.Enum; + + /** + * Encodes the specified Enum message. Does not implicitly {@link google.bigtable.v2.Type.Enum.verify|verify} messages. + * @param message Enum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Enum.verify|verify} messages. + * @param message Enum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Enum message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Enum; + + /** + * Decodes an Enum message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Enum; + + /** + * Verifies an Enum message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Enum message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Enum + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Enum; + + /** + * Creates a plain object from an Enum message. Also converts values to other types if specified. + * @param message Enum + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Enum, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Enum to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Enum + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Array. */ + interface IArray { + + /** Array elementType */ + elementType?: (google.bigtable.v2.IType|null); + } + + /** Represents an Array. */ + class Array implements IArray { + + /** + * Constructs a new Array. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IArray); + + /** Array elementType. */ + public elementType?: (google.bigtable.v2.IType|null); + + /** + * Creates a new Array instance using the specified properties. + * @param [properties] Properties to set + * @returns Array instance + */ + public static create(properties?: google.bigtable.v2.Type.IArray): google.bigtable.v2.Type.Array; + + /** + * Encodes the specified Array message. Does not implicitly {@link google.bigtable.v2.Type.Array.verify|verify} messages. + * @param message Array message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Array message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Array.verify|verify} messages. + * @param message Array message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Array message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Array; + + /** + * Decodes an Array message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Array; + + /** + * Verifies an Array message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Array message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Array + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Array; + + /** + * Creates a plain object from an Array message. Also converts values to other types if specified. + * @param message Array + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Array, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Array to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Array + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Map. */ + interface IMap { + + /** Map keyType */ + keyType?: (google.bigtable.v2.IType|null); + + /** Map valueType */ + valueType?: (google.bigtable.v2.IType|null); + } + + /** Represents a Map. */ + class Map implements IMap { + + /** + * Constructs a new Map. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IMap); + + /** Map keyType. */ + public keyType?: (google.bigtable.v2.IType|null); + + /** Map valueType. */ + public valueType?: (google.bigtable.v2.IType|null); + + /** + * Creates a new Map instance using the specified properties. + * @param [properties] Properties to set + * @returns Map instance + */ + public static create(properties?: google.bigtable.v2.Type.IMap): google.bigtable.v2.Type.Map; + + /** + * Encodes the specified Map message. Does not implicitly {@link google.bigtable.v2.Type.Map.verify|verify} messages. + * @param message Map message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Map message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Map.verify|verify} messages. + * @param message Map message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Map message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Map; + + /** + * Decodes a Map message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Map; + + /** + * Verifies a Map message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Map message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Map + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Map; + + /** + * Creates a plain object from a Map message. Also converts values to other types if specified. + * @param message Map + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Map, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Map to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Map + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Aggregate. */ + interface IAggregate { + + /** Aggregate inputType */ + inputType?: (google.bigtable.v2.IType|null); + + /** Aggregate stateType */ + stateType?: (google.bigtable.v2.IType|null); + + /** Aggregate sum */ + sum?: (google.bigtable.v2.Type.Aggregate.ISum|null); + + /** Aggregate hllppUniqueCount */ + hllppUniqueCount?: (google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null); + + /** Aggregate max */ + max?: (google.bigtable.v2.Type.Aggregate.IMax|null); + + /** Aggregate min */ + min?: (google.bigtable.v2.Type.Aggregate.IMin|null); + } + + /** Represents an Aggregate. */ + class Aggregate implements IAggregate { + + /** + * Constructs a new Aggregate. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IAggregate); + + /** Aggregate inputType. */ + public inputType?: (google.bigtable.v2.IType|null); + + /** Aggregate stateType. */ + public stateType?: (google.bigtable.v2.IType|null); + + /** Aggregate sum. */ + public sum?: (google.bigtable.v2.Type.Aggregate.ISum|null); + + /** Aggregate hllppUniqueCount. */ + public hllppUniqueCount?: (google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null); + + /** Aggregate max. */ + public max?: (google.bigtable.v2.Type.Aggregate.IMax|null); + + /** Aggregate min. */ + public min?: (google.bigtable.v2.Type.Aggregate.IMin|null); + + /** Aggregate aggregator. */ + public aggregator?: ("sum"|"hllppUniqueCount"|"max"|"min"); + + /** + * Creates a new Aggregate instance using the specified properties. + * @param [properties] Properties to set + * @returns Aggregate instance + */ + public static create(properties?: google.bigtable.v2.Type.IAggregate): google.bigtable.v2.Type.Aggregate; + + /** + * Encodes the specified Aggregate message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.verify|verify} messages. + * @param message Aggregate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IAggregate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Aggregate message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.verify|verify} messages. + * @param message Aggregate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IAggregate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Aggregate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Aggregate; + + /** + * Decodes an Aggregate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Aggregate; + + /** + * Verifies an Aggregate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Aggregate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Aggregate + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Aggregate; + + /** + * Creates a plain object from an Aggregate message. Also converts values to other types if specified. + * @param message Aggregate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Aggregate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Aggregate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Aggregate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Aggregate { + + /** Properties of a Sum. */ + interface ISum { + } + + /** Represents a Sum. */ + class Sum implements ISum { + + /** + * Constructs a new Sum. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Aggregate.ISum); + + /** + * Creates a new Sum instance using the specified properties. + * @param [properties] Properties to set + * @returns Sum instance + */ + public static create(properties?: google.bigtable.v2.Type.Aggregate.ISum): google.bigtable.v2.Type.Aggregate.Sum; + + /** + * Encodes the specified Sum message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Sum.verify|verify} messages. + * @param message Sum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Aggregate.ISum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Sum.verify|verify} messages. + * @param message Sum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Aggregate.ISum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sum message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Aggregate.Sum; + + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Aggregate.Sum; + + /** + * Verifies a Sum message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sum + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Aggregate.Sum; + + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @param message Sum + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Aggregate.Sum, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Sum to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Sum + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Max. */ + interface IMax { + } + + /** Represents a Max. */ + class Max implements IMax { + + /** + * Constructs a new Max. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Aggregate.IMax); + + /** + * Creates a new Max instance using the specified properties. + * @param [properties] Properties to set + * @returns Max instance + */ + public static create(properties?: google.bigtable.v2.Type.Aggregate.IMax): google.bigtable.v2.Type.Aggregate.Max; + + /** + * Encodes the specified Max message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Max.verify|verify} messages. + * @param message Max message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Aggregate.IMax, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Max message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Max.verify|verify} messages. + * @param message Max message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Aggregate.IMax, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Max message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Aggregate.Max; + + /** + * Decodes a Max message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Aggregate.Max; + + /** + * Verifies a Max message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Max message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Max + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Aggregate.Max; + + /** + * Creates a plain object from a Max message. Also converts values to other types if specified. + * @param message Max + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Aggregate.Max, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Max to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Max + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Min. */ + interface IMin { + } + + /** Represents a Min. */ + class Min implements IMin { + + /** + * Constructs a new Min. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Aggregate.IMin); + + /** + * Creates a new Min instance using the specified properties. + * @param [properties] Properties to set + * @returns Min instance + */ + public static create(properties?: google.bigtable.v2.Type.Aggregate.IMin): google.bigtable.v2.Type.Aggregate.Min; + + /** + * Encodes the specified Min message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Min.verify|verify} messages. + * @param message Min message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Aggregate.IMin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Min message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Min.verify|verify} messages. + * @param message Min message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Aggregate.IMin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Min message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Aggregate.Min; + + /** + * Decodes a Min message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Aggregate.Min; + + /** + * Verifies a Min message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Min message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Min + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Aggregate.Min; + + /** + * Creates a plain object from a Min message. Also converts values to other types if specified. + * @param message Min + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Aggregate.Min, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Min to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Min + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HyperLogLogPlusPlusUniqueCount. */ + interface IHyperLogLogPlusPlusUniqueCount { + } + + /** Represents a HyperLogLogPlusPlusUniqueCount. */ + class HyperLogLogPlusPlusUniqueCount implements IHyperLogLogPlusPlusUniqueCount { + + /** + * Constructs a new HyperLogLogPlusPlusUniqueCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount); + + /** + * Creates a new HyperLogLogPlusPlusUniqueCount instance using the specified properties. + * @param [properties] Properties to set + * @returns HyperLogLogPlusPlusUniqueCount instance + */ + public static create(properties?: google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount): google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @param message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @param message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Verifies a HyperLogLogPlusPlusUniqueCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HyperLogLogPlusPlusUniqueCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HyperLogLogPlusPlusUniqueCount + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Creates a plain object from a HyperLogLogPlusPlusUniqueCount message. Also converts values to other types if specified. + * @param message HyperLogLogPlusPlusUniqueCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HyperLogLogPlusPlusUniqueCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HyperLogLogPlusPlusUniqueCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a ReadIterationStats. */ + interface IReadIterationStats { + + /** ReadIterationStats rowsSeenCount */ + rowsSeenCount?: (number|Long|string|null); + + /** ReadIterationStats rowsReturnedCount */ + rowsReturnedCount?: (number|Long|string|null); + + /** ReadIterationStats cellsSeenCount */ + cellsSeenCount?: (number|Long|string|null); + + /** ReadIterationStats cellsReturnedCount */ + cellsReturnedCount?: (number|Long|string|null); + } + + /** Represents a ReadIterationStats. */ + class ReadIterationStats implements IReadIterationStats { + + /** + * Constructs a new ReadIterationStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadIterationStats); + + /** ReadIterationStats rowsSeenCount. */ + public rowsSeenCount: (number|Long|string); + + /** ReadIterationStats rowsReturnedCount. */ + public rowsReturnedCount: (number|Long|string); + + /** ReadIterationStats cellsSeenCount. */ + public cellsSeenCount: (number|Long|string); + + /** ReadIterationStats cellsReturnedCount. */ + public cellsReturnedCount: (number|Long|string); + + /** + * Creates a new ReadIterationStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadIterationStats instance + */ + public static create(properties?: google.bigtable.v2.IReadIterationStats): google.bigtable.v2.ReadIterationStats; + + /** + * Encodes the specified ReadIterationStats message. Does not implicitly {@link google.bigtable.v2.ReadIterationStats.verify|verify} messages. + * @param message ReadIterationStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadIterationStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadIterationStats message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadIterationStats.verify|verify} messages. + * @param message ReadIterationStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadIterationStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadIterationStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadIterationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadIterationStats; + + /** + * Decodes a ReadIterationStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadIterationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadIterationStats; + + /** + * Verifies a ReadIterationStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadIterationStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadIterationStats + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadIterationStats; + + /** + * Creates a plain object from a ReadIterationStats message. Also converts values to other types if specified. + * @param message ReadIterationStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadIterationStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadIterationStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadIterationStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestLatencyStats. */ + interface IRequestLatencyStats { + + /** RequestLatencyStats frontendServerLatency */ + frontendServerLatency?: (google.protobuf.IDuration|null); + } + + /** Represents a RequestLatencyStats. */ + class RequestLatencyStats implements IRequestLatencyStats { + + /** + * Constructs a new RequestLatencyStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRequestLatencyStats); + + /** RequestLatencyStats frontendServerLatency. */ + public frontendServerLatency?: (google.protobuf.IDuration|null); + + /** + * Creates a new RequestLatencyStats instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestLatencyStats instance + */ + public static create(properties?: google.bigtable.v2.IRequestLatencyStats): google.bigtable.v2.RequestLatencyStats; + + /** + * Encodes the specified RequestLatencyStats message. Does not implicitly {@link google.bigtable.v2.RequestLatencyStats.verify|verify} messages. + * @param message RequestLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRequestLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestLatencyStats message, length delimited. Does not implicitly {@link google.bigtable.v2.RequestLatencyStats.verify|verify} messages. + * @param message RequestLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRequestLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestLatencyStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RequestLatencyStats; + + /** + * Decodes a RequestLatencyStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RequestLatencyStats; + + /** + * Verifies a RequestLatencyStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestLatencyStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestLatencyStats + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RequestLatencyStats; + + /** + * Creates a plain object from a RequestLatencyStats message. Also converts values to other types if specified. + * @param message RequestLatencyStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RequestLatencyStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestLatencyStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestLatencyStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FullReadStatsView. */ + interface IFullReadStatsView { + + /** FullReadStatsView readIterationStats */ + readIterationStats?: (google.bigtable.v2.IReadIterationStats|null); + + /** FullReadStatsView requestLatencyStats */ + requestLatencyStats?: (google.bigtable.v2.IRequestLatencyStats|null); + } + + /** Represents a FullReadStatsView. */ + class FullReadStatsView implements IFullReadStatsView { + + /** + * Constructs a new FullReadStatsView. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IFullReadStatsView); + + /** FullReadStatsView readIterationStats. */ + public readIterationStats?: (google.bigtable.v2.IReadIterationStats|null); + + /** FullReadStatsView requestLatencyStats. */ + public requestLatencyStats?: (google.bigtable.v2.IRequestLatencyStats|null); + + /** + * Creates a new FullReadStatsView instance using the specified properties. + * @param [properties] Properties to set + * @returns FullReadStatsView instance + */ + public static create(properties?: google.bigtable.v2.IFullReadStatsView): google.bigtable.v2.FullReadStatsView; + + /** + * Encodes the specified FullReadStatsView message. Does not implicitly {@link google.bigtable.v2.FullReadStatsView.verify|verify} messages. + * @param message FullReadStatsView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IFullReadStatsView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FullReadStatsView message, length delimited. Does not implicitly {@link google.bigtable.v2.FullReadStatsView.verify|verify} messages. + * @param message FullReadStatsView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IFullReadStatsView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FullReadStatsView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FullReadStatsView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.FullReadStatsView; + + /** + * Decodes a FullReadStatsView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FullReadStatsView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.FullReadStatsView; + + /** + * Verifies a FullReadStatsView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FullReadStatsView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FullReadStatsView + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.FullReadStatsView; + + /** + * Creates a plain object from a FullReadStatsView message. Also converts values to other types if specified. + * @param message FullReadStatsView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.FullReadStatsView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FullReadStatsView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FullReadStatsView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestStats. */ + interface IRequestStats { + + /** RequestStats fullReadStatsView */ + fullReadStatsView?: (google.bigtable.v2.IFullReadStatsView|null); + } + + /** Represents a RequestStats. */ + class RequestStats implements IRequestStats { + + /** + * Constructs a new RequestStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRequestStats); + + /** RequestStats fullReadStatsView. */ + public fullReadStatsView?: (google.bigtable.v2.IFullReadStatsView|null); + + /** RequestStats statsView. */ + public statsView?: "fullReadStatsView"; + + /** + * Creates a new RequestStats instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestStats instance + */ + public static create(properties?: google.bigtable.v2.IRequestStats): google.bigtable.v2.RequestStats; + + /** + * Encodes the specified RequestStats message. Does not implicitly {@link google.bigtable.v2.RequestStats.verify|verify} messages. + * @param message RequestStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRequestStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestStats message, length delimited. Does not implicitly {@link google.bigtable.v2.RequestStats.verify|verify} messages. + * @param message RequestStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRequestStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RequestStats; + + /** + * Decodes a RequestStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RequestStats; + + /** + * Verifies a RequestStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestStats + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RequestStats; + + /** + * Creates a plain object from a RequestStats message. Also converts values to other types if specified. + * @param message RequestStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RequestStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeatureFlags. */ + interface IFeatureFlags { + + /** FeatureFlags reverseScans */ + reverseScans?: (boolean|null); + + /** FeatureFlags mutateRowsRateLimit */ + mutateRowsRateLimit?: (boolean|null); + + /** FeatureFlags mutateRowsRateLimit2 */ + mutateRowsRateLimit2?: (boolean|null); + + /** FeatureFlags lastScannedRowResponses */ + lastScannedRowResponses?: (boolean|null); + + /** FeatureFlags routingCookie */ + routingCookie?: (boolean|null); + + /** FeatureFlags retryInfo */ + retryInfo?: (boolean|null); + + /** FeatureFlags clientSideMetricsEnabled */ + clientSideMetricsEnabled?: (boolean|null); + + /** FeatureFlags trafficDirectorEnabled */ + trafficDirectorEnabled?: (boolean|null); + + /** FeatureFlags directAccessRequested */ + directAccessRequested?: (boolean|null); + + /** FeatureFlags peerInfo */ + peerInfo?: (boolean|null); + } + + /** Represents a FeatureFlags. */ + class FeatureFlags implements IFeatureFlags { + + /** + * Constructs a new FeatureFlags. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IFeatureFlags); + + /** FeatureFlags reverseScans. */ + public reverseScans: boolean; + + /** FeatureFlags mutateRowsRateLimit. */ + public mutateRowsRateLimit: boolean; + + /** FeatureFlags mutateRowsRateLimit2. */ + public mutateRowsRateLimit2: boolean; + + /** FeatureFlags lastScannedRowResponses. */ + public lastScannedRowResponses: boolean; + + /** FeatureFlags routingCookie. */ + public routingCookie: boolean; + + /** FeatureFlags retryInfo. */ + public retryInfo: boolean; + + /** FeatureFlags clientSideMetricsEnabled. */ + public clientSideMetricsEnabled: boolean; + + /** FeatureFlags trafficDirectorEnabled. */ + public trafficDirectorEnabled: boolean; + + /** FeatureFlags directAccessRequested. */ + public directAccessRequested: boolean; + + /** FeatureFlags peerInfo. */ + public peerInfo: boolean; + + /** + * Creates a new FeatureFlags instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureFlags instance + */ + public static create(properties?: google.bigtable.v2.IFeatureFlags): google.bigtable.v2.FeatureFlags; + + /** + * Encodes the specified FeatureFlags message. Does not implicitly {@link google.bigtable.v2.FeatureFlags.verify|verify} messages. + * @param message FeatureFlags message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IFeatureFlags, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureFlags message, length delimited. Does not implicitly {@link google.bigtable.v2.FeatureFlags.verify|verify} messages. + * @param message FeatureFlags message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IFeatureFlags, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureFlags message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.FeatureFlags; + + /** + * Decodes a FeatureFlags message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.FeatureFlags; + + /** + * Verifies a FeatureFlags message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureFlags message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureFlags + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.FeatureFlags; + + /** + * Creates a plain object from a FeatureFlags message. Also converts values to other types if specified. + * @param message FeatureFlags + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.FeatureFlags, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureFlags to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureFlags + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PeerInfo. */ + interface IPeerInfo { + + /** PeerInfo googleFrontendId */ + googleFrontendId?: (number|Long|string|null); + + /** PeerInfo applicationFrontendId */ + applicationFrontendId?: (number|Long|string|null); + + /** PeerInfo applicationFrontendZone */ + applicationFrontendZone?: (string|null); + + /** PeerInfo applicationFrontendSubzone */ + applicationFrontendSubzone?: (string|null); + + /** PeerInfo transportType */ + transportType?: (google.bigtable.v2.PeerInfo.TransportType|keyof typeof google.bigtable.v2.PeerInfo.TransportType|null); + } + + /** Represents a PeerInfo. */ + class PeerInfo implements IPeerInfo { + + /** + * Constructs a new PeerInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IPeerInfo); + + /** PeerInfo googleFrontendId. */ + public googleFrontendId: (number|Long|string); + + /** PeerInfo applicationFrontendId. */ + public applicationFrontendId: (number|Long|string); + + /** PeerInfo applicationFrontendZone. */ + public applicationFrontendZone: string; + + /** PeerInfo applicationFrontendSubzone. */ + public applicationFrontendSubzone: string; + + /** PeerInfo transportType. */ + public transportType: (google.bigtable.v2.PeerInfo.TransportType|keyof typeof google.bigtable.v2.PeerInfo.TransportType); + + /** + * Creates a new PeerInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PeerInfo instance + */ + public static create(properties?: google.bigtable.v2.IPeerInfo): google.bigtable.v2.PeerInfo; + + /** + * Encodes the specified PeerInfo message. Does not implicitly {@link google.bigtable.v2.PeerInfo.verify|verify} messages. + * @param message PeerInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IPeerInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PeerInfo message, length delimited. Does not implicitly {@link google.bigtable.v2.PeerInfo.verify|verify} messages. + * @param message PeerInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IPeerInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PeerInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PeerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.PeerInfo; + + /** + * Decodes a PeerInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PeerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.PeerInfo; + + /** + * Verifies a PeerInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PeerInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PeerInfo + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.PeerInfo; + + /** + * Creates a plain object from a PeerInfo message. Also converts values to other types if specified. + * @param message PeerInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.PeerInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PeerInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PeerInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PeerInfo { + + /** TransportType enum. */ + enum TransportType { + TRANSPORT_TYPE_UNKNOWN = 0, + TRANSPORT_TYPE_EXTERNAL = 1, + TRANSPORT_TYPE_CLOUD_PATH = 2, + TRANSPORT_TYPE_DIRECT_ACCESS = 3, + TRANSPORT_TYPE_SESSION_UNKNOWN = 4, + TRANSPORT_TYPE_SESSION_EXTERNAL = 5, + TRANSPORT_TYPE_SESSION_CLOUD_PATH = 6, + TRANSPORT_TYPE_SESSION_DIRECT_ACCESS = 7 + } + } + + /** Properties of a ResponseParams. */ + interface IResponseParams { + + /** ResponseParams zoneId */ + zoneId?: (string|null); + + /** ResponseParams clusterId */ + clusterId?: (string|null); + + /** ResponseParams afeId */ + afeId?: (number|Long|string|null); + } + + /** Represents a ResponseParams. */ + class ResponseParams implements IResponseParams { + + /** + * Constructs a new ResponseParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IResponseParams); + + /** ResponseParams zoneId. */ + public zoneId?: (string|null); + + /** ResponseParams clusterId. */ + public clusterId?: (string|null); + + /** ResponseParams afeId. */ + public afeId?: (number|Long|string|null); + + /** + * Creates a new ResponseParams instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponseParams instance + */ + public static create(properties?: google.bigtable.v2.IResponseParams): google.bigtable.v2.ResponseParams; + + /** + * Encodes the specified ResponseParams message. Does not implicitly {@link google.bigtable.v2.ResponseParams.verify|verify} messages. + * @param message ResponseParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IResponseParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResponseParams message, length delimited. Does not implicitly {@link google.bigtable.v2.ResponseParams.verify|verify} messages. + * @param message ResponseParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IResponseParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResponseParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponseParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ResponseParams; + + /** + * Decodes a ResponseParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponseParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ResponseParams; + + /** + * Verifies a ResponseParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResponseParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResponseParams + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ResponseParams; + + /** + * Creates a plain object from a ResponseParams message. Also converts values to other types if specified. + * @param message ResponseParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ResponseParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResponseParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResponseParams + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + 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|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** 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 }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + 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 }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not 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.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload 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.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not 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.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload 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.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not 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.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload 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.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not 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.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload 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.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not 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.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload 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.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not 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.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload 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.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not 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.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload 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.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not 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.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload 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.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not 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.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload 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.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not 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.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload 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.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not 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.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload 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.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not 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.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload 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.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not 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.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload 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.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not 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.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload 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.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not 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.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload 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.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * 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 }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of 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 }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingRule. */ + interface IRoutingRule { + + /** RoutingRule routingParameters */ + routingParameters?: (google.api.IRoutingParameter[]|null); + } + + /** Represents a RoutingRule. */ + class RoutingRule implements IRoutingRule { + + /** + * Constructs a new RoutingRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRoutingRule); + + /** RoutingRule routingParameters. */ + public routingParameters: google.api.IRoutingParameter[]; + + /** + * Creates a new RoutingRule instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingRule instance + */ + public static create(properties?: google.api.IRoutingRule): google.api.RoutingRule; + + /** + * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @param message RoutingRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @param message RoutingRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingRule + * @throws {Error} If the payload is not 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.RoutingRule; + + /** + * Decodes a RoutingRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingRule + * @throws {Error} If the payload 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.RoutingRule; + + /** + * Verifies a RoutingRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingRule + */ + public static fromObject(object: { [k: string]: any }): google.api.RoutingRule; + + /** + * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. + * @param message RoutingRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RoutingRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingParameter. */ + interface IRoutingParameter { + + /** RoutingParameter field */ + field?: (string|null); + + /** RoutingParameter pathTemplate */ + pathTemplate?: (string|null); + } + + /** Represents a RoutingParameter. */ + class RoutingParameter implements IRoutingParameter { + + /** + * Constructs a new RoutingParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRoutingParameter); + + /** RoutingParameter field. */ + public field: string; + + /** RoutingParameter pathTemplate. */ + public pathTemplate: string; + + /** + * Creates a new RoutingParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingParameter instance + */ + public static create(properties?: google.api.IRoutingParameter): google.api.RoutingParameter; + + /** + * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @param message RoutingParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @param message RoutingParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingParameter + * @throws {Error} If the payload is not 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.RoutingParameter; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingParameter + * @throws {Error} If the payload 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.RoutingParameter; + + /** + * Verifies a RoutingParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingParameter + */ + public static fromObject(object: { [k: string]: any }): google.api.RoutingParameter; + + /** + * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. + * @param message RoutingParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RoutingParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** 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 optionDependency */ + optionDependency?: (string[]|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); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|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 optionDependency. */ + public optionDependency: string[]; + + /** 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; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * 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 }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + 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); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|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[]; + + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * 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 }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** 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 }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + 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 }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|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[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * 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 }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not 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.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload 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.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** 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_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** 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 }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + 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); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|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[]; + + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * 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 }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** 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 }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + 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 }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** 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 }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions 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 features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions 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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** 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 deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|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 deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** 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 }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not 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.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload 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.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not 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.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload 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.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** 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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|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 deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** 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 }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** 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); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.api.routing */ + ".google.api.routing"?: (google.api.IRoutingRule|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** 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 }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not 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.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload 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.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not 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.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload 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.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not 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.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload 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.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not 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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload 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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** 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 }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** 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); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|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; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @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 }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + 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 }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy 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 IAMPolicy 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): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|Buffer|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/handwritten/bigtable/protos/protos.js b/handwritten/bigtable/protos/protos.js new file mode 100644 index 00000000000..ec3958b8f53 --- /dev/null +++ b/handwritten/bigtable/protos/protos.js @@ -0,0 +1,103438 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_bigtable_protos || ($protobuf.roots._google_cloud_bigtable_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.bigtable = (function() { + + /** + * Namespace bigtable. + * @memberof google + * @namespace + */ + var bigtable = {}; + + bigtable.admin = (function() { + + /** + * Namespace admin. + * @memberof google.bigtable + * @namespace + */ + var admin = {}; + + admin.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.bigtable.admin + * @namespace + */ + var v2 = {}; + + v2.BigtableInstanceAdmin = (function() { + + /** + * Constructs a new BigtableInstanceAdmin service. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a BigtableInstanceAdmin + * @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 BigtableInstanceAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BigtableInstanceAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BigtableInstanceAdmin; + + /** + * Creates new BigtableInstanceAdmin service using the specified rpc implementation. + * @function create + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @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 {BigtableInstanceAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + BigtableInstanceAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createInstance}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.bigtable.admin.v2.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getInstance}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.bigtable.admin.v2.GetInstanceRequest, $root.google.bigtable.admin.v2.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listInstances}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.bigtable.admin.v2.ListInstancesRequest, $root.google.bigtable.admin.v2.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateInstance}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Instance} [response] Instance + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IInstance} request Instance message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.bigtable.admin.v2.Instance, $root.google.bigtable.admin.v2.Instance, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IInstance} request Instance message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|partialUpdateInstance}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef PartialUpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PartialUpdateInstance. + * @function partialUpdateInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest} request PartialUpdateInstanceRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.partialUpdateInstance = function partialUpdateInstance(request, callback) { + return this.rpcCall(partialUpdateInstance, $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PartialUpdateInstance" }); + + /** + * Calls PartialUpdateInstance. + * @function partialUpdateInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest} request PartialUpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteInstance}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.bigtable.admin.v2.DeleteInstanceRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createCluster}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef CreateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.createCluster = function createCluster(request, callback) { + return this.rpcCall(createCluster, $root.google.bigtable.admin.v2.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCluster" }); + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getCluster}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef GetClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Cluster} [response] Cluster + */ + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetClusterRequest} request GetClusterRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.getCluster = function getCluster(request, callback) { + return this.rpcCall(getCluster, $root.google.bigtable.admin.v2.GetClusterRequest, $root.google.bigtable.admin.v2.Cluster, request, callback); + }, "name", { value: "GetCluster" }); + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetClusterRequest} request GetClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listClusters}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef ListClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListClustersResponse} [response] ListClustersResponse + */ + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListClustersRequest} request ListClustersRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.listClusters = function listClusters(request, callback) { + return this.rpcCall(listClusters, $root.google.bigtable.admin.v2.ListClustersRequest, $root.google.bigtable.admin.v2.ListClustersResponse, request, callback); + }, "name", { value: "ListClusters" }); + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListClustersRequest} request ListClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateCluster}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef UpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICluster} request Cluster message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.updateCluster = function updateCluster(request, callback) { + return this.rpcCall(updateCluster, $root.google.bigtable.admin.v2.Cluster, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCluster" }); + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICluster} request Cluster message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|partialUpdateCluster}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef PartialUpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PartialUpdateCluster. + * @function partialUpdateCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IPartialUpdateClusterRequest} request PartialUpdateClusterRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.partialUpdateCluster = function partialUpdateCluster(request, callback) { + return this.rpcCall(partialUpdateCluster, $root.google.bigtable.admin.v2.PartialUpdateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PartialUpdateCluster" }); + + /** + * Calls PartialUpdateCluster. + * @function partialUpdateCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IPartialUpdateClusterRequest} request PartialUpdateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteCluster}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef DeleteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { + return this.rpcCall(deleteCluster, $root.google.bigtable.admin.v2.DeleteClusterRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCluster" }); + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createAppProfile}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef CreateAppProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.AppProfile} [response] AppProfile + */ + + /** + * Calls CreateAppProfile. + * @function createAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest} request CreateAppProfileRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.CreateAppProfileCallback} callback Node-style callback called with the error, if any, and AppProfile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.createAppProfile = function createAppProfile(request, callback) { + return this.rpcCall(createAppProfile, $root.google.bigtable.admin.v2.CreateAppProfileRequest, $root.google.bigtable.admin.v2.AppProfile, request, callback); + }, "name", { value: "CreateAppProfile" }); + + /** + * Calls CreateAppProfile. + * @function createAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest} request CreateAppProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getAppProfile}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef GetAppProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.AppProfile} [response] AppProfile + */ + + /** + * Calls GetAppProfile. + * @function getAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetAppProfileRequest} request GetAppProfileRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.GetAppProfileCallback} callback Node-style callback called with the error, if any, and AppProfile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.getAppProfile = function getAppProfile(request, callback) { + return this.rpcCall(getAppProfile, $root.google.bigtable.admin.v2.GetAppProfileRequest, $root.google.bigtable.admin.v2.AppProfile, request, callback); + }, "name", { value: "GetAppProfile" }); + + /** + * Calls GetAppProfile. + * @function getAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetAppProfileRequest} request GetAppProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listAppProfiles}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef ListAppProfilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListAppProfilesResponse} [response] ListAppProfilesResponse + */ + + /** + * Calls ListAppProfiles. + * @function listAppProfiles + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListAppProfilesRequest} request ListAppProfilesRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.ListAppProfilesCallback} callback Node-style callback called with the error, if any, and ListAppProfilesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.listAppProfiles = function listAppProfiles(request, callback) { + return this.rpcCall(listAppProfiles, $root.google.bigtable.admin.v2.ListAppProfilesRequest, $root.google.bigtable.admin.v2.ListAppProfilesResponse, request, callback); + }, "name", { value: "ListAppProfiles" }); + + /** + * Calls ListAppProfiles. + * @function listAppProfiles + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListAppProfilesRequest} request ListAppProfilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateAppProfile}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef UpdateAppProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateAppProfile. + * @function updateAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest} request UpdateAppProfileRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateAppProfileCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.updateAppProfile = function updateAppProfile(request, callback) { + return this.rpcCall(updateAppProfile, $root.google.bigtable.admin.v2.UpdateAppProfileRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateAppProfile" }); + + /** + * Calls UpdateAppProfile. + * @function updateAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest} request UpdateAppProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteAppProfile}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef DeleteAppProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAppProfile. + * @function deleteAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest} request DeleteAppProfileRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteAppProfileCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.deleteAppProfile = function deleteAppProfile(request, callback) { + return this.rpcCall(deleteAppProfile, $root.google.bigtable.admin.v2.DeleteAppProfileRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAppProfile" }); + + /** + * Calls DeleteAppProfile. + * @function deleteAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest} request DeleteAppProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getIamPolicy}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|setIamPolicy}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|testIamPermissions}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listHotTablets}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef ListHotTabletsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListHotTabletsResponse} [response] ListHotTabletsResponse + */ + + /** + * Calls ListHotTablets. + * @function listHotTablets + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListHotTabletsRequest} request ListHotTabletsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.ListHotTabletsCallback} callback Node-style callback called with the error, if any, and ListHotTabletsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.listHotTablets = function listHotTablets(request, callback) { + return this.rpcCall(listHotTablets, $root.google.bigtable.admin.v2.ListHotTabletsRequest, $root.google.bigtable.admin.v2.ListHotTabletsResponse, request, callback); + }, "name", { value: "ListHotTablets" }); + + /** + * Calls ListHotTablets. + * @function listHotTablets + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListHotTabletsRequest} request ListHotTabletsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createLogicalView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef CreateLogicalViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateLogicalView. + * @function createLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateLogicalViewRequest} request CreateLogicalViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.CreateLogicalViewCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.createLogicalView = function createLogicalView(request, callback) { + return this.rpcCall(createLogicalView, $root.google.bigtable.admin.v2.CreateLogicalViewRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateLogicalView" }); + + /** + * Calls CreateLogicalView. + * @function createLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateLogicalViewRequest} request CreateLogicalViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getLogicalView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef GetLogicalViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.LogicalView} [response] LogicalView + */ + + /** + * Calls GetLogicalView. + * @function getLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetLogicalViewRequest} request GetLogicalViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.GetLogicalViewCallback} callback Node-style callback called with the error, if any, and LogicalView + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.getLogicalView = function getLogicalView(request, callback) { + return this.rpcCall(getLogicalView, $root.google.bigtable.admin.v2.GetLogicalViewRequest, $root.google.bigtable.admin.v2.LogicalView, request, callback); + }, "name", { value: "GetLogicalView" }); + + /** + * Calls GetLogicalView. + * @function getLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetLogicalViewRequest} request GetLogicalViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listLogicalViews}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef ListLogicalViewsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListLogicalViewsResponse} [response] ListLogicalViewsResponse + */ + + /** + * Calls ListLogicalViews. + * @function listLogicalViews + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListLogicalViewsRequest} request ListLogicalViewsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.ListLogicalViewsCallback} callback Node-style callback called with the error, if any, and ListLogicalViewsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.listLogicalViews = function listLogicalViews(request, callback) { + return this.rpcCall(listLogicalViews, $root.google.bigtable.admin.v2.ListLogicalViewsRequest, $root.google.bigtable.admin.v2.ListLogicalViewsResponse, request, callback); + }, "name", { value: "ListLogicalViews" }); + + /** + * Calls ListLogicalViews. + * @function listLogicalViews + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListLogicalViewsRequest} request ListLogicalViewsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateLogicalView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef UpdateLogicalViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateLogicalView. + * @function updateLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateLogicalViewRequest} request UpdateLogicalViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateLogicalViewCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.updateLogicalView = function updateLogicalView(request, callback) { + return this.rpcCall(updateLogicalView, $root.google.bigtable.admin.v2.UpdateLogicalViewRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateLogicalView" }); + + /** + * Calls UpdateLogicalView. + * @function updateLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateLogicalViewRequest} request UpdateLogicalViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteLogicalView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef DeleteLogicalViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteLogicalView. + * @function deleteLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteLogicalViewRequest} request DeleteLogicalViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteLogicalViewCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.deleteLogicalView = function deleteLogicalView(request, callback) { + return this.rpcCall(deleteLogicalView, $root.google.bigtable.admin.v2.DeleteLogicalViewRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteLogicalView" }); + + /** + * Calls DeleteLogicalView. + * @function deleteLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteLogicalViewRequest} request DeleteLogicalViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createMaterializedView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef CreateMaterializedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateMaterializedView. + * @function createMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateMaterializedViewRequest} request CreateMaterializedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.CreateMaterializedViewCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.createMaterializedView = function createMaterializedView(request, callback) { + return this.rpcCall(createMaterializedView, $root.google.bigtable.admin.v2.CreateMaterializedViewRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateMaterializedView" }); + + /** + * Calls CreateMaterializedView. + * @function createMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateMaterializedViewRequest} request CreateMaterializedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getMaterializedView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef GetMaterializedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.MaterializedView} [response] MaterializedView + */ + + /** + * Calls GetMaterializedView. + * @function getMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetMaterializedViewRequest} request GetMaterializedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.GetMaterializedViewCallback} callback Node-style callback called with the error, if any, and MaterializedView + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.getMaterializedView = function getMaterializedView(request, callback) { + return this.rpcCall(getMaterializedView, $root.google.bigtable.admin.v2.GetMaterializedViewRequest, $root.google.bigtable.admin.v2.MaterializedView, request, callback); + }, "name", { value: "GetMaterializedView" }); + + /** + * Calls GetMaterializedView. + * @function getMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetMaterializedViewRequest} request GetMaterializedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listMaterializedViews}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef ListMaterializedViewsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListMaterializedViewsResponse} [response] ListMaterializedViewsResponse + */ + + /** + * Calls ListMaterializedViews. + * @function listMaterializedViews + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListMaterializedViewsRequest} request ListMaterializedViewsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.ListMaterializedViewsCallback} callback Node-style callback called with the error, if any, and ListMaterializedViewsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.listMaterializedViews = function listMaterializedViews(request, callback) { + return this.rpcCall(listMaterializedViews, $root.google.bigtable.admin.v2.ListMaterializedViewsRequest, $root.google.bigtable.admin.v2.ListMaterializedViewsResponse, request, callback); + }, "name", { value: "ListMaterializedViews" }); + + /** + * Calls ListMaterializedViews. + * @function listMaterializedViews + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListMaterializedViewsRequest} request ListMaterializedViewsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateMaterializedView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef UpdateMaterializedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateMaterializedView. + * @function updateMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewRequest} request UpdateMaterializedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateMaterializedViewCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.updateMaterializedView = function updateMaterializedView(request, callback) { + return this.rpcCall(updateMaterializedView, $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateMaterializedView" }); + + /** + * Calls UpdateMaterializedView. + * @function updateMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewRequest} request UpdateMaterializedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteMaterializedView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef DeleteMaterializedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteMaterializedView. + * @function deleteMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteMaterializedViewRequest} request DeleteMaterializedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteMaterializedViewCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.deleteMaterializedView = function deleteMaterializedView(request, callback) { + return this.rpcCall(deleteMaterializedView, $root.google.bigtable.admin.v2.DeleteMaterializedViewRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteMaterializedView" }); + + /** + * Calls DeleteMaterializedView. + * @function deleteMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteMaterializedViewRequest} request DeleteMaterializedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BigtableInstanceAdmin; + })(); + + v2.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.bigtable.admin.v2.IInstance|null} [instance] CreateInstanceRequest instance + * @property {Object.|null} [clusters] CreateInstanceRequest clusters + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + this.clusters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.bigtable.admin.v2.IInstance|null|undefined} instance + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * CreateInstanceRequest clusters. + * @member {Object.} clusters + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.clusters = $util.emptyObject; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.bigtable.admin.v2.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.clusters != null && Object.hasOwnProperty.call(message, "clusters")) + for (var keys = Object.keys(message.clusters), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.admin.v2.Cluster.encode(message.clusters[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateInstanceRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.bigtable.admin.v2.Instance.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.clusters === $util.emptyObject) + message.clusters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.clusters[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.bigtable.admin.v2.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!$util.isObject(message.clusters)) + return "clusters: object expected"; + var key = Object.keys(message.clusters); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.admin.v2.Cluster.verify(message.clusters[key[i]]); + if (error) + return "clusters." + error; + } + } + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateInstanceRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.bigtable.admin.v2.Instance.fromObject(object.instance); + } + if (object.clusters) { + if (typeof object.clusters !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateInstanceRequest.clusters: object expected"); + message.clusters = {}; + for (var keys = Object.keys(object.clusters), i = 0; i < keys.length; ++i) { + if (typeof object.clusters[keys[i]] !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateInstanceRequest.clusters: object expected"); + message.clusters[keys[i]] = $root.google.bigtable.admin.v2.Cluster.fromObject(object.clusters[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.clusters = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.bigtable.admin.v2.Instance.toObject(message.instance, options); + var keys2; + if (message.clusters && (keys2 = Object.keys(message.clusters)).length) { + object.clusters = {}; + for (var j = 0; j < keys2.length; ++j) + object.clusters[keys2[j]] = $root.google.bigtable.admin.v2.Cluster.toObject(message.clusters[keys2[j]], options); + } + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v2.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetInstanceRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {google.bigtable.admin.v2.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.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 GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v2.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {string|null} [pageToken] ListInstancesRequest pageToken + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.bigtable.admin.v2.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {google.bigtable.admin.v2.IListInstancesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {google.bigtable.admin.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {google.bigtable.admin.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListInstancesRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {google.bigtable.admin.v2.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v2.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {Array.|null} [failedLocations] ListInstancesResponse failedLocations + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.bigtable.admin.v2.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + this.failedLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse failedLocations. + * @member {Array.} failedLocations + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.failedLocations = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {google.bigtable.admin.v2.IListInstancesResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {google.bigtable.admin.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.bigtable.admin.v2.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.failedLocations != null && message.failedLocations.length) + for (var i = 0; i < message.failedLocations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.failedLocations[i]); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {google.bigtable.admin.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.bigtable.admin.v2.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.failedLocations && message.failedLocations.length)) + message.failedLocations = []; + message.failedLocations.push(reader.string()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.bigtable.admin.v2.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.failedLocations != null && message.hasOwnProperty("failedLocations")) { + if (!Array.isArray(message.failedLocations)) + return "failedLocations: array expected"; + for (var i = 0; i < message.failedLocations.length; ++i) + if (!$util.isString(message.failedLocations[i])) + return "failedLocations: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListInstancesResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.bigtable.admin.v2.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.bigtable.admin.v2.Instance.fromObject(object.instances[i]); + } + } + if (object.failedLocations) { + if (!Array.isArray(object.failedLocations)) + throw TypeError(".google.bigtable.admin.v2.ListInstancesResponse.failedLocations: array expected"); + message.failedLocations = []; + for (var i = 0; i < object.failedLocations.length; ++i) + message.failedLocations[i] = String(object.failedLocations[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {google.bigtable.admin.v2.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.failedLocations = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.bigtable.admin.v2.Instance.toObject(message.instances[j], options); + } + if (message.failedLocations && message.failedLocations.length) { + object.failedLocations = []; + for (var j = 0; j < message.failedLocations.length; ++j) + object.failedLocations[j] = message.failedLocations[j]; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v2.PartialUpdateInstanceRequest = (function() { + + /** + * Properties of a PartialUpdateInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @interface IPartialUpdateInstanceRequest + * @property {google.bigtable.admin.v2.IInstance|null} [instance] PartialUpdateInstanceRequest instance + * @property {google.protobuf.IFieldMask|null} [updateMask] PartialUpdateInstanceRequest updateMask + */ + + /** + * Constructs a new PartialUpdateInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a PartialUpdateInstanceRequest. + * @implements IPartialUpdateInstanceRequest + * @constructor + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest=} [properties] Properties to set + */ + function PartialUpdateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartialUpdateInstanceRequest instance. + * @member {google.bigtable.admin.v2.IInstance|null|undefined} instance + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @instance + */ + PartialUpdateInstanceRequest.prototype.instance = null; + + /** + * PartialUpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @instance + */ + PartialUpdateInstanceRequest.prototype.updateMask = null; + + /** + * Creates a new PartialUpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.PartialUpdateInstanceRequest} PartialUpdateInstanceRequest instance + */ + PartialUpdateInstanceRequest.create = function create(properties) { + return new PartialUpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified PartialUpdateInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest} message PartialUpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialUpdateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.bigtable.admin.v2.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartialUpdateInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest} message PartialUpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialUpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartialUpdateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.PartialUpdateInstanceRequest} PartialUpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialUpdateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instance = $root.google.bigtable.admin.v2.Instance.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartialUpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.PartialUpdateInstanceRequest} PartialUpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialUpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartialUpdateInstanceRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartialUpdateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.bigtable.admin.v2.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a PartialUpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.PartialUpdateInstanceRequest} PartialUpdateInstanceRequest + */ + PartialUpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest) + return object; + var message = new $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest(); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.bigtable.admin.v2.Instance.fromObject(object.instance); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a PartialUpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.PartialUpdateInstanceRequest} message PartialUpdateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartialUpdateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = null; + object.updateMask = null; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.bigtable.admin.v2.Instance.toObject(message.instance, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this PartialUpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + PartialUpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartialUpdateInstanceRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartialUpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.PartialUpdateInstanceRequest"; + }; + + return PartialUpdateInstanceRequest; + })(); + + v2.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteInstanceRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {google.bigtable.admin.v2.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.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 DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v2.CreateClusterRequest = (function() { + + /** + * Properties of a CreateClusterRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateClusterRequest + * @property {string|null} [parent] CreateClusterRequest parent + * @property {string|null} [clusterId] CreateClusterRequest clusterId + * @property {google.bigtable.admin.v2.ICluster|null} [cluster] CreateClusterRequest cluster + */ + + /** + * Constructs a new CreateClusterRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateClusterRequest=} [properties] Properties to set + */ + function CreateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClusterRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.parent = ""; + + /** + * CreateClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.clusterId = ""; + + /** + * CreateClusterRequest cluster. + * @member {google.bigtable.admin.v2.ICluster|null|undefined} cluster + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.cluster = null; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {google.bigtable.admin.v2.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest instance + */ + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); + }; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {google.bigtable.admin.v2.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.bigtable.admin.v2.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {google.bigtable.admin.v2.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClusterRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.bigtable.admin.v2.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + return null; + }; + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest + */ + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateClusterRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterRequest.cluster: object expected"); + message.cluster = $root.google.bigtable.admin.v2.Cluster.fromObject(object.cluster); + } + return message; + }; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {google.bigtable.admin.v2.CreateClusterRequest} message CreateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.bigtable.admin.v2.Cluster.toObject(message.cluster, options); + return object; + }; + + /** + * Converts this CreateClusterRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClusterRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateClusterRequest"; + }; + + return CreateClusterRequest; + })(); + + v2.GetClusterRequest = (function() { + + /** + * Properties of a GetClusterRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetClusterRequest + * @property {string|null} [name] GetClusterRequest name + */ + + /** + * Constructs a new GetClusterRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetClusterRequest=} [properties] Properties to set + */ + function GetClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetClusterRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.name = ""; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {google.bigtable.admin.v2.IGetClusterRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest instance + */ + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); + }; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {google.bigtable.admin.v2.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {google.bigtable.admin.v2.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetClusterRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetClusterRequest.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 GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest + */ + GetClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetClusterRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetClusterRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {google.bigtable.admin.v2.GetClusterRequest} message GetClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetClusterRequest.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 GetClusterRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @instance + * @returns {Object.} JSON object + */ + GetClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetClusterRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetClusterRequest"; + }; + + return GetClusterRequest; + })(); + + v2.ListClustersRequest = (function() { + + /** + * Properties of a ListClustersRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListClustersRequest + * @property {string|null} [parent] ListClustersRequest parent + * @property {string|null} [pageToken] ListClustersRequest pageToken + */ + + /** + * Constructs a new ListClustersRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest + * @constructor + * @param {google.bigtable.admin.v2.IListClustersRequest=} [properties] Properties to set + */ + function ListClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.parent = ""; + + /** + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageToken = ""; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {google.bigtable.admin.v2.IListClustersRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest instance + */ + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); + }; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {google.bigtable.admin.v2.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {google.bigtable.admin.v2.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListClustersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest + */ + ListClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListClustersRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListClustersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {google.bigtable.admin.v2.ListClustersRequest} message ListClustersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListClustersRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListClustersRequest"; + }; + + return ListClustersRequest; + })(); + + v2.ListClustersResponse = (function() { + + /** + * Properties of a ListClustersResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {Array.|null} [failedLocations] ListClustersResponse failedLocations + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken + */ + + /** + * Constructs a new ListClustersResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse + * @constructor + * @param {google.bigtable.admin.v2.IListClustersResponse=} [properties] Properties to set + */ + function ListClustersResponse(properties) { + this.clusters = []; + this.failedLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.clusters = $util.emptyArray; + + /** + * ListClustersResponse failedLocations. + * @member {Array.} failedLocations + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.failedLocations = $util.emptyArray; + + /** + * ListClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {google.bigtable.admin.v2.IListClustersResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse instance + */ + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); + }; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {google.bigtable.admin.v2.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.bigtable.admin.v2.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.failedLocations != null && message.failedLocations.length) + for (var i = 0; i < message.failedLocations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.failedLocations[i]); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {google.bigtable.admin.v2.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.failedLocations && message.failedLocations.length)) + message.failedLocations = []; + message.failedLocations.push(reader.string()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.bigtable.admin.v2.Cluster.verify(message.clusters[i]); + if (error) + return "clusters." + error; + } + } + if (message.failedLocations != null && message.hasOwnProperty("failedLocations")) { + if (!Array.isArray(message.failedLocations)) + return "failedLocations: array expected"; + for (var i = 0; i < message.failedLocations.length; ++i) + if (!$util.isString(message.failedLocations[i])) + return "failedLocations: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse + */ + ListClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListClustersResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListClustersResponse(); + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.bigtable.admin.v2.ListClustersResponse.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (typeof object.clusters[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListClustersResponse.clusters: object expected"); + message.clusters[i] = $root.google.bigtable.admin.v2.Cluster.fromObject(object.clusters[i]); + } + } + if (object.failedLocations) { + if (!Array.isArray(object.failedLocations)) + throw TypeError(".google.bigtable.admin.v2.ListClustersResponse.failedLocations: array expected"); + message.failedLocations = []; + for (var i = 0; i < object.failedLocations.length; ++i) + message.failedLocations[i] = String(object.failedLocations[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {google.bigtable.admin.v2.ListClustersResponse} message ListClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clusters = []; + object.failedLocations = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.bigtable.admin.v2.Cluster.toObject(message.clusters[j], options); + } + if (message.failedLocations && message.failedLocations.length) { + object.failedLocations = []; + for (var j = 0; j < message.failedLocations.length; ++j) + object.failedLocations[j] = message.failedLocations[j]; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListClustersResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @instance + * @returns {Object.} JSON object + */ + ListClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListClustersResponse"; + }; + + return ListClustersResponse; + })(); + + v2.DeleteClusterRequest = (function() { + + /** + * Properties of a DeleteClusterRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteClusterRequest + * @property {string|null} [name] DeleteClusterRequest name + */ + + /** + * Constructs a new DeleteClusterRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteClusterRequest=} [properties] Properties to set + */ + function DeleteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteClusterRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.name = ""; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest instance + */ + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); + }; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteClusterRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteClusterRequest.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 DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest + */ + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteClusterRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {google.bigtable.admin.v2.DeleteClusterRequest} message DeleteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteClusterRequest.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 DeleteClusterRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteClusterRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteClusterRequest"; + }; + + return DeleteClusterRequest; + })(); + + v2.CreateInstanceMetadata = (function() { + + /** + * Properties of a CreateInstanceMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateInstanceMetadata + * @property {google.bigtable.admin.v2.ICreateInstanceRequest|null} [originalRequest] CreateInstanceMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] CreateInstanceMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] CreateInstanceMetadata finishTime + */ + + /** + * Constructs a new CreateInstanceMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateInstanceMetadata. + * @implements ICreateInstanceMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateInstanceMetadata=} [properties] Properties to set + */ + function CreateInstanceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateInstanceRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.originalRequest = null; + + /** + * CreateInstanceMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.requestTime = null; + + /** + * CreateInstanceMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.finishTime = null; + + /** + * Creates a new CreateInstanceMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateInstanceMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateInstanceMetadata} CreateInstanceMetadata instance + */ + CreateInstanceMetadata.create = function create(properties) { + return new CreateInstanceMetadata(properties); + }; + + /** + * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.CreateInstanceRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateInstanceMetadata} CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateInstanceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.CreateInstanceRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateInstanceMetadata} CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateInstanceRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateInstanceMetadata} CreateInstanceMetadata + */ + CreateInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateInstanceMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateInstanceMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateInstanceMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.CreateInstanceRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateInstanceMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateInstanceMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.CreateInstanceMetadata} message CreateInstanceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.CreateInstanceRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this CreateInstanceMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateInstanceMetadata"; + }; + + return CreateInstanceMetadata; + })(); + + v2.UpdateInstanceMetadata = (function() { + + /** + * Properties of an UpdateInstanceMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateInstanceMetadata + * @property {google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null} [originalRequest] UpdateInstanceMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] UpdateInstanceMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] UpdateInstanceMetadata finishTime + */ + + /** + * Constructs a new UpdateInstanceMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateInstanceMetadata. + * @implements IUpdateInstanceMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata=} [properties] Properties to set + */ + function UpdateInstanceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceMetadata originalRequest. + * @member {google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.originalRequest = null; + + /** + * UpdateInstanceMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.requestTime = null; + + /** + * UpdateInstanceMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.finishTime = null; + + /** + * Creates a new UpdateInstanceMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata instance + */ + UpdateInstanceMetadata.create = function create(properties) { + return new UpdateInstanceMetadata(properties); + }; + + /** + * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateInstanceMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateInstanceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateInstanceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata + */ + UpdateInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateInstanceMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateInstanceMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateInstanceMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateInstanceMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateInstanceMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateInstanceMetadata} message UpdateInstanceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this UpdateInstanceMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateInstanceMetadata"; + }; + + return UpdateInstanceMetadata; + })(); + + v2.CreateClusterMetadata = (function() { + + /** + * Properties of a CreateClusterMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateClusterMetadata + * @property {google.bigtable.admin.v2.ICreateClusterRequest|null} [originalRequest] CreateClusterMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] CreateClusterMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] CreateClusterMetadata finishTime + * @property {Object.|null} [tables] CreateClusterMetadata tables + */ + + /** + * Constructs a new CreateClusterMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateClusterMetadata. + * @implements ICreateClusterMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateClusterMetadata=} [properties] Properties to set + */ + function CreateClusterMetadata(properties) { + this.tables = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClusterMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateClusterRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @instance + */ + CreateClusterMetadata.prototype.originalRequest = null; + + /** + * CreateClusterMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @instance + */ + CreateClusterMetadata.prototype.requestTime = null; + + /** + * CreateClusterMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @instance + */ + CreateClusterMetadata.prototype.finishTime = null; + + /** + * CreateClusterMetadata tables. + * @member {Object.} tables + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @instance + */ + CreateClusterMetadata.prototype.tables = $util.emptyObject; + + /** + * Creates a new CreateClusterMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateClusterMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata instance + */ + CreateClusterMetadata.create = function create(properties) { + return new CreateClusterMetadata(properties); + }; + + /** + * Encodes the specified CreateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateClusterMetadata} message CreateClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.CreateClusterRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tables != null && Object.hasOwnProperty.call(message, "tables")) + for (var keys = Object.keys(message.tables), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.encode(message.tables[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CreateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateClusterMetadata} message CreateClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClusterMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateClusterMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.CreateClusterRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.tables === $util.emptyObject) + message.tables = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tables[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClusterMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClusterMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClusterMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateClusterRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + if (message.tables != null && message.hasOwnProperty("tables")) { + if (!$util.isObject(message.tables)) + return "tables: object expected"; + var key = Object.keys(message.tables); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify(message.tables[key[i]]); + if (error) + return "tables." + error; + } + } + return null; + }; + + /** + * Creates a CreateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata + */ + CreateClusterMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateClusterMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateClusterMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.CreateClusterRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + if (object.tables) { + if (typeof object.tables !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.tables: object expected"); + message.tables = {}; + for (var keys = Object.keys(object.tables), i = 0; i < keys.length; ++i) { + if (typeof object.tables[keys[i]] !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.tables: object expected"); + message.tables[keys[i]] = $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.fromObject(object.tables[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateClusterMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata} message CreateClusterMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClusterMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.tables = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.CreateClusterRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + var keys2; + if (message.tables && (keys2 = Object.keys(message.tables)).length) { + object.tables = {}; + for (var j = 0; j < keys2.length; ++j) + object.tables[keys2[j]] = $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.toObject(message.tables[keys2[j]], options); + } + return object; + }; + + /** + * Converts this CreateClusterMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateClusterMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClusterMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClusterMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateClusterMetadata"; + }; + + CreateClusterMetadata.TableProgress = (function() { + + /** + * Properties of a TableProgress. + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @interface ITableProgress + * @property {number|Long|null} [estimatedSizeBytes] TableProgress estimatedSizeBytes + * @property {number|Long|null} [estimatedCopiedBytes] TableProgress estimatedCopiedBytes + * @property {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State|null} [state] TableProgress state + */ + + /** + * Constructs a new TableProgress. + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @classdesc Represents a TableProgress. + * @implements ITableProgress + * @constructor + * @param {google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress=} [properties] Properties to set + */ + function TableProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableProgress estimatedSizeBytes. + * @member {number|Long} estimatedSizeBytes + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @instance + */ + TableProgress.prototype.estimatedSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableProgress estimatedCopiedBytes. + * @member {number|Long} estimatedCopiedBytes + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @instance + */ + TableProgress.prototype.estimatedCopiedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableProgress state. + * @member {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State} state + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @instance + */ + TableProgress.prototype.state = 0; + + /** + * Creates a new TableProgress instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} TableProgress instance + */ + TableProgress.create = function create(properties) { + return new TableProgress(properties); + }; + + /** + * Encodes the specified TableProgress message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress} message TableProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.estimatedSizeBytes != null && Object.hasOwnProperty.call(message, "estimatedSizeBytes")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.estimatedSizeBytes); + if (message.estimatedCopiedBytes != null && Object.hasOwnProperty.call(message, "estimatedCopiedBytes")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.estimatedCopiedBytes); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + return writer; + }; + + /** + * Encodes the specified TableProgress message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress} message TableProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableProgress message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} TableProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableProgress.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.estimatedSizeBytes = reader.int64(); + break; + } + case 3: { + message.estimatedCopiedBytes = reader.int64(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} TableProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableProgress message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.estimatedSizeBytes != null && message.hasOwnProperty("estimatedSizeBytes")) + if (!$util.isInteger(message.estimatedSizeBytes) && !(message.estimatedSizeBytes && $util.isInteger(message.estimatedSizeBytes.low) && $util.isInteger(message.estimatedSizeBytes.high))) + return "estimatedSizeBytes: integer|Long expected"; + if (message.estimatedCopiedBytes != null && message.hasOwnProperty("estimatedCopiedBytes")) + if (!$util.isInteger(message.estimatedCopiedBytes) && !(message.estimatedCopiedBytes && $util.isInteger(message.estimatedCopiedBytes.low) && $util.isInteger(message.estimatedCopiedBytes.high))) + return "estimatedCopiedBytes: integer|Long expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a TableProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} TableProgress + */ + TableProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) + return object; + var message = new $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress(); + if (object.estimatedSizeBytes != null) + if ($util.Long) + (message.estimatedSizeBytes = $util.Long.fromValue(object.estimatedSizeBytes)).unsigned = false; + else if (typeof object.estimatedSizeBytes === "string") + message.estimatedSizeBytes = parseInt(object.estimatedSizeBytes, 10); + else if (typeof object.estimatedSizeBytes === "number") + message.estimatedSizeBytes = object.estimatedSizeBytes; + else if (typeof object.estimatedSizeBytes === "object") + message.estimatedSizeBytes = new $util.LongBits(object.estimatedSizeBytes.low >>> 0, object.estimatedSizeBytes.high >>> 0).toNumber(); + if (object.estimatedCopiedBytes != null) + if ($util.Long) + (message.estimatedCopiedBytes = $util.Long.fromValue(object.estimatedCopiedBytes)).unsigned = false; + else if (typeof object.estimatedCopiedBytes === "string") + message.estimatedCopiedBytes = parseInt(object.estimatedCopiedBytes, 10); + else if (typeof object.estimatedCopiedBytes === "number") + message.estimatedCopiedBytes = object.estimatedCopiedBytes; + else if (typeof object.estimatedCopiedBytes === "object") + message.estimatedCopiedBytes = new $util.LongBits(object.estimatedCopiedBytes.low >>> 0, object.estimatedCopiedBytes.high >>> 0).toNumber(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "COPYING": + case 2: + message.state = 2; + break; + case "COMPLETED": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a TableProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} message TableProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableProgress.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.estimatedSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.estimatedSizeBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.estimatedCopiedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.estimatedCopiedBytes = options.longs === String ? "0" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.estimatedSizeBytes != null && message.hasOwnProperty("estimatedSizeBytes")) + if (typeof message.estimatedSizeBytes === "number") + object.estimatedSizeBytes = options.longs === String ? String(message.estimatedSizeBytes) : message.estimatedSizeBytes; + else + object.estimatedSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedSizeBytes) : options.longs === Number ? new $util.LongBits(message.estimatedSizeBytes.low >>> 0, message.estimatedSizeBytes.high >>> 0).toNumber() : message.estimatedSizeBytes; + if (message.estimatedCopiedBytes != null && message.hasOwnProperty("estimatedCopiedBytes")) + if (typeof message.estimatedCopiedBytes === "number") + object.estimatedCopiedBytes = options.longs === String ? String(message.estimatedCopiedBytes) : message.estimatedCopiedBytes; + else + object.estimatedCopiedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedCopiedBytes) : options.longs === Number ? new $util.LongBits(message.estimatedCopiedBytes.low >>> 0, message.estimatedCopiedBytes.high >>> 0).toNumber() : message.estimatedCopiedBytes; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State[message.state] === undefined ? message.state : $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State[message.state] : message.state; + return object; + }; + + /** + * Converts this TableProgress to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @instance + * @returns {Object.} JSON object + */ + TableProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableProgress + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateClusterMetadata.TableProgress"; + }; + + /** + * State enum. + * @name google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} COPYING=2 COPYING value + * @property {number} COMPLETED=3 COMPLETED value + * @property {number} CANCELLED=4 CANCELLED value + */ + TableProgress.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "COPYING"] = 2; + values[valuesById[3] = "COMPLETED"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + return values; + })(); + + return TableProgress; + })(); + + return CreateClusterMetadata; + })(); + + v2.UpdateClusterMetadata = (function() { + + /** + * Properties of an UpdateClusterMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateClusterMetadata + * @property {google.bigtable.admin.v2.ICluster|null} [originalRequest] UpdateClusterMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] UpdateClusterMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] UpdateClusterMetadata finishTime + */ + + /** + * Constructs a new UpdateClusterMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateClusterMetadata. + * @implements IUpdateClusterMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateClusterMetadata=} [properties] Properties to set + */ + function UpdateClusterMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateClusterMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICluster|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @instance + */ + UpdateClusterMetadata.prototype.originalRequest = null; + + /** + * UpdateClusterMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @instance + */ + UpdateClusterMetadata.prototype.requestTime = null; + + /** + * UpdateClusterMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @instance + */ + UpdateClusterMetadata.prototype.finishTime = null; + + /** + * Creates a new UpdateClusterMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateClusterMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata instance + */ + UpdateClusterMetadata.create = function create(properties) { + return new UpdateClusterMetadata(properties); + }; + + /** + * Encodes the specified UpdateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateClusterMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateClusterMetadata} message UpdateClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.Cluster.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateClusterMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateClusterMetadata} message UpdateClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateClusterMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateClusterMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateClusterMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateClusterMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateClusterMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.Cluster.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates an UpdateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata + */ + UpdateClusterMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateClusterMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateClusterMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateClusterMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.Cluster.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateClusterMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateClusterMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateClusterMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateClusterMetadata} message UpdateClusterMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateClusterMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.Cluster.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this UpdateClusterMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateClusterMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateClusterMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateClusterMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateClusterMetadata"; + }; + + return UpdateClusterMetadata; + })(); + + v2.PartialUpdateClusterMetadata = (function() { + + /** + * Properties of a PartialUpdateClusterMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IPartialUpdateClusterMetadata + * @property {google.protobuf.ITimestamp|null} [requestTime] PartialUpdateClusterMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] PartialUpdateClusterMetadata finishTime + * @property {google.bigtable.admin.v2.IPartialUpdateClusterRequest|null} [originalRequest] PartialUpdateClusterMetadata originalRequest + */ + + /** + * Constructs a new PartialUpdateClusterMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a PartialUpdateClusterMetadata. + * @implements IPartialUpdateClusterMetadata + * @constructor + * @param {google.bigtable.admin.v2.IPartialUpdateClusterMetadata=} [properties] Properties to set + */ + function PartialUpdateClusterMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartialUpdateClusterMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @instance + */ + PartialUpdateClusterMetadata.prototype.requestTime = null; + + /** + * PartialUpdateClusterMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @instance + */ + PartialUpdateClusterMetadata.prototype.finishTime = null; + + /** + * PartialUpdateClusterMetadata originalRequest. + * @member {google.bigtable.admin.v2.IPartialUpdateClusterRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @instance + */ + PartialUpdateClusterMetadata.prototype.originalRequest = null; + + /** + * Creates a new PartialUpdateClusterMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateClusterMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.PartialUpdateClusterMetadata} PartialUpdateClusterMetadata instance + */ + PartialUpdateClusterMetadata.create = function create(properties) { + return new PartialUpdateClusterMetadata(properties); + }; + + /** + * Encodes the specified PartialUpdateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateClusterMetadata} message PartialUpdateClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialUpdateClusterMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.PartialUpdateClusterRequest.encode(message.originalRequest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartialUpdateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateClusterMetadata} message PartialUpdateClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialUpdateClusterMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartialUpdateClusterMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.PartialUpdateClusterMetadata} PartialUpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialUpdateClusterMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.PartialUpdateClusterMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.originalRequest = $root.google.bigtable.admin.v2.PartialUpdateClusterRequest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartialUpdateClusterMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.PartialUpdateClusterMetadata} PartialUpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialUpdateClusterMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartialUpdateClusterMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartialUpdateClusterMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.PartialUpdateClusterRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + return null; + }; + + /** + * Creates a PartialUpdateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.PartialUpdateClusterMetadata} PartialUpdateClusterMetadata + */ + PartialUpdateClusterMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.PartialUpdateClusterMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.PartialUpdateClusterMetadata(); + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateClusterMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateClusterMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateClusterMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.PartialUpdateClusterRequest.fromObject(object.originalRequest); + } + return message; + }; + + /** + * Creates a plain object from a PartialUpdateClusterMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.PartialUpdateClusterMetadata} message PartialUpdateClusterMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartialUpdateClusterMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requestTime = null; + object.finishTime = null; + object.originalRequest = null; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.PartialUpdateClusterRequest.toObject(message.originalRequest, options); + return object; + }; + + /** + * Converts this PartialUpdateClusterMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @instance + * @returns {Object.} JSON object + */ + PartialUpdateClusterMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartialUpdateClusterMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartialUpdateClusterMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.PartialUpdateClusterMetadata"; + }; + + return PartialUpdateClusterMetadata; + })(); + + v2.PartialUpdateClusterRequest = (function() { + + /** + * Properties of a PartialUpdateClusterRequest. + * @memberof google.bigtable.admin.v2 + * @interface IPartialUpdateClusterRequest + * @property {google.bigtable.admin.v2.ICluster|null} [cluster] PartialUpdateClusterRequest cluster + * @property {google.protobuf.IFieldMask|null} [updateMask] PartialUpdateClusterRequest updateMask + */ + + /** + * Constructs a new PartialUpdateClusterRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a PartialUpdateClusterRequest. + * @implements IPartialUpdateClusterRequest + * @constructor + * @param {google.bigtable.admin.v2.IPartialUpdateClusterRequest=} [properties] Properties to set + */ + function PartialUpdateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartialUpdateClusterRequest cluster. + * @member {google.bigtable.admin.v2.ICluster|null|undefined} cluster + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @instance + */ + PartialUpdateClusterRequest.prototype.cluster = null; + + /** + * PartialUpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @instance + */ + PartialUpdateClusterRequest.prototype.updateMask = null; + + /** + * Creates a new PartialUpdateClusterRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateClusterRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.PartialUpdateClusterRequest} PartialUpdateClusterRequest instance + */ + PartialUpdateClusterRequest.create = function create(properties) { + return new PartialUpdateClusterRequest(properties); + }; + + /** + * Encodes the specified PartialUpdateClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateClusterRequest} message PartialUpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialUpdateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.bigtable.admin.v2.Cluster.encode(message.cluster, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartialUpdateClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateClusterRequest} message PartialUpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialUpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartialUpdateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.PartialUpdateClusterRequest} PartialUpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialUpdateClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.PartialUpdateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cluster = $root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartialUpdateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.PartialUpdateClusterRequest} PartialUpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialUpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartialUpdateClusterRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartialUpdateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.bigtable.admin.v2.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a PartialUpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.PartialUpdateClusterRequest} PartialUpdateClusterRequest + */ + PartialUpdateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.PartialUpdateClusterRequest) + return object; + var message = new $root.google.bigtable.admin.v2.PartialUpdateClusterRequest(); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateClusterRequest.cluster: object expected"); + message.cluster = $root.google.bigtable.admin.v2.Cluster.fromObject(object.cluster); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a PartialUpdateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {google.bigtable.admin.v2.PartialUpdateClusterRequest} message PartialUpdateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartialUpdateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cluster = null; + object.updateMask = null; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.bigtable.admin.v2.Cluster.toObject(message.cluster, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this PartialUpdateClusterRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + PartialUpdateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartialUpdateClusterRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartialUpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.PartialUpdateClusterRequest"; + }; + + return PartialUpdateClusterRequest; + })(); + + v2.CreateAppProfileRequest = (function() { + + /** + * Properties of a CreateAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateAppProfileRequest + * @property {string|null} [parent] CreateAppProfileRequest parent + * @property {string|null} [appProfileId] CreateAppProfileRequest appProfileId + * @property {google.bigtable.admin.v2.IAppProfile|null} [appProfile] CreateAppProfileRequest appProfile + * @property {boolean|null} [ignoreWarnings] CreateAppProfileRequest ignoreWarnings + */ + + /** + * Constructs a new CreateAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateAppProfileRequest. + * @implements ICreateAppProfileRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest=} [properties] Properties to set + */ + function CreateAppProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAppProfileRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @instance + */ + CreateAppProfileRequest.prototype.parent = ""; + + /** + * CreateAppProfileRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @instance + */ + CreateAppProfileRequest.prototype.appProfileId = ""; + + /** + * CreateAppProfileRequest appProfile. + * @member {google.bigtable.admin.v2.IAppProfile|null|undefined} appProfile + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @instance + */ + CreateAppProfileRequest.prototype.appProfile = null; + + /** + * CreateAppProfileRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @instance + */ + CreateAppProfileRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new CreateAppProfileRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest instance + */ + CreateAppProfileRequest.create = function create(properties) { + return new CreateAppProfileRequest(properties); + }; + + /** + * Encodes the specified CreateAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateAppProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest} message CreateAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + if (message.appProfile != null && Object.hasOwnProperty.call(message, "appProfile")) + $root.google.bigtable.admin.v2.AppProfile.encode(message.appProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified CreateAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAppProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest} message CreateAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAppProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppProfileRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateAppProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + case 3: { + message.appProfile = $root.google.bigtable.admin.v2.AppProfile.decode(reader, reader.uint32()); + break; + } + case 4: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAppProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAppProfileRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAppProfileRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.appProfile != null && message.hasOwnProperty("appProfile")) { + var error = $root.google.bigtable.admin.v2.AppProfile.verify(message.appProfile); + if (error) + return "appProfile." + error; + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates a CreateAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest + */ + CreateAppProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateAppProfileRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateAppProfileRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.appProfile != null) { + if (typeof object.appProfile !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateAppProfileRequest.appProfile: object expected"); + message.appProfile = $root.google.bigtable.admin.v2.AppProfile.fromObject(object.appProfile); + } + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from a CreateAppProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.CreateAppProfileRequest} message CreateAppProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAppProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.appProfileId = ""; + object.appProfile = null; + object.ignoreWarnings = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.appProfile != null && message.hasOwnProperty("appProfile")) + object.appProfile = $root.google.bigtable.admin.v2.AppProfile.toObject(message.appProfile, options); + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this CreateAppProfileRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAppProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAppProfileRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAppProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateAppProfileRequest"; + }; + + return CreateAppProfileRequest; + })(); + + v2.GetAppProfileRequest = (function() { + + /** + * Properties of a GetAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetAppProfileRequest + * @property {string|null} [name] GetAppProfileRequest name + */ + + /** + * Constructs a new GetAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetAppProfileRequest. + * @implements IGetAppProfileRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetAppProfileRequest=} [properties] Properties to set + */ + function GetAppProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAppProfileRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @instance + */ + GetAppProfileRequest.prototype.name = ""; + + /** + * Creates a new GetAppProfileRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IGetAppProfileRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetAppProfileRequest} GetAppProfileRequest instance + */ + GetAppProfileRequest.create = function create(properties) { + return new GetAppProfileRequest(properties); + }; + + /** + * Encodes the specified GetAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetAppProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IGetAppProfileRequest} message GetAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetAppProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IGetAppProfileRequest} message GetAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAppProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetAppProfileRequest} GetAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppProfileRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetAppProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAppProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetAppProfileRequest} GetAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAppProfileRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAppProfileRequest.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 GetAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetAppProfileRequest} GetAppProfileRequest + */ + GetAppProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetAppProfileRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetAppProfileRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAppProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.GetAppProfileRequest} message GetAppProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAppProfileRequest.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 GetAppProfileRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @instance + * @returns {Object.} JSON object + */ + GetAppProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAppProfileRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAppProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetAppProfileRequest"; + }; + + return GetAppProfileRequest; + })(); + + v2.ListAppProfilesRequest = (function() { + + /** + * Properties of a ListAppProfilesRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListAppProfilesRequest + * @property {string|null} [parent] ListAppProfilesRequest parent + * @property {number|null} [pageSize] ListAppProfilesRequest pageSize + * @property {string|null} [pageToken] ListAppProfilesRequest pageToken + */ + + /** + * Constructs a new ListAppProfilesRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListAppProfilesRequest. + * @implements IListAppProfilesRequest + * @constructor + * @param {google.bigtable.admin.v2.IListAppProfilesRequest=} [properties] Properties to set + */ + function ListAppProfilesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppProfilesRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @instance + */ + ListAppProfilesRequest.prototype.parent = ""; + + /** + * ListAppProfilesRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @instance + */ + ListAppProfilesRequest.prototype.pageSize = 0; + + /** + * ListAppProfilesRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @instance + */ + ListAppProfilesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAppProfilesRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {google.bigtable.admin.v2.IListAppProfilesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest instance + */ + ListAppProfilesRequest.create = function create(properties) { + return new ListAppProfilesRequest(properties); + }; + + /** + * Encodes the specified ListAppProfilesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {google.bigtable.admin.v2.IListAppProfilesRequest} message ListAppProfilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppProfilesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListAppProfilesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {google.bigtable.admin.v2.IListAppProfilesRequest} message ListAppProfilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppProfilesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppProfilesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppProfilesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListAppProfilesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppProfilesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppProfilesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppProfilesRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppProfilesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAppProfilesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest + */ + ListAppProfilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListAppProfilesRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListAppProfilesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAppProfilesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {google.bigtable.admin.v2.ListAppProfilesRequest} message ListAppProfilesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppProfilesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListAppProfilesRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAppProfilesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppProfilesRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppProfilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListAppProfilesRequest"; + }; + + return ListAppProfilesRequest; + })(); + + v2.ListAppProfilesResponse = (function() { + + /** + * Properties of a ListAppProfilesResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListAppProfilesResponse + * @property {Array.|null} [appProfiles] ListAppProfilesResponse appProfiles + * @property {string|null} [nextPageToken] ListAppProfilesResponse nextPageToken + * @property {Array.|null} [failedLocations] ListAppProfilesResponse failedLocations + */ + + /** + * Constructs a new ListAppProfilesResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListAppProfilesResponse. + * @implements IListAppProfilesResponse + * @constructor + * @param {google.bigtable.admin.v2.IListAppProfilesResponse=} [properties] Properties to set + */ + function ListAppProfilesResponse(properties) { + this.appProfiles = []; + this.failedLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppProfilesResponse appProfiles. + * @member {Array.} appProfiles + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @instance + */ + ListAppProfilesResponse.prototype.appProfiles = $util.emptyArray; + + /** + * ListAppProfilesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @instance + */ + ListAppProfilesResponse.prototype.nextPageToken = ""; + + /** + * ListAppProfilesResponse failedLocations. + * @member {Array.} failedLocations + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @instance + */ + ListAppProfilesResponse.prototype.failedLocations = $util.emptyArray; + + /** + * Creates a new ListAppProfilesResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {google.bigtable.admin.v2.IListAppProfilesResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse instance + */ + ListAppProfilesResponse.create = function create(properties) { + return new ListAppProfilesResponse(properties); + }; + + /** + * Encodes the specified ListAppProfilesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {google.bigtable.admin.v2.IListAppProfilesResponse} message ListAppProfilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppProfilesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appProfiles != null && message.appProfiles.length) + for (var i = 0; i < message.appProfiles.length; ++i) + $root.google.bigtable.admin.v2.AppProfile.encode(message.appProfiles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.failedLocations != null && message.failedLocations.length) + for (var i = 0; i < message.failedLocations.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.failedLocations[i]); + return writer; + }; + + /** + * Encodes the specified ListAppProfilesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {google.bigtable.admin.v2.IListAppProfilesResponse} message ListAppProfilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppProfilesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppProfilesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppProfilesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListAppProfilesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.appProfiles && message.appProfiles.length)) + message.appProfiles = []; + message.appProfiles.push($root.google.bigtable.admin.v2.AppProfile.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.failedLocations && message.failedLocations.length)) + message.failedLocations = []; + message.failedLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppProfilesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppProfilesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppProfilesResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppProfilesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appProfiles != null && message.hasOwnProperty("appProfiles")) { + if (!Array.isArray(message.appProfiles)) + return "appProfiles: array expected"; + for (var i = 0; i < message.appProfiles.length; ++i) { + var error = $root.google.bigtable.admin.v2.AppProfile.verify(message.appProfiles[i]); + if (error) + return "appProfiles." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.failedLocations != null && message.hasOwnProperty("failedLocations")) { + if (!Array.isArray(message.failedLocations)) + return "failedLocations: array expected"; + for (var i = 0; i < message.failedLocations.length; ++i) + if (!$util.isString(message.failedLocations[i])) + return "failedLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a ListAppProfilesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse + */ + ListAppProfilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListAppProfilesResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListAppProfilesResponse(); + if (object.appProfiles) { + if (!Array.isArray(object.appProfiles)) + throw TypeError(".google.bigtable.admin.v2.ListAppProfilesResponse.appProfiles: array expected"); + message.appProfiles = []; + for (var i = 0; i < object.appProfiles.length; ++i) { + if (typeof object.appProfiles[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListAppProfilesResponse.appProfiles: object expected"); + message.appProfiles[i] = $root.google.bigtable.admin.v2.AppProfile.fromObject(object.appProfiles[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.failedLocations) { + if (!Array.isArray(object.failedLocations)) + throw TypeError(".google.bigtable.admin.v2.ListAppProfilesResponse.failedLocations: array expected"); + message.failedLocations = []; + for (var i = 0; i < object.failedLocations.length; ++i) + message.failedLocations[i] = String(object.failedLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListAppProfilesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {google.bigtable.admin.v2.ListAppProfilesResponse} message ListAppProfilesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppProfilesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.appProfiles = []; + object.failedLocations = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.appProfiles && message.appProfiles.length) { + object.appProfiles = []; + for (var j = 0; j < message.appProfiles.length; ++j) + object.appProfiles[j] = $root.google.bigtable.admin.v2.AppProfile.toObject(message.appProfiles[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.failedLocations && message.failedLocations.length) { + object.failedLocations = []; + for (var j = 0; j < message.failedLocations.length; ++j) + object.failedLocations[j] = message.failedLocations[j]; + } + return object; + }; + + /** + * Converts this ListAppProfilesResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @instance + * @returns {Object.} JSON object + */ + ListAppProfilesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppProfilesResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppProfilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListAppProfilesResponse"; + }; + + return ListAppProfilesResponse; + })(); + + v2.UpdateAppProfileRequest = (function() { + + /** + * Properties of an UpdateAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateAppProfileRequest + * @property {google.bigtable.admin.v2.IAppProfile|null} [appProfile] UpdateAppProfileRequest appProfile + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAppProfileRequest updateMask + * @property {boolean|null} [ignoreWarnings] UpdateAppProfileRequest ignoreWarnings + */ + + /** + * Constructs a new UpdateAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateAppProfileRequest. + * @implements IUpdateAppProfileRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest=} [properties] Properties to set + */ + function UpdateAppProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAppProfileRequest appProfile. + * @member {google.bigtable.admin.v2.IAppProfile|null|undefined} appProfile + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @instance + */ + UpdateAppProfileRequest.prototype.appProfile = null; + + /** + * UpdateAppProfileRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @instance + */ + UpdateAppProfileRequest.prototype.updateMask = null; + + /** + * UpdateAppProfileRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @instance + */ + UpdateAppProfileRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new UpdateAppProfileRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest instance + */ + UpdateAppProfileRequest.create = function create(properties) { + return new UpdateAppProfileRequest(properties); + }; + + /** + * Encodes the specified UpdateAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest} message UpdateAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appProfile != null && Object.hasOwnProperty.call(message, "appProfile")) + $root.google.bigtable.admin.v2.AppProfile.encode(message.appProfile, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified UpdateAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest} message UpdateAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAppProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppProfileRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateAppProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.appProfile = $root.google.bigtable.admin.v2.AppProfile.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAppProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAppProfileRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAppProfileRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appProfile != null && message.hasOwnProperty("appProfile")) { + var error = $root.google.bigtable.admin.v2.AppProfile.verify(message.appProfile); + if (error) + return "appProfile." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates an UpdateAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest + */ + UpdateAppProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateAppProfileRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateAppProfileRequest(); + if (object.appProfile != null) { + if (typeof object.appProfile !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAppProfileRequest.appProfile: object expected"); + message.appProfile = $root.google.bigtable.admin.v2.AppProfile.fromObject(object.appProfile); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAppProfileRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from an UpdateAppProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.UpdateAppProfileRequest} message UpdateAppProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAppProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.appProfile = null; + object.updateMask = null; + object.ignoreWarnings = false; + } + if (message.appProfile != null && message.hasOwnProperty("appProfile")) + object.appProfile = $root.google.bigtable.admin.v2.AppProfile.toObject(message.appProfile, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this UpdateAppProfileRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAppProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAppProfileRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAppProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateAppProfileRequest"; + }; + + return UpdateAppProfileRequest; + })(); + + v2.DeleteAppProfileRequest = (function() { + + /** + * Properties of a DeleteAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteAppProfileRequest + * @property {string|null} [name] DeleteAppProfileRequest name + * @property {boolean|null} [ignoreWarnings] DeleteAppProfileRequest ignoreWarnings + */ + + /** + * Constructs a new DeleteAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteAppProfileRequest. + * @implements IDeleteAppProfileRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest=} [properties] Properties to set + */ + function DeleteAppProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAppProfileRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @instance + */ + DeleteAppProfileRequest.prototype.name = ""; + + /** + * DeleteAppProfileRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @instance + */ + DeleteAppProfileRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new DeleteAppProfileRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteAppProfileRequest} DeleteAppProfileRequest instance + */ + DeleteAppProfileRequest.create = function create(properties) { + return new DeleteAppProfileRequest(properties); + }; + + /** + * Encodes the specified DeleteAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteAppProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest} message DeleteAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified DeleteAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteAppProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest} message DeleteAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAppProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteAppProfileRequest} DeleteAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppProfileRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteAppProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAppProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteAppProfileRequest} DeleteAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAppProfileRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAppProfileRequest.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.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates a DeleteAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteAppProfileRequest} DeleteAppProfileRequest + */ + DeleteAppProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteAppProfileRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteAppProfileRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from a DeleteAppProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.DeleteAppProfileRequest} message DeleteAppProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAppProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ignoreWarnings = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this DeleteAppProfileRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAppProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAppProfileRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAppProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteAppProfileRequest"; + }; + + return DeleteAppProfileRequest; + })(); + + v2.UpdateAppProfileMetadata = (function() { + + /** + * Properties of an UpdateAppProfileMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateAppProfileMetadata + */ + + /** + * Constructs a new UpdateAppProfileMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateAppProfileMetadata. + * @implements IUpdateAppProfileMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateAppProfileMetadata=} [properties] Properties to set + */ + function UpdateAppProfileMetadata(properties) { + if (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 UpdateAppProfileMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateAppProfileMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateAppProfileMetadata} UpdateAppProfileMetadata instance + */ + UpdateAppProfileMetadata.create = function create(properties) { + return new UpdateAppProfileMetadata(properties); + }; + + /** + * Encodes the specified UpdateAppProfileMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateAppProfileMetadata} message UpdateAppProfileMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppProfileMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateAppProfileMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateAppProfileMetadata} message UpdateAppProfileMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppProfileMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAppProfileMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateAppProfileMetadata} UpdateAppProfileMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppProfileMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateAppProfileMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAppProfileMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateAppProfileMetadata} UpdateAppProfileMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppProfileMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAppProfileMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAppProfileMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UpdateAppProfileMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateAppProfileMetadata} UpdateAppProfileMetadata + */ + UpdateAppProfileMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateAppProfileMetadata) + return object; + return new $root.google.bigtable.admin.v2.UpdateAppProfileMetadata(); + }; + + /** + * Creates a plain object from an UpdateAppProfileMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateAppProfileMetadata} message UpdateAppProfileMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAppProfileMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateAppProfileMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateAppProfileMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAppProfileMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAppProfileMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateAppProfileMetadata"; + }; + + return UpdateAppProfileMetadata; + })(); + + v2.ListHotTabletsRequest = (function() { + + /** + * Properties of a ListHotTabletsRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListHotTabletsRequest + * @property {string|null} [parent] ListHotTabletsRequest parent + * @property {google.protobuf.ITimestamp|null} [startTime] ListHotTabletsRequest startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ListHotTabletsRequest endTime + * @property {number|null} [pageSize] ListHotTabletsRequest pageSize + * @property {string|null} [pageToken] ListHotTabletsRequest pageToken + */ + + /** + * Constructs a new ListHotTabletsRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListHotTabletsRequest. + * @implements IListHotTabletsRequest + * @constructor + * @param {google.bigtable.admin.v2.IListHotTabletsRequest=} [properties] Properties to set + */ + function ListHotTabletsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListHotTabletsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @instance + */ + ListHotTabletsRequest.prototype.parent = ""; + + /** + * ListHotTabletsRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @instance + */ + ListHotTabletsRequest.prototype.startTime = null; + + /** + * ListHotTabletsRequest endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @instance + */ + ListHotTabletsRequest.prototype.endTime = null; + + /** + * ListHotTabletsRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @instance + */ + ListHotTabletsRequest.prototype.pageSize = 0; + + /** + * ListHotTabletsRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @instance + */ + ListHotTabletsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListHotTabletsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {google.bigtable.admin.v2.IListHotTabletsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListHotTabletsRequest} ListHotTabletsRequest instance + */ + ListHotTabletsRequest.create = function create(properties) { + return new ListHotTabletsRequest(properties); + }; + + /** + * Encodes the specified ListHotTabletsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {google.bigtable.admin.v2.IListHotTabletsRequest} message ListHotTabletsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHotTabletsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListHotTabletsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {google.bigtable.admin.v2.IListHotTabletsRequest} message ListHotTabletsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHotTabletsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHotTabletsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListHotTabletsRequest} ListHotTabletsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHotTabletsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListHotTabletsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListHotTabletsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListHotTabletsRequest} ListHotTabletsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHotTabletsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHotTabletsRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHotTabletsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListHotTabletsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListHotTabletsRequest} ListHotTabletsRequest + */ + ListHotTabletsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListHotTabletsRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListHotTabletsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.ListHotTabletsRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.ListHotTabletsRequest.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListHotTabletsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {google.bigtable.admin.v2.ListHotTabletsRequest} message ListHotTabletsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHotTabletsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.startTime = null; + object.endTime = null; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListHotTabletsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @instance + * @returns {Object.} JSON object + */ + ListHotTabletsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListHotTabletsRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListHotTabletsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListHotTabletsRequest"; + }; + + return ListHotTabletsRequest; + })(); + + v2.ListHotTabletsResponse = (function() { + + /** + * Properties of a ListHotTabletsResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListHotTabletsResponse + * @property {Array.|null} [hotTablets] ListHotTabletsResponse hotTablets + * @property {string|null} [nextPageToken] ListHotTabletsResponse nextPageToken + */ + + /** + * Constructs a new ListHotTabletsResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListHotTabletsResponse. + * @implements IListHotTabletsResponse + * @constructor + * @param {google.bigtable.admin.v2.IListHotTabletsResponse=} [properties] Properties to set + */ + function ListHotTabletsResponse(properties) { + this.hotTablets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListHotTabletsResponse hotTablets. + * @member {Array.} hotTablets + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @instance + */ + ListHotTabletsResponse.prototype.hotTablets = $util.emptyArray; + + /** + * ListHotTabletsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @instance + */ + ListHotTabletsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListHotTabletsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {google.bigtable.admin.v2.IListHotTabletsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListHotTabletsResponse} ListHotTabletsResponse instance + */ + ListHotTabletsResponse.create = function create(properties) { + return new ListHotTabletsResponse(properties); + }; + + /** + * Encodes the specified ListHotTabletsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {google.bigtable.admin.v2.IListHotTabletsResponse} message ListHotTabletsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHotTabletsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hotTablets != null && message.hotTablets.length) + for (var i = 0; i < message.hotTablets.length; ++i) + $root.google.bigtable.admin.v2.HotTablet.encode(message.hotTablets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListHotTabletsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {google.bigtable.admin.v2.IListHotTabletsResponse} message ListHotTabletsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHotTabletsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHotTabletsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListHotTabletsResponse} ListHotTabletsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHotTabletsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListHotTabletsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.hotTablets && message.hotTablets.length)) + message.hotTablets = []; + message.hotTablets.push($root.google.bigtable.admin.v2.HotTablet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListHotTabletsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListHotTabletsResponse} ListHotTabletsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHotTabletsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHotTabletsResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHotTabletsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hotTablets != null && message.hasOwnProperty("hotTablets")) { + if (!Array.isArray(message.hotTablets)) + return "hotTablets: array expected"; + for (var i = 0; i < message.hotTablets.length; ++i) { + var error = $root.google.bigtable.admin.v2.HotTablet.verify(message.hotTablets[i]); + if (error) + return "hotTablets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListHotTabletsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListHotTabletsResponse} ListHotTabletsResponse + */ + ListHotTabletsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListHotTabletsResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListHotTabletsResponse(); + if (object.hotTablets) { + if (!Array.isArray(object.hotTablets)) + throw TypeError(".google.bigtable.admin.v2.ListHotTabletsResponse.hotTablets: array expected"); + message.hotTablets = []; + for (var i = 0; i < object.hotTablets.length; ++i) { + if (typeof object.hotTablets[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListHotTabletsResponse.hotTablets: object expected"); + message.hotTablets[i] = $root.google.bigtable.admin.v2.HotTablet.fromObject(object.hotTablets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListHotTabletsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {google.bigtable.admin.v2.ListHotTabletsResponse} message ListHotTabletsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHotTabletsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.hotTablets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.hotTablets && message.hotTablets.length) { + object.hotTablets = []; + for (var j = 0; j < message.hotTablets.length; ++j) + object.hotTablets[j] = $root.google.bigtable.admin.v2.HotTablet.toObject(message.hotTablets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListHotTabletsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @instance + * @returns {Object.} JSON object + */ + ListHotTabletsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListHotTabletsResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListHotTabletsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListHotTabletsResponse"; + }; + + return ListHotTabletsResponse; + })(); + + v2.CreateLogicalViewRequest = (function() { + + /** + * Properties of a CreateLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateLogicalViewRequest + * @property {string|null} [parent] CreateLogicalViewRequest parent + * @property {string|null} [logicalViewId] CreateLogicalViewRequest logicalViewId + * @property {google.bigtable.admin.v2.ILogicalView|null} [logicalView] CreateLogicalViewRequest logicalView + */ + + /** + * Constructs a new CreateLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateLogicalViewRequest. + * @implements ICreateLogicalViewRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateLogicalViewRequest=} [properties] Properties to set + */ + function CreateLogicalViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateLogicalViewRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @instance + */ + CreateLogicalViewRequest.prototype.parent = ""; + + /** + * CreateLogicalViewRequest logicalViewId. + * @member {string} logicalViewId + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @instance + */ + CreateLogicalViewRequest.prototype.logicalViewId = ""; + + /** + * CreateLogicalViewRequest logicalView. + * @member {google.bigtable.admin.v2.ILogicalView|null|undefined} logicalView + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @instance + */ + CreateLogicalViewRequest.prototype.logicalView = null; + + /** + * Creates a new CreateLogicalViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateLogicalViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateLogicalViewRequest} CreateLogicalViewRequest instance + */ + CreateLogicalViewRequest.create = function create(properties) { + return new CreateLogicalViewRequest(properties); + }; + + /** + * Encodes the specified CreateLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateLogicalViewRequest} message CreateLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLogicalViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.logicalViewId != null && Object.hasOwnProperty.call(message, "logicalViewId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.logicalViewId); + if (message.logicalView != null && Object.hasOwnProperty.call(message, "logicalView")) + $root.google.bigtable.admin.v2.LogicalView.encode(message.logicalView, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateLogicalViewRequest} message CreateLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLogicalViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateLogicalViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateLogicalViewRequest} CreateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLogicalViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateLogicalViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.logicalViewId = reader.string(); + break; + } + case 3: { + message.logicalView = $root.google.bigtable.admin.v2.LogicalView.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateLogicalViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateLogicalViewRequest} CreateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLogicalViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateLogicalViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateLogicalViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.logicalViewId != null && message.hasOwnProperty("logicalViewId")) + if (!$util.isString(message.logicalViewId)) + return "logicalViewId: string expected"; + if (message.logicalView != null && message.hasOwnProperty("logicalView")) { + var error = $root.google.bigtable.admin.v2.LogicalView.verify(message.logicalView); + if (error) + return "logicalView." + error; + } + return null; + }; + + /** + * Creates a CreateLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateLogicalViewRequest} CreateLogicalViewRequest + */ + CreateLogicalViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateLogicalViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateLogicalViewRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.logicalViewId != null) + message.logicalViewId = String(object.logicalViewId); + if (object.logicalView != null) { + if (typeof object.logicalView !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateLogicalViewRequest.logicalView: object expected"); + message.logicalView = $root.google.bigtable.admin.v2.LogicalView.fromObject(object.logicalView); + } + return message; + }; + + /** + * Creates a plain object from a CreateLogicalViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.CreateLogicalViewRequest} message CreateLogicalViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateLogicalViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.logicalViewId = ""; + object.logicalView = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.logicalViewId != null && message.hasOwnProperty("logicalViewId")) + object.logicalViewId = message.logicalViewId; + if (message.logicalView != null && message.hasOwnProperty("logicalView")) + object.logicalView = $root.google.bigtable.admin.v2.LogicalView.toObject(message.logicalView, options); + return object; + }; + + /** + * Converts this CreateLogicalViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @instance + * @returns {Object.} JSON object + */ + CreateLogicalViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateLogicalViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateLogicalViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateLogicalViewRequest"; + }; + + return CreateLogicalViewRequest; + })(); + + v2.CreateLogicalViewMetadata = (function() { + + /** + * Properties of a CreateLogicalViewMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateLogicalViewMetadata + * @property {google.bigtable.admin.v2.ICreateLogicalViewRequest|null} [originalRequest] CreateLogicalViewMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [startTime] CreateLogicalViewMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] CreateLogicalViewMetadata endTime + */ + + /** + * Constructs a new CreateLogicalViewMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateLogicalViewMetadata. + * @implements ICreateLogicalViewMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateLogicalViewMetadata=} [properties] Properties to set + */ + function CreateLogicalViewMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateLogicalViewMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateLogicalViewRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @instance + */ + CreateLogicalViewMetadata.prototype.originalRequest = null; + + /** + * CreateLogicalViewMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @instance + */ + CreateLogicalViewMetadata.prototype.startTime = null; + + /** + * CreateLogicalViewMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @instance + */ + CreateLogicalViewMetadata.prototype.endTime = null; + + /** + * Creates a new CreateLogicalViewMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateLogicalViewMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateLogicalViewMetadata} CreateLogicalViewMetadata instance + */ + CreateLogicalViewMetadata.create = function create(properties) { + return new CreateLogicalViewMetadata(properties); + }; + + /** + * Encodes the specified CreateLogicalViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateLogicalViewMetadata} message CreateLogicalViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLogicalViewMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.CreateLogicalViewRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateLogicalViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateLogicalViewMetadata} message CreateLogicalViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLogicalViewMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateLogicalViewMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateLogicalViewMetadata} CreateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLogicalViewMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateLogicalViewMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.CreateLogicalViewRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateLogicalViewMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateLogicalViewMetadata} CreateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLogicalViewMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateLogicalViewMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateLogicalViewMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateLogicalViewRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a CreateLogicalViewMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateLogicalViewMetadata} CreateLogicalViewMetadata + */ + CreateLogicalViewMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateLogicalViewMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateLogicalViewMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateLogicalViewMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.CreateLogicalViewRequest.fromObject(object.originalRequest); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateLogicalViewMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateLogicalViewMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateLogicalViewMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.CreateLogicalViewMetadata} message CreateLogicalViewMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateLogicalViewMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.startTime = null; + object.endTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.CreateLogicalViewRequest.toObject(message.originalRequest, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this CreateLogicalViewMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateLogicalViewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateLogicalViewMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateLogicalViewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateLogicalViewMetadata"; + }; + + return CreateLogicalViewMetadata; + })(); + + v2.GetLogicalViewRequest = (function() { + + /** + * Properties of a GetLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetLogicalViewRequest + * @property {string|null} [name] GetLogicalViewRequest name + */ + + /** + * Constructs a new GetLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetLogicalViewRequest. + * @implements IGetLogicalViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetLogicalViewRequest=} [properties] Properties to set + */ + function GetLogicalViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetLogicalViewRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @instance + */ + GetLogicalViewRequest.prototype.name = ""; + + /** + * Creates a new GetLogicalViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetLogicalViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetLogicalViewRequest} GetLogicalViewRequest instance + */ + GetLogicalViewRequest.create = function create(properties) { + return new GetLogicalViewRequest(properties); + }; + + /** + * Encodes the specified GetLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetLogicalViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetLogicalViewRequest} message GetLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLogicalViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetLogicalViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetLogicalViewRequest} message GetLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLogicalViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLogicalViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetLogicalViewRequest} GetLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLogicalViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetLogicalViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetLogicalViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetLogicalViewRequest} GetLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLogicalViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLogicalViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLogicalViewRequest.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 GetLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetLogicalViewRequest} GetLogicalViewRequest + */ + GetLogicalViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetLogicalViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetLogicalViewRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetLogicalViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.GetLogicalViewRequest} message GetLogicalViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLogicalViewRequest.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 GetLogicalViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @instance + * @returns {Object.} JSON object + */ + GetLogicalViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetLogicalViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetLogicalViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetLogicalViewRequest"; + }; + + return GetLogicalViewRequest; + })(); + + v2.ListLogicalViewsRequest = (function() { + + /** + * Properties of a ListLogicalViewsRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListLogicalViewsRequest + * @property {string|null} [parent] ListLogicalViewsRequest parent + * @property {number|null} [pageSize] ListLogicalViewsRequest pageSize + * @property {string|null} [pageToken] ListLogicalViewsRequest pageToken + */ + + /** + * Constructs a new ListLogicalViewsRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListLogicalViewsRequest. + * @implements IListLogicalViewsRequest + * @constructor + * @param {google.bigtable.admin.v2.IListLogicalViewsRequest=} [properties] Properties to set + */ + function ListLogicalViewsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLogicalViewsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @instance + */ + ListLogicalViewsRequest.prototype.parent = ""; + + /** + * ListLogicalViewsRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @instance + */ + ListLogicalViewsRequest.prototype.pageSize = 0; + + /** + * ListLogicalViewsRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @instance + */ + ListLogicalViewsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListLogicalViewsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListLogicalViewsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListLogicalViewsRequest} ListLogicalViewsRequest instance + */ + ListLogicalViewsRequest.create = function create(properties) { + return new ListLogicalViewsRequest(properties); + }; + + /** + * Encodes the specified ListLogicalViewsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListLogicalViewsRequest} message ListLogicalViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogicalViewsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListLogicalViewsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListLogicalViewsRequest} message ListLogicalViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogicalViewsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLogicalViewsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListLogicalViewsRequest} ListLogicalViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogicalViewsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListLogicalViewsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLogicalViewsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListLogicalViewsRequest} ListLogicalViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogicalViewsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLogicalViewsRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLogicalViewsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListLogicalViewsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListLogicalViewsRequest} ListLogicalViewsRequest + */ + ListLogicalViewsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListLogicalViewsRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListLogicalViewsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListLogicalViewsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {google.bigtable.admin.v2.ListLogicalViewsRequest} message ListLogicalViewsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLogicalViewsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListLogicalViewsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @instance + * @returns {Object.} JSON object + */ + ListLogicalViewsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLogicalViewsRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLogicalViewsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListLogicalViewsRequest"; + }; + + return ListLogicalViewsRequest; + })(); + + v2.ListLogicalViewsResponse = (function() { + + /** + * Properties of a ListLogicalViewsResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListLogicalViewsResponse + * @property {Array.|null} [logicalViews] ListLogicalViewsResponse logicalViews + * @property {string|null} [nextPageToken] ListLogicalViewsResponse nextPageToken + */ + + /** + * Constructs a new ListLogicalViewsResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListLogicalViewsResponse. + * @implements IListLogicalViewsResponse + * @constructor + * @param {google.bigtable.admin.v2.IListLogicalViewsResponse=} [properties] Properties to set + */ + function ListLogicalViewsResponse(properties) { + this.logicalViews = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLogicalViewsResponse logicalViews. + * @member {Array.} logicalViews + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @instance + */ + ListLogicalViewsResponse.prototype.logicalViews = $util.emptyArray; + + /** + * ListLogicalViewsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @instance + */ + ListLogicalViewsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListLogicalViewsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListLogicalViewsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListLogicalViewsResponse} ListLogicalViewsResponse instance + */ + ListLogicalViewsResponse.create = function create(properties) { + return new ListLogicalViewsResponse(properties); + }; + + /** + * Encodes the specified ListLogicalViewsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListLogicalViewsResponse} message ListLogicalViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogicalViewsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logicalViews != null && message.logicalViews.length) + for (var i = 0; i < message.logicalViews.length; ++i) + $root.google.bigtable.admin.v2.LogicalView.encode(message.logicalViews[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListLogicalViewsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListLogicalViewsResponse} message ListLogicalViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogicalViewsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLogicalViewsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListLogicalViewsResponse} ListLogicalViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogicalViewsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListLogicalViewsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.logicalViews && message.logicalViews.length)) + message.logicalViews = []; + message.logicalViews.push($root.google.bigtable.admin.v2.LogicalView.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLogicalViewsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListLogicalViewsResponse} ListLogicalViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogicalViewsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLogicalViewsResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLogicalViewsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logicalViews != null && message.hasOwnProperty("logicalViews")) { + if (!Array.isArray(message.logicalViews)) + return "logicalViews: array expected"; + for (var i = 0; i < message.logicalViews.length; ++i) { + var error = $root.google.bigtable.admin.v2.LogicalView.verify(message.logicalViews[i]); + if (error) + return "logicalViews." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListLogicalViewsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListLogicalViewsResponse} ListLogicalViewsResponse + */ + ListLogicalViewsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListLogicalViewsResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListLogicalViewsResponse(); + if (object.logicalViews) { + if (!Array.isArray(object.logicalViews)) + throw TypeError(".google.bigtable.admin.v2.ListLogicalViewsResponse.logicalViews: array expected"); + message.logicalViews = []; + for (var i = 0; i < object.logicalViews.length; ++i) { + if (typeof object.logicalViews[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListLogicalViewsResponse.logicalViews: object expected"); + message.logicalViews[i] = $root.google.bigtable.admin.v2.LogicalView.fromObject(object.logicalViews[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListLogicalViewsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {google.bigtable.admin.v2.ListLogicalViewsResponse} message ListLogicalViewsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLogicalViewsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.logicalViews = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.logicalViews && message.logicalViews.length) { + object.logicalViews = []; + for (var j = 0; j < message.logicalViews.length; ++j) + object.logicalViews[j] = $root.google.bigtable.admin.v2.LogicalView.toObject(message.logicalViews[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListLogicalViewsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @instance + * @returns {Object.} JSON object + */ + ListLogicalViewsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLogicalViewsResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLogicalViewsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListLogicalViewsResponse"; + }; + + return ListLogicalViewsResponse; + })(); + + v2.UpdateLogicalViewRequest = (function() { + + /** + * Properties of an UpdateLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateLogicalViewRequest + * @property {google.bigtable.admin.v2.ILogicalView|null} [logicalView] UpdateLogicalViewRequest logicalView + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateLogicalViewRequest updateMask + */ + + /** + * Constructs a new UpdateLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateLogicalViewRequest. + * @implements IUpdateLogicalViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateLogicalViewRequest=} [properties] Properties to set + */ + function UpdateLogicalViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateLogicalViewRequest logicalView. + * @member {google.bigtable.admin.v2.ILogicalView|null|undefined} logicalView + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @instance + */ + UpdateLogicalViewRequest.prototype.logicalView = null; + + /** + * UpdateLogicalViewRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @instance + */ + UpdateLogicalViewRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateLogicalViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateLogicalViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateLogicalViewRequest} UpdateLogicalViewRequest instance + */ + UpdateLogicalViewRequest.create = function create(properties) { + return new UpdateLogicalViewRequest(properties); + }; + + /** + * Encodes the specified UpdateLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateLogicalViewRequest} message UpdateLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateLogicalViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logicalView != null && Object.hasOwnProperty.call(message, "logicalView")) + $root.google.bigtable.admin.v2.LogicalView.encode(message.logicalView, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateLogicalViewRequest} message UpdateLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateLogicalViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateLogicalViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateLogicalViewRequest} UpdateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateLogicalViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateLogicalViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logicalView = $root.google.bigtable.admin.v2.LogicalView.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateLogicalViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateLogicalViewRequest} UpdateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateLogicalViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateLogicalViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateLogicalViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logicalView != null && message.hasOwnProperty("logicalView")) { + var error = $root.google.bigtable.admin.v2.LogicalView.verify(message.logicalView); + if (error) + return "logicalView." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateLogicalViewRequest} UpdateLogicalViewRequest + */ + UpdateLogicalViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateLogicalViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateLogicalViewRequest(); + if (object.logicalView != null) { + if (typeof object.logicalView !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateLogicalViewRequest.logicalView: object expected"); + message.logicalView = $root.google.bigtable.admin.v2.LogicalView.fromObject(object.logicalView); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateLogicalViewRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateLogicalViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.UpdateLogicalViewRequest} message UpdateLogicalViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateLogicalViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.logicalView = null; + object.updateMask = null; + } + if (message.logicalView != null && message.hasOwnProperty("logicalView")) + object.logicalView = $root.google.bigtable.admin.v2.LogicalView.toObject(message.logicalView, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateLogicalViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateLogicalViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateLogicalViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateLogicalViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateLogicalViewRequest"; + }; + + return UpdateLogicalViewRequest; + })(); + + v2.UpdateLogicalViewMetadata = (function() { + + /** + * Properties of an UpdateLogicalViewMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateLogicalViewMetadata + * @property {google.bigtable.admin.v2.IUpdateLogicalViewRequest|null} [originalRequest] UpdateLogicalViewMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateLogicalViewMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] UpdateLogicalViewMetadata endTime + */ + + /** + * Constructs a new UpdateLogicalViewMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateLogicalViewMetadata. + * @implements IUpdateLogicalViewMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateLogicalViewMetadata=} [properties] Properties to set + */ + function UpdateLogicalViewMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateLogicalViewMetadata originalRequest. + * @member {google.bigtable.admin.v2.IUpdateLogicalViewRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @instance + */ + UpdateLogicalViewMetadata.prototype.originalRequest = null; + + /** + * UpdateLogicalViewMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @instance + */ + UpdateLogicalViewMetadata.prototype.startTime = null; + + /** + * UpdateLogicalViewMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @instance + */ + UpdateLogicalViewMetadata.prototype.endTime = null; + + /** + * Creates a new UpdateLogicalViewMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateLogicalViewMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateLogicalViewMetadata} UpdateLogicalViewMetadata instance + */ + UpdateLogicalViewMetadata.create = function create(properties) { + return new UpdateLogicalViewMetadata(properties); + }; + + /** + * Encodes the specified UpdateLogicalViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateLogicalViewMetadata} message UpdateLogicalViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateLogicalViewMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.UpdateLogicalViewRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateLogicalViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateLogicalViewMetadata} message UpdateLogicalViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateLogicalViewMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateLogicalViewMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateLogicalViewMetadata} UpdateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateLogicalViewMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateLogicalViewMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.UpdateLogicalViewRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateLogicalViewMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateLogicalViewMetadata} UpdateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateLogicalViewMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateLogicalViewMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateLogicalViewMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.UpdateLogicalViewRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an UpdateLogicalViewMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateLogicalViewMetadata} UpdateLogicalViewMetadata + */ + UpdateLogicalViewMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateLogicalViewMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateLogicalViewMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateLogicalViewMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.UpdateLogicalViewRequest.fromObject(object.originalRequest); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateLogicalViewMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateLogicalViewMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateLogicalViewMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateLogicalViewMetadata} message UpdateLogicalViewMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateLogicalViewMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.startTime = null; + object.endTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.UpdateLogicalViewRequest.toObject(message.originalRequest, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this UpdateLogicalViewMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateLogicalViewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateLogicalViewMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateLogicalViewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateLogicalViewMetadata"; + }; + + return UpdateLogicalViewMetadata; + })(); + + v2.DeleteLogicalViewRequest = (function() { + + /** + * Properties of a DeleteLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteLogicalViewRequest + * @property {string|null} [name] DeleteLogicalViewRequest name + * @property {string|null} [etag] DeleteLogicalViewRequest etag + */ + + /** + * Constructs a new DeleteLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteLogicalViewRequest. + * @implements IDeleteLogicalViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteLogicalViewRequest=} [properties] Properties to set + */ + function DeleteLogicalViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteLogicalViewRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @instance + */ + DeleteLogicalViewRequest.prototype.name = ""; + + /** + * DeleteLogicalViewRequest etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @instance + */ + DeleteLogicalViewRequest.prototype.etag = ""; + + /** + * Creates a new DeleteLogicalViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteLogicalViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteLogicalViewRequest} DeleteLogicalViewRequest instance + */ + DeleteLogicalViewRequest.create = function create(properties) { + return new DeleteLogicalViewRequest(properties); + }; + + /** + * Encodes the specified DeleteLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteLogicalViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteLogicalViewRequest} message DeleteLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLogicalViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteLogicalViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteLogicalViewRequest} message DeleteLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLogicalViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteLogicalViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteLogicalViewRequest} DeleteLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLogicalViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteLogicalViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteLogicalViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteLogicalViewRequest} DeleteLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLogicalViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteLogicalViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteLogicalViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteLogicalViewRequest} DeleteLogicalViewRequest + */ + DeleteLogicalViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteLogicalViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteLogicalViewRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteLogicalViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.DeleteLogicalViewRequest} message DeleteLogicalViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteLogicalViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteLogicalViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteLogicalViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteLogicalViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteLogicalViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteLogicalViewRequest"; + }; + + return DeleteLogicalViewRequest; + })(); + + v2.CreateMaterializedViewRequest = (function() { + + /** + * Properties of a CreateMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateMaterializedViewRequest + * @property {string|null} [parent] CreateMaterializedViewRequest parent + * @property {string|null} [materializedViewId] CreateMaterializedViewRequest materializedViewId + * @property {google.bigtable.admin.v2.IMaterializedView|null} [materializedView] CreateMaterializedViewRequest materializedView + */ + + /** + * Constructs a new CreateMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateMaterializedViewRequest. + * @implements ICreateMaterializedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateMaterializedViewRequest=} [properties] Properties to set + */ + function CreateMaterializedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMaterializedViewRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @instance + */ + CreateMaterializedViewRequest.prototype.parent = ""; + + /** + * CreateMaterializedViewRequest materializedViewId. + * @member {string} materializedViewId + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @instance + */ + CreateMaterializedViewRequest.prototype.materializedViewId = ""; + + /** + * CreateMaterializedViewRequest materializedView. + * @member {google.bigtable.admin.v2.IMaterializedView|null|undefined} materializedView + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @instance + */ + CreateMaterializedViewRequest.prototype.materializedView = null; + + /** + * Creates a new CreateMaterializedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateMaterializedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateMaterializedViewRequest} CreateMaterializedViewRequest instance + */ + CreateMaterializedViewRequest.create = function create(properties) { + return new CreateMaterializedViewRequest(properties); + }; + + /** + * Encodes the specified CreateMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateMaterializedViewRequest} message CreateMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMaterializedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.materializedViewId != null && Object.hasOwnProperty.call(message, "materializedViewId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.materializedViewId); + if (message.materializedView != null && Object.hasOwnProperty.call(message, "materializedView")) + $root.google.bigtable.admin.v2.MaterializedView.encode(message.materializedView, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateMaterializedViewRequest} message CreateMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMaterializedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMaterializedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateMaterializedViewRequest} CreateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMaterializedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateMaterializedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.materializedViewId = reader.string(); + break; + } + case 3: { + message.materializedView = $root.google.bigtable.admin.v2.MaterializedView.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateMaterializedViewRequest} CreateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMaterializedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMaterializedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMaterializedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.materializedViewId != null && message.hasOwnProperty("materializedViewId")) + if (!$util.isString(message.materializedViewId)) + return "materializedViewId: string expected"; + if (message.materializedView != null && message.hasOwnProperty("materializedView")) { + var error = $root.google.bigtable.admin.v2.MaterializedView.verify(message.materializedView); + if (error) + return "materializedView." + error; + } + return null; + }; + + /** + * Creates a CreateMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateMaterializedViewRequest} CreateMaterializedViewRequest + */ + CreateMaterializedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateMaterializedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateMaterializedViewRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.materializedViewId != null) + message.materializedViewId = String(object.materializedViewId); + if (object.materializedView != null) { + if (typeof object.materializedView !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateMaterializedViewRequest.materializedView: object expected"); + message.materializedView = $root.google.bigtable.admin.v2.MaterializedView.fromObject(object.materializedView); + } + return message; + }; + + /** + * Creates a plain object from a CreateMaterializedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.CreateMaterializedViewRequest} message CreateMaterializedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMaterializedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.materializedViewId = ""; + object.materializedView = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.materializedViewId != null && message.hasOwnProperty("materializedViewId")) + object.materializedViewId = message.materializedViewId; + if (message.materializedView != null && message.hasOwnProperty("materializedView")) + object.materializedView = $root.google.bigtable.admin.v2.MaterializedView.toObject(message.materializedView, options); + return object; + }; + + /** + * Converts this CreateMaterializedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMaterializedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMaterializedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMaterializedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateMaterializedViewRequest"; + }; + + return CreateMaterializedViewRequest; + })(); + + v2.CreateMaterializedViewMetadata = (function() { + + /** + * Properties of a CreateMaterializedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateMaterializedViewMetadata + * @property {google.bigtable.admin.v2.ICreateMaterializedViewRequest|null} [originalRequest] CreateMaterializedViewMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [startTime] CreateMaterializedViewMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] CreateMaterializedViewMetadata endTime + */ + + /** + * Constructs a new CreateMaterializedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateMaterializedViewMetadata. + * @implements ICreateMaterializedViewMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateMaterializedViewMetadata=} [properties] Properties to set + */ + function CreateMaterializedViewMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMaterializedViewMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateMaterializedViewRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @instance + */ + CreateMaterializedViewMetadata.prototype.originalRequest = null; + + /** + * CreateMaterializedViewMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @instance + */ + CreateMaterializedViewMetadata.prototype.startTime = null; + + /** + * CreateMaterializedViewMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @instance + */ + CreateMaterializedViewMetadata.prototype.endTime = null; + + /** + * Creates a new CreateMaterializedViewMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateMaterializedViewMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateMaterializedViewMetadata} CreateMaterializedViewMetadata instance + */ + CreateMaterializedViewMetadata.create = function create(properties) { + return new CreateMaterializedViewMetadata(properties); + }; + + /** + * Encodes the specified CreateMaterializedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateMaterializedViewMetadata} message CreateMaterializedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMaterializedViewMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.CreateMaterializedViewRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateMaterializedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateMaterializedViewMetadata} message CreateMaterializedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMaterializedViewMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMaterializedViewMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateMaterializedViewMetadata} CreateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMaterializedViewMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateMaterializedViewMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.CreateMaterializedViewRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMaterializedViewMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateMaterializedViewMetadata} CreateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMaterializedViewMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMaterializedViewMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMaterializedViewMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateMaterializedViewRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a CreateMaterializedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateMaterializedViewMetadata} CreateMaterializedViewMetadata + */ + CreateMaterializedViewMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateMaterializedViewMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateMaterializedViewMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateMaterializedViewMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.CreateMaterializedViewRequest.fromObject(object.originalRequest); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateMaterializedViewMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateMaterializedViewMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateMaterializedViewMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.CreateMaterializedViewMetadata} message CreateMaterializedViewMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMaterializedViewMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.startTime = null; + object.endTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.CreateMaterializedViewRequest.toObject(message.originalRequest, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this CreateMaterializedViewMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateMaterializedViewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMaterializedViewMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMaterializedViewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateMaterializedViewMetadata"; + }; + + return CreateMaterializedViewMetadata; + })(); + + v2.GetMaterializedViewRequest = (function() { + + /** + * Properties of a GetMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetMaterializedViewRequest + * @property {string|null} [name] GetMaterializedViewRequest name + */ + + /** + * Constructs a new GetMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetMaterializedViewRequest. + * @implements IGetMaterializedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetMaterializedViewRequest=} [properties] Properties to set + */ + function GetMaterializedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMaterializedViewRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @instance + */ + GetMaterializedViewRequest.prototype.name = ""; + + /** + * Creates a new GetMaterializedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetMaterializedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetMaterializedViewRequest} GetMaterializedViewRequest instance + */ + GetMaterializedViewRequest.create = function create(properties) { + return new GetMaterializedViewRequest(properties); + }; + + /** + * Encodes the specified GetMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetMaterializedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetMaterializedViewRequest} message GetMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMaterializedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetMaterializedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetMaterializedViewRequest} message GetMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMaterializedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMaterializedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetMaterializedViewRequest} GetMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMaterializedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetMaterializedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetMaterializedViewRequest} GetMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMaterializedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMaterializedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMaterializedViewRequest.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 GetMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetMaterializedViewRequest} GetMaterializedViewRequest + */ + GetMaterializedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetMaterializedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetMaterializedViewRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMaterializedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.GetMaterializedViewRequest} message GetMaterializedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMaterializedViewRequest.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 GetMaterializedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @instance + * @returns {Object.} JSON object + */ + GetMaterializedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMaterializedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMaterializedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetMaterializedViewRequest"; + }; + + return GetMaterializedViewRequest; + })(); + + v2.ListMaterializedViewsRequest = (function() { + + /** + * Properties of a ListMaterializedViewsRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListMaterializedViewsRequest + * @property {string|null} [parent] ListMaterializedViewsRequest parent + * @property {number|null} [pageSize] ListMaterializedViewsRequest pageSize + * @property {string|null} [pageToken] ListMaterializedViewsRequest pageToken + */ + + /** + * Constructs a new ListMaterializedViewsRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListMaterializedViewsRequest. + * @implements IListMaterializedViewsRequest + * @constructor + * @param {google.bigtable.admin.v2.IListMaterializedViewsRequest=} [properties] Properties to set + */ + function ListMaterializedViewsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMaterializedViewsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @instance + */ + ListMaterializedViewsRequest.prototype.parent = ""; + + /** + * ListMaterializedViewsRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @instance + */ + ListMaterializedViewsRequest.prototype.pageSize = 0; + + /** + * ListMaterializedViewsRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @instance + */ + ListMaterializedViewsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListMaterializedViewsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListMaterializedViewsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListMaterializedViewsRequest} ListMaterializedViewsRequest instance + */ + ListMaterializedViewsRequest.create = function create(properties) { + return new ListMaterializedViewsRequest(properties); + }; + + /** + * Encodes the specified ListMaterializedViewsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListMaterializedViewsRequest} message ListMaterializedViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMaterializedViewsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListMaterializedViewsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListMaterializedViewsRequest} message ListMaterializedViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMaterializedViewsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMaterializedViewsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListMaterializedViewsRequest} ListMaterializedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMaterializedViewsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListMaterializedViewsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMaterializedViewsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListMaterializedViewsRequest} ListMaterializedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMaterializedViewsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMaterializedViewsRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMaterializedViewsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListMaterializedViewsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListMaterializedViewsRequest} ListMaterializedViewsRequest + */ + ListMaterializedViewsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListMaterializedViewsRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListMaterializedViewsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListMaterializedViewsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {google.bigtable.admin.v2.ListMaterializedViewsRequest} message ListMaterializedViewsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMaterializedViewsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListMaterializedViewsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMaterializedViewsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMaterializedViewsRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMaterializedViewsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListMaterializedViewsRequest"; + }; + + return ListMaterializedViewsRequest; + })(); + + v2.ListMaterializedViewsResponse = (function() { + + /** + * Properties of a ListMaterializedViewsResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListMaterializedViewsResponse + * @property {Array.|null} [materializedViews] ListMaterializedViewsResponse materializedViews + * @property {string|null} [nextPageToken] ListMaterializedViewsResponse nextPageToken + */ + + /** + * Constructs a new ListMaterializedViewsResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListMaterializedViewsResponse. + * @implements IListMaterializedViewsResponse + * @constructor + * @param {google.bigtable.admin.v2.IListMaterializedViewsResponse=} [properties] Properties to set + */ + function ListMaterializedViewsResponse(properties) { + this.materializedViews = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMaterializedViewsResponse materializedViews. + * @member {Array.} materializedViews + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @instance + */ + ListMaterializedViewsResponse.prototype.materializedViews = $util.emptyArray; + + /** + * ListMaterializedViewsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @instance + */ + ListMaterializedViewsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMaterializedViewsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListMaterializedViewsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListMaterializedViewsResponse} ListMaterializedViewsResponse instance + */ + ListMaterializedViewsResponse.create = function create(properties) { + return new ListMaterializedViewsResponse(properties); + }; + + /** + * Encodes the specified ListMaterializedViewsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListMaterializedViewsResponse} message ListMaterializedViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMaterializedViewsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.materializedViews != null && message.materializedViews.length) + for (var i = 0; i < message.materializedViews.length; ++i) + $root.google.bigtable.admin.v2.MaterializedView.encode(message.materializedViews[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListMaterializedViewsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListMaterializedViewsResponse} message ListMaterializedViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMaterializedViewsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMaterializedViewsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListMaterializedViewsResponse} ListMaterializedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMaterializedViewsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListMaterializedViewsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.materializedViews && message.materializedViews.length)) + message.materializedViews = []; + message.materializedViews.push($root.google.bigtable.admin.v2.MaterializedView.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMaterializedViewsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListMaterializedViewsResponse} ListMaterializedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMaterializedViewsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMaterializedViewsResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMaterializedViewsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.materializedViews != null && message.hasOwnProperty("materializedViews")) { + if (!Array.isArray(message.materializedViews)) + return "materializedViews: array expected"; + for (var i = 0; i < message.materializedViews.length; ++i) { + var error = $root.google.bigtable.admin.v2.MaterializedView.verify(message.materializedViews[i]); + if (error) + return "materializedViews." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMaterializedViewsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListMaterializedViewsResponse} ListMaterializedViewsResponse + */ + ListMaterializedViewsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListMaterializedViewsResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListMaterializedViewsResponse(); + if (object.materializedViews) { + if (!Array.isArray(object.materializedViews)) + throw TypeError(".google.bigtable.admin.v2.ListMaterializedViewsResponse.materializedViews: array expected"); + message.materializedViews = []; + for (var i = 0; i < object.materializedViews.length; ++i) { + if (typeof object.materializedViews[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListMaterializedViewsResponse.materializedViews: object expected"); + message.materializedViews[i] = $root.google.bigtable.admin.v2.MaterializedView.fromObject(object.materializedViews[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMaterializedViewsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {google.bigtable.admin.v2.ListMaterializedViewsResponse} message ListMaterializedViewsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMaterializedViewsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.materializedViews = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.materializedViews && message.materializedViews.length) { + object.materializedViews = []; + for (var j = 0; j < message.materializedViews.length; ++j) + object.materializedViews[j] = $root.google.bigtable.admin.v2.MaterializedView.toObject(message.materializedViews[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMaterializedViewsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMaterializedViewsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMaterializedViewsResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMaterializedViewsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListMaterializedViewsResponse"; + }; + + return ListMaterializedViewsResponse; + })(); + + v2.UpdateMaterializedViewRequest = (function() { + + /** + * Properties of an UpdateMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateMaterializedViewRequest + * @property {google.bigtable.admin.v2.IMaterializedView|null} [materializedView] UpdateMaterializedViewRequest materializedView + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMaterializedViewRequest updateMask + */ + + /** + * Constructs a new UpdateMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateMaterializedViewRequest. + * @implements IUpdateMaterializedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewRequest=} [properties] Properties to set + */ + function UpdateMaterializedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMaterializedViewRequest materializedView. + * @member {google.bigtable.admin.v2.IMaterializedView|null|undefined} materializedView + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @instance + */ + UpdateMaterializedViewRequest.prototype.materializedView = null; + + /** + * UpdateMaterializedViewRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @instance + */ + UpdateMaterializedViewRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateMaterializedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewRequest} UpdateMaterializedViewRequest instance + */ + UpdateMaterializedViewRequest.create = function create(properties) { + return new UpdateMaterializedViewRequest(properties); + }; + + /** + * Encodes the specified UpdateMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewRequest} message UpdateMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMaterializedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.materializedView != null && Object.hasOwnProperty.call(message, "materializedView")) + $root.google.bigtable.admin.v2.MaterializedView.encode(message.materializedView, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewRequest} message UpdateMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMaterializedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMaterializedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewRequest} UpdateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMaterializedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.materializedView = $root.google.bigtable.admin.v2.MaterializedView.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewRequest} UpdateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMaterializedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMaterializedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMaterializedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.materializedView != null && message.hasOwnProperty("materializedView")) { + var error = $root.google.bigtable.admin.v2.MaterializedView.verify(message.materializedView); + if (error) + return "materializedView." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewRequest} UpdateMaterializedViewRequest + */ + UpdateMaterializedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest(); + if (object.materializedView != null) { + if (typeof object.materializedView !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateMaterializedViewRequest.materializedView: object expected"); + message.materializedView = $root.google.bigtable.admin.v2.MaterializedView.fromObject(object.materializedView); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateMaterializedViewRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateMaterializedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.UpdateMaterializedViewRequest} message UpdateMaterializedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMaterializedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.materializedView = null; + object.updateMask = null; + } + if (message.materializedView != null && message.hasOwnProperty("materializedView")) + object.materializedView = $root.google.bigtable.admin.v2.MaterializedView.toObject(message.materializedView, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateMaterializedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMaterializedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMaterializedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMaterializedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateMaterializedViewRequest"; + }; + + return UpdateMaterializedViewRequest; + })(); + + v2.UpdateMaterializedViewMetadata = (function() { + + /** + * Properties of an UpdateMaterializedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateMaterializedViewMetadata + * @property {google.bigtable.admin.v2.IUpdateMaterializedViewRequest|null} [originalRequest] UpdateMaterializedViewMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateMaterializedViewMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] UpdateMaterializedViewMetadata endTime + */ + + /** + * Constructs a new UpdateMaterializedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateMaterializedViewMetadata. + * @implements IUpdateMaterializedViewMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewMetadata=} [properties] Properties to set + */ + function UpdateMaterializedViewMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMaterializedViewMetadata originalRequest. + * @member {google.bigtable.admin.v2.IUpdateMaterializedViewRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @instance + */ + UpdateMaterializedViewMetadata.prototype.originalRequest = null; + + /** + * UpdateMaterializedViewMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @instance + */ + UpdateMaterializedViewMetadata.prototype.startTime = null; + + /** + * UpdateMaterializedViewMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @instance + */ + UpdateMaterializedViewMetadata.prototype.endTime = null; + + /** + * Creates a new UpdateMaterializedViewMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewMetadata} UpdateMaterializedViewMetadata instance + */ + UpdateMaterializedViewMetadata.create = function create(properties) { + return new UpdateMaterializedViewMetadata(properties); + }; + + /** + * Encodes the specified UpdateMaterializedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewMetadata} message UpdateMaterializedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMaterializedViewMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateMaterializedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewMetadata} message UpdateMaterializedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMaterializedViewMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMaterializedViewMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewMetadata} UpdateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMaterializedViewMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateMaterializedViewMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMaterializedViewMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewMetadata} UpdateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMaterializedViewMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMaterializedViewMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMaterializedViewMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an UpdateMaterializedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewMetadata} UpdateMaterializedViewMetadata + */ + UpdateMaterializedViewMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateMaterializedViewMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateMaterializedViewMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateMaterializedViewMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest.fromObject(object.originalRequest); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateMaterializedViewMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateMaterializedViewMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateMaterializedViewMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateMaterializedViewMetadata} message UpdateMaterializedViewMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMaterializedViewMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.startTime = null; + object.endTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest.toObject(message.originalRequest, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this UpdateMaterializedViewMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateMaterializedViewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMaterializedViewMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMaterializedViewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateMaterializedViewMetadata"; + }; + + return UpdateMaterializedViewMetadata; + })(); + + v2.DeleteMaterializedViewRequest = (function() { + + /** + * Properties of a DeleteMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteMaterializedViewRequest + * @property {string|null} [name] DeleteMaterializedViewRequest name + * @property {string|null} [etag] DeleteMaterializedViewRequest etag + */ + + /** + * Constructs a new DeleteMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteMaterializedViewRequest. + * @implements IDeleteMaterializedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteMaterializedViewRequest=} [properties] Properties to set + */ + function DeleteMaterializedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteMaterializedViewRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @instance + */ + DeleteMaterializedViewRequest.prototype.name = ""; + + /** + * DeleteMaterializedViewRequest etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @instance + */ + DeleteMaterializedViewRequest.prototype.etag = ""; + + /** + * Creates a new DeleteMaterializedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteMaterializedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteMaterializedViewRequest} DeleteMaterializedViewRequest instance + */ + DeleteMaterializedViewRequest.create = function create(properties) { + return new DeleteMaterializedViewRequest(properties); + }; + + /** + * Encodes the specified DeleteMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteMaterializedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteMaterializedViewRequest} message DeleteMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMaterializedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteMaterializedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteMaterializedViewRequest} message DeleteMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMaterializedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteMaterializedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteMaterializedViewRequest} DeleteMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMaterializedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteMaterializedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteMaterializedViewRequest} DeleteMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMaterializedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMaterializedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMaterializedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteMaterializedViewRequest} DeleteMaterializedViewRequest + */ + DeleteMaterializedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteMaterializedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteMaterializedViewRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteMaterializedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.DeleteMaterializedViewRequest} message DeleteMaterializedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMaterializedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteMaterializedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMaterializedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMaterializedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMaterializedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteMaterializedViewRequest"; + }; + + return DeleteMaterializedViewRequest; + })(); + + v2.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.bigtable.admin.v2 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {google.bigtable.admin.v2.Instance.State|null} [state] Instance state + * @property {google.bigtable.admin.v2.Instance.Type|null} [type] Instance type + * @property {Object.|null} [labels] Instance labels + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Instance satisfiesPzi + * @property {Object.|null} [tags] Instance tags + */ + + /** + * Constructs a new Instance. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.bigtable.admin.v2.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.tags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance state. + * @member {google.bigtable.admin.v2.Instance.State} state + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance type. + * @member {google.bigtable.admin.v2.Instance.Type} type + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.type = 0; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance satisfiesPzs. + * @member {boolean|null|undefined} satisfiesPzs + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.satisfiesPzs = null; + + /** + * Instance satisfiesPzi. + * @member {boolean|null|undefined} satisfiesPzi + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.satisfiesPzi = null; + + /** + * Instance tags. + * @member {Object.} tags + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.tags = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Instance.prototype, "_satisfiesPzs", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Instance.prototype, "_satisfiesPzi", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {google.bigtable.admin.v2.IInstance=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.bigtable.admin.v2.Instance.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {google.bigtable.admin.v2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.satisfiesPzi); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {google.bigtable.admin.v2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.type = reader.int32(); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.satisfiesPzs = reader.bool(); + break; + } + case 11: { + message.satisfiesPzi = reader.bool(); + break; + } + case 12: { + if (message.tags === $util.emptyObject) + message.tags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tags[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + properties._satisfiesPzs = 1; + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + properties._satisfiesPzi = 1; + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!$util.isObject(message.tags)) + return "tags: object expected"; + var key = Object.keys(message.tags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.tags[key[i]])) + return "tags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Instance) + return object; + var message = new $root.google.bigtable.admin.v2.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_NOT_KNOWN": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PRODUCTION": + case 1: + message.type = 1; + break; + case "DEVELOPMENT": + case 2: + message.type = 2; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.bigtable.admin.v2.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + if (object.tags) { + if (typeof object.tags !== "object") + throw TypeError(".google.bigtable.admin.v2.Instance.tags: object expected"); + message.tags = {}; + for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) + message.tags[keys[i]] = String(object.tags[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {google.bigtable.admin.v2.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.tags = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_NOT_KNOWN" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.bigtable.admin.v2.Instance.State[message.state] === undefined ? message.state : $root.google.bigtable.admin.v2.Instance.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.bigtable.admin.v2.Instance.Type[message.type] === undefined ? message.type : $root.google.bigtable.admin.v2.Instance.Type[message.type] : message.type; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + object.satisfiesPzs = message.satisfiesPzs; + if (options.oneofs) + object._satisfiesPzs = "satisfiesPzs"; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + object.satisfiesPzi = message.satisfiesPzi; + if (options.oneofs) + object._satisfiesPzi = "satisfiesPzi"; + } + if (message.tags && (keys2 = Object.keys(message.tags)).length) { + object.tags = {}; + for (var j = 0; j < keys2.length; ++j) + object.tags[keys2[j]] = message.tags[keys2[j]]; + } + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Instance"; + }; + + /** + * State enum. + * @name google.bigtable.admin.v2.Instance.State + * @enum {number} + * @property {number} STATE_NOT_KNOWN=0 STATE_NOT_KNOWN value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_NOT_KNOWN"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + return values; + })(); + + /** + * Type enum. + * @name google.bigtable.admin.v2.Instance.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} PRODUCTION=1 PRODUCTION value + * @property {number} DEVELOPMENT=2 DEVELOPMENT value + */ + Instance.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRODUCTION"] = 1; + values[valuesById[2] = "DEVELOPMENT"] = 2; + return values; + })(); + + return Instance; + })(); + + v2.AutoscalingTargets = (function() { + + /** + * Properties of an AutoscalingTargets. + * @memberof google.bigtable.admin.v2 + * @interface IAutoscalingTargets + * @property {number|null} [cpuUtilizationPercent] AutoscalingTargets cpuUtilizationPercent + * @property {number|null} [storageUtilizationGibPerNode] AutoscalingTargets storageUtilizationGibPerNode + */ + + /** + * Constructs a new AutoscalingTargets. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an AutoscalingTargets. + * @implements IAutoscalingTargets + * @constructor + * @param {google.bigtable.admin.v2.IAutoscalingTargets=} [properties] Properties to set + */ + function AutoscalingTargets(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingTargets cpuUtilizationPercent. + * @member {number} cpuUtilizationPercent + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @instance + */ + AutoscalingTargets.prototype.cpuUtilizationPercent = 0; + + /** + * AutoscalingTargets storageUtilizationGibPerNode. + * @member {number} storageUtilizationGibPerNode + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @instance + */ + AutoscalingTargets.prototype.storageUtilizationGibPerNode = 0; + + /** + * Creates a new AutoscalingTargets instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {google.bigtable.admin.v2.IAutoscalingTargets=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AutoscalingTargets} AutoscalingTargets instance + */ + AutoscalingTargets.create = function create(properties) { + return new AutoscalingTargets(properties); + }; + + /** + * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingTargets.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {google.bigtable.admin.v2.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingTargets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "cpuUtilizationPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.cpuUtilizationPercent); + if (message.storageUtilizationGibPerNode != null && Object.hasOwnProperty.call(message, "storageUtilizationGibPerNode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.storageUtilizationGibPerNode); + return writer; + }; + + /** + * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingTargets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {google.bigtable.admin.v2.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingTargets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AutoscalingTargets} AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingTargets.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AutoscalingTargets(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.cpuUtilizationPercent = reader.int32(); + break; + } + case 3: { + message.storageUtilizationGibPerNode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AutoscalingTargets} AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingTargets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingTargets message. + * @function verify + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingTargets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuUtilizationPercent != null && message.hasOwnProperty("cpuUtilizationPercent")) + if (!$util.isInteger(message.cpuUtilizationPercent)) + return "cpuUtilizationPercent: integer expected"; + if (message.storageUtilizationGibPerNode != null && message.hasOwnProperty("storageUtilizationGibPerNode")) + if (!$util.isInteger(message.storageUtilizationGibPerNode)) + return "storageUtilizationGibPerNode: integer expected"; + return null; + }; + + /** + * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AutoscalingTargets} AutoscalingTargets + */ + AutoscalingTargets.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AutoscalingTargets) + return object; + var message = new $root.google.bigtable.admin.v2.AutoscalingTargets(); + if (object.cpuUtilizationPercent != null) + message.cpuUtilizationPercent = object.cpuUtilizationPercent | 0; + if (object.storageUtilizationGibPerNode != null) + message.storageUtilizationGibPerNode = object.storageUtilizationGibPerNode | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {google.bigtable.admin.v2.AutoscalingTargets} message AutoscalingTargets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingTargets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpuUtilizationPercent = 0; + object.storageUtilizationGibPerNode = 0; + } + if (message.cpuUtilizationPercent != null && message.hasOwnProperty("cpuUtilizationPercent")) + object.cpuUtilizationPercent = message.cpuUtilizationPercent; + if (message.storageUtilizationGibPerNode != null && message.hasOwnProperty("storageUtilizationGibPerNode")) + object.storageUtilizationGibPerNode = message.storageUtilizationGibPerNode; + return object; + }; + + /** + * Converts this AutoscalingTargets to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @instance + * @returns {Object.} JSON object + */ + AutoscalingTargets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingTargets + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingTargets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AutoscalingTargets"; + }; + + return AutoscalingTargets; + })(); + + v2.AutoscalingLimits = (function() { + + /** + * Properties of an AutoscalingLimits. + * @memberof google.bigtable.admin.v2 + * @interface IAutoscalingLimits + * @property {number|null} [minServeNodes] AutoscalingLimits minServeNodes + * @property {number|null} [maxServeNodes] AutoscalingLimits maxServeNodes + */ + + /** + * Constructs a new AutoscalingLimits. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an AutoscalingLimits. + * @implements IAutoscalingLimits + * @constructor + * @param {google.bigtable.admin.v2.IAutoscalingLimits=} [properties] Properties to set + */ + function AutoscalingLimits(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingLimits minServeNodes. + * @member {number} minServeNodes + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.minServeNodes = 0; + + /** + * AutoscalingLimits maxServeNodes. + * @member {number} maxServeNodes + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.maxServeNodes = 0; + + /** + * Creates a new AutoscalingLimits instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {google.bigtable.admin.v2.IAutoscalingLimits=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AutoscalingLimits} AutoscalingLimits instance + */ + AutoscalingLimits.create = function create(properties) { + return new AutoscalingLimits(properties); + }; + + /** + * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingLimits.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {google.bigtable.admin.v2.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingLimits.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minServeNodes != null && Object.hasOwnProperty.call(message, "minServeNodes")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minServeNodes); + if (message.maxServeNodes != null && Object.hasOwnProperty.call(message, "maxServeNodes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxServeNodes); + return writer; + }; + + /** + * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingLimits.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {google.bigtable.admin.v2.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingLimits.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AutoscalingLimits} AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingLimits.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AutoscalingLimits(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minServeNodes = reader.int32(); + break; + } + case 2: { + message.maxServeNodes = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AutoscalingLimits} AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingLimits.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingLimits message. + * @function verify + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingLimits.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minServeNodes != null && message.hasOwnProperty("minServeNodes")) + if (!$util.isInteger(message.minServeNodes)) + return "minServeNodes: integer expected"; + if (message.maxServeNodes != null && message.hasOwnProperty("maxServeNodes")) + if (!$util.isInteger(message.maxServeNodes)) + return "maxServeNodes: integer expected"; + return null; + }; + + /** + * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AutoscalingLimits} AutoscalingLimits + */ + AutoscalingLimits.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AutoscalingLimits) + return object; + var message = new $root.google.bigtable.admin.v2.AutoscalingLimits(); + if (object.minServeNodes != null) + message.minServeNodes = object.minServeNodes | 0; + if (object.maxServeNodes != null) + message.maxServeNodes = object.maxServeNodes | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {google.bigtable.admin.v2.AutoscalingLimits} message AutoscalingLimits + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingLimits.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minServeNodes = 0; + object.maxServeNodes = 0; + } + if (message.minServeNodes != null && message.hasOwnProperty("minServeNodes")) + object.minServeNodes = message.minServeNodes; + if (message.maxServeNodes != null && message.hasOwnProperty("maxServeNodes")) + object.maxServeNodes = message.maxServeNodes; + return object; + }; + + /** + * Converts this AutoscalingLimits to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @instance + * @returns {Object.} JSON object + */ + AutoscalingLimits.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingLimits + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingLimits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AutoscalingLimits"; + }; + + return AutoscalingLimits; + })(); + + v2.Cluster = (function() { + + /** + * Properties of a Cluster. + * @memberof google.bigtable.admin.v2 + * @interface ICluster + * @property {string|null} [name] Cluster name + * @property {string|null} [location] Cluster location + * @property {google.bigtable.admin.v2.Cluster.State|null} [state] Cluster state + * @property {number|null} [serveNodes] Cluster serveNodes + * @property {google.bigtable.admin.v2.Cluster.NodeScalingFactor|null} [nodeScalingFactor] Cluster nodeScalingFactor + * @property {google.bigtable.admin.v2.Cluster.IClusterConfig|null} [clusterConfig] Cluster clusterConfig + * @property {google.bigtable.admin.v2.StorageType|null} [defaultStorageType] Cluster defaultStorageType + * @property {google.bigtable.admin.v2.Cluster.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig + */ + + /** + * Constructs a new Cluster. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.bigtable.admin.v2.ICluster=} [properties] Properties to set + */ + function Cluster(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cluster name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.name = ""; + + /** + * Cluster location. + * @member {string} location + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.location = ""; + + /** + * Cluster state. + * @member {google.bigtable.admin.v2.Cluster.State} state + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.state = 0; + + /** + * Cluster serveNodes. + * @member {number} serveNodes + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.serveNodes = 0; + + /** + * Cluster nodeScalingFactor. + * @member {google.bigtable.admin.v2.Cluster.NodeScalingFactor} nodeScalingFactor + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.nodeScalingFactor = 0; + + /** + * Cluster clusterConfig. + * @member {google.bigtable.admin.v2.Cluster.IClusterConfig|null|undefined} clusterConfig + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.clusterConfig = null; + + /** + * Cluster defaultStorageType. + * @member {google.bigtable.admin.v2.StorageType} defaultStorageType + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.defaultStorageType = 0; + + /** + * Cluster encryptionConfig. + * @member {google.bigtable.admin.v2.Cluster.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.encryptionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Cluster config. + * @member {"clusterConfig"|undefined} config + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Object.defineProperty(Cluster.prototype, "config", { + get: $util.oneOfGetter($oneOfFields = ["clusterConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {google.bigtable.admin.v2.ICluster=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Cluster} Cluster instance + */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {google.bigtable.admin.v2.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.serveNodes != null && Object.hasOwnProperty.call(message, "serveNodes")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.serveNodes); + if (message.defaultStorageType != null && Object.hasOwnProperty.call(message, "defaultStorageType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.defaultStorageType); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.bigtable.admin.v2.Cluster.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.clusterConfig != null && Object.hasOwnProperty.call(message, "clusterConfig")) + $root.google.bigtable.admin.v2.Cluster.ClusterConfig.encode(message.clusterConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.nodeScalingFactor != null && Object.hasOwnProperty.call(message, "nodeScalingFactor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.nodeScalingFactor); + return writer; + }; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {google.bigtable.admin.v2.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Cluster(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.serveNodes = reader.int32(); + break; + } + case 9: { + message.nodeScalingFactor = reader.int32(); + break; + } + case 7: { + message.clusterConfig = $root.google.bigtable.admin.v2.Cluster.ClusterConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.defaultStorageType = reader.int32(); + break; + } + case 6: { + message.encryptionConfig = $root.google.bigtable.admin.v2.Cluster.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cluster message. + * @function verify + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cluster.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.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.serveNodes != null && message.hasOwnProperty("serveNodes")) + if (!$util.isInteger(message.serveNodes)) + return "serveNodes: integer expected"; + if (message.nodeScalingFactor != null && message.hasOwnProperty("nodeScalingFactor")) + switch (message.nodeScalingFactor) { + default: + return "nodeScalingFactor: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.clusterConfig != null && message.hasOwnProperty("clusterConfig")) { + properties.config = 1; + { + var error = $root.google.bigtable.admin.v2.Cluster.ClusterConfig.verify(message.clusterConfig); + if (error) + return "clusterConfig." + error; + } + } + if (message.defaultStorageType != null && message.hasOwnProperty("defaultStorageType")) + switch (message.defaultStorageType) { + default: + return "defaultStorageType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.bigtable.admin.v2.Cluster.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Cluster} Cluster + */ + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Cluster) + return object; + var message = new $root.google.bigtable.admin.v2.Cluster(); + if (object.name != null) + message.name = String(object.name); + if (object.location != null) + message.location = String(object.location); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_NOT_KNOWN": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "RESIZING": + case 3: + message.state = 3; + break; + case "DISABLED": + case 4: + message.state = 4; + break; + } + if (object.serveNodes != null) + message.serveNodes = object.serveNodes | 0; + switch (object.nodeScalingFactor) { + default: + if (typeof object.nodeScalingFactor === "number") { + message.nodeScalingFactor = object.nodeScalingFactor; + break; + } + break; + case "NODE_SCALING_FACTOR_UNSPECIFIED": + case 0: + message.nodeScalingFactor = 0; + break; + case "NODE_SCALING_FACTOR_1X": + case 1: + message.nodeScalingFactor = 1; + break; + case "NODE_SCALING_FACTOR_2X": + case 2: + message.nodeScalingFactor = 2; + break; + } + if (object.clusterConfig != null) { + if (typeof object.clusterConfig !== "object") + throw TypeError(".google.bigtable.admin.v2.Cluster.clusterConfig: object expected"); + message.clusterConfig = $root.google.bigtable.admin.v2.Cluster.ClusterConfig.fromObject(object.clusterConfig); + } + switch (object.defaultStorageType) { + default: + if (typeof object.defaultStorageType === "number") { + message.defaultStorageType = object.defaultStorageType; + break; + } + break; + case "STORAGE_TYPE_UNSPECIFIED": + case 0: + message.defaultStorageType = 0; + break; + case "SSD": + case 1: + message.defaultStorageType = 1; + break; + case "HDD": + case 2: + message.defaultStorageType = 2; + break; + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.bigtable.admin.v2.Cluster.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.bigtable.admin.v2.Cluster.EncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {google.bigtable.admin.v2.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.location = ""; + object.state = options.enums === String ? "STATE_NOT_KNOWN" : 0; + object.serveNodes = 0; + object.defaultStorageType = options.enums === String ? "STORAGE_TYPE_UNSPECIFIED" : 0; + object.encryptionConfig = null; + object.nodeScalingFactor = options.enums === String ? "NODE_SCALING_FACTOR_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.bigtable.admin.v2.Cluster.State[message.state] === undefined ? message.state : $root.google.bigtable.admin.v2.Cluster.State[message.state] : message.state; + if (message.serveNodes != null && message.hasOwnProperty("serveNodes")) + object.serveNodes = message.serveNodes; + if (message.defaultStorageType != null && message.hasOwnProperty("defaultStorageType")) + object.defaultStorageType = options.enums === String ? $root.google.bigtable.admin.v2.StorageType[message.defaultStorageType] === undefined ? message.defaultStorageType : $root.google.bigtable.admin.v2.StorageType[message.defaultStorageType] : message.defaultStorageType; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.bigtable.admin.v2.Cluster.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.clusterConfig != null && message.hasOwnProperty("clusterConfig")) { + object.clusterConfig = $root.google.bigtable.admin.v2.Cluster.ClusterConfig.toObject(message.clusterConfig, options); + if (options.oneofs) + object.config = "clusterConfig"; + } + if (message.nodeScalingFactor != null && message.hasOwnProperty("nodeScalingFactor")) + object.nodeScalingFactor = options.enums === String ? $root.google.bigtable.admin.v2.Cluster.NodeScalingFactor[message.nodeScalingFactor] === undefined ? message.nodeScalingFactor : $root.google.bigtable.admin.v2.Cluster.NodeScalingFactor[message.nodeScalingFactor] : message.nodeScalingFactor; + return object; + }; + + /** + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Cluster + * @instance + * @returns {Object.} JSON object + */ + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Cluster"; + }; + + /** + * State enum. + * @name google.bigtable.admin.v2.Cluster.State + * @enum {number} + * @property {number} STATE_NOT_KNOWN=0 STATE_NOT_KNOWN value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + * @property {number} RESIZING=3 RESIZING value + * @property {number} DISABLED=4 DISABLED value + */ + Cluster.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_NOT_KNOWN"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "RESIZING"] = 3; + values[valuesById[4] = "DISABLED"] = 4; + return values; + })(); + + /** + * NodeScalingFactor enum. + * @name google.bigtable.admin.v2.Cluster.NodeScalingFactor + * @enum {number} + * @property {number} NODE_SCALING_FACTOR_UNSPECIFIED=0 NODE_SCALING_FACTOR_UNSPECIFIED value + * @property {number} NODE_SCALING_FACTOR_1X=1 NODE_SCALING_FACTOR_1X value + * @property {number} NODE_SCALING_FACTOR_2X=2 NODE_SCALING_FACTOR_2X value + */ + Cluster.NodeScalingFactor = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NODE_SCALING_FACTOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "NODE_SCALING_FACTOR_1X"] = 1; + values[valuesById[2] = "NODE_SCALING_FACTOR_2X"] = 2; + return values; + })(); + + Cluster.ClusterAutoscalingConfig = (function() { + + /** + * Properties of a ClusterAutoscalingConfig. + * @memberof google.bigtable.admin.v2.Cluster + * @interface IClusterAutoscalingConfig + * @property {google.bigtable.admin.v2.IAutoscalingLimits|null} [autoscalingLimits] ClusterAutoscalingConfig autoscalingLimits + * @property {google.bigtable.admin.v2.IAutoscalingTargets|null} [autoscalingTargets] ClusterAutoscalingConfig autoscalingTargets + */ + + /** + * Constructs a new ClusterAutoscalingConfig. + * @memberof google.bigtable.admin.v2.Cluster + * @classdesc Represents a ClusterAutoscalingConfig. + * @implements IClusterAutoscalingConfig + * @constructor + * @param {google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig=} [properties] Properties to set + */ + function ClusterAutoscalingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterAutoscalingConfig autoscalingLimits. + * @member {google.bigtable.admin.v2.IAutoscalingLimits|null|undefined} autoscalingLimits + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @instance + */ + ClusterAutoscalingConfig.prototype.autoscalingLimits = null; + + /** + * ClusterAutoscalingConfig autoscalingTargets. + * @member {google.bigtable.admin.v2.IAutoscalingTargets|null|undefined} autoscalingTargets + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @instance + */ + ClusterAutoscalingConfig.prototype.autoscalingTargets = null; + + /** + * Creates a new ClusterAutoscalingConfig instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} ClusterAutoscalingConfig instance + */ + ClusterAutoscalingConfig.create = function create(properties) { + return new ClusterAutoscalingConfig(properties); + }; + + /** + * Encodes the specified ClusterAutoscalingConfig message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig} message ClusterAutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterAutoscalingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) + $root.google.bigtable.admin.v2.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoscalingTargets != null && Object.hasOwnProperty.call(message, "autoscalingTargets")) + $root.google.bigtable.admin.v2.AutoscalingTargets.encode(message.autoscalingTargets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterAutoscalingConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig} message ClusterAutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterAutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterAutoscalingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} ClusterAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterAutoscalingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.autoscalingLimits = $root.google.bigtable.admin.v2.AutoscalingLimits.decode(reader, reader.uint32()); + break; + } + case 2: { + message.autoscalingTargets = $root.google.bigtable.admin.v2.AutoscalingTargets.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterAutoscalingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} ClusterAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterAutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterAutoscalingConfig message. + * @function verify + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterAutoscalingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { + var error = $root.google.bigtable.admin.v2.AutoscalingLimits.verify(message.autoscalingLimits); + if (error) + return "autoscalingLimits." + error; + } + if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) { + var error = $root.google.bigtable.admin.v2.AutoscalingTargets.verify(message.autoscalingTargets); + if (error) + return "autoscalingTargets." + error; + } + return null; + }; + + /** + * Creates a ClusterAutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} ClusterAutoscalingConfig + */ + ClusterAutoscalingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig) + return object; + var message = new $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig(); + if (object.autoscalingLimits != null) { + if (typeof object.autoscalingLimits !== "object") + throw TypeError(".google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.autoscalingLimits: object expected"); + message.autoscalingLimits = $root.google.bigtable.admin.v2.AutoscalingLimits.fromObject(object.autoscalingLimits); + } + if (object.autoscalingTargets != null) { + if (typeof object.autoscalingTargets !== "object") + throw TypeError(".google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.autoscalingTargets: object expected"); + message.autoscalingTargets = $root.google.bigtable.admin.v2.AutoscalingTargets.fromObject(object.autoscalingTargets); + } + return message; + }; + + /** + * Creates a plain object from a ClusterAutoscalingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} message ClusterAutoscalingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterAutoscalingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.autoscalingLimits = null; + object.autoscalingTargets = null; + } + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) + object.autoscalingLimits = $root.google.bigtable.admin.v2.AutoscalingLimits.toObject(message.autoscalingLimits, options); + if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) + object.autoscalingTargets = $root.google.bigtable.admin.v2.AutoscalingTargets.toObject(message.autoscalingTargets, options); + return object; + }; + + /** + * Converts this ClusterAutoscalingConfig to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @instance + * @returns {Object.} JSON object + */ + ClusterAutoscalingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterAutoscalingConfig + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterAutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig"; + }; + + return ClusterAutoscalingConfig; + })(); + + Cluster.ClusterConfig = (function() { + + /** + * Properties of a ClusterConfig. + * @memberof google.bigtable.admin.v2.Cluster + * @interface IClusterConfig + * @property {google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig|null} [clusterAutoscalingConfig] ClusterConfig clusterAutoscalingConfig + */ + + /** + * Constructs a new ClusterConfig. + * @memberof google.bigtable.admin.v2.Cluster + * @classdesc Represents a ClusterConfig. + * @implements IClusterConfig + * @constructor + * @param {google.bigtable.admin.v2.Cluster.IClusterConfig=} [properties] Properties to set + */ + function ClusterConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterConfig clusterAutoscalingConfig. + * @member {google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig|null|undefined} clusterAutoscalingConfig + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @instance + */ + ClusterConfig.prototype.clusterAutoscalingConfig = null; + + /** + * Creates a new ClusterConfig instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IClusterConfig=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Cluster.ClusterConfig} ClusterConfig instance + */ + ClusterConfig.create = function create(properties) { + return new ClusterConfig(properties); + }; + + /** + * Encodes the specified ClusterConfig message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterConfig.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IClusterConfig} message ClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterAutoscalingConfig != null && Object.hasOwnProperty.call(message, "clusterAutoscalingConfig")) + $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.encode(message.clusterAutoscalingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IClusterConfig} message ClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Cluster.ClusterConfig} ClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Cluster.ClusterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clusterAutoscalingConfig = $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Cluster.ClusterConfig} ClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterConfig message. + * @function verify + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterAutoscalingConfig != null && message.hasOwnProperty("clusterAutoscalingConfig")) { + var error = $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.verify(message.clusterAutoscalingConfig); + if (error) + return "clusterAutoscalingConfig." + error; + } + return null; + }; + + /** + * Creates a ClusterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Cluster.ClusterConfig} ClusterConfig + */ + ClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Cluster.ClusterConfig) + return object; + var message = new $root.google.bigtable.admin.v2.Cluster.ClusterConfig(); + if (object.clusterAutoscalingConfig != null) { + if (typeof object.clusterAutoscalingConfig !== "object") + throw TypeError(".google.bigtable.admin.v2.Cluster.ClusterConfig.clusterAutoscalingConfig: object expected"); + message.clusterAutoscalingConfig = $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.fromObject(object.clusterAutoscalingConfig); + } + return message; + }; + + /** + * Creates a plain object from a ClusterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.ClusterConfig} message ClusterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.clusterAutoscalingConfig = null; + if (message.clusterAutoscalingConfig != null && message.hasOwnProperty("clusterAutoscalingConfig")) + object.clusterAutoscalingConfig = $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.toObject(message.clusterAutoscalingConfig, options); + return object; + }; + + /** + * Converts this ClusterConfig to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @instance + * @returns {Object.} JSON object + */ + ClusterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterConfig + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Cluster.ClusterConfig"; + }; + + return ClusterConfig; + })(); + + Cluster.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.bigtable.admin.v2.Cluster + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.bigtable.admin.v2.Cluster + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.bigtable.admin.v2.Cluster.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IEncryptionConfig=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Cluster.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Cluster.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Cluster.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Cluster.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + return null; + }; + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Cluster.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Cluster.EncryptionConfig) + return object; + var message = new $root.google.bigtable.admin.v2.Cluster.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + return message; + }; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + return object; + }; + + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Cluster.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + return Cluster; + })(); + + v2.AppProfile = (function() { + + /** + * Properties of an AppProfile. + * @memberof google.bigtable.admin.v2 + * @interface IAppProfile + * @property {string|null} [name] AppProfile name + * @property {string|null} [etag] AppProfile etag + * @property {string|null} [description] AppProfile description + * @property {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny|null} [multiClusterRoutingUseAny] AppProfile multiClusterRoutingUseAny + * @property {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting|null} [singleClusterRouting] AppProfile singleClusterRouting + * @property {google.bigtable.admin.v2.AppProfile.Priority|null} [priority] AppProfile priority + * @property {google.bigtable.admin.v2.AppProfile.IStandardIsolation|null} [standardIsolation] AppProfile standardIsolation + * @property {google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly|null} [dataBoostIsolationReadOnly] AppProfile dataBoostIsolationReadOnly + */ + + /** + * Constructs a new AppProfile. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an AppProfile. + * @implements IAppProfile + * @constructor + * @param {google.bigtable.admin.v2.IAppProfile=} [properties] Properties to set + */ + function AppProfile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppProfile name. + * @member {string} name + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.name = ""; + + /** + * AppProfile etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.etag = ""; + + /** + * AppProfile description. + * @member {string} description + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.description = ""; + + /** + * AppProfile multiClusterRoutingUseAny. + * @member {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny|null|undefined} multiClusterRoutingUseAny + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.multiClusterRoutingUseAny = null; + + /** + * AppProfile singleClusterRouting. + * @member {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting|null|undefined} singleClusterRouting + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.singleClusterRouting = null; + + /** + * AppProfile priority. + * @member {google.bigtable.admin.v2.AppProfile.Priority|null|undefined} priority + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.priority = null; + + /** + * AppProfile standardIsolation. + * @member {google.bigtable.admin.v2.AppProfile.IStandardIsolation|null|undefined} standardIsolation + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.standardIsolation = null; + + /** + * AppProfile dataBoostIsolationReadOnly. + * @member {google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly|null|undefined} dataBoostIsolationReadOnly + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.dataBoostIsolationReadOnly = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AppProfile routingPolicy. + * @member {"multiClusterRoutingUseAny"|"singleClusterRouting"|undefined} routingPolicy + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + Object.defineProperty(AppProfile.prototype, "routingPolicy", { + get: $util.oneOfGetter($oneOfFields = ["multiClusterRoutingUseAny", "singleClusterRouting"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AppProfile isolation. + * @member {"priority"|"standardIsolation"|"dataBoostIsolationReadOnly"|undefined} isolation + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + Object.defineProperty(AppProfile.prototype, "isolation", { + get: $util.oneOfGetter($oneOfFields = ["priority", "standardIsolation", "dataBoostIsolationReadOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AppProfile instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {google.bigtable.admin.v2.IAppProfile=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile} AppProfile instance + */ + AppProfile.create = function create(properties) { + return new AppProfile(properties); + }; + + /** + * Encodes the specified AppProfile message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {google.bigtable.admin.v2.IAppProfile} message AppProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.multiClusterRoutingUseAny != null && Object.hasOwnProperty.call(message, "multiClusterRoutingUseAny")) + $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.encode(message.multiClusterRoutingUseAny, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.singleClusterRouting != null && Object.hasOwnProperty.call(message, "singleClusterRouting")) + $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.encode(message.singleClusterRouting, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.priority); + if (message.dataBoostIsolationReadOnly != null && Object.hasOwnProperty.call(message, "dataBoostIsolationReadOnly")) + $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.encode(message.dataBoostIsolationReadOnly, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.standardIsolation != null && Object.hasOwnProperty.call(message, "standardIsolation")) + $root.google.bigtable.admin.v2.AppProfile.StandardIsolation.encode(message.standardIsolation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppProfile message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {google.bigtable.admin.v2.IAppProfile} message AppProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppProfile message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile} AppProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppProfile.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 5: { + message.multiClusterRoutingUseAny = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.decode(reader, reader.uint32()); + break; + } + case 6: { + message.singleClusterRouting = $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.decode(reader, reader.uint32()); + break; + } + case 7: { + message.priority = reader.int32(); + break; + } + case 11: { + message.standardIsolation = $root.google.bigtable.admin.v2.AppProfile.StandardIsolation.decode(reader, reader.uint32()); + break; + } + case 10: { + message.dataBoostIsolationReadOnly = $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile} AppProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppProfile message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppProfile.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.multiClusterRoutingUseAny != null && message.hasOwnProperty("multiClusterRoutingUseAny")) { + properties.routingPolicy = 1; + { + var error = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.verify(message.multiClusterRoutingUseAny); + if (error) + return "multiClusterRoutingUseAny." + error; + } + } + if (message.singleClusterRouting != null && message.hasOwnProperty("singleClusterRouting")) { + if (properties.routingPolicy === 1) + return "routingPolicy: multiple values"; + properties.routingPolicy = 1; + { + var error = $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.verify(message.singleClusterRouting); + if (error) + return "singleClusterRouting." + error; + } + } + if (message.priority != null && message.hasOwnProperty("priority")) { + properties.isolation = 1; + switch (message.priority) { + default: + return "priority: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.standardIsolation != null && message.hasOwnProperty("standardIsolation")) { + if (properties.isolation === 1) + return "isolation: multiple values"; + properties.isolation = 1; + { + var error = $root.google.bigtable.admin.v2.AppProfile.StandardIsolation.verify(message.standardIsolation); + if (error) + return "standardIsolation." + error; + } + } + if (message.dataBoostIsolationReadOnly != null && message.hasOwnProperty("dataBoostIsolationReadOnly")) { + if (properties.isolation === 1) + return "isolation: multiple values"; + properties.isolation = 1; + { + var error = $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.verify(message.dataBoostIsolationReadOnly); + if (error) + return "dataBoostIsolationReadOnly." + error; + } + } + return null; + }; + + /** + * Creates an AppProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile} AppProfile + */ + AppProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile) + return object; + var message = new $root.google.bigtable.admin.v2.AppProfile(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + if (object.description != null) + message.description = String(object.description); + if (object.multiClusterRoutingUseAny != null) { + if (typeof object.multiClusterRoutingUseAny !== "object") + throw TypeError(".google.bigtable.admin.v2.AppProfile.multiClusterRoutingUseAny: object expected"); + message.multiClusterRoutingUseAny = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.fromObject(object.multiClusterRoutingUseAny); + } + if (object.singleClusterRouting != null) { + if (typeof object.singleClusterRouting !== "object") + throw TypeError(".google.bigtable.admin.v2.AppProfile.singleClusterRouting: object expected"); + message.singleClusterRouting = $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.fromObject(object.singleClusterRouting); + } + switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; + case "PRIORITY_UNSPECIFIED": + case 0: + message.priority = 0; + break; + case "PRIORITY_LOW": + case 1: + message.priority = 1; + break; + case "PRIORITY_MEDIUM": + case 2: + message.priority = 2; + break; + case "PRIORITY_HIGH": + case 3: + message.priority = 3; + break; + } + if (object.standardIsolation != null) { + if (typeof object.standardIsolation !== "object") + throw TypeError(".google.bigtable.admin.v2.AppProfile.standardIsolation: object expected"); + message.standardIsolation = $root.google.bigtable.admin.v2.AppProfile.StandardIsolation.fromObject(object.standardIsolation); + } + if (object.dataBoostIsolationReadOnly != null) { + if (typeof object.dataBoostIsolationReadOnly !== "object") + throw TypeError(".google.bigtable.admin.v2.AppProfile.dataBoostIsolationReadOnly: object expected"); + message.dataBoostIsolationReadOnly = $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.fromObject(object.dataBoostIsolationReadOnly); + } + return message; + }; + + /** + * Creates a plain object from an AppProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {google.bigtable.admin.v2.AppProfile} message AppProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.multiClusterRoutingUseAny != null && message.hasOwnProperty("multiClusterRoutingUseAny")) { + object.multiClusterRoutingUseAny = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.toObject(message.multiClusterRoutingUseAny, options); + if (options.oneofs) + object.routingPolicy = "multiClusterRoutingUseAny"; + } + if (message.singleClusterRouting != null && message.hasOwnProperty("singleClusterRouting")) { + object.singleClusterRouting = $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.toObject(message.singleClusterRouting, options); + if (options.oneofs) + object.routingPolicy = "singleClusterRouting"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = options.enums === String ? $root.google.bigtable.admin.v2.AppProfile.Priority[message.priority] === undefined ? message.priority : $root.google.bigtable.admin.v2.AppProfile.Priority[message.priority] : message.priority; + if (options.oneofs) + object.isolation = "priority"; + } + if (message.dataBoostIsolationReadOnly != null && message.hasOwnProperty("dataBoostIsolationReadOnly")) { + object.dataBoostIsolationReadOnly = $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.toObject(message.dataBoostIsolationReadOnly, options); + if (options.oneofs) + object.isolation = "dataBoostIsolationReadOnly"; + } + if (message.standardIsolation != null && message.hasOwnProperty("standardIsolation")) { + object.standardIsolation = $root.google.bigtable.admin.v2.AppProfile.StandardIsolation.toObject(message.standardIsolation, options); + if (options.oneofs) + object.isolation = "standardIsolation"; + } + return object; + }; + + /** + * Converts this AppProfile to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + * @returns {Object.} JSON object + */ + AppProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppProfile + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile"; + }; + + AppProfile.MultiClusterRoutingUseAny = (function() { + + /** + * Properties of a MultiClusterRoutingUseAny. + * @memberof google.bigtable.admin.v2.AppProfile + * @interface IMultiClusterRoutingUseAny + * @property {Array.|null} [clusterIds] MultiClusterRoutingUseAny clusterIds + * @property {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity|null} [rowAffinity] MultiClusterRoutingUseAny rowAffinity + */ + + /** + * Constructs a new MultiClusterRoutingUseAny. + * @memberof google.bigtable.admin.v2.AppProfile + * @classdesc Represents a MultiClusterRoutingUseAny. + * @implements IMultiClusterRoutingUseAny + * @constructor + * @param {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny=} [properties] Properties to set + */ + function MultiClusterRoutingUseAny(properties) { + this.clusterIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiClusterRoutingUseAny clusterIds. + * @member {Array.} clusterIds + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @instance + */ + MultiClusterRoutingUseAny.prototype.clusterIds = $util.emptyArray; + + /** + * MultiClusterRoutingUseAny rowAffinity. + * @member {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity|null|undefined} rowAffinity + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @instance + */ + MultiClusterRoutingUseAny.prototype.rowAffinity = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MultiClusterRoutingUseAny affinity. + * @member {"rowAffinity"|undefined} affinity + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @instance + */ + Object.defineProperty(MultiClusterRoutingUseAny.prototype, "affinity", { + get: $util.oneOfGetter($oneOfFields = ["rowAffinity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MultiClusterRoutingUseAny instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} MultiClusterRoutingUseAny instance + */ + MultiClusterRoutingUseAny.create = function create(properties) { + return new MultiClusterRoutingUseAny(properties); + }; + + /** + * Encodes the specified MultiClusterRoutingUseAny message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny} message MultiClusterRoutingUseAny message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiClusterRoutingUseAny.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterIds != null && message.clusterIds.length) + for (var i = 0; i < message.clusterIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterIds[i]); + if (message.rowAffinity != null && Object.hasOwnProperty.call(message, "rowAffinity")) + $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.encode(message.rowAffinity, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MultiClusterRoutingUseAny message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny} message MultiClusterRoutingUseAny message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiClusterRoutingUseAny.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiClusterRoutingUseAny message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} MultiClusterRoutingUseAny + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiClusterRoutingUseAny.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.clusterIds && message.clusterIds.length)) + message.clusterIds = []; + message.clusterIds.push(reader.string()); + break; + } + case 3: { + message.rowAffinity = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiClusterRoutingUseAny message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} MultiClusterRoutingUseAny + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiClusterRoutingUseAny.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiClusterRoutingUseAny message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiClusterRoutingUseAny.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.clusterIds != null && message.hasOwnProperty("clusterIds")) { + if (!Array.isArray(message.clusterIds)) + return "clusterIds: array expected"; + for (var i = 0; i < message.clusterIds.length; ++i) + if (!$util.isString(message.clusterIds[i])) + return "clusterIds: string[] expected"; + } + if (message.rowAffinity != null && message.hasOwnProperty("rowAffinity")) { + properties.affinity = 1; + { + var error = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify(message.rowAffinity); + if (error) + return "rowAffinity." + error; + } + } + return null; + }; + + /** + * Creates a MultiClusterRoutingUseAny message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} MultiClusterRoutingUseAny + */ + MultiClusterRoutingUseAny.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) + return object; + var message = new $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny(); + if (object.clusterIds) { + if (!Array.isArray(object.clusterIds)) + throw TypeError(".google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.clusterIds: array expected"); + message.clusterIds = []; + for (var i = 0; i < object.clusterIds.length; ++i) + message.clusterIds[i] = String(object.clusterIds[i]); + } + if (object.rowAffinity != null) { + if (typeof object.rowAffinity !== "object") + throw TypeError(".google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.rowAffinity: object expected"); + message.rowAffinity = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.fromObject(object.rowAffinity); + } + return message; + }; + + /** + * Creates a plain object from a MultiClusterRoutingUseAny message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} message MultiClusterRoutingUseAny + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiClusterRoutingUseAny.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.clusterIds = []; + if (message.clusterIds && message.clusterIds.length) { + object.clusterIds = []; + for (var j = 0; j < message.clusterIds.length; ++j) + object.clusterIds[j] = message.clusterIds[j]; + } + if (message.rowAffinity != null && message.hasOwnProperty("rowAffinity")) { + object.rowAffinity = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.toObject(message.rowAffinity, options); + if (options.oneofs) + object.affinity = "rowAffinity"; + } + return object; + }; + + /** + * Converts this MultiClusterRoutingUseAny to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @instance + * @returns {Object.} JSON object + */ + MultiClusterRoutingUseAny.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiClusterRoutingUseAny + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiClusterRoutingUseAny.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny"; + }; + + MultiClusterRoutingUseAny.RowAffinity = (function() { + + /** + * Properties of a RowAffinity. + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @interface IRowAffinity + */ + + /** + * Constructs a new RowAffinity. + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @classdesc Represents a RowAffinity. + * @implements IRowAffinity + * @constructor + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity=} [properties] Properties to set + */ + function RowAffinity(properties) { + if (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 RowAffinity instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} RowAffinity instance + */ + RowAffinity.create = function create(properties) { + return new RowAffinity(properties); + }; + + /** + * Encodes the specified RowAffinity message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity} message RowAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RowAffinity message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity} message RowAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} RowAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowAffinity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} RowAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowAffinity message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RowAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} RowAffinity + */ + RowAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + return object; + return new $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity(); + }; + + /** + * Creates a plain object from a RowAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} message RowAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowAffinity.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RowAffinity to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @instance + * @returns {Object.} JSON object + */ + RowAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowAffinity + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity"; + }; + + return RowAffinity; + })(); + + return MultiClusterRoutingUseAny; + })(); + + AppProfile.SingleClusterRouting = (function() { + + /** + * Properties of a SingleClusterRouting. + * @memberof google.bigtable.admin.v2.AppProfile + * @interface ISingleClusterRouting + * @property {string|null} [clusterId] SingleClusterRouting clusterId + * @property {boolean|null} [allowTransactionalWrites] SingleClusterRouting allowTransactionalWrites + */ + + /** + * Constructs a new SingleClusterRouting. + * @memberof google.bigtable.admin.v2.AppProfile + * @classdesc Represents a SingleClusterRouting. + * @implements ISingleClusterRouting + * @constructor + * @param {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting=} [properties] Properties to set + */ + function SingleClusterRouting(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SingleClusterRouting clusterId. + * @member {string} clusterId + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @instance + */ + SingleClusterRouting.prototype.clusterId = ""; + + /** + * SingleClusterRouting allowTransactionalWrites. + * @member {boolean} allowTransactionalWrites + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @instance + */ + SingleClusterRouting.prototype.allowTransactionalWrites = false; + + /** + * Creates a new SingleClusterRouting instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} SingleClusterRouting instance + */ + SingleClusterRouting.create = function create(properties) { + return new SingleClusterRouting(properties); + }; + + /** + * Encodes the specified SingleClusterRouting message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.SingleClusterRouting.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting} message SingleClusterRouting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SingleClusterRouting.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterId); + if (message.allowTransactionalWrites != null && Object.hasOwnProperty.call(message, "allowTransactionalWrites")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowTransactionalWrites); + return writer; + }; + + /** + * Encodes the specified SingleClusterRouting message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.SingleClusterRouting.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting} message SingleClusterRouting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SingleClusterRouting.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SingleClusterRouting message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} SingleClusterRouting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SingleClusterRouting.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clusterId = reader.string(); + break; + } + case 2: { + message.allowTransactionalWrites = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SingleClusterRouting message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} SingleClusterRouting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SingleClusterRouting.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SingleClusterRouting message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SingleClusterRouting.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.allowTransactionalWrites != null && message.hasOwnProperty("allowTransactionalWrites")) + if (typeof message.allowTransactionalWrites !== "boolean") + return "allowTransactionalWrites: boolean expected"; + return null; + }; + + /** + * Creates a SingleClusterRouting message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} SingleClusterRouting + */ + SingleClusterRouting.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) + return object; + var message = new $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting(); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.allowTransactionalWrites != null) + message.allowTransactionalWrites = Boolean(object.allowTransactionalWrites); + return message; + }; + + /** + * Creates a plain object from a SingleClusterRouting message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} message SingleClusterRouting + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SingleClusterRouting.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clusterId = ""; + object.allowTransactionalWrites = false; + } + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.allowTransactionalWrites != null && message.hasOwnProperty("allowTransactionalWrites")) + object.allowTransactionalWrites = message.allowTransactionalWrites; + return object; + }; + + /** + * Converts this SingleClusterRouting to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @instance + * @returns {Object.} JSON object + */ + SingleClusterRouting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SingleClusterRouting + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SingleClusterRouting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile.SingleClusterRouting"; + }; + + return SingleClusterRouting; + })(); + + /** + * Priority enum. + * @name google.bigtable.admin.v2.AppProfile.Priority + * @enum {number} + * @property {number} PRIORITY_UNSPECIFIED=0 PRIORITY_UNSPECIFIED value + * @property {number} PRIORITY_LOW=1 PRIORITY_LOW value + * @property {number} PRIORITY_MEDIUM=2 PRIORITY_MEDIUM value + * @property {number} PRIORITY_HIGH=3 PRIORITY_HIGH value + */ + AppProfile.Priority = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIORITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIORITY_LOW"] = 1; + values[valuesById[2] = "PRIORITY_MEDIUM"] = 2; + values[valuesById[3] = "PRIORITY_HIGH"] = 3; + return values; + })(); + + AppProfile.StandardIsolation = (function() { + + /** + * Properties of a StandardIsolation. + * @memberof google.bigtable.admin.v2.AppProfile + * @interface IStandardIsolation + * @property {google.bigtable.admin.v2.AppProfile.Priority|null} [priority] StandardIsolation priority + */ + + /** + * Constructs a new StandardIsolation. + * @memberof google.bigtable.admin.v2.AppProfile + * @classdesc Represents a StandardIsolation. + * @implements IStandardIsolation + * @constructor + * @param {google.bigtable.admin.v2.AppProfile.IStandardIsolation=} [properties] Properties to set + */ + function StandardIsolation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StandardIsolation priority. + * @member {google.bigtable.admin.v2.AppProfile.Priority} priority + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @instance + */ + StandardIsolation.prototype.priority = 0; + + /** + * Creates a new StandardIsolation instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {google.bigtable.admin.v2.AppProfile.IStandardIsolation=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile.StandardIsolation} StandardIsolation instance + */ + StandardIsolation.create = function create(properties) { + return new StandardIsolation(properties); + }; + + /** + * Encodes the specified StandardIsolation message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.StandardIsolation.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {google.bigtable.admin.v2.AppProfile.IStandardIsolation} message StandardIsolation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardIsolation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.priority); + return writer; + }; + + /** + * Encodes the specified StandardIsolation message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.StandardIsolation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {google.bigtable.admin.v2.AppProfile.IStandardIsolation} message StandardIsolation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardIsolation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StandardIsolation message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile.StandardIsolation} StandardIsolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardIsolation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile.StandardIsolation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.priority = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StandardIsolation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile.StandardIsolation} StandardIsolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardIsolation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardIsolation message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardIsolation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + switch (message.priority) { + default: + return "priority: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a StandardIsolation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile.StandardIsolation} StandardIsolation + */ + StandardIsolation.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile.StandardIsolation) + return object; + var message = new $root.google.bigtable.admin.v2.AppProfile.StandardIsolation(); + switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; + case "PRIORITY_UNSPECIFIED": + case 0: + message.priority = 0; + break; + case "PRIORITY_LOW": + case 1: + message.priority = 1; + break; + case "PRIORITY_MEDIUM": + case 2: + message.priority = 2; + break; + case "PRIORITY_HIGH": + case 3: + message.priority = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a StandardIsolation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {google.bigtable.admin.v2.AppProfile.StandardIsolation} message StandardIsolation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardIsolation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = options.enums === String ? $root.google.bigtable.admin.v2.AppProfile.Priority[message.priority] === undefined ? message.priority : $root.google.bigtable.admin.v2.AppProfile.Priority[message.priority] : message.priority; + return object; + }; + + /** + * Converts this StandardIsolation to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @instance + * @returns {Object.} JSON object + */ + StandardIsolation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardIsolation + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardIsolation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile.StandardIsolation"; + }; + + return StandardIsolation; + })(); + + AppProfile.DataBoostIsolationReadOnly = (function() { + + /** + * Properties of a DataBoostIsolationReadOnly. + * @memberof google.bigtable.admin.v2.AppProfile + * @interface IDataBoostIsolationReadOnly + * @property {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner|null} [computeBillingOwner] DataBoostIsolationReadOnly computeBillingOwner + */ + + /** + * Constructs a new DataBoostIsolationReadOnly. + * @memberof google.bigtable.admin.v2.AppProfile + * @classdesc Represents a DataBoostIsolationReadOnly. + * @implements IDataBoostIsolationReadOnly + * @constructor + * @param {google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly=} [properties] Properties to set + */ + function DataBoostIsolationReadOnly(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataBoostIsolationReadOnly computeBillingOwner. + * @member {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner|null|undefined} computeBillingOwner + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @instance + */ + DataBoostIsolationReadOnly.prototype.computeBillingOwner = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataBoostIsolationReadOnly.prototype, "_computeBillingOwner", { + get: $util.oneOfGetter($oneOfFields = ["computeBillingOwner"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataBoostIsolationReadOnly instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} DataBoostIsolationReadOnly instance + */ + DataBoostIsolationReadOnly.create = function create(properties) { + return new DataBoostIsolationReadOnly(properties); + }; + + /** + * Encodes the specified DataBoostIsolationReadOnly message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly} message DataBoostIsolationReadOnly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataBoostIsolationReadOnly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.computeBillingOwner != null && Object.hasOwnProperty.call(message, "computeBillingOwner")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.computeBillingOwner); + return writer; + }; + + /** + * Encodes the specified DataBoostIsolationReadOnly message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly} message DataBoostIsolationReadOnly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataBoostIsolationReadOnly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataBoostIsolationReadOnly message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} DataBoostIsolationReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataBoostIsolationReadOnly.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.computeBillingOwner = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataBoostIsolationReadOnly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} DataBoostIsolationReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataBoostIsolationReadOnly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataBoostIsolationReadOnly message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataBoostIsolationReadOnly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.computeBillingOwner != null && message.hasOwnProperty("computeBillingOwner")) { + properties._computeBillingOwner = 1; + switch (message.computeBillingOwner) { + default: + return "computeBillingOwner: enum value expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a DataBoostIsolationReadOnly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} DataBoostIsolationReadOnly + */ + DataBoostIsolationReadOnly.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) + return object; + var message = new $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly(); + switch (object.computeBillingOwner) { + default: + if (typeof object.computeBillingOwner === "number") { + message.computeBillingOwner = object.computeBillingOwner; + break; + } + break; + case "COMPUTE_BILLING_OWNER_UNSPECIFIED": + case 0: + message.computeBillingOwner = 0; + break; + case "HOST_PAYS": + case 1: + message.computeBillingOwner = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a DataBoostIsolationReadOnly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} message DataBoostIsolationReadOnly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataBoostIsolationReadOnly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.computeBillingOwner != null && message.hasOwnProperty("computeBillingOwner")) { + object.computeBillingOwner = options.enums === String ? $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner[message.computeBillingOwner] === undefined ? message.computeBillingOwner : $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner[message.computeBillingOwner] : message.computeBillingOwner; + if (options.oneofs) + object._computeBillingOwner = "computeBillingOwner"; + } + return object; + }; + + /** + * Converts this DataBoostIsolationReadOnly to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @instance + * @returns {Object.} JSON object + */ + DataBoostIsolationReadOnly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataBoostIsolationReadOnly + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataBoostIsolationReadOnly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly"; + }; + + /** + * ComputeBillingOwner enum. + * @name google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + * @enum {number} + * @property {number} COMPUTE_BILLING_OWNER_UNSPECIFIED=0 COMPUTE_BILLING_OWNER_UNSPECIFIED value + * @property {number} HOST_PAYS=1 HOST_PAYS value + */ + DataBoostIsolationReadOnly.ComputeBillingOwner = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPUTE_BILLING_OWNER_UNSPECIFIED"] = 0; + values[valuesById[1] = "HOST_PAYS"] = 1; + return values; + })(); + + return DataBoostIsolationReadOnly; + })(); + + return AppProfile; + })(); + + v2.HotTablet = (function() { + + /** + * Properties of a HotTablet. + * @memberof google.bigtable.admin.v2 + * @interface IHotTablet + * @property {string|null} [name] HotTablet name + * @property {string|null} [tableName] HotTablet tableName + * @property {google.protobuf.ITimestamp|null} [startTime] HotTablet startTime + * @property {google.protobuf.ITimestamp|null} [endTime] HotTablet endTime + * @property {string|null} [startKey] HotTablet startKey + * @property {string|null} [endKey] HotTablet endKey + * @property {number|null} [nodeCpuUsagePercent] HotTablet nodeCpuUsagePercent + */ + + /** + * Constructs a new HotTablet. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a HotTablet. + * @implements IHotTablet + * @constructor + * @param {google.bigtable.admin.v2.IHotTablet=} [properties] Properties to set + */ + function HotTablet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HotTablet name. + * @member {string} name + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.name = ""; + + /** + * HotTablet tableName. + * @member {string} tableName + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.tableName = ""; + + /** + * HotTablet startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.startTime = null; + + /** + * HotTablet endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.endTime = null; + + /** + * HotTablet startKey. + * @member {string} startKey + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.startKey = ""; + + /** + * HotTablet endKey. + * @member {string} endKey + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.endKey = ""; + + /** + * HotTablet nodeCpuUsagePercent. + * @member {number} nodeCpuUsagePercent + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.nodeCpuUsagePercent = 0; + + /** + * Creates a new HotTablet instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {google.bigtable.admin.v2.IHotTablet=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.HotTablet} HotTablet instance + */ + HotTablet.create = function create(properties) { + return new HotTablet(properties); + }; + + /** + * Encodes the specified HotTablet message. Does not implicitly {@link google.bigtable.admin.v2.HotTablet.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {google.bigtable.admin.v2.IHotTablet} message HotTablet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HotTablet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableName); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.startKey != null && Object.hasOwnProperty.call(message, "startKey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.startKey); + if (message.endKey != null && Object.hasOwnProperty.call(message, "endKey")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.endKey); + if (message.nodeCpuUsagePercent != null && Object.hasOwnProperty.call(message, "nodeCpuUsagePercent")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.nodeCpuUsagePercent); + return writer; + }; + + /** + * Encodes the specified HotTablet message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.HotTablet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {google.bigtable.admin.v2.IHotTablet} message HotTablet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HotTablet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HotTablet message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.HotTablet} HotTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HotTablet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.HotTablet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.tableName = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.startKey = reader.string(); + break; + } + case 6: { + message.endKey = reader.string(); + break; + } + case 7: { + message.nodeCpuUsagePercent = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HotTablet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.HotTablet} HotTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HotTablet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HotTablet message. + * @function verify + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HotTablet.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.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.startKey != null && message.hasOwnProperty("startKey")) + if (!$util.isString(message.startKey)) + return "startKey: string expected"; + if (message.endKey != null && message.hasOwnProperty("endKey")) + if (!$util.isString(message.endKey)) + return "endKey: string expected"; + if (message.nodeCpuUsagePercent != null && message.hasOwnProperty("nodeCpuUsagePercent")) + if (typeof message.nodeCpuUsagePercent !== "number") + return "nodeCpuUsagePercent: number expected"; + return null; + }; + + /** + * Creates a HotTablet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.HotTablet} HotTablet + */ + HotTablet.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.HotTablet) + return object; + var message = new $root.google.bigtable.admin.v2.HotTablet(); + if (object.name != null) + message.name = String(object.name); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.HotTablet.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.HotTablet.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.startKey != null) + message.startKey = String(object.startKey); + if (object.endKey != null) + message.endKey = String(object.endKey); + if (object.nodeCpuUsagePercent != null) + message.nodeCpuUsagePercent = Number(object.nodeCpuUsagePercent); + return message; + }; + + /** + * Creates a plain object from a HotTablet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {google.bigtable.admin.v2.HotTablet} message HotTablet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HotTablet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.tableName = ""; + object.startTime = null; + object.endTime = null; + object.startKey = ""; + object.endKey = ""; + object.nodeCpuUsagePercent = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.startKey != null && message.hasOwnProperty("startKey")) + object.startKey = message.startKey; + if (message.endKey != null && message.hasOwnProperty("endKey")) + object.endKey = message.endKey; + if (message.nodeCpuUsagePercent != null && message.hasOwnProperty("nodeCpuUsagePercent")) + object.nodeCpuUsagePercent = options.json && !isFinite(message.nodeCpuUsagePercent) ? String(message.nodeCpuUsagePercent) : message.nodeCpuUsagePercent; + return object; + }; + + /** + * Converts this HotTablet to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + * @returns {Object.} JSON object + */ + HotTablet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HotTablet + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HotTablet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.HotTablet"; + }; + + return HotTablet; + })(); + + v2.LogicalView = (function() { + + /** + * Properties of a LogicalView. + * @memberof google.bigtable.admin.v2 + * @interface ILogicalView + * @property {string|null} [name] LogicalView name + * @property {string|null} [query] LogicalView query + * @property {string|null} [etag] LogicalView etag + * @property {boolean|null} [deletionProtection] LogicalView deletionProtection + */ + + /** + * Constructs a new LogicalView. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a LogicalView. + * @implements ILogicalView + * @constructor + * @param {google.bigtable.admin.v2.ILogicalView=} [properties] Properties to set + */ + function LogicalView(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogicalView name. + * @member {string} name + * @memberof google.bigtable.admin.v2.LogicalView + * @instance + */ + LogicalView.prototype.name = ""; + + /** + * LogicalView query. + * @member {string} query + * @memberof google.bigtable.admin.v2.LogicalView + * @instance + */ + LogicalView.prototype.query = ""; + + /** + * LogicalView etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.LogicalView + * @instance + */ + LogicalView.prototype.etag = ""; + + /** + * LogicalView deletionProtection. + * @member {boolean} deletionProtection + * @memberof google.bigtable.admin.v2.LogicalView + * @instance + */ + LogicalView.prototype.deletionProtection = false; + + /** + * Creates a new LogicalView instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {google.bigtable.admin.v2.ILogicalView=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.LogicalView} LogicalView instance + */ + LogicalView.create = function create(properties) { + return new LogicalView(properties); + }; + + /** + * Encodes the specified LogicalView message. Does not implicitly {@link google.bigtable.admin.v2.LogicalView.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {google.bigtable.admin.v2.ILogicalView} message LogicalView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogicalView.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deletionProtection); + return writer; + }; + + /** + * Encodes the specified LogicalView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.LogicalView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {google.bigtable.admin.v2.ILogicalView} message LogicalView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogicalView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogicalView message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.LogicalView} LogicalView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogicalView.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.LogicalView(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 6: { + message.deletionProtection = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogicalView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.LogicalView} LogicalView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogicalView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogicalView message. + * @function verify + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogicalView.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.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + return null; + }; + + /** + * Creates a LogicalView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.LogicalView} LogicalView + */ + LogicalView.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.LogicalView) + return object; + var message = new $root.google.bigtable.admin.v2.LogicalView(); + if (object.name != null) + message.name = String(object.name); + if (object.query != null) + message.query = String(object.query); + if (object.etag != null) + message.etag = String(object.etag); + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + return message; + }; + + /** + * Creates a plain object from a LogicalView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {google.bigtable.admin.v2.LogicalView} message LogicalView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogicalView.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.query = ""; + object.etag = ""; + object.deletionProtection = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + object.deletionProtection = message.deletionProtection; + return object; + }; + + /** + * Converts this LogicalView to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.LogicalView + * @instance + * @returns {Object.} JSON object + */ + LogicalView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogicalView + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogicalView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.LogicalView"; + }; + + return LogicalView; + })(); + + v2.MaterializedView = (function() { + + /** + * Properties of a MaterializedView. + * @memberof google.bigtable.admin.v2 + * @interface IMaterializedView + * @property {string|null} [name] MaterializedView name + * @property {string|null} [query] MaterializedView query + * @property {string|null} [etag] MaterializedView etag + * @property {boolean|null} [deletionProtection] MaterializedView deletionProtection + */ + + /** + * Constructs a new MaterializedView. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a MaterializedView. + * @implements IMaterializedView + * @constructor + * @param {google.bigtable.admin.v2.IMaterializedView=} [properties] Properties to set + */ + function MaterializedView(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaterializedView name. + * @member {string} name + * @memberof google.bigtable.admin.v2.MaterializedView + * @instance + */ + MaterializedView.prototype.name = ""; + + /** + * MaterializedView query. + * @member {string} query + * @memberof google.bigtable.admin.v2.MaterializedView + * @instance + */ + MaterializedView.prototype.query = ""; + + /** + * MaterializedView etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.MaterializedView + * @instance + */ + MaterializedView.prototype.etag = ""; + + /** + * MaterializedView deletionProtection. + * @member {boolean} deletionProtection + * @memberof google.bigtable.admin.v2.MaterializedView + * @instance + */ + MaterializedView.prototype.deletionProtection = false; + + /** + * Creates a new MaterializedView instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {google.bigtable.admin.v2.IMaterializedView=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.MaterializedView} MaterializedView instance + */ + MaterializedView.create = function create(properties) { + return new MaterializedView(properties); + }; + + /** + * Encodes the specified MaterializedView message. Does not implicitly {@link google.bigtable.admin.v2.MaterializedView.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {google.bigtable.admin.v2.IMaterializedView} message MaterializedView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializedView.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deletionProtection); + return writer; + }; + + /** + * Encodes the specified MaterializedView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.MaterializedView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {google.bigtable.admin.v2.IMaterializedView} message MaterializedView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializedView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaterializedView message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.MaterializedView} MaterializedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializedView.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.MaterializedView(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 6: { + message.deletionProtection = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaterializedView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.MaterializedView} MaterializedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializedView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaterializedView message. + * @function verify + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaterializedView.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.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + return null; + }; + + /** + * Creates a MaterializedView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.MaterializedView} MaterializedView + */ + MaterializedView.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.MaterializedView) + return object; + var message = new $root.google.bigtable.admin.v2.MaterializedView(); + if (object.name != null) + message.name = String(object.name); + if (object.query != null) + message.query = String(object.query); + if (object.etag != null) + message.etag = String(object.etag); + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + return message; + }; + + /** + * Creates a plain object from a MaterializedView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {google.bigtable.admin.v2.MaterializedView} message MaterializedView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaterializedView.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.query = ""; + object.etag = ""; + object.deletionProtection = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + object.deletionProtection = message.deletionProtection; + return object; + }; + + /** + * Converts this MaterializedView to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.MaterializedView + * @instance + * @returns {Object.} JSON object + */ + MaterializedView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaterializedView + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaterializedView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.MaterializedView"; + }; + + return MaterializedView; + })(); + + /** + * StorageType enum. + * @name google.bigtable.admin.v2.StorageType + * @enum {number} + * @property {number} STORAGE_TYPE_UNSPECIFIED=0 STORAGE_TYPE_UNSPECIFIED value + * @property {number} SSD=1 SSD value + * @property {number} HDD=2 HDD value + */ + v2.StorageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STORAGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SSD"] = 1; + values[valuesById[2] = "HDD"] = 2; + return values; + })(); + + v2.OperationProgress = (function() { + + /** + * Properties of an OperationProgress. + * @memberof google.bigtable.admin.v2 + * @interface IOperationProgress + * @property {number|null} [progressPercent] OperationProgress progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] OperationProgress startTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationProgress endTime + */ + + /** + * Constructs a new OperationProgress. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an OperationProgress. + * @implements IOperationProgress + * @constructor + * @param {google.bigtable.admin.v2.IOperationProgress=} [properties] Properties to set + */ + function OperationProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationProgress progressPercent. + * @member {number} progressPercent + * @memberof google.bigtable.admin.v2.OperationProgress + * @instance + */ + OperationProgress.prototype.progressPercent = 0; + + /** + * OperationProgress startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.OperationProgress + * @instance + */ + OperationProgress.prototype.startTime = null; + + /** + * OperationProgress endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.OperationProgress + * @instance + */ + OperationProgress.prototype.endTime = null; + + /** + * Creates a new OperationProgress instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {google.bigtable.admin.v2.IOperationProgress=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.OperationProgress} OperationProgress instance + */ + OperationProgress.create = function create(properties) { + return new OperationProgress(properties); + }; + + /** + * Encodes the specified OperationProgress message. Does not implicitly {@link google.bigtable.admin.v2.OperationProgress.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {google.bigtable.admin.v2.IOperationProgress} message OperationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.OperationProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {google.bigtable.admin.v2.IOperationProgress} message OperationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationProgress message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.OperationProgress} OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationProgress.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.OperationProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.OperationProgress} OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationProgress message. + * @function verify + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.OperationProgress} OperationProgress + */ + OperationProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.OperationProgress) + return object; + var message = new $root.google.bigtable.admin.v2.OperationProgress(); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.OperationProgress.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.OperationProgress.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {google.bigtable.admin.v2.OperationProgress} message OperationProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.progressPercent = 0; + object.startTime = null; + object.endTime = null; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this OperationProgress to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.OperationProgress + * @instance + * @returns {Object.} JSON object + */ + OperationProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationProgress + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.OperationProgress"; + }; + + return OperationProgress; + })(); + + v2.BigtableTableAdmin = (function() { + + /** + * Constructs a new BigtableTableAdmin service. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a BigtableTableAdmin + * @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 BigtableTableAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BigtableTableAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BigtableTableAdmin; + + /** + * Creates new BigtableTableAdmin service using the specified rpc implementation. + * @function create + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @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 {BigtableTableAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + BigtableTableAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CreateTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Table} [response] Table + */ + + /** + * Calls CreateTable. + * @function createTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateTableRequest} request CreateTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CreateTableCallback} callback Node-style callback called with the error, if any, and Table + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.createTable = function createTable(request, callback) { + return this.rpcCall(createTable, $root.google.bigtable.admin.v2.CreateTableRequest, $root.google.bigtable.admin.v2.Table, request, callback); + }, "name", { value: "CreateTable" }); + + /** + * Calls CreateTable. + * @function createTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateTableRequest} request CreateTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createTableFromSnapshot}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CreateTableFromSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTableFromSnapshot. + * @function createTableFromSnapshot + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest} request CreateTableFromSnapshotRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.createTableFromSnapshot = function createTableFromSnapshot(request, callback) { + return this.rpcCall(createTableFromSnapshot, $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTableFromSnapshot" }); + + /** + * Calls CreateTableFromSnapshot. + * @function createTableFromSnapshot + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest} request CreateTableFromSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listTables}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef ListTablesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListTablesResponse} [response] ListTablesResponse + */ + + /** + * Calls ListTables. + * @function listTables + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListTablesRequest} request ListTablesRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.ListTablesCallback} callback Node-style callback called with the error, if any, and ListTablesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.listTables = function listTables(request, callback) { + return this.rpcCall(listTables, $root.google.bigtable.admin.v2.ListTablesRequest, $root.google.bigtable.admin.v2.ListTablesResponse, request, callback); + }, "name", { value: "ListTables" }); + + /** + * Calls ListTables. + * @function listTables + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListTablesRequest} request ListTablesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GetTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Table} [response] Table + */ + + /** + * Calls GetTable. + * @function getTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetTableRequest} request GetTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GetTableCallback} callback Node-style callback called with the error, if any, and Table + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.getTable = function getTable(request, callback) { + return this.rpcCall(getTable, $root.google.bigtable.admin.v2.GetTableRequest, $root.google.bigtable.admin.v2.Table, request, callback); + }, "name", { value: "GetTable" }); + + /** + * Calls GetTable. + * @function getTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetTableRequest} request GetTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef UpdateTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateTable. + * @function updateTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateTableRequest} request UpdateTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.UpdateTableCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.updateTable = function updateTable(request, callback) { + return this.rpcCall(updateTable, $root.google.bigtable.admin.v2.UpdateTableRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateTable" }); + + /** + * Calls UpdateTable. + * @function updateTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateTableRequest} request UpdateTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef DeleteTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTable. + * @function deleteTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteTableRequest} request DeleteTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.DeleteTableCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.deleteTable = function deleteTable(request, callback) { + return this.rpcCall(deleteTable, $root.google.bigtable.admin.v2.DeleteTableRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTable" }); + + /** + * Calls DeleteTable. + * @function deleteTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteTableRequest} request DeleteTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|undeleteTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef UndeleteTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeleteTable. + * @function undeleteTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUndeleteTableRequest} request UndeleteTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTableCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.undeleteTable = function undeleteTable(request, callback) { + return this.rpcCall(undeleteTable, $root.google.bigtable.admin.v2.UndeleteTableRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeleteTable" }); + + /** + * Calls UndeleteTable. + * @function undeleteTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUndeleteTableRequest} request UndeleteTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createAuthorizedView}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CreateAuthorizedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateAuthorizedView. + * @function createAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewRequest} request CreateAuthorizedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedViewCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.createAuthorizedView = function createAuthorizedView(request, callback) { + return this.rpcCall(createAuthorizedView, $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateAuthorizedView" }); + + /** + * Calls CreateAuthorizedView. + * @function createAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewRequest} request CreateAuthorizedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listAuthorizedViews}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef ListAuthorizedViewsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListAuthorizedViewsResponse} [response] ListAuthorizedViewsResponse + */ + + /** + * Calls ListAuthorizedViews. + * @function listAuthorizedViews + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListAuthorizedViewsRequest} request ListAuthorizedViewsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViewsCallback} callback Node-style callback called with the error, if any, and ListAuthorizedViewsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.listAuthorizedViews = function listAuthorizedViews(request, callback) { + return this.rpcCall(listAuthorizedViews, $root.google.bigtable.admin.v2.ListAuthorizedViewsRequest, $root.google.bigtable.admin.v2.ListAuthorizedViewsResponse, request, callback); + }, "name", { value: "ListAuthorizedViews" }); + + /** + * Calls ListAuthorizedViews. + * @function listAuthorizedViews + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListAuthorizedViewsRequest} request ListAuthorizedViewsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getAuthorizedView}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GetAuthorizedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.AuthorizedView} [response] AuthorizedView + */ + + /** + * Calls GetAuthorizedView. + * @function getAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetAuthorizedViewRequest} request GetAuthorizedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedViewCallback} callback Node-style callback called with the error, if any, and AuthorizedView + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.getAuthorizedView = function getAuthorizedView(request, callback) { + return this.rpcCall(getAuthorizedView, $root.google.bigtable.admin.v2.GetAuthorizedViewRequest, $root.google.bigtable.admin.v2.AuthorizedView, request, callback); + }, "name", { value: "GetAuthorizedView" }); + + /** + * Calls GetAuthorizedView. + * @function getAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetAuthorizedViewRequest} request GetAuthorizedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateAuthorizedView}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef UpdateAuthorizedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateAuthorizedView. + * @function updateAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest} request UpdateAuthorizedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedViewCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.updateAuthorizedView = function updateAuthorizedView(request, callback) { + return this.rpcCall(updateAuthorizedView, $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateAuthorizedView" }); + + /** + * Calls UpdateAuthorizedView. + * @function updateAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest} request UpdateAuthorizedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteAuthorizedView}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef DeleteAuthorizedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAuthorizedView. + * @function deleteAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteAuthorizedViewRequest} request DeleteAuthorizedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedViewCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.deleteAuthorizedView = function deleteAuthorizedView(request, callback) { + return this.rpcCall(deleteAuthorizedView, $root.google.bigtable.admin.v2.DeleteAuthorizedViewRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAuthorizedView" }); + + /** + * Calls DeleteAuthorizedView. + * @function deleteAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteAuthorizedViewRequest} request DeleteAuthorizedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|modifyColumnFamilies}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef ModifyColumnFamiliesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Table} [response] Table + */ + + /** + * Calls ModifyColumnFamilies. + * @function modifyColumnFamilies + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest} request ModifyColumnFamiliesRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamiliesCallback} callback Node-style callback called with the error, if any, and Table + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.modifyColumnFamilies = function modifyColumnFamilies(request, callback) { + return this.rpcCall(modifyColumnFamilies, $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest, $root.google.bigtable.admin.v2.Table, request, callback); + }, "name", { value: "ModifyColumnFamilies" }); + + /** + * Calls ModifyColumnFamilies. + * @function modifyColumnFamilies + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest} request ModifyColumnFamiliesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|dropRowRange}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef DropRowRangeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DropRowRange. + * @function dropRowRange + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDropRowRangeRequest} request DropRowRangeRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.DropRowRangeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.dropRowRange = function dropRowRange(request, callback) { + return this.rpcCall(dropRowRange, $root.google.bigtable.admin.v2.DropRowRangeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DropRowRange" }); + + /** + * Calls DropRowRange. + * @function dropRowRange + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDropRowRangeRequest} request DropRowRangeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|generateConsistencyToken}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GenerateConsistencyTokenCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} [response] GenerateConsistencyTokenResponse + */ + + /** + * Calls GenerateConsistencyToken. + * @function generateConsistencyToken + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest} request GenerateConsistencyTokenRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyTokenCallback} callback Node-style callback called with the error, if any, and GenerateConsistencyTokenResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.generateConsistencyToken = function generateConsistencyToken(request, callback) { + return this.rpcCall(generateConsistencyToken, $root.google.bigtable.admin.v2.GenerateConsistencyTokenRequest, $root.google.bigtable.admin.v2.GenerateConsistencyTokenResponse, request, callback); + }, "name", { value: "GenerateConsistencyToken" }); + + /** + * Calls GenerateConsistencyToken. + * @function generateConsistencyToken + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest} request GenerateConsistencyTokenRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|checkConsistency}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CheckConsistencyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.CheckConsistencyResponse} [response] CheckConsistencyResponse + */ + + /** + * Calls CheckConsistency. + * @function checkConsistency + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest} request CheckConsistencyRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistencyCallback} callback Node-style callback called with the error, if any, and CheckConsistencyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.checkConsistency = function checkConsistency(request, callback) { + return this.rpcCall(checkConsistency, $root.google.bigtable.admin.v2.CheckConsistencyRequest, $root.google.bigtable.admin.v2.CheckConsistencyResponse, request, callback); + }, "name", { value: "CheckConsistency" }); + + /** + * Calls CheckConsistency. + * @function checkConsistency + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest} request CheckConsistencyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|snapshotTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef SnapshotTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SnapshotTable. + * @function snapshotTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ISnapshotTableRequest} request SnapshotTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTableCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.snapshotTable = function snapshotTable(request, callback) { + return this.rpcCall(snapshotTable, $root.google.bigtable.admin.v2.SnapshotTableRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SnapshotTable" }); + + /** + * Calls SnapshotTable. + * @function snapshotTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ISnapshotTableRequest} request SnapshotTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getSnapshot}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GetSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Snapshot} [response] Snapshot + */ + + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.getSnapshot = function getSnapshot(request, callback) { + return this.rpcCall(getSnapshot, $root.google.bigtable.admin.v2.GetSnapshotRequest, $root.google.bigtable.admin.v2.Snapshot, request, callback); + }, "name", { value: "GetSnapshot" }); + + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listSnapshots}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef ListSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListSnapshotsResponse} [response] ListSnapshotsResponse + */ + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ListSnapshotsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.listSnapshots = function listSnapshots(request, callback) { + return this.rpcCall(listSnapshots, $root.google.bigtable.admin.v2.ListSnapshotsRequest, $root.google.bigtable.admin.v2.ListSnapshotsResponse, request, callback); + }, "name", { value: "ListSnapshots" }); + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteSnapshot}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef DeleteSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshotCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.deleteSnapshot = function deleteSnapshot(request, callback) { + return this.rpcCall(deleteSnapshot, $root.google.bigtable.admin.v2.DeleteSnapshotRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSnapshot" }); + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createBackup}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.bigtable.admin.v2.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getBackup}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.bigtable.admin.v2.GetBackupRequest, $root.google.bigtable.admin.v2.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateBackup}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Backup} [response] Backup + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.bigtable.admin.v2.UpdateBackupRequest, $root.google.bigtable.admin.v2.Backup, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteBackup}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.bigtable.admin.v2.DeleteBackupRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listBackups}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.bigtable.admin.v2.ListBackupsRequest, $root.google.bigtable.admin.v2.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|restoreTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef RestoreTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreTable. + * @function restoreTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IRestoreTableRequest} request RestoreTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.RestoreTableCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.restoreTable = function restoreTable(request, callback) { + return this.rpcCall(restoreTable, $root.google.bigtable.admin.v2.RestoreTableRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreTable" }); + + /** + * Calls RestoreTable. + * @function restoreTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IRestoreTableRequest} request RestoreTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|copyBackup}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CopyBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CopyBackup. + * @function copyBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICopyBackupRequest} request CopyBackupRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CopyBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.copyBackup = function copyBackup(request, callback) { + return this.rpcCall(copyBackup, $root.google.bigtable.admin.v2.CopyBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CopyBackup" }); + + /** + * Calls CopyBackup. + * @function copyBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICopyBackupRequest} request CopyBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getIamPolicy}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|setIamPolicy}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|testIamPermissions}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createSchemaBundle}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CreateSchemaBundleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSchemaBundle. + * @function createSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateSchemaBundleRequest} request CreateSchemaBundleRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.createSchemaBundle = function createSchemaBundle(request, callback) { + return this.rpcCall(createSchemaBundle, $root.google.bigtable.admin.v2.CreateSchemaBundleRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSchemaBundle" }); + + /** + * Calls CreateSchemaBundle. + * @function createSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateSchemaBundleRequest} request CreateSchemaBundleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateSchemaBundle}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef UpdateSchemaBundleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateSchemaBundle. + * @function updateSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleRequest} request UpdateSchemaBundleRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.updateSchemaBundle = function updateSchemaBundle(request, callback) { + return this.rpcCall(updateSchemaBundle, $root.google.bigtable.admin.v2.UpdateSchemaBundleRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateSchemaBundle" }); + + /** + * Calls UpdateSchemaBundle. + * @function updateSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleRequest} request UpdateSchemaBundleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getSchemaBundle}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GetSchemaBundleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.SchemaBundle} [response] SchemaBundle + */ + + /** + * Calls GetSchemaBundle. + * @function getSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetSchemaBundleRequest} request GetSchemaBundleRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundleCallback} callback Node-style callback called with the error, if any, and SchemaBundle + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.getSchemaBundle = function getSchemaBundle(request, callback) { + return this.rpcCall(getSchemaBundle, $root.google.bigtable.admin.v2.GetSchemaBundleRequest, $root.google.bigtable.admin.v2.SchemaBundle, request, callback); + }, "name", { value: "GetSchemaBundle" }); + + /** + * Calls GetSchemaBundle. + * @function getSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetSchemaBundleRequest} request GetSchemaBundleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listSchemaBundles}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef ListSchemaBundlesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListSchemaBundlesResponse} [response] ListSchemaBundlesResponse + */ + + /** + * Calls ListSchemaBundles. + * @function listSchemaBundles + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListSchemaBundlesRequest} request ListSchemaBundlesRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundlesCallback} callback Node-style callback called with the error, if any, and ListSchemaBundlesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.listSchemaBundles = function listSchemaBundles(request, callback) { + return this.rpcCall(listSchemaBundles, $root.google.bigtable.admin.v2.ListSchemaBundlesRequest, $root.google.bigtable.admin.v2.ListSchemaBundlesResponse, request, callback); + }, "name", { value: "ListSchemaBundles" }); + + /** + * Calls ListSchemaBundles. + * @function listSchemaBundles + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListSchemaBundlesRequest} request ListSchemaBundlesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteSchemaBundle}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef DeleteSchemaBundleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSchemaBundle. + * @function deleteSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteSchemaBundleRequest} request DeleteSchemaBundleRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.deleteSchemaBundle = function deleteSchemaBundle(request, callback) { + return this.rpcCall(deleteSchemaBundle, $root.google.bigtable.admin.v2.DeleteSchemaBundleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSchemaBundle" }); + + /** + * Calls DeleteSchemaBundle. + * @function deleteSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteSchemaBundleRequest} request DeleteSchemaBundleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BigtableTableAdmin; + })(); + + v2.RestoreTableRequest = (function() { + + /** + * Properties of a RestoreTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface IRestoreTableRequest + * @property {string|null} [parent] RestoreTableRequest parent + * @property {string|null} [tableId] RestoreTableRequest tableId + * @property {string|null} [backup] RestoreTableRequest backup + */ + + /** + * Constructs a new RestoreTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a RestoreTableRequest. + * @implements IRestoreTableRequest + * @constructor + * @param {google.bigtable.admin.v2.IRestoreTableRequest=} [properties] Properties to set + */ + function RestoreTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreTableRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @instance + */ + RestoreTableRequest.prototype.parent = ""; + + /** + * RestoreTableRequest tableId. + * @member {string} tableId + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @instance + */ + RestoreTableRequest.prototype.tableId = ""; + + /** + * RestoreTableRequest backup. + * @member {string|null|undefined} backup + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @instance + */ + RestoreTableRequest.prototype.backup = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreTableRequest source. + * @member {"backup"|undefined} source + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @instance + */ + Object.defineProperty(RestoreTableRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {google.bigtable.admin.v2.IRestoreTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.RestoreTableRequest} RestoreTableRequest instance + */ + RestoreTableRequest.create = function create(properties) { + return new RestoreTableRequest(properties); + }; + + /** + * Encodes the specified RestoreTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {google.bigtable.admin.v2.IRestoreTableRequest} message RestoreTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backup); + return writer; + }; + + /** + * Encodes the specified RestoreTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {google.bigtable.admin.v2.IRestoreTableRequest} message RestoreTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.RestoreTableRequest} RestoreTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.RestoreTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tableId = reader.string(); + break; + } + case 3: { + message.backup = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.RestoreTableRequest} RestoreTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreTableRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + properties.source = 1; + if (!$util.isString(message.backup)) + return "backup: string expected"; + } + return null; + }; + + /** + * Creates a RestoreTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.RestoreTableRequest} RestoreTableRequest + */ + RestoreTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.RestoreTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.RestoreTableRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.backup != null) + message.backup = String(object.backup); + return message; + }; + + /** + * Creates a plain object from a RestoreTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {google.bigtable.admin.v2.RestoreTableRequest} message RestoreTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreTableRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tableId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.backup != null && message.hasOwnProperty("backup")) { + object.backup = message.backup; + if (options.oneofs) + object.source = "backup"; + } + return object; + }; + + /** + * Converts this RestoreTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.RestoreTableRequest"; + }; + + return RestoreTableRequest; + })(); + + v2.RestoreTableMetadata = (function() { + + /** + * Properties of a RestoreTableMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IRestoreTableMetadata + * @property {string|null} [name] RestoreTableMetadata name + * @property {google.bigtable.admin.v2.RestoreSourceType|null} [sourceType] RestoreTableMetadata sourceType + * @property {google.bigtable.admin.v2.IBackupInfo|null} [backupInfo] RestoreTableMetadata backupInfo + * @property {string|null} [optimizeTableOperationName] RestoreTableMetadata optimizeTableOperationName + * @property {google.bigtable.admin.v2.IOperationProgress|null} [progress] RestoreTableMetadata progress + */ + + /** + * Constructs a new RestoreTableMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a RestoreTableMetadata. + * @implements IRestoreTableMetadata + * @constructor + * @param {google.bigtable.admin.v2.IRestoreTableMetadata=} [properties] Properties to set + */ + function RestoreTableMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreTableMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + */ + RestoreTableMetadata.prototype.name = ""; + + /** + * RestoreTableMetadata sourceType. + * @member {google.bigtable.admin.v2.RestoreSourceType} sourceType + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + */ + RestoreTableMetadata.prototype.sourceType = 0; + + /** + * RestoreTableMetadata backupInfo. + * @member {google.bigtable.admin.v2.IBackupInfo|null|undefined} backupInfo + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + */ + RestoreTableMetadata.prototype.backupInfo = null; + + /** + * RestoreTableMetadata optimizeTableOperationName. + * @member {string} optimizeTableOperationName + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + */ + RestoreTableMetadata.prototype.optimizeTableOperationName = ""; + + /** + * RestoreTableMetadata progress. + * @member {google.bigtable.admin.v2.IOperationProgress|null|undefined} progress + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + */ + RestoreTableMetadata.prototype.progress = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreTableMetadata sourceInfo. + * @member {"backupInfo"|undefined} sourceInfo + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + */ + Object.defineProperty(RestoreTableMetadata.prototype, "sourceInfo", { + get: $util.oneOfGetter($oneOfFields = ["backupInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreTableMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {google.bigtable.admin.v2.IRestoreTableMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.RestoreTableMetadata} RestoreTableMetadata instance + */ + RestoreTableMetadata.create = function create(properties) { + return new RestoreTableMetadata(properties); + }; + + /** + * Encodes the specified RestoreTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {google.bigtable.admin.v2.IRestoreTableMetadata} message RestoreTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreTableMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sourceType); + if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) + $root.google.bigtable.admin.v2.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.optimizeTableOperationName != null && Object.hasOwnProperty.call(message, "optimizeTableOperationName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.optimizeTableOperationName); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.bigtable.admin.v2.OperationProgress.encode(message.progress, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {google.bigtable.admin.v2.IRestoreTableMetadata} message RestoreTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreTableMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreTableMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.RestoreTableMetadata} RestoreTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreTableMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.RestoreTableMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceType = reader.int32(); + break; + } + case 3: { + message.backupInfo = $root.google.bigtable.admin.v2.BackupInfo.decode(reader, reader.uint32()); + break; + } + case 4: { + message.optimizeTableOperationName = reader.string(); + break; + } + case 5: { + message.progress = $root.google.bigtable.admin.v2.OperationProgress.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreTableMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.RestoreTableMetadata} RestoreTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreTableMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreTableMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreTableMetadata.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.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + properties.sourceInfo = 1; + { + var error = $root.google.bigtable.admin.v2.BackupInfo.verify(message.backupInfo); + if (error) + return "backupInfo." + error; + } + } + if (message.optimizeTableOperationName != null && message.hasOwnProperty("optimizeTableOperationName")) + if (!$util.isString(message.optimizeTableOperationName)) + return "optimizeTableOperationName: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.bigtable.admin.v2.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + return null; + }; + + /** + * Creates a RestoreTableMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.RestoreTableMetadata} RestoreTableMetadata + */ + RestoreTableMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.RestoreTableMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.RestoreTableMetadata(); + if (object.name != null) + message.name = String(object.name); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "RESTORE_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "BACKUP": + case 1: + message.sourceType = 1; + break; + } + if (object.backupInfo != null) { + if (typeof object.backupInfo !== "object") + throw TypeError(".google.bigtable.admin.v2.RestoreTableMetadata.backupInfo: object expected"); + message.backupInfo = $root.google.bigtable.admin.v2.BackupInfo.fromObject(object.backupInfo); + } + if (object.optimizeTableOperationName != null) + message.optimizeTableOperationName = String(object.optimizeTableOperationName); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.bigtable.admin.v2.RestoreTableMetadata.progress: object expected"); + message.progress = $root.google.bigtable.admin.v2.OperationProgress.fromObject(object.progress); + } + return message; + }; + + /** + * Creates a plain object from a RestoreTableMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {google.bigtable.admin.v2.RestoreTableMetadata} message RestoreTableMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreTableMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceType = options.enums === String ? "RESTORE_SOURCE_TYPE_UNSPECIFIED" : 0; + object.optimizeTableOperationName = ""; + object.progress = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.bigtable.admin.v2.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.bigtable.admin.v2.RestoreSourceType[message.sourceType] : message.sourceType; + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + object.backupInfo = $root.google.bigtable.admin.v2.BackupInfo.toObject(message.backupInfo, options); + if (options.oneofs) + object.sourceInfo = "backupInfo"; + } + if (message.optimizeTableOperationName != null && message.hasOwnProperty("optimizeTableOperationName")) + object.optimizeTableOperationName = message.optimizeTableOperationName; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.bigtable.admin.v2.OperationProgress.toObject(message.progress, options); + return object; + }; + + /** + * Converts this RestoreTableMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + * @returns {Object.} JSON object + */ + RestoreTableMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreTableMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreTableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.RestoreTableMetadata"; + }; + + return RestoreTableMetadata; + })(); + + v2.OptimizeRestoredTableMetadata = (function() { + + /** + * Properties of an OptimizeRestoredTableMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IOptimizeRestoredTableMetadata + * @property {string|null} [name] OptimizeRestoredTableMetadata name + * @property {google.bigtable.admin.v2.IOperationProgress|null} [progress] OptimizeRestoredTableMetadata progress + */ + + /** + * Constructs a new OptimizeRestoredTableMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an OptimizeRestoredTableMetadata. + * @implements IOptimizeRestoredTableMetadata + * @constructor + * @param {google.bigtable.admin.v2.IOptimizeRestoredTableMetadata=} [properties] Properties to set + */ + function OptimizeRestoredTableMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OptimizeRestoredTableMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @instance + */ + OptimizeRestoredTableMetadata.prototype.name = ""; + + /** + * OptimizeRestoredTableMetadata progress. + * @member {google.bigtable.admin.v2.IOperationProgress|null|undefined} progress + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @instance + */ + OptimizeRestoredTableMetadata.prototype.progress = null; + + /** + * Creates a new OptimizeRestoredTableMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {google.bigtable.admin.v2.IOptimizeRestoredTableMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.OptimizeRestoredTableMetadata} OptimizeRestoredTableMetadata instance + */ + OptimizeRestoredTableMetadata.create = function create(properties) { + return new OptimizeRestoredTableMetadata(properties); + }; + + /** + * Encodes the specified OptimizeRestoredTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.OptimizeRestoredTableMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {google.bigtable.admin.v2.IOptimizeRestoredTableMetadata} message OptimizeRestoredTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeRestoredTableMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.bigtable.admin.v2.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OptimizeRestoredTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.OptimizeRestoredTableMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {google.bigtable.admin.v2.IOptimizeRestoredTableMetadata} message OptimizeRestoredTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeRestoredTableMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OptimizeRestoredTableMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.OptimizeRestoredTableMetadata} OptimizeRestoredTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeRestoredTableMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.OptimizeRestoredTableMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.progress = $root.google.bigtable.admin.v2.OperationProgress.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OptimizeRestoredTableMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.OptimizeRestoredTableMetadata} OptimizeRestoredTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeRestoredTableMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OptimizeRestoredTableMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OptimizeRestoredTableMetadata.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.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.bigtable.admin.v2.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + return null; + }; + + /** + * Creates an OptimizeRestoredTableMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.OptimizeRestoredTableMetadata} OptimizeRestoredTableMetadata + */ + OptimizeRestoredTableMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.OptimizeRestoredTableMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.OptimizeRestoredTableMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.bigtable.admin.v2.OptimizeRestoredTableMetadata.progress: object expected"); + message.progress = $root.google.bigtable.admin.v2.OperationProgress.fromObject(object.progress); + } + return message; + }; + + /** + * Creates a plain object from an OptimizeRestoredTableMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {google.bigtable.admin.v2.OptimizeRestoredTableMetadata} message OptimizeRestoredTableMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OptimizeRestoredTableMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.progress = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.bigtable.admin.v2.OperationProgress.toObject(message.progress, options); + return object; + }; + + /** + * Converts this OptimizeRestoredTableMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @instance + * @returns {Object.} JSON object + */ + OptimizeRestoredTableMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OptimizeRestoredTableMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OptimizeRestoredTableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.OptimizeRestoredTableMetadata"; + }; + + return OptimizeRestoredTableMetadata; + })(); + + v2.CreateTableRequest = (function() { + + /** + * Properties of a CreateTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateTableRequest + * @property {string|null} [parent] CreateTableRequest parent + * @property {string|null} [tableId] CreateTableRequest tableId + * @property {google.bigtable.admin.v2.ITable|null} [table] CreateTableRequest table + * @property {Array.|null} [initialSplits] CreateTableRequest initialSplits + */ + + /** + * Constructs a new CreateTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateTableRequest. + * @implements ICreateTableRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateTableRequest=} [properties] Properties to set + */ + function CreateTableRequest(properties) { + this.initialSplits = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTableRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @instance + */ + CreateTableRequest.prototype.parent = ""; + + /** + * CreateTableRequest tableId. + * @member {string} tableId + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @instance + */ + CreateTableRequest.prototype.tableId = ""; + + /** + * CreateTableRequest table. + * @member {google.bigtable.admin.v2.ITable|null|undefined} table + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @instance + */ + CreateTableRequest.prototype.table = null; + + /** + * CreateTableRequest initialSplits. + * @member {Array.} initialSplits + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @instance + */ + CreateTableRequest.prototype.initialSplits = $util.emptyArray; + + /** + * Creates a new CreateTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {google.bigtable.admin.v2.ICreateTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest instance + */ + CreateTableRequest.create = function create(properties) { + return new CreateTableRequest(properties); + }; + + /** + * Encodes the specified CreateTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {google.bigtable.admin.v2.ICreateTableRequest} message CreateTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.google.bigtable.admin.v2.Table.encode(message.table, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.initialSplits != null && message.initialSplits.length) + for (var i = 0; i < message.initialSplits.length; ++i) + $root.google.bigtable.admin.v2.CreateTableRequest.Split.encode(message.initialSplits[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {google.bigtable.admin.v2.ICreateTableRequest} message CreateTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tableId = reader.string(); + break; + } + case 3: { + message.table = $root.google.bigtable.admin.v2.Table.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.initialSplits && message.initialSplits.length)) + message.initialSplits = []; + message.initialSplits.push($root.google.bigtable.admin.v2.CreateTableRequest.Split.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTableRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.table != null && message.hasOwnProperty("table")) { + var error = $root.google.bigtable.admin.v2.Table.verify(message.table); + if (error) + return "table." + error; + } + if (message.initialSplits != null && message.hasOwnProperty("initialSplits")) { + if (!Array.isArray(message.initialSplits)) + return "initialSplits: array expected"; + for (var i = 0; i < message.initialSplits.length; ++i) { + var error = $root.google.bigtable.admin.v2.CreateTableRequest.Split.verify(message.initialSplits[i]); + if (error) + return "initialSplits." + error; + } + } + return null; + }; + + /** + * Creates a CreateTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest + */ + CreateTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateTableRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.table != null) { + if (typeof object.table !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateTableRequest.table: object expected"); + message.table = $root.google.bigtable.admin.v2.Table.fromObject(object.table); + } + if (object.initialSplits) { + if (!Array.isArray(object.initialSplits)) + throw TypeError(".google.bigtable.admin.v2.CreateTableRequest.initialSplits: array expected"); + message.initialSplits = []; + for (var i = 0; i < object.initialSplits.length; ++i) { + if (typeof object.initialSplits[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateTableRequest.initialSplits: object expected"); + message.initialSplits[i] = $root.google.bigtable.admin.v2.CreateTableRequest.Split.fromObject(object.initialSplits[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {google.bigtable.admin.v2.CreateTableRequest} message CreateTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTableRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.initialSplits = []; + if (options.defaults) { + object.parent = ""; + object.tableId = ""; + object.table = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.table != null && message.hasOwnProperty("table")) + object.table = $root.google.bigtable.admin.v2.Table.toObject(message.table, options); + if (message.initialSplits && message.initialSplits.length) { + object.initialSplits = []; + for (var j = 0; j < message.initialSplits.length; ++j) + object.initialSplits[j] = $root.google.bigtable.admin.v2.CreateTableRequest.Split.toObject(message.initialSplits[j], options); + } + return object; + }; + + /** + * Converts this CreateTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateTableRequest"; + }; + + CreateTableRequest.Split = (function() { + + /** + * Properties of a Split. + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @interface ISplit + * @property {Uint8Array|null} [key] Split key + */ + + /** + * Constructs a new Split. + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @classdesc Represents a Split. + * @implements ISplit + * @constructor + * @param {google.bigtable.admin.v2.CreateTableRequest.ISplit=} [properties] Properties to set + */ + function Split(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Split key. + * @member {Uint8Array} key + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @instance + */ + Split.prototype.key = $util.newBuffer([]); + + /** + * Creates a new Split instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {google.bigtable.admin.v2.CreateTableRequest.ISplit=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateTableRequest.Split} Split instance + */ + Split.create = function create(properties) { + return new Split(properties); + }; + + /** + * Encodes the specified Split message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.Split.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {google.bigtable.admin.v2.CreateTableRequest.ISplit} message Split message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Split.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + return writer; + }; + + /** + * Encodes the specified Split message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.Split.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {google.bigtable.admin.v2.CreateTableRequest.ISplit} message Split message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Split.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Split message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateTableRequest.Split} Split + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Split.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateTableRequest.Split(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.key = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Split message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateTableRequest.Split} Split + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Split.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Split message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Split.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + return null; + }; + + /** + * Creates a Split message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateTableRequest.Split} Split + */ + Split.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateTableRequest.Split) + return object; + var message = new $root.google.bigtable.admin.v2.CreateTableRequest.Split(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length >= 0) + message.key = object.key; + return message; + }; + + /** + * Creates a plain object from a Split message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {google.bigtable.admin.v2.CreateTableRequest.Split} message Split + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Split.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + return object; + }; + + /** + * Converts this Split to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @instance + * @returns {Object.} JSON object + */ + Split.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Split + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Split.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateTableRequest.Split"; + }; + + return Split; + })(); + + return CreateTableRequest; + })(); + + v2.CreateTableFromSnapshotRequest = (function() { + + /** + * Properties of a CreateTableFromSnapshotRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateTableFromSnapshotRequest + * @property {string|null} [parent] CreateTableFromSnapshotRequest parent + * @property {string|null} [tableId] CreateTableFromSnapshotRequest tableId + * @property {string|null} [sourceSnapshot] CreateTableFromSnapshotRequest sourceSnapshot + */ + + /** + * Constructs a new CreateTableFromSnapshotRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateTableFromSnapshotRequest. + * @implements ICreateTableFromSnapshotRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest=} [properties] Properties to set + */ + function CreateTableFromSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTableFromSnapshotRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @instance + */ + CreateTableFromSnapshotRequest.prototype.parent = ""; + + /** + * CreateTableFromSnapshotRequest tableId. + * @member {string} tableId + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @instance + */ + CreateTableFromSnapshotRequest.prototype.tableId = ""; + + /** + * CreateTableFromSnapshotRequest sourceSnapshot. + * @member {string} sourceSnapshot + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @instance + */ + CreateTableFromSnapshotRequest.prototype.sourceSnapshot = ""; + + /** + * Creates a new CreateTableFromSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} CreateTableFromSnapshotRequest instance + */ + CreateTableFromSnapshotRequest.create = function create(properties) { + return new CreateTableFromSnapshotRequest(properties); + }; + + /** + * Encodes the specified CreateTableFromSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest} message CreateTableFromSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableFromSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); + if (message.sourceSnapshot != null && Object.hasOwnProperty.call(message, "sourceSnapshot")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceSnapshot); + return writer; + }; + + /** + * Encodes the specified CreateTableFromSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest} message CreateTableFromSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableFromSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTableFromSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} CreateTableFromSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableFromSnapshotRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tableId = reader.string(); + break; + } + case 3: { + message.sourceSnapshot = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTableFromSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} CreateTableFromSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableFromSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTableFromSnapshotRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTableFromSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) + if (!$util.isString(message.sourceSnapshot)) + return "sourceSnapshot: string expected"; + return null; + }; + + /** + * Creates a CreateTableFromSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} CreateTableFromSnapshotRequest + */ + CreateTableFromSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.sourceSnapshot != null) + message.sourceSnapshot = String(object.sourceSnapshot); + return message; + }; + + /** + * Creates a plain object from a CreateTableFromSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} message CreateTableFromSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTableFromSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tableId = ""; + object.sourceSnapshot = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) + object.sourceSnapshot = message.sourceSnapshot; + return object; + }; + + /** + * Converts this CreateTableFromSnapshotRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTableFromSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTableFromSnapshotRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTableFromSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateTableFromSnapshotRequest"; + }; + + return CreateTableFromSnapshotRequest; + })(); + + v2.DropRowRangeRequest = (function() { + + /** + * Properties of a DropRowRangeRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDropRowRangeRequest + * @property {string|null} [name] DropRowRangeRequest name + * @property {Uint8Array|null} [rowKeyPrefix] DropRowRangeRequest rowKeyPrefix + * @property {boolean|null} [deleteAllDataFromTable] DropRowRangeRequest deleteAllDataFromTable + */ + + /** + * Constructs a new DropRowRangeRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DropRowRangeRequest. + * @implements IDropRowRangeRequest + * @constructor + * @param {google.bigtable.admin.v2.IDropRowRangeRequest=} [properties] Properties to set + */ + function DropRowRangeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DropRowRangeRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @instance + */ + DropRowRangeRequest.prototype.name = ""; + + /** + * DropRowRangeRequest rowKeyPrefix. + * @member {Uint8Array|null|undefined} rowKeyPrefix + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @instance + */ + DropRowRangeRequest.prototype.rowKeyPrefix = null; + + /** + * DropRowRangeRequest deleteAllDataFromTable. + * @member {boolean|null|undefined} deleteAllDataFromTable + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @instance + */ + DropRowRangeRequest.prototype.deleteAllDataFromTable = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DropRowRangeRequest target. + * @member {"rowKeyPrefix"|"deleteAllDataFromTable"|undefined} target + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @instance + */ + Object.defineProperty(DropRowRangeRequest.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["rowKeyPrefix", "deleteAllDataFromTable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DropRowRangeRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {google.bigtable.admin.v2.IDropRowRangeRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DropRowRangeRequest} DropRowRangeRequest instance + */ + DropRowRangeRequest.create = function create(properties) { + return new DropRowRangeRequest(properties); + }; + + /** + * Encodes the specified DropRowRangeRequest message. Does not implicitly {@link google.bigtable.admin.v2.DropRowRangeRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {google.bigtable.admin.v2.IDropRowRangeRequest} message DropRowRangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropRowRangeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.rowKeyPrefix != null && Object.hasOwnProperty.call(message, "rowKeyPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rowKeyPrefix); + if (message.deleteAllDataFromTable != null && Object.hasOwnProperty.call(message, "deleteAllDataFromTable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deleteAllDataFromTable); + return writer; + }; + + /** + * Encodes the specified DropRowRangeRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DropRowRangeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {google.bigtable.admin.v2.IDropRowRangeRequest} message DropRowRangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropRowRangeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DropRowRangeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DropRowRangeRequest} DropRowRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropRowRangeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DropRowRangeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.rowKeyPrefix = reader.bytes(); + break; + } + case 3: { + message.deleteAllDataFromTable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DropRowRangeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DropRowRangeRequest} DropRowRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropRowRangeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DropRowRangeRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DropRowRangeRequest.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.rowKeyPrefix != null && message.hasOwnProperty("rowKeyPrefix")) { + properties.target = 1; + if (!(message.rowKeyPrefix && typeof message.rowKeyPrefix.length === "number" || $util.isString(message.rowKeyPrefix))) + return "rowKeyPrefix: buffer expected"; + } + if (message.deleteAllDataFromTable != null && message.hasOwnProperty("deleteAllDataFromTable")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (typeof message.deleteAllDataFromTable !== "boolean") + return "deleteAllDataFromTable: boolean expected"; + } + return null; + }; + + /** + * Creates a DropRowRangeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DropRowRangeRequest} DropRowRangeRequest + */ + DropRowRangeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DropRowRangeRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DropRowRangeRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.rowKeyPrefix != null) + if (typeof object.rowKeyPrefix === "string") + $util.base64.decode(object.rowKeyPrefix, message.rowKeyPrefix = $util.newBuffer($util.base64.length(object.rowKeyPrefix)), 0); + else if (object.rowKeyPrefix.length >= 0) + message.rowKeyPrefix = object.rowKeyPrefix; + if (object.deleteAllDataFromTable != null) + message.deleteAllDataFromTable = Boolean(object.deleteAllDataFromTable); + return message; + }; + + /** + * Creates a plain object from a DropRowRangeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {google.bigtable.admin.v2.DropRowRangeRequest} message DropRowRangeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DropRowRangeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.rowKeyPrefix != null && message.hasOwnProperty("rowKeyPrefix")) { + object.rowKeyPrefix = options.bytes === String ? $util.base64.encode(message.rowKeyPrefix, 0, message.rowKeyPrefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKeyPrefix) : message.rowKeyPrefix; + if (options.oneofs) + object.target = "rowKeyPrefix"; + } + if (message.deleteAllDataFromTable != null && message.hasOwnProperty("deleteAllDataFromTable")) { + object.deleteAllDataFromTable = message.deleteAllDataFromTable; + if (options.oneofs) + object.target = "deleteAllDataFromTable"; + } + return object; + }; + + /** + * Converts this DropRowRangeRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @instance + * @returns {Object.} JSON object + */ + DropRowRangeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DropRowRangeRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DropRowRangeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DropRowRangeRequest"; + }; + + return DropRowRangeRequest; + })(); + + v2.ListTablesRequest = (function() { + + /** + * Properties of a ListTablesRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListTablesRequest + * @property {string|null} [parent] ListTablesRequest parent + * @property {google.bigtable.admin.v2.Table.View|null} [view] ListTablesRequest view + * @property {number|null} [pageSize] ListTablesRequest pageSize + * @property {string|null} [pageToken] ListTablesRequest pageToken + */ + + /** + * Constructs a new ListTablesRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListTablesRequest. + * @implements IListTablesRequest + * @constructor + * @param {google.bigtable.admin.v2.IListTablesRequest=} [properties] Properties to set + */ + function ListTablesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTablesRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @instance + */ + ListTablesRequest.prototype.parent = ""; + + /** + * ListTablesRequest view. + * @member {google.bigtable.admin.v2.Table.View} view + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @instance + */ + ListTablesRequest.prototype.view = 0; + + /** + * ListTablesRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @instance + */ + ListTablesRequest.prototype.pageSize = 0; + + /** + * ListTablesRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @instance + */ + ListTablesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTablesRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {google.bigtable.admin.v2.IListTablesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListTablesRequest} ListTablesRequest instance + */ + ListTablesRequest.create = function create(properties) { + return new ListTablesRequest(properties); + }; + + /** + * Encodes the specified ListTablesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListTablesRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {google.bigtable.admin.v2.IListTablesRequest} message ListTablesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTablesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListTablesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListTablesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {google.bigtable.admin.v2.IListTablesRequest} message ListTablesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTablesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTablesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListTablesRequest} ListTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTablesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListTablesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTablesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListTablesRequest} ListTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTablesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTablesRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTablesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + case 4: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTablesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListTablesRequest} ListTablesRequest + */ + ListTablesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListTablesRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListTablesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "NAME_ONLY": + case 1: + message.view = 1; + break; + case "SCHEMA_VIEW": + case 2: + message.view = 2; + break; + case "REPLICATION_VIEW": + case 3: + message.view = 3; + break; + case "ENCRYPTION_VIEW": + case 5: + message.view = 5; + break; + case "FULL": + case 4: + message.view = 4; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTablesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {google.bigtable.admin.v2.ListTablesRequest} message ListTablesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTablesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.bigtable.admin.v2.Table.View[message.view] === undefined ? message.view : $root.google.bigtable.admin.v2.Table.View[message.view] : message.view; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListTablesRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTablesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTablesRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTablesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListTablesRequest"; + }; + + return ListTablesRequest; + })(); + + v2.ListTablesResponse = (function() { + + /** + * Properties of a ListTablesResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListTablesResponse + * @property {Array.|null} [tables] ListTablesResponse tables + * @property {string|null} [nextPageToken] ListTablesResponse nextPageToken + */ + + /** + * Constructs a new ListTablesResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListTablesResponse. + * @implements IListTablesResponse + * @constructor + * @param {google.bigtable.admin.v2.IListTablesResponse=} [properties] Properties to set + */ + function ListTablesResponse(properties) { + this.tables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTablesResponse tables. + * @member {Array.} tables + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @instance + */ + ListTablesResponse.prototype.tables = $util.emptyArray; + + /** + * ListTablesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @instance + */ + ListTablesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTablesResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {google.bigtable.admin.v2.IListTablesResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse instance + */ + ListTablesResponse.create = function create(properties) { + return new ListTablesResponse(properties); + }; + + /** + * Encodes the specified ListTablesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListTablesResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {google.bigtable.admin.v2.IListTablesResponse} message ListTablesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTablesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tables != null && message.tables.length) + for (var i = 0; i < message.tables.length; ++i) + $root.google.bigtable.admin.v2.Table.encode(message.tables[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListTablesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListTablesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {google.bigtable.admin.v2.IListTablesResponse} message ListTablesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTablesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTablesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTablesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListTablesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tables && message.tables.length)) + message.tables = []; + message.tables.push($root.google.bigtable.admin.v2.Table.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTablesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTablesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTablesResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTablesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tables != null && message.hasOwnProperty("tables")) { + if (!Array.isArray(message.tables)) + return "tables: array expected"; + for (var i = 0; i < message.tables.length; ++i) { + var error = $root.google.bigtable.admin.v2.Table.verify(message.tables[i]); + if (error) + return "tables." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTablesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse + */ + ListTablesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListTablesResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListTablesResponse(); + if (object.tables) { + if (!Array.isArray(object.tables)) + throw TypeError(".google.bigtable.admin.v2.ListTablesResponse.tables: array expected"); + message.tables = []; + for (var i = 0; i < object.tables.length; ++i) { + if (typeof object.tables[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListTablesResponse.tables: object expected"); + message.tables[i] = $root.google.bigtable.admin.v2.Table.fromObject(object.tables[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTablesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {google.bigtable.admin.v2.ListTablesResponse} message ListTablesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTablesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tables = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tables && message.tables.length) { + object.tables = []; + for (var j = 0; j < message.tables.length; ++j) + object.tables[j] = $root.google.bigtable.admin.v2.Table.toObject(message.tables[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTablesResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @instance + * @returns {Object.} JSON object + */ + ListTablesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTablesResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTablesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListTablesResponse"; + }; + + return ListTablesResponse; + })(); + + v2.GetTableRequest = (function() { + + /** + * Properties of a GetTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetTableRequest + * @property {string|null} [name] GetTableRequest name + * @property {google.bigtable.admin.v2.Table.View|null} [view] GetTableRequest view + */ + + /** + * Constructs a new GetTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetTableRequest. + * @implements IGetTableRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetTableRequest=} [properties] Properties to set + */ + function GetTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTableRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetTableRequest + * @instance + */ + GetTableRequest.prototype.name = ""; + + /** + * GetTableRequest view. + * @member {google.bigtable.admin.v2.Table.View} view + * @memberof google.bigtable.admin.v2.GetTableRequest + * @instance + */ + GetTableRequest.prototype.view = 0; + + /** + * Creates a new GetTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {google.bigtable.admin.v2.IGetTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetTableRequest} GetTableRequest instance + */ + GetTableRequest.create = function create(properties) { + return new GetTableRequest(properties); + }; + + /** + * Encodes the specified GetTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {google.bigtable.admin.v2.IGetTableRequest} message GetTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {google.bigtable.admin.v2.IGetTableRequest} message GetTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetTableRequest} GetTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetTableRequest} GetTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTableRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + case 4: + break; + } + return null; + }; + + /** + * Creates a GetTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetTableRequest} GetTableRequest + */ + GetTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetTableRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "NAME_ONLY": + case 1: + message.view = 1; + break; + case "SCHEMA_VIEW": + case 2: + message.view = 2; + break; + case "REPLICATION_VIEW": + case 3: + message.view = 3; + break; + case "ENCRYPTION_VIEW": + case 5: + message.view = 5; + break; + case "FULL": + case 4: + message.view = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {google.bigtable.admin.v2.GetTableRequest} message GetTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTableRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.bigtable.admin.v2.Table.View[message.view] === undefined ? message.view : $root.google.bigtable.admin.v2.Table.View[message.view] : message.view; + return object; + }; + + /** + * Converts this GetTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetTableRequest + * @instance + * @returns {Object.} JSON object + */ + GetTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetTableRequest"; + }; + + return GetTableRequest; + })(); + + v2.UpdateTableRequest = (function() { + + /** + * Properties of an UpdateTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateTableRequest + * @property {google.bigtable.admin.v2.ITable|null} [table] UpdateTableRequest table + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTableRequest updateMask + * @property {boolean|null} [ignoreWarnings] UpdateTableRequest ignoreWarnings + */ + + /** + * Constructs a new UpdateTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateTableRequest. + * @implements IUpdateTableRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateTableRequest=} [properties] Properties to set + */ + function UpdateTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTableRequest table. + * @member {google.bigtable.admin.v2.ITable|null|undefined} table + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @instance + */ + UpdateTableRequest.prototype.table = null; + + /** + * UpdateTableRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @instance + */ + UpdateTableRequest.prototype.updateMask = null; + + /** + * UpdateTableRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @instance + */ + UpdateTableRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new UpdateTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateTableRequest} UpdateTableRequest instance + */ + UpdateTableRequest.create = function create(properties) { + return new UpdateTableRequest(properties); + }; + + /** + * Encodes the specified UpdateTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateTableRequest} message UpdateTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.google.bigtable.admin.v2.Table.encode(message.table, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified UpdateTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateTableRequest} message UpdateTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateTableRequest} UpdateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = $root.google.bigtable.admin.v2.Table.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateTableRequest} UpdateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTableRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) { + var error = $root.google.bigtable.admin.v2.Table.verify(message.table); + if (error) + return "table." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates an UpdateTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateTableRequest} UpdateTableRequest + */ + UpdateTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateTableRequest(); + if (object.table != null) { + if (typeof object.table !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateTableRequest.table: object expected"); + message.table = $root.google.bigtable.admin.v2.Table.fromObject(object.table); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateTableRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from an UpdateTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {google.bigtable.admin.v2.UpdateTableRequest} message UpdateTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTableRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.table = null; + object.updateMask = null; + object.ignoreWarnings = false; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = $root.google.bigtable.admin.v2.Table.toObject(message.table, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this UpdateTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateTableRequest"; + }; + + return UpdateTableRequest; + })(); + + v2.UpdateTableMetadata = (function() { + + /** + * Properties of an UpdateTableMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateTableMetadata + * @property {string|null} [name] UpdateTableMetadata name + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateTableMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] UpdateTableMetadata endTime + */ + + /** + * Constructs a new UpdateTableMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateTableMetadata. + * @implements IUpdateTableMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateTableMetadata=} [properties] Properties to set + */ + function UpdateTableMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTableMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @instance + */ + UpdateTableMetadata.prototype.name = ""; + + /** + * UpdateTableMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @instance + */ + UpdateTableMetadata.prototype.startTime = null; + + /** + * UpdateTableMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @instance + */ + UpdateTableMetadata.prototype.endTime = null; + + /** + * Creates a new UpdateTableMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateTableMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateTableMetadata} UpdateTableMetadata instance + */ + UpdateTableMetadata.create = function create(properties) { + return new UpdateTableMetadata(properties); + }; + + /** + * Encodes the specified UpdateTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateTableMetadata} message UpdateTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTableMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateTableMetadata} message UpdateTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTableMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTableMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateTableMetadata} UpdateTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTableMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateTableMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTableMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateTableMetadata} UpdateTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTableMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTableMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTableMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an UpdateTableMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateTableMetadata} UpdateTableMetadata + */ + UpdateTableMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateTableMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateTableMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateTableMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateTableMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTableMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateTableMetadata} message UpdateTableMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTableMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this UpdateTableMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateTableMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTableMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateTableMetadata"; + }; + + return UpdateTableMetadata; + })(); + + v2.DeleteTableRequest = (function() { + + /** + * Properties of a DeleteTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteTableRequest + * @property {string|null} [name] DeleteTableRequest name + */ + + /** + * Constructs a new DeleteTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteTableRequest. + * @implements IDeleteTableRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteTableRequest=} [properties] Properties to set + */ + function DeleteTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTableRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @instance + */ + DeleteTableRequest.prototype.name = ""; + + /** + * Creates a new DeleteTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest instance + */ + DeleteTableRequest.create = function create(properties) { + return new DeleteTableRequest(properties); + }; + + /** + * Encodes the specified DeleteTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteTableRequest} message DeleteTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteTableRequest} message DeleteTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTableRequest.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 DeleteTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest + */ + DeleteTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteTableRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.DeleteTableRequest} message DeleteTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTableRequest.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 DeleteTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteTableRequest"; + }; + + return DeleteTableRequest; + })(); + + v2.UndeleteTableRequest = (function() { + + /** + * Properties of an UndeleteTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUndeleteTableRequest + * @property {string|null} [name] UndeleteTableRequest name + */ + + /** + * Constructs a new UndeleteTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UndeleteTableRequest. + * @implements IUndeleteTableRequest + * @constructor + * @param {google.bigtable.admin.v2.IUndeleteTableRequest=} [properties] Properties to set + */ + function UndeleteTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeleteTableRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @instance + */ + UndeleteTableRequest.prototype.name = ""; + + /** + * Creates a new UndeleteTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.IUndeleteTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UndeleteTableRequest} UndeleteTableRequest instance + */ + UndeleteTableRequest.create = function create(properties) { + return new UndeleteTableRequest(properties); + }; + + /** + * Encodes the specified UndeleteTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.IUndeleteTableRequest} message UndeleteTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified UndeleteTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.IUndeleteTableRequest} message UndeleteTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UndeleteTableRequest} UndeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UndeleteTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UndeleteTableRequest} UndeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteTableRequest.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 UndeleteTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UndeleteTableRequest} UndeleteTableRequest + */ + UndeleteTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UndeleteTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UndeleteTableRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UndeleteTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.UndeleteTableRequest} message UndeleteTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteTableRequest.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 UndeleteTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @instance + * @returns {Object.} JSON object + */ + UndeleteTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UndeleteTableRequest"; + }; + + return UndeleteTableRequest; + })(); + + v2.UndeleteTableMetadata = (function() { + + /** + * Properties of an UndeleteTableMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUndeleteTableMetadata + * @property {string|null} [name] UndeleteTableMetadata name + * @property {google.protobuf.ITimestamp|null} [startTime] UndeleteTableMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] UndeleteTableMetadata endTime + */ + + /** + * Constructs a new UndeleteTableMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UndeleteTableMetadata. + * @implements IUndeleteTableMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUndeleteTableMetadata=} [properties] Properties to set + */ + function UndeleteTableMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeleteTableMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @instance + */ + UndeleteTableMetadata.prototype.name = ""; + + /** + * UndeleteTableMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @instance + */ + UndeleteTableMetadata.prototype.startTime = null; + + /** + * UndeleteTableMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @instance + */ + UndeleteTableMetadata.prototype.endTime = null; + + /** + * Creates a new UndeleteTableMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {google.bigtable.admin.v2.IUndeleteTableMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UndeleteTableMetadata} UndeleteTableMetadata instance + */ + UndeleteTableMetadata.create = function create(properties) { + return new UndeleteTableMetadata(properties); + }; + + /** + * Encodes the specified UndeleteTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {google.bigtable.admin.v2.IUndeleteTableMetadata} message UndeleteTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteTableMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UndeleteTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {google.bigtable.admin.v2.IUndeleteTableMetadata} message UndeleteTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteTableMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteTableMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UndeleteTableMetadata} UndeleteTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteTableMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UndeleteTableMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteTableMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UndeleteTableMetadata} UndeleteTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteTableMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteTableMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteTableMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an UndeleteTableMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UndeleteTableMetadata} UndeleteTableMetadata + */ + UndeleteTableMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UndeleteTableMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UndeleteTableMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UndeleteTableMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UndeleteTableMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an UndeleteTableMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {google.bigtable.admin.v2.UndeleteTableMetadata} message UndeleteTableMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteTableMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this UndeleteTableMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @instance + * @returns {Object.} JSON object + */ + UndeleteTableMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteTableMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteTableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UndeleteTableMetadata"; + }; + + return UndeleteTableMetadata; + })(); + + v2.ModifyColumnFamiliesRequest = (function() { + + /** + * Properties of a ModifyColumnFamiliesRequest. + * @memberof google.bigtable.admin.v2 + * @interface IModifyColumnFamiliesRequest + * @property {string|null} [name] ModifyColumnFamiliesRequest name + * @property {Array.|null} [modifications] ModifyColumnFamiliesRequest modifications + * @property {boolean|null} [ignoreWarnings] ModifyColumnFamiliesRequest ignoreWarnings + */ + + /** + * Constructs a new ModifyColumnFamiliesRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ModifyColumnFamiliesRequest. + * @implements IModifyColumnFamiliesRequest + * @constructor + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest=} [properties] Properties to set + */ + function ModifyColumnFamiliesRequest(properties) { + this.modifications = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModifyColumnFamiliesRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @instance + */ + ModifyColumnFamiliesRequest.prototype.name = ""; + + /** + * ModifyColumnFamiliesRequest modifications. + * @member {Array.} modifications + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @instance + */ + ModifyColumnFamiliesRequest.prototype.modifications = $util.emptyArray; + + /** + * ModifyColumnFamiliesRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @instance + */ + ModifyColumnFamiliesRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new ModifyColumnFamiliesRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest instance + */ + ModifyColumnFamiliesRequest.create = function create(properties) { + return new ModifyColumnFamiliesRequest(properties); + }; + + /** + * Encodes the specified ModifyColumnFamiliesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest} message ModifyColumnFamiliesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyColumnFamiliesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.modifications != null && message.modifications.length) + for (var i = 0; i < message.modifications.length; ++i) + $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.encode(message.modifications[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified ModifyColumnFamiliesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest} message ModifyColumnFamiliesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyColumnFamiliesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyColumnFamiliesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.modifications && message.modifications.length)) + message.modifications = []; + message.modifications.push($root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.decode(reader, reader.uint32())); + break; + } + case 3: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyColumnFamiliesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModifyColumnFamiliesRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModifyColumnFamiliesRequest.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.modifications != null && message.hasOwnProperty("modifications")) { + if (!Array.isArray(message.modifications)) + return "modifications: array expected"; + for (var i = 0; i < message.modifications.length; ++i) { + var error = $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.verify(message.modifications[i]); + if (error) + return "modifications." + error; + } + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates a ModifyColumnFamiliesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest + */ + ModifyColumnFamiliesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.modifications) { + if (!Array.isArray(object.modifications)) + throw TypeError(".google.bigtable.admin.v2.ModifyColumnFamiliesRequest.modifications: array expected"); + message.modifications = []; + for (var i = 0; i < object.modifications.length; ++i) { + if (typeof object.modifications[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ModifyColumnFamiliesRequest.modifications: object expected"); + message.modifications[i] = $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.fromObject(object.modifications[i]); + } + } + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from a ModifyColumnFamiliesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} message ModifyColumnFamiliesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModifyColumnFamiliesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.modifications = []; + if (options.defaults) { + object.name = ""; + object.ignoreWarnings = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.modifications && message.modifications.length) { + object.modifications = []; + for (var j = 0; j < message.modifications.length; ++j) + object.modifications[j] = $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.toObject(message.modifications[j], options); + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this ModifyColumnFamiliesRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @instance + * @returns {Object.} JSON object + */ + ModifyColumnFamiliesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModifyColumnFamiliesRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModifyColumnFamiliesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ModifyColumnFamiliesRequest"; + }; + + ModifyColumnFamiliesRequest.Modification = (function() { + + /** + * Properties of a Modification. + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @interface IModification + * @property {string|null} [id] Modification id + * @property {google.bigtable.admin.v2.IColumnFamily|null} [create] Modification create + * @property {google.bigtable.admin.v2.IColumnFamily|null} [update] Modification update + * @property {boolean|null} [drop] Modification drop + * @property {google.protobuf.IFieldMask|null} [updateMask] Modification updateMask + */ + + /** + * Constructs a new Modification. + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @classdesc Represents a Modification. + * @implements IModification + * @constructor + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification=} [properties] Properties to set + */ + function Modification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Modification id. + * @member {string} id + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Modification.prototype.id = ""; + + /** + * Modification create. + * @member {google.bigtable.admin.v2.IColumnFamily|null|undefined} create + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Modification.prototype.create = null; + + /** + * Modification update. + * @member {google.bigtable.admin.v2.IColumnFamily|null|undefined} update + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Modification.prototype.update = null; + + /** + * Modification drop. + * @member {boolean|null|undefined} drop + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Modification.prototype.drop = null; + + /** + * Modification updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Modification.prototype.updateMask = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Modification mod. + * @member {"create"|"update"|"drop"|undefined} mod + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Object.defineProperty(Modification.prototype, "mod", { + get: $util.oneOfGetter($oneOfFields = ["create", "update", "drop"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Modification instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} Modification instance + */ + Modification.create = function create(properties) { + return new Modification(properties); + }; + + /** + * Encodes the specified Modification message. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification} message Modification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Modification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.create != null && Object.hasOwnProperty.call(message, "create")) + $root.google.bigtable.admin.v2.ColumnFamily.encode(message.create, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.google.bigtable.admin.v2.ColumnFamily.encode(message.update, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.drop != null && Object.hasOwnProperty.call(message, "drop")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.drop); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Modification message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification} message Modification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Modification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Modification message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} Modification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Modification.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.create = $root.google.bigtable.admin.v2.ColumnFamily.decode(reader, reader.uint32()); + break; + } + case 3: { + message.update = $root.google.bigtable.admin.v2.ColumnFamily.decode(reader, reader.uint32()); + break; + } + case 4: { + message.drop = reader.bool(); + break; + } + case 6: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Modification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} Modification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Modification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Modification message. + * @function verify + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Modification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.create != null && message.hasOwnProperty("create")) { + properties.mod = 1; + { + var error = $root.google.bigtable.admin.v2.ColumnFamily.verify(message.create); + if (error) + return "create." + error; + } + } + if (message.update != null && message.hasOwnProperty("update")) { + if (properties.mod === 1) + return "mod: multiple values"; + properties.mod = 1; + { + var error = $root.google.bigtable.admin.v2.ColumnFamily.verify(message.update); + if (error) + return "update." + error; + } + } + if (message.drop != null && message.hasOwnProperty("drop")) { + if (properties.mod === 1) + return "mod: multiple values"; + properties.mod = 1; + if (typeof message.drop !== "boolean") + return "drop: boolean expected"; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a Modification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} Modification + */ + Modification.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification) + return object; + var message = new $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification(); + if (object.id != null) + message.id = String(object.id); + if (object.create != null) { + if (typeof object.create !== "object") + throw TypeError(".google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.create: object expected"); + message.create = $root.google.bigtable.admin.v2.ColumnFamily.fromObject(object.create); + } + if (object.update != null) { + if (typeof object.update !== "object") + throw TypeError(".google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.update: object expected"); + message.update = $root.google.bigtable.admin.v2.ColumnFamily.fromObject(object.update); + } + if (object.drop != null) + message.drop = Boolean(object.drop); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a Modification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} message Modification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Modification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.updateMask = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.create != null && message.hasOwnProperty("create")) { + object.create = $root.google.bigtable.admin.v2.ColumnFamily.toObject(message.create, options); + if (options.oneofs) + object.mod = "create"; + } + if (message.update != null && message.hasOwnProperty("update")) { + object.update = $root.google.bigtable.admin.v2.ColumnFamily.toObject(message.update, options); + if (options.oneofs) + object.mod = "update"; + } + if (message.drop != null && message.hasOwnProperty("drop")) { + object.drop = message.drop; + if (options.oneofs) + object.mod = "drop"; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this Modification to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + * @returns {Object.} JSON object + */ + Modification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Modification + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Modification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification"; + }; + + return Modification; + })(); + + return ModifyColumnFamiliesRequest; + })(); + + v2.GenerateConsistencyTokenRequest = (function() { + + /** + * Properties of a GenerateConsistencyTokenRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGenerateConsistencyTokenRequest + * @property {string|null} [name] GenerateConsistencyTokenRequest name + */ + + /** + * Constructs a new GenerateConsistencyTokenRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GenerateConsistencyTokenRequest. + * @implements IGenerateConsistencyTokenRequest + * @constructor + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest=} [properties] Properties to set + */ + function GenerateConsistencyTokenRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateConsistencyTokenRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @instance + */ + GenerateConsistencyTokenRequest.prototype.name = ""; + + /** + * Creates a new GenerateConsistencyTokenRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest instance + */ + GenerateConsistencyTokenRequest.create = function create(properties) { + return new GenerateConsistencyTokenRequest(properties); + }; + + /** + * Encodes the specified GenerateConsistencyTokenRequest message. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest} message GenerateConsistencyTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateConsistencyTokenRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GenerateConsistencyTokenRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest} message GenerateConsistencyTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateConsistencyTokenRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateConsistencyTokenRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GenerateConsistencyTokenRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateConsistencyTokenRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateConsistencyTokenRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateConsistencyTokenRequest.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 GenerateConsistencyTokenRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest + */ + GenerateConsistencyTokenRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GenerateConsistencyTokenRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GenerateConsistencyTokenRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GenerateConsistencyTokenRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} message GenerateConsistencyTokenRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateConsistencyTokenRequest.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 GenerateConsistencyTokenRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateConsistencyTokenRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateConsistencyTokenRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateConsistencyTokenRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GenerateConsistencyTokenRequest"; + }; + + return GenerateConsistencyTokenRequest; + })(); + + v2.GenerateConsistencyTokenResponse = (function() { + + /** + * Properties of a GenerateConsistencyTokenResponse. + * @memberof google.bigtable.admin.v2 + * @interface IGenerateConsistencyTokenResponse + * @property {string|null} [consistencyToken] GenerateConsistencyTokenResponse consistencyToken + */ + + /** + * Constructs a new GenerateConsistencyTokenResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GenerateConsistencyTokenResponse. + * @implements IGenerateConsistencyTokenResponse + * @constructor + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse=} [properties] Properties to set + */ + function GenerateConsistencyTokenResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateConsistencyTokenResponse consistencyToken. + * @member {string} consistencyToken + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @instance + */ + GenerateConsistencyTokenResponse.prototype.consistencyToken = ""; + + /** + * Creates a new GenerateConsistencyTokenResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse instance + */ + GenerateConsistencyTokenResponse.create = function create(properties) { + return new GenerateConsistencyTokenResponse(properties); + }; + + /** + * Encodes the specified GenerateConsistencyTokenResponse message. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse} message GenerateConsistencyTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateConsistencyTokenResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consistencyToken != null && Object.hasOwnProperty.call(message, "consistencyToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.consistencyToken); + return writer; + }; + + /** + * Encodes the specified GenerateConsistencyTokenResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse} message GenerateConsistencyTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateConsistencyTokenResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateConsistencyTokenResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GenerateConsistencyTokenResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.consistencyToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateConsistencyTokenResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateConsistencyTokenResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateConsistencyTokenResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + if (!$util.isString(message.consistencyToken)) + return "consistencyToken: string expected"; + return null; + }; + + /** + * Creates a GenerateConsistencyTokenResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse + */ + GenerateConsistencyTokenResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GenerateConsistencyTokenResponse) + return object; + var message = new $root.google.bigtable.admin.v2.GenerateConsistencyTokenResponse(); + if (object.consistencyToken != null) + message.consistencyToken = String(object.consistencyToken); + return message; + }; + + /** + * Creates a plain object from a GenerateConsistencyTokenResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} message GenerateConsistencyTokenResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateConsistencyTokenResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.consistencyToken = ""; + if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + object.consistencyToken = message.consistencyToken; + return object; + }; + + /** + * Converts this GenerateConsistencyTokenResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateConsistencyTokenResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateConsistencyTokenResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateConsistencyTokenResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GenerateConsistencyTokenResponse"; + }; + + return GenerateConsistencyTokenResponse; + })(); + + v2.CheckConsistencyRequest = (function() { + + /** + * Properties of a CheckConsistencyRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICheckConsistencyRequest + * @property {string|null} [name] CheckConsistencyRequest name + * @property {string|null} [consistencyToken] CheckConsistencyRequest consistencyToken + * @property {google.bigtable.admin.v2.IStandardReadRemoteWrites|null} [standardReadRemoteWrites] CheckConsistencyRequest standardReadRemoteWrites + * @property {google.bigtable.admin.v2.IDataBoostReadLocalWrites|null} [dataBoostReadLocalWrites] CheckConsistencyRequest dataBoostReadLocalWrites + */ + + /** + * Constructs a new CheckConsistencyRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CheckConsistencyRequest. + * @implements ICheckConsistencyRequest + * @constructor + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest=} [properties] Properties to set + */ + function CheckConsistencyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckConsistencyRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @instance + */ + CheckConsistencyRequest.prototype.name = ""; + + /** + * CheckConsistencyRequest consistencyToken. + * @member {string} consistencyToken + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @instance + */ + CheckConsistencyRequest.prototype.consistencyToken = ""; + + /** + * CheckConsistencyRequest standardReadRemoteWrites. + * @member {google.bigtable.admin.v2.IStandardReadRemoteWrites|null|undefined} standardReadRemoteWrites + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @instance + */ + CheckConsistencyRequest.prototype.standardReadRemoteWrites = null; + + /** + * CheckConsistencyRequest dataBoostReadLocalWrites. + * @member {google.bigtable.admin.v2.IDataBoostReadLocalWrites|null|undefined} dataBoostReadLocalWrites + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @instance + */ + CheckConsistencyRequest.prototype.dataBoostReadLocalWrites = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CheckConsistencyRequest mode. + * @member {"standardReadRemoteWrites"|"dataBoostReadLocalWrites"|undefined} mode + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @instance + */ + Object.defineProperty(CheckConsistencyRequest.prototype, "mode", { + get: $util.oneOfGetter($oneOfFields = ["standardReadRemoteWrites", "dataBoostReadLocalWrites"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CheckConsistencyRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest instance + */ + CheckConsistencyRequest.create = function create(properties) { + return new CheckConsistencyRequest(properties); + }; + + /** + * Encodes the specified CheckConsistencyRequest message. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest} message CheckConsistencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckConsistencyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.consistencyToken != null && Object.hasOwnProperty.call(message, "consistencyToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.consistencyToken); + if (message.standardReadRemoteWrites != null && Object.hasOwnProperty.call(message, "standardReadRemoteWrites")) + $root.google.bigtable.admin.v2.StandardReadRemoteWrites.encode(message.standardReadRemoteWrites, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dataBoostReadLocalWrites != null && Object.hasOwnProperty.call(message, "dataBoostReadLocalWrites")) + $root.google.bigtable.admin.v2.DataBoostReadLocalWrites.encode(message.dataBoostReadLocalWrites, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CheckConsistencyRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest} message CheckConsistencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckConsistencyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckConsistencyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckConsistencyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CheckConsistencyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.consistencyToken = reader.string(); + break; + } + case 3: { + message.standardReadRemoteWrites = $root.google.bigtable.admin.v2.StandardReadRemoteWrites.decode(reader, reader.uint32()); + break; + } + case 4: { + message.dataBoostReadLocalWrites = $root.google.bigtable.admin.v2.DataBoostReadLocalWrites.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckConsistencyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckConsistencyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckConsistencyRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckConsistencyRequest.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.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + if (!$util.isString(message.consistencyToken)) + return "consistencyToken: string expected"; + if (message.standardReadRemoteWrites != null && message.hasOwnProperty("standardReadRemoteWrites")) { + properties.mode = 1; + { + var error = $root.google.bigtable.admin.v2.StandardReadRemoteWrites.verify(message.standardReadRemoteWrites); + if (error) + return "standardReadRemoteWrites." + error; + } + } + if (message.dataBoostReadLocalWrites != null && message.hasOwnProperty("dataBoostReadLocalWrites")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + { + var error = $root.google.bigtable.admin.v2.DataBoostReadLocalWrites.verify(message.dataBoostReadLocalWrites); + if (error) + return "dataBoostReadLocalWrites." + error; + } + } + return null; + }; + + /** + * Creates a CheckConsistencyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest + */ + CheckConsistencyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CheckConsistencyRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CheckConsistencyRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.consistencyToken != null) + message.consistencyToken = String(object.consistencyToken); + if (object.standardReadRemoteWrites != null) { + if (typeof object.standardReadRemoteWrites !== "object") + throw TypeError(".google.bigtable.admin.v2.CheckConsistencyRequest.standardReadRemoteWrites: object expected"); + message.standardReadRemoteWrites = $root.google.bigtable.admin.v2.StandardReadRemoteWrites.fromObject(object.standardReadRemoteWrites); + } + if (object.dataBoostReadLocalWrites != null) { + if (typeof object.dataBoostReadLocalWrites !== "object") + throw TypeError(".google.bigtable.admin.v2.CheckConsistencyRequest.dataBoostReadLocalWrites: object expected"); + message.dataBoostReadLocalWrites = $root.google.bigtable.admin.v2.DataBoostReadLocalWrites.fromObject(object.dataBoostReadLocalWrites); + } + return message; + }; + + /** + * Creates a plain object from a CheckConsistencyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {google.bigtable.admin.v2.CheckConsistencyRequest} message CheckConsistencyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckConsistencyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.consistencyToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + object.consistencyToken = message.consistencyToken; + if (message.standardReadRemoteWrites != null && message.hasOwnProperty("standardReadRemoteWrites")) { + object.standardReadRemoteWrites = $root.google.bigtable.admin.v2.StandardReadRemoteWrites.toObject(message.standardReadRemoteWrites, options); + if (options.oneofs) + object.mode = "standardReadRemoteWrites"; + } + if (message.dataBoostReadLocalWrites != null && message.hasOwnProperty("dataBoostReadLocalWrites")) { + object.dataBoostReadLocalWrites = $root.google.bigtable.admin.v2.DataBoostReadLocalWrites.toObject(message.dataBoostReadLocalWrites, options); + if (options.oneofs) + object.mode = "dataBoostReadLocalWrites"; + } + return object; + }; + + /** + * Converts this CheckConsistencyRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @instance + * @returns {Object.} JSON object + */ + CheckConsistencyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckConsistencyRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckConsistencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CheckConsistencyRequest"; + }; + + return CheckConsistencyRequest; + })(); + + v2.StandardReadRemoteWrites = (function() { + + /** + * Properties of a StandardReadRemoteWrites. + * @memberof google.bigtable.admin.v2 + * @interface IStandardReadRemoteWrites + */ + + /** + * Constructs a new StandardReadRemoteWrites. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a StandardReadRemoteWrites. + * @implements IStandardReadRemoteWrites + * @constructor + * @param {google.bigtable.admin.v2.IStandardReadRemoteWrites=} [properties] Properties to set + */ + function StandardReadRemoteWrites(properties) { + if (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 StandardReadRemoteWrites instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {google.bigtable.admin.v2.IStandardReadRemoteWrites=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.StandardReadRemoteWrites} StandardReadRemoteWrites instance + */ + StandardReadRemoteWrites.create = function create(properties) { + return new StandardReadRemoteWrites(properties); + }; + + /** + * Encodes the specified StandardReadRemoteWrites message. Does not implicitly {@link google.bigtable.admin.v2.StandardReadRemoteWrites.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {google.bigtable.admin.v2.IStandardReadRemoteWrites} message StandardReadRemoteWrites message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardReadRemoteWrites.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified StandardReadRemoteWrites message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.StandardReadRemoteWrites.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {google.bigtable.admin.v2.IStandardReadRemoteWrites} message StandardReadRemoteWrites message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardReadRemoteWrites.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StandardReadRemoteWrites message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.StandardReadRemoteWrites} StandardReadRemoteWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardReadRemoteWrites.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.StandardReadRemoteWrites(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StandardReadRemoteWrites message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.StandardReadRemoteWrites} StandardReadRemoteWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardReadRemoteWrites.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardReadRemoteWrites message. + * @function verify + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardReadRemoteWrites.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a StandardReadRemoteWrites message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.StandardReadRemoteWrites} StandardReadRemoteWrites + */ + StandardReadRemoteWrites.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.StandardReadRemoteWrites) + return object; + return new $root.google.bigtable.admin.v2.StandardReadRemoteWrites(); + }; + + /** + * Creates a plain object from a StandardReadRemoteWrites message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {google.bigtable.admin.v2.StandardReadRemoteWrites} message StandardReadRemoteWrites + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardReadRemoteWrites.toObject = function toObject() { + return {}; + }; + + /** + * Converts this StandardReadRemoteWrites to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @instance + * @returns {Object.} JSON object + */ + StandardReadRemoteWrites.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardReadRemoteWrites + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardReadRemoteWrites.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.StandardReadRemoteWrites"; + }; + + return StandardReadRemoteWrites; + })(); + + v2.DataBoostReadLocalWrites = (function() { + + /** + * Properties of a DataBoostReadLocalWrites. + * @memberof google.bigtable.admin.v2 + * @interface IDataBoostReadLocalWrites + */ + + /** + * Constructs a new DataBoostReadLocalWrites. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DataBoostReadLocalWrites. + * @implements IDataBoostReadLocalWrites + * @constructor + * @param {google.bigtable.admin.v2.IDataBoostReadLocalWrites=} [properties] Properties to set + */ + function DataBoostReadLocalWrites(properties) { + if (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 DataBoostReadLocalWrites instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {google.bigtable.admin.v2.IDataBoostReadLocalWrites=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DataBoostReadLocalWrites} DataBoostReadLocalWrites instance + */ + DataBoostReadLocalWrites.create = function create(properties) { + return new DataBoostReadLocalWrites(properties); + }; + + /** + * Encodes the specified DataBoostReadLocalWrites message. Does not implicitly {@link google.bigtable.admin.v2.DataBoostReadLocalWrites.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {google.bigtable.admin.v2.IDataBoostReadLocalWrites} message DataBoostReadLocalWrites message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataBoostReadLocalWrites.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DataBoostReadLocalWrites message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DataBoostReadLocalWrites.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {google.bigtable.admin.v2.IDataBoostReadLocalWrites} message DataBoostReadLocalWrites message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataBoostReadLocalWrites.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataBoostReadLocalWrites message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DataBoostReadLocalWrites} DataBoostReadLocalWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataBoostReadLocalWrites.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DataBoostReadLocalWrites(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataBoostReadLocalWrites message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DataBoostReadLocalWrites} DataBoostReadLocalWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataBoostReadLocalWrites.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataBoostReadLocalWrites message. + * @function verify + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataBoostReadLocalWrites.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DataBoostReadLocalWrites message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DataBoostReadLocalWrites} DataBoostReadLocalWrites + */ + DataBoostReadLocalWrites.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DataBoostReadLocalWrites) + return object; + return new $root.google.bigtable.admin.v2.DataBoostReadLocalWrites(); + }; + + /** + * Creates a plain object from a DataBoostReadLocalWrites message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {google.bigtable.admin.v2.DataBoostReadLocalWrites} message DataBoostReadLocalWrites + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataBoostReadLocalWrites.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DataBoostReadLocalWrites to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @instance + * @returns {Object.} JSON object + */ + DataBoostReadLocalWrites.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataBoostReadLocalWrites + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataBoostReadLocalWrites.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DataBoostReadLocalWrites"; + }; + + return DataBoostReadLocalWrites; + })(); + + v2.CheckConsistencyResponse = (function() { + + /** + * Properties of a CheckConsistencyResponse. + * @memberof google.bigtable.admin.v2 + * @interface ICheckConsistencyResponse + * @property {boolean|null} [consistent] CheckConsistencyResponse consistent + */ + + /** + * Constructs a new CheckConsistencyResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CheckConsistencyResponse. + * @implements ICheckConsistencyResponse + * @constructor + * @param {google.bigtable.admin.v2.ICheckConsistencyResponse=} [properties] Properties to set + */ + function CheckConsistencyResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckConsistencyResponse consistent. + * @member {boolean} consistent + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @instance + */ + CheckConsistencyResponse.prototype.consistent = false; + + /** + * Creates a new CheckConsistencyResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {google.bigtable.admin.v2.ICheckConsistencyResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse instance + */ + CheckConsistencyResponse.create = function create(properties) { + return new CheckConsistencyResponse(properties); + }; + + /** + * Encodes the specified CheckConsistencyResponse message. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {google.bigtable.admin.v2.ICheckConsistencyResponse} message CheckConsistencyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckConsistencyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consistent != null && Object.hasOwnProperty.call(message, "consistent")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.consistent); + return writer; + }; + + /** + * Encodes the specified CheckConsistencyResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {google.bigtable.admin.v2.ICheckConsistencyResponse} message CheckConsistencyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckConsistencyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckConsistencyResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckConsistencyResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CheckConsistencyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.consistent = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckConsistencyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckConsistencyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckConsistencyResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckConsistencyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consistent != null && message.hasOwnProperty("consistent")) + if (typeof message.consistent !== "boolean") + return "consistent: boolean expected"; + return null; + }; + + /** + * Creates a CheckConsistencyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse + */ + CheckConsistencyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CheckConsistencyResponse) + return object; + var message = new $root.google.bigtable.admin.v2.CheckConsistencyResponse(); + if (object.consistent != null) + message.consistent = Boolean(object.consistent); + return message; + }; + + /** + * Creates a plain object from a CheckConsistencyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {google.bigtable.admin.v2.CheckConsistencyResponse} message CheckConsistencyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckConsistencyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.consistent = false; + if (message.consistent != null && message.hasOwnProperty("consistent")) + object.consistent = message.consistent; + return object; + }; + + /** + * Converts this CheckConsistencyResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @instance + * @returns {Object.} JSON object + */ + CheckConsistencyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckConsistencyResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckConsistencyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CheckConsistencyResponse"; + }; + + return CheckConsistencyResponse; + })(); + + v2.SnapshotTableRequest = (function() { + + /** + * Properties of a SnapshotTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface ISnapshotTableRequest + * @property {string|null} [name] SnapshotTableRequest name + * @property {string|null} [cluster] SnapshotTableRequest cluster + * @property {string|null} [snapshotId] SnapshotTableRequest snapshotId + * @property {google.protobuf.IDuration|null} [ttl] SnapshotTableRequest ttl + * @property {string|null} [description] SnapshotTableRequest description + */ + + /** + * Constructs a new SnapshotTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a SnapshotTableRequest. + * @implements ISnapshotTableRequest + * @constructor + * @param {google.bigtable.admin.v2.ISnapshotTableRequest=} [properties] Properties to set + */ + function SnapshotTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SnapshotTableRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @instance + */ + SnapshotTableRequest.prototype.name = ""; + + /** + * SnapshotTableRequest cluster. + * @member {string} cluster + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @instance + */ + SnapshotTableRequest.prototype.cluster = ""; + + /** + * SnapshotTableRequest snapshotId. + * @member {string} snapshotId + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @instance + */ + SnapshotTableRequest.prototype.snapshotId = ""; + + /** + * SnapshotTableRequest ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @instance + */ + SnapshotTableRequest.prototype.ttl = null; + + /** + * SnapshotTableRequest description. + * @member {string} description + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @instance + */ + SnapshotTableRequest.prototype.description = ""; + + /** + * Creates a new SnapshotTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {google.bigtable.admin.v2.ISnapshotTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest instance + */ + SnapshotTableRequest.create = function create(properties) { + return new SnapshotTableRequest(properties); + }; + + /** + * Encodes the specified SnapshotTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {google.bigtable.admin.v2.ISnapshotTableRequest} message SnapshotTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cluster); + if (message.snapshotId != null && Object.hasOwnProperty.call(message, "snapshotId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshotId); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + return writer; + }; + + /** + * Encodes the specified SnapshotTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {google.bigtable.admin.v2.ISnapshotTableRequest} message SnapshotTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SnapshotTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.SnapshotTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.cluster = reader.string(); + break; + } + case 3: { + message.snapshotId = reader.string(); + break; + } + case 4: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SnapshotTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SnapshotTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SnapshotTableRequest.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.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.snapshotId != null && message.hasOwnProperty("snapshotId")) + if (!$util.isString(message.snapshotId)) + return "snapshotId: string expected"; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a SnapshotTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest + */ + SnapshotTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.SnapshotTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.SnapshotTableRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.snapshotId != null) + message.snapshotId = String(object.snapshotId); + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.bigtable.admin.v2.SnapshotTableRequest.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a SnapshotTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {google.bigtable.admin.v2.SnapshotTableRequest} message SnapshotTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SnapshotTableRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.cluster = ""; + object.snapshotId = ""; + object.ttl = null; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.snapshotId != null && message.hasOwnProperty("snapshotId")) + object.snapshotId = message.snapshotId; + if (message.ttl != null && message.hasOwnProperty("ttl")) + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this SnapshotTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @instance + * @returns {Object.} JSON object + */ + SnapshotTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SnapshotTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SnapshotTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.SnapshotTableRequest"; + }; + + return SnapshotTableRequest; + })(); + + v2.GetSnapshotRequest = (function() { + + /** + * Properties of a GetSnapshotRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetSnapshotRequest + * @property {string|null} [name] GetSnapshotRequest name + */ + + /** + * Constructs a new GetSnapshotRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetSnapshotRequest. + * @implements IGetSnapshotRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetSnapshotRequest=} [properties] Properties to set + */ + function GetSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSnapshotRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @instance + */ + GetSnapshotRequest.prototype.name = ""; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.IGetSnapshotRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest instance + */ + GetSnapshotRequest.create = function create(properties) { + return new GetSnapshotRequest(properties); + }; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSnapshotRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSnapshotRequest.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 GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest + */ + GetSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetSnapshotRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetSnapshotRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.GetSnapshotRequest} message GetSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSnapshotRequest.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 GetSnapshotRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + GetSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSnapshotRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetSnapshotRequest"; + }; + + return GetSnapshotRequest; + })(); + + v2.ListSnapshotsRequest = (function() { + + /** + * Properties of a ListSnapshotsRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListSnapshotsRequest + * @property {string|null} [parent] ListSnapshotsRequest parent + * @property {number|null} [pageSize] ListSnapshotsRequest pageSize + * @property {string|null} [pageToken] ListSnapshotsRequest pageToken + */ + + /** + * Constructs a new ListSnapshotsRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListSnapshotsRequest. + * @implements IListSnapshotsRequest + * @constructor + * @param {google.bigtable.admin.v2.IListSnapshotsRequest=} [properties] Properties to set + */ + function ListSnapshotsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSnapshotsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.parent = ""; + + /** + * ListSnapshotsRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.pageSize = 0; + + /** + * ListSnapshotsRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {google.bigtable.admin.v2.IListSnapshotsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListSnapshotsRequest} ListSnapshotsRequest instance + */ + ListSnapshotsRequest.create = function create(properties) { + return new ListSnapshotsRequest(properties); + }; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {google.bigtable.admin.v2.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {google.bigtable.admin.v2.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListSnapshotsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListSnapshotsRequest} ListSnapshotsRequest + */ + ListSnapshotsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListSnapshotsRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListSnapshotsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {google.bigtable.admin.v2.ListSnapshotsRequest} message ListSnapshotsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSnapshotsRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSnapshotsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListSnapshotsRequest"; + }; + + return ListSnapshotsRequest; + })(); + + v2.ListSnapshotsResponse = (function() { + + /** + * Properties of a ListSnapshotsResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListSnapshotsResponse + * @property {Array.|null} [snapshots] ListSnapshotsResponse snapshots + * @property {string|null} [nextPageToken] ListSnapshotsResponse nextPageToken + */ + + /** + * Constructs a new ListSnapshotsResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListSnapshotsResponse. + * @implements IListSnapshotsResponse + * @constructor + * @param {google.bigtable.admin.v2.IListSnapshotsResponse=} [properties] Properties to set + */ + function ListSnapshotsResponse(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSnapshotsResponse snapshots. + * @member {Array.} snapshots + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @instance + */ + ListSnapshotsResponse.prototype.snapshots = $util.emptyArray; + + /** + * ListSnapshotsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @instance + */ + ListSnapshotsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSnapshotsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {google.bigtable.admin.v2.IListSnapshotsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse instance + */ + ListSnapshotsResponse.create = function create(properties) { + return new ListSnapshotsResponse(properties); + }; + + /** + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {google.bigtable.admin.v2.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.google.bigtable.admin.v2.Snapshot.encode(message.snapshots[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {google.bigtable.admin.v2.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListSnapshotsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.google.bigtable.admin.v2.Snapshot.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.google.bigtable.admin.v2.Snapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse + */ + ListSnapshotsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListSnapshotsResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListSnapshotsResponse(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.bigtable.admin.v2.ListSnapshotsResponse.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListSnapshotsResponse.snapshots: object expected"); + message.snapshots[i] = $root.google.bigtable.admin.v2.Snapshot.fromObject(object.snapshots[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {google.bigtable.admin.v2.ListSnapshotsResponse} message ListSnapshotsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.google.bigtable.admin.v2.Snapshot.toObject(message.snapshots[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSnapshotsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSnapshotsResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSnapshotsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListSnapshotsResponse"; + }; + + return ListSnapshotsResponse; + })(); + + v2.DeleteSnapshotRequest = (function() { + + /** + * Properties of a DeleteSnapshotRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteSnapshotRequest + * @property {string|null} [name] DeleteSnapshotRequest name + */ + + /** + * Constructs a new DeleteSnapshotRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteSnapshotRequest. + * @implements IDeleteSnapshotRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest=} [properties] Properties to set + */ + function DeleteSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSnapshotRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @instance + */ + DeleteSnapshotRequest.prototype.name = ""; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest instance + */ + DeleteSnapshotRequest.create = function create(properties) { + return new DeleteSnapshotRequest(properties); + }; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSnapshotRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSnapshotRequest.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 DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest + */ + DeleteSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteSnapshotRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteSnapshotRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.DeleteSnapshotRequest} message DeleteSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSnapshotRequest.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 DeleteSnapshotRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSnapshotRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteSnapshotRequest"; + }; + + return DeleteSnapshotRequest; + })(); + + v2.SnapshotTableMetadata = (function() { + + /** + * Properties of a SnapshotTableMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ISnapshotTableMetadata + * @property {google.bigtable.admin.v2.ISnapshotTableRequest|null} [originalRequest] SnapshotTableMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] SnapshotTableMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] SnapshotTableMetadata finishTime + */ + + /** + * Constructs a new SnapshotTableMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a SnapshotTableMetadata. + * @implements ISnapshotTableMetadata + * @constructor + * @param {google.bigtable.admin.v2.ISnapshotTableMetadata=} [properties] Properties to set + */ + function SnapshotTableMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SnapshotTableMetadata originalRequest. + * @member {google.bigtable.admin.v2.ISnapshotTableRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @instance + */ + SnapshotTableMetadata.prototype.originalRequest = null; + + /** + * SnapshotTableMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @instance + */ + SnapshotTableMetadata.prototype.requestTime = null; + + /** + * SnapshotTableMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @instance + */ + SnapshotTableMetadata.prototype.finishTime = null; + + /** + * Creates a new SnapshotTableMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {google.bigtable.admin.v2.ISnapshotTableMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.SnapshotTableMetadata} SnapshotTableMetadata instance + */ + SnapshotTableMetadata.create = function create(properties) { + return new SnapshotTableMetadata(properties); + }; + + /** + * Encodes the specified SnapshotTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {google.bigtable.admin.v2.ISnapshotTableMetadata} message SnapshotTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotTableMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.SnapshotTableRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SnapshotTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {google.bigtable.admin.v2.ISnapshotTableMetadata} message SnapshotTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotTableMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SnapshotTableMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.SnapshotTableMetadata} SnapshotTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotTableMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.SnapshotTableMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.SnapshotTableRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SnapshotTableMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.SnapshotTableMetadata} SnapshotTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotTableMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SnapshotTableMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SnapshotTableMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.SnapshotTableRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates a SnapshotTableMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.SnapshotTableMetadata} SnapshotTableMetadata + */ + SnapshotTableMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.SnapshotTableMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.SnapshotTableMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.SnapshotTableMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.SnapshotTableRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.SnapshotTableMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.SnapshotTableMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from a SnapshotTableMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {google.bigtable.admin.v2.SnapshotTableMetadata} message SnapshotTableMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SnapshotTableMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.SnapshotTableRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this SnapshotTableMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @instance + * @returns {Object.} JSON object + */ + SnapshotTableMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SnapshotTableMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SnapshotTableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.SnapshotTableMetadata"; + }; + + return SnapshotTableMetadata; + })(); + + v2.CreateTableFromSnapshotMetadata = (function() { + + /** + * Properties of a CreateTableFromSnapshotMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateTableFromSnapshotMetadata + * @property {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest|null} [originalRequest] CreateTableFromSnapshotMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] CreateTableFromSnapshotMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] CreateTableFromSnapshotMetadata finishTime + */ + + /** + * Constructs a new CreateTableFromSnapshotMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateTableFromSnapshotMetadata. + * @implements ICreateTableFromSnapshotMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata=} [properties] Properties to set + */ + function CreateTableFromSnapshotMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTableFromSnapshotMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @instance + */ + CreateTableFromSnapshotMetadata.prototype.originalRequest = null; + + /** + * CreateTableFromSnapshotMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @instance + */ + CreateTableFromSnapshotMetadata.prototype.requestTime = null; + + /** + * CreateTableFromSnapshotMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @instance + */ + CreateTableFromSnapshotMetadata.prototype.finishTime = null; + + /** + * Creates a new CreateTableFromSnapshotMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata instance + */ + CreateTableFromSnapshotMetadata.create = function create(properties) { + return new CreateTableFromSnapshotMetadata(properties); + }; + + /** + * Encodes the specified CreateTableFromSnapshotMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata} message CreateTableFromSnapshotMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableFromSnapshotMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTableFromSnapshotMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata} message CreateTableFromSnapshotMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableFromSnapshotMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableFromSnapshotMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableFromSnapshotMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTableFromSnapshotMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTableFromSnapshotMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates a CreateTableFromSnapshotMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata + */ + CreateTableFromSnapshotMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateTableFromSnapshotMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} message CreateTableFromSnapshotMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTableFromSnapshotMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this CreateTableFromSnapshotMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateTableFromSnapshotMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTableFromSnapshotMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTableFromSnapshotMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateTableFromSnapshotMetadata"; + }; + + return CreateTableFromSnapshotMetadata; + })(); + + v2.CreateBackupRequest = (function() { + + /** + * Properties of a CreateBackupRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {string|null} [backupId] CreateBackupRequest backupId + * @property {google.bigtable.admin.v2.IBackup|null} [backup] CreateBackupRequest backup + */ + + /** + * Constructs a new CreateBackupRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateBackupRequest=} [properties] Properties to set + */ + function CreateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.parent = ""; + + /** + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backupId = ""; + + /** + * CreateBackupRequest backup. + * @member {google.bigtable.admin.v2.IBackup|null|undefined} backup + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backup = null; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {google.bigtable.admin.v2.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateBackupRequest} CreateBackupRequest instance + */ + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); + }; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {google.bigtable.admin.v2.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.bigtable.admin.v2.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {google.bigtable.admin.v2.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupId = reader.string(); + break; + } + case 3: { + message.backup = $root.google.bigtable.admin.v2.Backup.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.bigtable.admin.v2.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + return null; + }; + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateBackupRequest} CreateBackupRequest + */ + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateBackupRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.bigtable.admin.v2.Backup.fromObject(object.backup); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {google.bigtable.admin.v2.CreateBackupRequest} message CreateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupId = ""; + object.backup = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.bigtable.admin.v2.Backup.toObject(message.backup, options); + return object; + }; + + /** + * Converts this CreateBackupRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateBackupRequest"; + }; + + return CreateBackupRequest; + })(); + + v2.CreateBackupMetadata = (function() { + + /** + * Properties of a CreateBackupMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateBackupMetadata + * @property {string|null} [name] CreateBackupMetadata name + * @property {string|null} [sourceTable] CreateBackupMetadata sourceTable + * @property {google.protobuf.ITimestamp|null} [startTime] CreateBackupMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] CreateBackupMetadata endTime + */ + + /** + * Constructs a new CreateBackupMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateBackupMetadata. + * @implements ICreateBackupMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateBackupMetadata=} [properties] Properties to set + */ + function CreateBackupMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.name = ""; + + /** + * CreateBackupMetadata sourceTable. + * @member {string} sourceTable + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.sourceTable = ""; + + /** + * CreateBackupMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.startTime = null; + + /** + * CreateBackupMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.endTime = null; + + /** + * Creates a new CreateBackupMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateBackupMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateBackupMetadata} CreateBackupMetadata instance + */ + CreateBackupMetadata.create = function create(properties) { + return new CreateBackupMetadata(properties); + }; + + /** + * Encodes the specified CreateBackupMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateBackupMetadata} message CreateBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceTable); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateBackupMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateBackupMetadata} message CreateBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateBackupMetadata} CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateBackupMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceTable = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateBackupMetadata} CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupMetadata.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.sourceTable != null && message.hasOwnProperty("sourceTable")) + if (!$util.isString(message.sourceTable)) + return "sourceTable: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a CreateBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateBackupMetadata} CreateBackupMetadata + */ + CreateBackupMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateBackupMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateBackupMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.sourceTable != null) + message.sourceTable = String(object.sourceTable); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateBackupMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateBackupMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackupMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {google.bigtable.admin.v2.CreateBackupMetadata} message CreateBackupMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceTable = ""; + object.startTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) + object.sourceTable = message.sourceTable; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this CreateBackupMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateBackupMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateBackupMetadata"; + }; + + return CreateBackupMetadata; + })(); + + v2.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateBackupRequest + * @property {google.bigtable.admin.v2.IBackup|null} [backup] UpdateBackupRequest backup + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupRequest backup. + * @member {google.bigtable.admin.v2.IBackup|null|undefined} backup + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.bigtable.admin.v2.Backup.encode(message.backup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backup = $root.google.bigtable.admin.v2.Backup.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.bigtable.admin.v2.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateBackupRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateBackupRequest(); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.bigtable.admin.v2.Backup.fromObject(object.backup); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {google.bigtable.admin.v2.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backup = null; + object.updateMask = null; + } + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.bigtable.admin.v2.Backup.toObject(message.backup, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateBackupRequest"; + }; + + return UpdateBackupRequest; + })(); + + v2.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {google.bigtable.admin.v2.IGetBackupRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {google.bigtable.admin.v2.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {google.bigtable.admin.v2.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.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 GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetBackupRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {google.bigtable.admin.v2.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.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 GetBackupRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v2.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.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 DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteBackupRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {google.bigtable.admin.v2.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.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 DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v2.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {string|null} [filter] ListBackupsRequest filter + * @property {string|null} [orderBy] ListBackupsRequest orderBy + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.bigtable.admin.v2.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {google.bigtable.admin.v2.IListBackupsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {google.bigtable.admin.v2.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {google.bigtable.admin.v2.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListBackupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.orderBy = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListBackupsRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {google.bigtable.admin.v2.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v2.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.bigtable.admin.v2.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {google.bigtable.admin.v2.IListBackupsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {google.bigtable.admin.v2.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.bigtable.admin.v2.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {google.bigtable.admin.v2.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.bigtable.admin.v2.Backup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.bigtable.admin.v2.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListBackupsResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.bigtable.admin.v2.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.bigtable.admin.v2.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {google.bigtable.admin.v2.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.bigtable.admin.v2.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v2.CopyBackupRequest = (function() { + + /** + * Properties of a CopyBackupRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICopyBackupRequest + * @property {string|null} [parent] CopyBackupRequest parent + * @property {string|null} [backupId] CopyBackupRequest backupId + * @property {string|null} [sourceBackup] CopyBackupRequest sourceBackup + * @property {google.protobuf.ITimestamp|null} [expireTime] CopyBackupRequest expireTime + */ + + /** + * Constructs a new CopyBackupRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CopyBackupRequest. + * @implements ICopyBackupRequest + * @constructor + * @param {google.bigtable.admin.v2.ICopyBackupRequest=} [properties] Properties to set + */ + function CopyBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyBackupRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.parent = ""; + + /** + * CopyBackupRequest backupId. + * @member {string} backupId + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.backupId = ""; + + /** + * CopyBackupRequest sourceBackup. + * @member {string} sourceBackup + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.sourceBackup = ""; + + /** + * CopyBackupRequest expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.expireTime = null; + + /** + * Creates a new CopyBackupRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {google.bigtable.admin.v2.ICopyBackupRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CopyBackupRequest} CopyBackupRequest instance + */ + CopyBackupRequest.create = function create(properties) { + return new CopyBackupRequest(properties); + }; + + /** + * Encodes the specified CopyBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {google.bigtable.admin.v2.ICopyBackupRequest} message CopyBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceBackup); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CopyBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {google.bigtable.admin.v2.ICopyBackupRequest} message CopyBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CopyBackupRequest} CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CopyBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupId = reader.string(); + break; + } + case 3: { + message.sourceBackup = reader.string(); + break; + } + case 4: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CopyBackupRequest} CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyBackupRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a CopyBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CopyBackupRequest} CopyBackupRequest + */ + CopyBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CopyBackupRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CopyBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CopyBackupRequest.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a CopyBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {google.bigtable.admin.v2.CopyBackupRequest} message CopyBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupId = ""; + object.sourceBackup = ""; + object.expireTime = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + object.sourceBackup = message.sourceBackup; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this CopyBackupRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CopyBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyBackupRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CopyBackupRequest"; + }; + + return CopyBackupRequest; + })(); + + v2.CopyBackupMetadata = (function() { + + /** + * Properties of a CopyBackupMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICopyBackupMetadata + * @property {string|null} [name] CopyBackupMetadata name + * @property {google.bigtable.admin.v2.IBackupInfo|null} [sourceBackupInfo] CopyBackupMetadata sourceBackupInfo + * @property {google.bigtable.admin.v2.IOperationProgress|null} [progress] CopyBackupMetadata progress + */ + + /** + * Constructs a new CopyBackupMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CopyBackupMetadata. + * @implements ICopyBackupMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICopyBackupMetadata=} [properties] Properties to set + */ + function CopyBackupMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyBackupMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.name = ""; + + /** + * CopyBackupMetadata sourceBackupInfo. + * @member {google.bigtable.admin.v2.IBackupInfo|null|undefined} sourceBackupInfo + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.sourceBackupInfo = null; + + /** + * CopyBackupMetadata progress. + * @member {google.bigtable.admin.v2.IOperationProgress|null|undefined} progress + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.progress = null; + + /** + * Creates a new CopyBackupMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {google.bigtable.admin.v2.ICopyBackupMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CopyBackupMetadata} CopyBackupMetadata instance + */ + CopyBackupMetadata.create = function create(properties) { + return new CopyBackupMetadata(properties); + }; + + /** + * Encodes the specified CopyBackupMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {google.bigtable.admin.v2.ICopyBackupMetadata} message CopyBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceBackupInfo != null && Object.hasOwnProperty.call(message, "sourceBackupInfo")) + $root.google.bigtable.admin.v2.BackupInfo.encode(message.sourceBackupInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.bigtable.admin.v2.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CopyBackupMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {google.bigtable.admin.v2.ICopyBackupMetadata} message CopyBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CopyBackupMetadata} CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CopyBackupMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceBackupInfo = $root.google.bigtable.admin.v2.BackupInfo.decode(reader, reader.uint32()); + break; + } + case 3: { + message.progress = $root.google.bigtable.admin.v2.OperationProgress.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CopyBackupMetadata} CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyBackupMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyBackupMetadata.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.sourceBackupInfo != null && message.hasOwnProperty("sourceBackupInfo")) { + var error = $root.google.bigtable.admin.v2.BackupInfo.verify(message.sourceBackupInfo); + if (error) + return "sourceBackupInfo." + error; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.bigtable.admin.v2.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + return null; + }; + + /** + * Creates a CopyBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CopyBackupMetadata} CopyBackupMetadata + */ + CopyBackupMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CopyBackupMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CopyBackupMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.sourceBackupInfo != null) { + if (typeof object.sourceBackupInfo !== "object") + throw TypeError(".google.bigtable.admin.v2.CopyBackupMetadata.sourceBackupInfo: object expected"); + message.sourceBackupInfo = $root.google.bigtable.admin.v2.BackupInfo.fromObject(object.sourceBackupInfo); + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.bigtable.admin.v2.CopyBackupMetadata.progress: object expected"); + message.progress = $root.google.bigtable.admin.v2.OperationProgress.fromObject(object.progress); + } + return message; + }; + + /** + * Creates a plain object from a CopyBackupMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {google.bigtable.admin.v2.CopyBackupMetadata} message CopyBackupMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyBackupMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceBackupInfo = null; + object.progress = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceBackupInfo != null && message.hasOwnProperty("sourceBackupInfo")) + object.sourceBackupInfo = $root.google.bigtable.admin.v2.BackupInfo.toObject(message.sourceBackupInfo, options); + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.bigtable.admin.v2.OperationProgress.toObject(message.progress, options); + return object; + }; + + /** + * Converts this CopyBackupMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @instance + * @returns {Object.} JSON object + */ + CopyBackupMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyBackupMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyBackupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CopyBackupMetadata"; + }; + + return CopyBackupMetadata; + })(); + + v2.CreateAuthorizedViewRequest = (function() { + + /** + * Properties of a CreateAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateAuthorizedViewRequest + * @property {string|null} [parent] CreateAuthorizedViewRequest parent + * @property {string|null} [authorizedViewId] CreateAuthorizedViewRequest authorizedViewId + * @property {google.bigtable.admin.v2.IAuthorizedView|null} [authorizedView] CreateAuthorizedViewRequest authorizedView + */ + + /** + * Constructs a new CreateAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateAuthorizedViewRequest. + * @implements ICreateAuthorizedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewRequest=} [properties] Properties to set + */ + function CreateAuthorizedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAuthorizedViewRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @instance + */ + CreateAuthorizedViewRequest.prototype.parent = ""; + + /** + * CreateAuthorizedViewRequest authorizedViewId. + * @member {string} authorizedViewId + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @instance + */ + CreateAuthorizedViewRequest.prototype.authorizedViewId = ""; + + /** + * CreateAuthorizedViewRequest authorizedView. + * @member {google.bigtable.admin.v2.IAuthorizedView|null|undefined} authorizedView + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @instance + */ + CreateAuthorizedViewRequest.prototype.authorizedView = null; + + /** + * Creates a new CreateAuthorizedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewRequest} CreateAuthorizedViewRequest instance + */ + CreateAuthorizedViewRequest.create = function create(properties) { + return new CreateAuthorizedViewRequest(properties); + }; + + /** + * Encodes the specified CreateAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewRequest} message CreateAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAuthorizedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.authorizedViewId != null && Object.hasOwnProperty.call(message, "authorizedViewId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.authorizedViewId); + if (message.authorizedView != null && Object.hasOwnProperty.call(message, "authorizedView")) + $root.google.bigtable.admin.v2.AuthorizedView.encode(message.authorizedView, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewRequest} message CreateAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAuthorizedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAuthorizedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewRequest} CreateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAuthorizedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.authorizedViewId = reader.string(); + break; + } + case 3: { + message.authorizedView = $root.google.bigtable.admin.v2.AuthorizedView.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewRequest} CreateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAuthorizedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAuthorizedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAuthorizedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.authorizedViewId != null && message.hasOwnProperty("authorizedViewId")) + if (!$util.isString(message.authorizedViewId)) + return "authorizedViewId: string expected"; + if (message.authorizedView != null && message.hasOwnProperty("authorizedView")) { + var error = $root.google.bigtable.admin.v2.AuthorizedView.verify(message.authorizedView); + if (error) + return "authorizedView." + error; + } + return null; + }; + + /** + * Creates a CreateAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewRequest} CreateAuthorizedViewRequest + */ + CreateAuthorizedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.authorizedViewId != null) + message.authorizedViewId = String(object.authorizedViewId); + if (object.authorizedView != null) { + if (typeof object.authorizedView !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateAuthorizedViewRequest.authorizedView: object expected"); + message.authorizedView = $root.google.bigtable.admin.v2.AuthorizedView.fromObject(object.authorizedView); + } + return message; + }; + + /** + * Creates a plain object from a CreateAuthorizedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.CreateAuthorizedViewRequest} message CreateAuthorizedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAuthorizedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.authorizedViewId = ""; + object.authorizedView = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.authorizedViewId != null && message.hasOwnProperty("authorizedViewId")) + object.authorizedViewId = message.authorizedViewId; + if (message.authorizedView != null && message.hasOwnProperty("authorizedView")) + object.authorizedView = $root.google.bigtable.admin.v2.AuthorizedView.toObject(message.authorizedView, options); + return object; + }; + + /** + * Converts this CreateAuthorizedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAuthorizedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAuthorizedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAuthorizedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateAuthorizedViewRequest"; + }; + + return CreateAuthorizedViewRequest; + })(); + + v2.CreateAuthorizedViewMetadata = (function() { + + /** + * Properties of a CreateAuthorizedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateAuthorizedViewMetadata + * @property {google.bigtable.admin.v2.ICreateAuthorizedViewRequest|null} [originalRequest] CreateAuthorizedViewMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] CreateAuthorizedViewMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] CreateAuthorizedViewMetadata finishTime + */ + + /** + * Constructs a new CreateAuthorizedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateAuthorizedViewMetadata. + * @implements ICreateAuthorizedViewMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewMetadata=} [properties] Properties to set + */ + function CreateAuthorizedViewMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAuthorizedViewMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateAuthorizedViewRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @instance + */ + CreateAuthorizedViewMetadata.prototype.originalRequest = null; + + /** + * CreateAuthorizedViewMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @instance + */ + CreateAuthorizedViewMetadata.prototype.requestTime = null; + + /** + * CreateAuthorizedViewMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @instance + */ + CreateAuthorizedViewMetadata.prototype.finishTime = null; + + /** + * Creates a new CreateAuthorizedViewMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewMetadata} CreateAuthorizedViewMetadata instance + */ + CreateAuthorizedViewMetadata.create = function create(properties) { + return new CreateAuthorizedViewMetadata(properties); + }; + + /** + * Encodes the specified CreateAuthorizedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewMetadata} message CreateAuthorizedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAuthorizedViewMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAuthorizedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewMetadata} message CreateAuthorizedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAuthorizedViewMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAuthorizedViewMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewMetadata} CreateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAuthorizedViewMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateAuthorizedViewMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAuthorizedViewMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewMetadata} CreateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAuthorizedViewMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAuthorizedViewMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAuthorizedViewMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates a CreateAuthorizedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewMetadata} CreateAuthorizedViewMetadata + */ + CreateAuthorizedViewMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateAuthorizedViewMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateAuthorizedViewMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateAuthorizedViewMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateAuthorizedViewMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateAuthorizedViewMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateAuthorizedViewMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.CreateAuthorizedViewMetadata} message CreateAuthorizedViewMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAuthorizedViewMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this CreateAuthorizedViewMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateAuthorizedViewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAuthorizedViewMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAuthorizedViewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateAuthorizedViewMetadata"; + }; + + return CreateAuthorizedViewMetadata; + })(); + + v2.ListAuthorizedViewsRequest = (function() { + + /** + * Properties of a ListAuthorizedViewsRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListAuthorizedViewsRequest + * @property {string|null} [parent] ListAuthorizedViewsRequest parent + * @property {number|null} [pageSize] ListAuthorizedViewsRequest pageSize + * @property {string|null} [pageToken] ListAuthorizedViewsRequest pageToken + * @property {google.bigtable.admin.v2.AuthorizedView.ResponseView|null} [view] ListAuthorizedViewsRequest view + */ + + /** + * Constructs a new ListAuthorizedViewsRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListAuthorizedViewsRequest. + * @implements IListAuthorizedViewsRequest + * @constructor + * @param {google.bigtable.admin.v2.IListAuthorizedViewsRequest=} [properties] Properties to set + */ + function ListAuthorizedViewsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAuthorizedViewsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @instance + */ + ListAuthorizedViewsRequest.prototype.parent = ""; + + /** + * ListAuthorizedViewsRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @instance + */ + ListAuthorizedViewsRequest.prototype.pageSize = 0; + + /** + * ListAuthorizedViewsRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @instance + */ + ListAuthorizedViewsRequest.prototype.pageToken = ""; + + /** + * ListAuthorizedViewsRequest view. + * @member {google.bigtable.admin.v2.AuthorizedView.ResponseView} view + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @instance + */ + ListAuthorizedViewsRequest.prototype.view = 0; + + /** + * Creates a new ListAuthorizedViewsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListAuthorizedViewsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsRequest} ListAuthorizedViewsRequest instance + */ + ListAuthorizedViewsRequest.create = function create(properties) { + return new ListAuthorizedViewsRequest(properties); + }; + + /** + * Encodes the specified ListAuthorizedViewsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListAuthorizedViewsRequest} message ListAuthorizedViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedViewsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListAuthorizedViewsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListAuthorizedViewsRequest} message ListAuthorizedViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedViewsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAuthorizedViewsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsRequest} ListAuthorizedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedViewsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListAuthorizedViewsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAuthorizedViewsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsRequest} ListAuthorizedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedViewsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAuthorizedViewsRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAuthorizedViewsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ListAuthorizedViewsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsRequest} ListAuthorizedViewsRequest + */ + ListAuthorizedViewsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListAuthorizedViewsRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListAuthorizedViewsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "RESPONSE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "NAME_ONLY": + case 1: + message.view = 1; + break; + case "BASIC": + case 2: + message.view = 2; + break; + case "FULL": + case 3: + message.view = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListAuthorizedViewsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {google.bigtable.admin.v2.ListAuthorizedViewsRequest} message ListAuthorizedViewsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAuthorizedViewsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "RESPONSE_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.bigtable.admin.v2.AuthorizedView.ResponseView[message.view] === undefined ? message.view : $root.google.bigtable.admin.v2.AuthorizedView.ResponseView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListAuthorizedViewsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAuthorizedViewsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAuthorizedViewsRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAuthorizedViewsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListAuthorizedViewsRequest"; + }; + + return ListAuthorizedViewsRequest; + })(); + + v2.ListAuthorizedViewsResponse = (function() { + + /** + * Properties of a ListAuthorizedViewsResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListAuthorizedViewsResponse + * @property {Array.|null} [authorizedViews] ListAuthorizedViewsResponse authorizedViews + * @property {string|null} [nextPageToken] ListAuthorizedViewsResponse nextPageToken + */ + + /** + * Constructs a new ListAuthorizedViewsResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListAuthorizedViewsResponse. + * @implements IListAuthorizedViewsResponse + * @constructor + * @param {google.bigtable.admin.v2.IListAuthorizedViewsResponse=} [properties] Properties to set + */ + function ListAuthorizedViewsResponse(properties) { + this.authorizedViews = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAuthorizedViewsResponse authorizedViews. + * @member {Array.} authorizedViews + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @instance + */ + ListAuthorizedViewsResponse.prototype.authorizedViews = $util.emptyArray; + + /** + * ListAuthorizedViewsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @instance + */ + ListAuthorizedViewsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAuthorizedViewsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListAuthorizedViewsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsResponse} ListAuthorizedViewsResponse instance + */ + ListAuthorizedViewsResponse.create = function create(properties) { + return new ListAuthorizedViewsResponse(properties); + }; + + /** + * Encodes the specified ListAuthorizedViewsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListAuthorizedViewsResponse} message ListAuthorizedViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedViewsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authorizedViews != null && message.authorizedViews.length) + for (var i = 0; i < message.authorizedViews.length; ++i) + $root.google.bigtable.admin.v2.AuthorizedView.encode(message.authorizedViews[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListAuthorizedViewsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListAuthorizedViewsResponse} message ListAuthorizedViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedViewsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAuthorizedViewsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsResponse} ListAuthorizedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedViewsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListAuthorizedViewsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.authorizedViews && message.authorizedViews.length)) + message.authorizedViews = []; + message.authorizedViews.push($root.google.bigtable.admin.v2.AuthorizedView.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAuthorizedViewsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsResponse} ListAuthorizedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedViewsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAuthorizedViewsResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAuthorizedViewsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.authorizedViews != null && message.hasOwnProperty("authorizedViews")) { + if (!Array.isArray(message.authorizedViews)) + return "authorizedViews: array expected"; + for (var i = 0; i < message.authorizedViews.length; ++i) { + var error = $root.google.bigtable.admin.v2.AuthorizedView.verify(message.authorizedViews[i]); + if (error) + return "authorizedViews." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAuthorizedViewsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsResponse} ListAuthorizedViewsResponse + */ + ListAuthorizedViewsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListAuthorizedViewsResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListAuthorizedViewsResponse(); + if (object.authorizedViews) { + if (!Array.isArray(object.authorizedViews)) + throw TypeError(".google.bigtable.admin.v2.ListAuthorizedViewsResponse.authorizedViews: array expected"); + message.authorizedViews = []; + for (var i = 0; i < object.authorizedViews.length; ++i) { + if (typeof object.authorizedViews[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListAuthorizedViewsResponse.authorizedViews: object expected"); + message.authorizedViews[i] = $root.google.bigtable.admin.v2.AuthorizedView.fromObject(object.authorizedViews[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAuthorizedViewsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {google.bigtable.admin.v2.ListAuthorizedViewsResponse} message ListAuthorizedViewsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAuthorizedViewsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.authorizedViews = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.authorizedViews && message.authorizedViews.length) { + object.authorizedViews = []; + for (var j = 0; j < message.authorizedViews.length; ++j) + object.authorizedViews[j] = $root.google.bigtable.admin.v2.AuthorizedView.toObject(message.authorizedViews[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAuthorizedViewsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAuthorizedViewsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAuthorizedViewsResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAuthorizedViewsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListAuthorizedViewsResponse"; + }; + + return ListAuthorizedViewsResponse; + })(); + + v2.GetAuthorizedViewRequest = (function() { + + /** + * Properties of a GetAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetAuthorizedViewRequest + * @property {string|null} [name] GetAuthorizedViewRequest name + * @property {google.bigtable.admin.v2.AuthorizedView.ResponseView|null} [view] GetAuthorizedViewRequest view + */ + + /** + * Constructs a new GetAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetAuthorizedViewRequest. + * @implements IGetAuthorizedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetAuthorizedViewRequest=} [properties] Properties to set + */ + function GetAuthorizedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAuthorizedViewRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @instance + */ + GetAuthorizedViewRequest.prototype.name = ""; + + /** + * GetAuthorizedViewRequest view. + * @member {google.bigtable.admin.v2.AuthorizedView.ResponseView} view + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @instance + */ + GetAuthorizedViewRequest.prototype.view = 0; + + /** + * Creates a new GetAuthorizedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetAuthorizedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetAuthorizedViewRequest} GetAuthorizedViewRequest instance + */ + GetAuthorizedViewRequest.create = function create(properties) { + return new GetAuthorizedViewRequest(properties); + }; + + /** + * Encodes the specified GetAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetAuthorizedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetAuthorizedViewRequest} message GetAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAuthorizedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetAuthorizedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetAuthorizedViewRequest} message GetAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAuthorizedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAuthorizedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetAuthorizedViewRequest} GetAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAuthorizedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetAuthorizedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetAuthorizedViewRequest} GetAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAuthorizedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAuthorizedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAuthorizedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a GetAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetAuthorizedViewRequest} GetAuthorizedViewRequest + */ + GetAuthorizedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetAuthorizedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetAuthorizedViewRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "RESPONSE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "NAME_ONLY": + case 1: + message.view = 1; + break; + case "BASIC": + case 2: + message.view = 2; + break; + case "FULL": + case 3: + message.view = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetAuthorizedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.GetAuthorizedViewRequest} message GetAuthorizedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAuthorizedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "RESPONSE_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.bigtable.admin.v2.AuthorizedView.ResponseView[message.view] === undefined ? message.view : $root.google.bigtable.admin.v2.AuthorizedView.ResponseView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetAuthorizedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @instance + * @returns {Object.} JSON object + */ + GetAuthorizedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAuthorizedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAuthorizedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetAuthorizedViewRequest"; + }; + + return GetAuthorizedViewRequest; + })(); + + v2.UpdateAuthorizedViewRequest = (function() { + + /** + * Properties of an UpdateAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateAuthorizedViewRequest + * @property {google.bigtable.admin.v2.IAuthorizedView|null} [authorizedView] UpdateAuthorizedViewRequest authorizedView + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAuthorizedViewRequest updateMask + * @property {boolean|null} [ignoreWarnings] UpdateAuthorizedViewRequest ignoreWarnings + */ + + /** + * Constructs a new UpdateAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateAuthorizedViewRequest. + * @implements IUpdateAuthorizedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest=} [properties] Properties to set + */ + function UpdateAuthorizedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAuthorizedViewRequest authorizedView. + * @member {google.bigtable.admin.v2.IAuthorizedView|null|undefined} authorizedView + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @instance + */ + UpdateAuthorizedViewRequest.prototype.authorizedView = null; + + /** + * UpdateAuthorizedViewRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @instance + */ + UpdateAuthorizedViewRequest.prototype.updateMask = null; + + /** + * UpdateAuthorizedViewRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @instance + */ + UpdateAuthorizedViewRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new UpdateAuthorizedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewRequest} UpdateAuthorizedViewRequest instance + */ + UpdateAuthorizedViewRequest.create = function create(properties) { + return new UpdateAuthorizedViewRequest(properties); + }; + + /** + * Encodes the specified UpdateAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest} message UpdateAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAuthorizedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authorizedView != null && Object.hasOwnProperty.call(message, "authorizedView")) + $root.google.bigtable.admin.v2.AuthorizedView.encode(message.authorizedView, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified UpdateAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest} message UpdateAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAuthorizedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAuthorizedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewRequest} UpdateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAuthorizedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.authorizedView = $root.google.bigtable.admin.v2.AuthorizedView.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewRequest} UpdateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAuthorizedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAuthorizedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAuthorizedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.authorizedView != null && message.hasOwnProperty("authorizedView")) { + var error = $root.google.bigtable.admin.v2.AuthorizedView.verify(message.authorizedView); + if (error) + return "authorizedView." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates an UpdateAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewRequest} UpdateAuthorizedViewRequest + */ + UpdateAuthorizedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest(); + if (object.authorizedView != null) { + if (typeof object.authorizedView !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAuthorizedViewRequest.authorizedView: object expected"); + message.authorizedView = $root.google.bigtable.admin.v2.AuthorizedView.fromObject(object.authorizedView); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAuthorizedViewRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from an UpdateAuthorizedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.UpdateAuthorizedViewRequest} message UpdateAuthorizedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAuthorizedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.authorizedView = null; + object.updateMask = null; + object.ignoreWarnings = false; + } + if (message.authorizedView != null && message.hasOwnProperty("authorizedView")) + object.authorizedView = $root.google.bigtable.admin.v2.AuthorizedView.toObject(message.authorizedView, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this UpdateAuthorizedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAuthorizedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAuthorizedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAuthorizedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateAuthorizedViewRequest"; + }; + + return UpdateAuthorizedViewRequest; + })(); + + v2.UpdateAuthorizedViewMetadata = (function() { + + /** + * Properties of an UpdateAuthorizedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateAuthorizedViewMetadata + * @property {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest|null} [originalRequest] UpdateAuthorizedViewMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] UpdateAuthorizedViewMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] UpdateAuthorizedViewMetadata finishTime + */ + + /** + * Constructs a new UpdateAuthorizedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateAuthorizedViewMetadata. + * @implements IUpdateAuthorizedViewMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata=} [properties] Properties to set + */ + function UpdateAuthorizedViewMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAuthorizedViewMetadata originalRequest. + * @member {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @instance + */ + UpdateAuthorizedViewMetadata.prototype.originalRequest = null; + + /** + * UpdateAuthorizedViewMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @instance + */ + UpdateAuthorizedViewMetadata.prototype.requestTime = null; + + /** + * UpdateAuthorizedViewMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @instance + */ + UpdateAuthorizedViewMetadata.prototype.finishTime = null; + + /** + * Creates a new UpdateAuthorizedViewMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewMetadata} UpdateAuthorizedViewMetadata instance + */ + UpdateAuthorizedViewMetadata.create = function create(properties) { + return new UpdateAuthorizedViewMetadata(properties); + }; + + /** + * Encodes the specified UpdateAuthorizedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata} message UpdateAuthorizedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAuthorizedViewMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAuthorizedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata} message UpdateAuthorizedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAuthorizedViewMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAuthorizedViewMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewMetadata} UpdateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAuthorizedViewMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAuthorizedViewMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewMetadata} UpdateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAuthorizedViewMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAuthorizedViewMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAuthorizedViewMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates an UpdateAuthorizedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewMetadata} UpdateAuthorizedViewMetadata + */ + UpdateAuthorizedViewMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAuthorizedViewMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateAuthorizedViewMetadata} message UpdateAuthorizedViewMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAuthorizedViewMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this UpdateAuthorizedViewMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateAuthorizedViewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAuthorizedViewMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAuthorizedViewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateAuthorizedViewMetadata"; + }; + + return UpdateAuthorizedViewMetadata; + })(); + + v2.DeleteAuthorizedViewRequest = (function() { + + /** + * Properties of a DeleteAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteAuthorizedViewRequest + * @property {string|null} [name] DeleteAuthorizedViewRequest name + * @property {string|null} [etag] DeleteAuthorizedViewRequest etag + */ + + /** + * Constructs a new DeleteAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteAuthorizedViewRequest. + * @implements IDeleteAuthorizedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteAuthorizedViewRequest=} [properties] Properties to set + */ + function DeleteAuthorizedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAuthorizedViewRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @instance + */ + DeleteAuthorizedViewRequest.prototype.name = ""; + + /** + * DeleteAuthorizedViewRequest etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @instance + */ + DeleteAuthorizedViewRequest.prototype.etag = ""; + + /** + * Creates a new DeleteAuthorizedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteAuthorizedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteAuthorizedViewRequest} DeleteAuthorizedViewRequest instance + */ + DeleteAuthorizedViewRequest.create = function create(properties) { + return new DeleteAuthorizedViewRequest(properties); + }; + + /** + * Encodes the specified DeleteAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteAuthorizedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteAuthorizedViewRequest} message DeleteAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAuthorizedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteAuthorizedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteAuthorizedViewRequest} message DeleteAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAuthorizedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAuthorizedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteAuthorizedViewRequest} DeleteAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAuthorizedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteAuthorizedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteAuthorizedViewRequest} DeleteAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAuthorizedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAuthorizedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAuthorizedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteAuthorizedViewRequest} DeleteAuthorizedViewRequest + */ + DeleteAuthorizedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteAuthorizedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteAuthorizedViewRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteAuthorizedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.DeleteAuthorizedViewRequest} message DeleteAuthorizedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAuthorizedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteAuthorizedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAuthorizedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAuthorizedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAuthorizedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteAuthorizedViewRequest"; + }; + + return DeleteAuthorizedViewRequest; + })(); + + v2.CreateSchemaBundleRequest = (function() { + + /** + * Properties of a CreateSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateSchemaBundleRequest + * @property {string|null} [parent] CreateSchemaBundleRequest parent + * @property {string|null} [schemaBundleId] CreateSchemaBundleRequest schemaBundleId + * @property {google.bigtable.admin.v2.ISchemaBundle|null} [schemaBundle] CreateSchemaBundleRequest schemaBundle + */ + + /** + * Constructs a new CreateSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateSchemaBundleRequest. + * @implements ICreateSchemaBundleRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateSchemaBundleRequest=} [properties] Properties to set + */ + function CreateSchemaBundleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSchemaBundleRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @instance + */ + CreateSchemaBundleRequest.prototype.parent = ""; + + /** + * CreateSchemaBundleRequest schemaBundleId. + * @member {string} schemaBundleId + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @instance + */ + CreateSchemaBundleRequest.prototype.schemaBundleId = ""; + + /** + * CreateSchemaBundleRequest schemaBundle. + * @member {google.bigtable.admin.v2.ISchemaBundle|null|undefined} schemaBundle + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @instance + */ + CreateSchemaBundleRequest.prototype.schemaBundle = null; + + /** + * Creates a new CreateSchemaBundleRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.ICreateSchemaBundleRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateSchemaBundleRequest} CreateSchemaBundleRequest instance + */ + CreateSchemaBundleRequest.create = function create(properties) { + return new CreateSchemaBundleRequest(properties); + }; + + /** + * Encodes the specified CreateSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.ICreateSchemaBundleRequest} message CreateSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaBundleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.schemaBundleId); + if (message.schemaBundle != null && Object.hasOwnProperty.call(message, "schemaBundle")) + $root.google.bigtable.admin.v2.SchemaBundle.encode(message.schemaBundle, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.ICreateSchemaBundleRequest} message CreateSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaBundleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSchemaBundleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateSchemaBundleRequest} CreateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaBundleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateSchemaBundleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.schemaBundleId = reader.string(); + break; + } + case 3: { + message.schemaBundle = $root.google.bigtable.admin.v2.SchemaBundle.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateSchemaBundleRequest} CreateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaBundleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSchemaBundleRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSchemaBundleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + if (!$util.isString(message.schemaBundleId)) + return "schemaBundleId: string expected"; + if (message.schemaBundle != null && message.hasOwnProperty("schemaBundle")) { + var error = $root.google.bigtable.admin.v2.SchemaBundle.verify(message.schemaBundle); + if (error) + return "schemaBundle." + error; + } + return null; + }; + + /** + * Creates a CreateSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateSchemaBundleRequest} CreateSchemaBundleRequest + */ + CreateSchemaBundleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateSchemaBundleRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateSchemaBundleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.schemaBundleId != null) + message.schemaBundleId = String(object.schemaBundleId); + if (object.schemaBundle != null) { + if (typeof object.schemaBundle !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateSchemaBundleRequest.schemaBundle: object expected"); + message.schemaBundle = $root.google.bigtable.admin.v2.SchemaBundle.fromObject(object.schemaBundle); + } + return message; + }; + + /** + * Creates a plain object from a CreateSchemaBundleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.CreateSchemaBundleRequest} message CreateSchemaBundleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSchemaBundleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.schemaBundleId = ""; + object.schemaBundle = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + object.schemaBundleId = message.schemaBundleId; + if (message.schemaBundle != null && message.hasOwnProperty("schemaBundle")) + object.schemaBundle = $root.google.bigtable.admin.v2.SchemaBundle.toObject(message.schemaBundle, options); + return object; + }; + + /** + * Converts this CreateSchemaBundleRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSchemaBundleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSchemaBundleRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSchemaBundleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateSchemaBundleRequest"; + }; + + return CreateSchemaBundleRequest; + })(); + + v2.CreateSchemaBundleMetadata = (function() { + + /** + * Properties of a CreateSchemaBundleMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateSchemaBundleMetadata + * @property {string|null} [name] CreateSchemaBundleMetadata name + * @property {google.protobuf.ITimestamp|null} [startTime] CreateSchemaBundleMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] CreateSchemaBundleMetadata endTime + */ + + /** + * Constructs a new CreateSchemaBundleMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateSchemaBundleMetadata. + * @implements ICreateSchemaBundleMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateSchemaBundleMetadata=} [properties] Properties to set + */ + function CreateSchemaBundleMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSchemaBundleMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @instance + */ + CreateSchemaBundleMetadata.prototype.name = ""; + + /** + * CreateSchemaBundleMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @instance + */ + CreateSchemaBundleMetadata.prototype.startTime = null; + + /** + * CreateSchemaBundleMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @instance + */ + CreateSchemaBundleMetadata.prototype.endTime = null; + + /** + * Creates a new CreateSchemaBundleMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateSchemaBundleMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateSchemaBundleMetadata} CreateSchemaBundleMetadata instance + */ + CreateSchemaBundleMetadata.create = function create(properties) { + return new CreateSchemaBundleMetadata(properties); + }; + + /** + * Encodes the specified CreateSchemaBundleMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateSchemaBundleMetadata} message CreateSchemaBundleMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaBundleMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSchemaBundleMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateSchemaBundleMetadata} message CreateSchemaBundleMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaBundleMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSchemaBundleMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateSchemaBundleMetadata} CreateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaBundleMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateSchemaBundleMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSchemaBundleMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateSchemaBundleMetadata} CreateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaBundleMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSchemaBundleMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSchemaBundleMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a CreateSchemaBundleMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateSchemaBundleMetadata} CreateSchemaBundleMetadata + */ + CreateSchemaBundleMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateSchemaBundleMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateSchemaBundleMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateSchemaBundleMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateSchemaBundleMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateSchemaBundleMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.CreateSchemaBundleMetadata} message CreateSchemaBundleMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSchemaBundleMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this CreateSchemaBundleMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateSchemaBundleMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSchemaBundleMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSchemaBundleMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateSchemaBundleMetadata"; + }; + + return CreateSchemaBundleMetadata; + })(); + + v2.UpdateSchemaBundleRequest = (function() { + + /** + * Properties of an UpdateSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateSchemaBundleRequest + * @property {google.bigtable.admin.v2.ISchemaBundle|null} [schemaBundle] UpdateSchemaBundleRequest schemaBundle + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSchemaBundleRequest updateMask + * @property {boolean|null} [ignoreWarnings] UpdateSchemaBundleRequest ignoreWarnings + */ + + /** + * Constructs a new UpdateSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateSchemaBundleRequest. + * @implements IUpdateSchemaBundleRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleRequest=} [properties] Properties to set + */ + function UpdateSchemaBundleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSchemaBundleRequest schemaBundle. + * @member {google.bigtable.admin.v2.ISchemaBundle|null|undefined} schemaBundle + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @instance + */ + UpdateSchemaBundleRequest.prototype.schemaBundle = null; + + /** + * UpdateSchemaBundleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @instance + */ + UpdateSchemaBundleRequest.prototype.updateMask = null; + + /** + * UpdateSchemaBundleRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @instance + */ + UpdateSchemaBundleRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new UpdateSchemaBundleRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleRequest} UpdateSchemaBundleRequest instance + */ + UpdateSchemaBundleRequest.create = function create(properties) { + return new UpdateSchemaBundleRequest(properties); + }; + + /** + * Encodes the specified UpdateSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleRequest} message UpdateSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSchemaBundleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaBundle != null && Object.hasOwnProperty.call(message, "schemaBundle")) + $root.google.bigtable.admin.v2.SchemaBundle.encode(message.schemaBundle, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified UpdateSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleRequest} message UpdateSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSchemaBundleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSchemaBundleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleRequest} UpdateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSchemaBundleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateSchemaBundleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schemaBundle = $root.google.bigtable.admin.v2.SchemaBundle.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleRequest} UpdateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSchemaBundleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSchemaBundleRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSchemaBundleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaBundle != null && message.hasOwnProperty("schemaBundle")) { + var error = $root.google.bigtable.admin.v2.SchemaBundle.verify(message.schemaBundle); + if (error) + return "schemaBundle." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates an UpdateSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleRequest} UpdateSchemaBundleRequest + */ + UpdateSchemaBundleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateSchemaBundleRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateSchemaBundleRequest(); + if (object.schemaBundle != null) { + if (typeof object.schemaBundle !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateSchemaBundleRequest.schemaBundle: object expected"); + message.schemaBundle = $root.google.bigtable.admin.v2.SchemaBundle.fromObject(object.schemaBundle); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateSchemaBundleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from an UpdateSchemaBundleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.UpdateSchemaBundleRequest} message UpdateSchemaBundleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSchemaBundleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schemaBundle = null; + object.updateMask = null; + object.ignoreWarnings = false; + } + if (message.schemaBundle != null && message.hasOwnProperty("schemaBundle")) + object.schemaBundle = $root.google.bigtable.admin.v2.SchemaBundle.toObject(message.schemaBundle, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this UpdateSchemaBundleRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSchemaBundleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSchemaBundleRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSchemaBundleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateSchemaBundleRequest"; + }; + + return UpdateSchemaBundleRequest; + })(); + + v2.UpdateSchemaBundleMetadata = (function() { + + /** + * Properties of an UpdateSchemaBundleMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateSchemaBundleMetadata + * @property {string|null} [name] UpdateSchemaBundleMetadata name + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSchemaBundleMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] UpdateSchemaBundleMetadata endTime + */ + + /** + * Constructs a new UpdateSchemaBundleMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateSchemaBundleMetadata. + * @implements IUpdateSchemaBundleMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleMetadata=} [properties] Properties to set + */ + function UpdateSchemaBundleMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSchemaBundleMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @instance + */ + UpdateSchemaBundleMetadata.prototype.name = ""; + + /** + * UpdateSchemaBundleMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @instance + */ + UpdateSchemaBundleMetadata.prototype.startTime = null; + + /** + * UpdateSchemaBundleMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @instance + */ + UpdateSchemaBundleMetadata.prototype.endTime = null; + + /** + * Creates a new UpdateSchemaBundleMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleMetadata} UpdateSchemaBundleMetadata instance + */ + UpdateSchemaBundleMetadata.create = function create(properties) { + return new UpdateSchemaBundleMetadata(properties); + }; + + /** + * Encodes the specified UpdateSchemaBundleMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleMetadata} message UpdateSchemaBundleMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSchemaBundleMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSchemaBundleMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleMetadata} message UpdateSchemaBundleMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSchemaBundleMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSchemaBundleMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleMetadata} UpdateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSchemaBundleMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateSchemaBundleMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSchemaBundleMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleMetadata} UpdateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSchemaBundleMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSchemaBundleMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSchemaBundleMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an UpdateSchemaBundleMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleMetadata} UpdateSchemaBundleMetadata + */ + UpdateSchemaBundleMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateSchemaBundleMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateSchemaBundleMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateSchemaBundleMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateSchemaBundleMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSchemaBundleMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateSchemaBundleMetadata} message UpdateSchemaBundleMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSchemaBundleMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this UpdateSchemaBundleMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateSchemaBundleMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSchemaBundleMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSchemaBundleMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateSchemaBundleMetadata"; + }; + + return UpdateSchemaBundleMetadata; + })(); + + v2.GetSchemaBundleRequest = (function() { + + /** + * Properties of a GetSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetSchemaBundleRequest + * @property {string|null} [name] GetSchemaBundleRequest name + */ + + /** + * Constructs a new GetSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetSchemaBundleRequest. + * @implements IGetSchemaBundleRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetSchemaBundleRequest=} [properties] Properties to set + */ + function GetSchemaBundleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSchemaBundleRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @instance + */ + GetSchemaBundleRequest.prototype.name = ""; + + /** + * Creates a new GetSchemaBundleRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IGetSchemaBundleRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetSchemaBundleRequest} GetSchemaBundleRequest instance + */ + GetSchemaBundleRequest.create = function create(properties) { + return new GetSchemaBundleRequest(properties); + }; + + /** + * Encodes the specified GetSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetSchemaBundleRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IGetSchemaBundleRequest} message GetSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaBundleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetSchemaBundleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IGetSchemaBundleRequest} message GetSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaBundleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSchemaBundleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetSchemaBundleRequest} GetSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaBundleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetSchemaBundleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetSchemaBundleRequest} GetSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaBundleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSchemaBundleRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSchemaBundleRequest.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 GetSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetSchemaBundleRequest} GetSchemaBundleRequest + */ + GetSchemaBundleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetSchemaBundleRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetSchemaBundleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSchemaBundleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.GetSchemaBundleRequest} message GetSchemaBundleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSchemaBundleRequest.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 GetSchemaBundleRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @instance + * @returns {Object.} JSON object + */ + GetSchemaBundleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSchemaBundleRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSchemaBundleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetSchemaBundleRequest"; + }; + + return GetSchemaBundleRequest; + })(); + + v2.ListSchemaBundlesRequest = (function() { + + /** + * Properties of a ListSchemaBundlesRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListSchemaBundlesRequest + * @property {string|null} [parent] ListSchemaBundlesRequest parent + * @property {number|null} [pageSize] ListSchemaBundlesRequest pageSize + * @property {string|null} [pageToken] ListSchemaBundlesRequest pageToken + */ + + /** + * Constructs a new ListSchemaBundlesRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListSchemaBundlesRequest. + * @implements IListSchemaBundlesRequest + * @constructor + * @param {google.bigtable.admin.v2.IListSchemaBundlesRequest=} [properties] Properties to set + */ + function ListSchemaBundlesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSchemaBundlesRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @instance + */ + ListSchemaBundlesRequest.prototype.parent = ""; + + /** + * ListSchemaBundlesRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @instance + */ + ListSchemaBundlesRequest.prototype.pageSize = 0; + + /** + * ListSchemaBundlesRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @instance + */ + ListSchemaBundlesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSchemaBundlesRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {google.bigtable.admin.v2.IListSchemaBundlesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListSchemaBundlesRequest} ListSchemaBundlesRequest instance + */ + ListSchemaBundlesRequest.create = function create(properties) { + return new ListSchemaBundlesRequest(properties); + }; + + /** + * Encodes the specified ListSchemaBundlesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {google.bigtable.admin.v2.IListSchemaBundlesRequest} message ListSchemaBundlesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaBundlesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSchemaBundlesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {google.bigtable.admin.v2.IListSchemaBundlesRequest} message ListSchemaBundlesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaBundlesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemaBundlesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListSchemaBundlesRequest} ListSchemaBundlesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaBundlesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListSchemaBundlesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemaBundlesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListSchemaBundlesRequest} ListSchemaBundlesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaBundlesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemaBundlesRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemaBundlesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchemaBundlesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListSchemaBundlesRequest} ListSchemaBundlesRequest + */ + ListSchemaBundlesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListSchemaBundlesRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListSchemaBundlesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemaBundlesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {google.bigtable.admin.v2.ListSchemaBundlesRequest} message ListSchemaBundlesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemaBundlesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSchemaBundlesRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSchemaBundlesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemaBundlesRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemaBundlesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListSchemaBundlesRequest"; + }; + + return ListSchemaBundlesRequest; + })(); + + v2.ListSchemaBundlesResponse = (function() { + + /** + * Properties of a ListSchemaBundlesResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListSchemaBundlesResponse + * @property {Array.|null} [schemaBundles] ListSchemaBundlesResponse schemaBundles + * @property {string|null} [nextPageToken] ListSchemaBundlesResponse nextPageToken + */ + + /** + * Constructs a new ListSchemaBundlesResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListSchemaBundlesResponse. + * @implements IListSchemaBundlesResponse + * @constructor + * @param {google.bigtable.admin.v2.IListSchemaBundlesResponse=} [properties] Properties to set + */ + function ListSchemaBundlesResponse(properties) { + this.schemaBundles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSchemaBundlesResponse schemaBundles. + * @member {Array.} schemaBundles + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @instance + */ + ListSchemaBundlesResponse.prototype.schemaBundles = $util.emptyArray; + + /** + * ListSchemaBundlesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @instance + */ + ListSchemaBundlesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSchemaBundlesResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {google.bigtable.admin.v2.IListSchemaBundlesResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListSchemaBundlesResponse} ListSchemaBundlesResponse instance + */ + ListSchemaBundlesResponse.create = function create(properties) { + return new ListSchemaBundlesResponse(properties); + }; + + /** + * Encodes the specified ListSchemaBundlesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {google.bigtable.admin.v2.IListSchemaBundlesResponse} message ListSchemaBundlesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaBundlesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaBundles != null && message.schemaBundles.length) + for (var i = 0; i < message.schemaBundles.length; ++i) + $root.google.bigtable.admin.v2.SchemaBundle.encode(message.schemaBundles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSchemaBundlesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {google.bigtable.admin.v2.IListSchemaBundlesResponse} message ListSchemaBundlesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaBundlesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemaBundlesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListSchemaBundlesResponse} ListSchemaBundlesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaBundlesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListSchemaBundlesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.schemaBundles && message.schemaBundles.length)) + message.schemaBundles = []; + message.schemaBundles.push($root.google.bigtable.admin.v2.SchemaBundle.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemaBundlesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListSchemaBundlesResponse} ListSchemaBundlesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaBundlesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemaBundlesResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemaBundlesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaBundles != null && message.hasOwnProperty("schemaBundles")) { + if (!Array.isArray(message.schemaBundles)) + return "schemaBundles: array expected"; + for (var i = 0; i < message.schemaBundles.length; ++i) { + var error = $root.google.bigtable.admin.v2.SchemaBundle.verify(message.schemaBundles[i]); + if (error) + return "schemaBundles." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchemaBundlesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListSchemaBundlesResponse} ListSchemaBundlesResponse + */ + ListSchemaBundlesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListSchemaBundlesResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListSchemaBundlesResponse(); + if (object.schemaBundles) { + if (!Array.isArray(object.schemaBundles)) + throw TypeError(".google.bigtable.admin.v2.ListSchemaBundlesResponse.schemaBundles: array expected"); + message.schemaBundles = []; + for (var i = 0; i < object.schemaBundles.length; ++i) { + if (typeof object.schemaBundles[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListSchemaBundlesResponse.schemaBundles: object expected"); + message.schemaBundles[i] = $root.google.bigtable.admin.v2.SchemaBundle.fromObject(object.schemaBundles[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemaBundlesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {google.bigtable.admin.v2.ListSchemaBundlesResponse} message ListSchemaBundlesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemaBundlesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schemaBundles = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.schemaBundles && message.schemaBundles.length) { + object.schemaBundles = []; + for (var j = 0; j < message.schemaBundles.length; ++j) + object.schemaBundles[j] = $root.google.bigtable.admin.v2.SchemaBundle.toObject(message.schemaBundles[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSchemaBundlesResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSchemaBundlesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemaBundlesResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemaBundlesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListSchemaBundlesResponse"; + }; + + return ListSchemaBundlesResponse; + })(); + + v2.DeleteSchemaBundleRequest = (function() { + + /** + * Properties of a DeleteSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteSchemaBundleRequest + * @property {string|null} [name] DeleteSchemaBundleRequest name + * @property {string|null} [etag] DeleteSchemaBundleRequest etag + */ + + /** + * Constructs a new DeleteSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteSchemaBundleRequest. + * @implements IDeleteSchemaBundleRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteSchemaBundleRequest=} [properties] Properties to set + */ + function DeleteSchemaBundleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSchemaBundleRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @instance + */ + DeleteSchemaBundleRequest.prototype.name = ""; + + /** + * DeleteSchemaBundleRequest etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @instance + */ + DeleteSchemaBundleRequest.prototype.etag = ""; + + /** + * Creates a new DeleteSchemaBundleRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteSchemaBundleRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteSchemaBundleRequest} DeleteSchemaBundleRequest instance + */ + DeleteSchemaBundleRequest.create = function create(properties) { + return new DeleteSchemaBundleRequest(properties); + }; + + /** + * Encodes the specified DeleteSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteSchemaBundleRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteSchemaBundleRequest} message DeleteSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaBundleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteSchemaBundleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteSchemaBundleRequest} message DeleteSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaBundleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSchemaBundleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteSchemaBundleRequest} DeleteSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaBundleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteSchemaBundleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteSchemaBundleRequest} DeleteSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaBundleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSchemaBundleRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSchemaBundleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteSchemaBundleRequest} DeleteSchemaBundleRequest + */ + DeleteSchemaBundleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteSchemaBundleRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteSchemaBundleRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteSchemaBundleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.DeleteSchemaBundleRequest} message DeleteSchemaBundleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSchemaBundleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteSchemaBundleRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSchemaBundleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSchemaBundleRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSchemaBundleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteSchemaBundleRequest"; + }; + + return DeleteSchemaBundleRequest; + })(); + + v2.RestoreInfo = (function() { + + /** + * Properties of a RestoreInfo. + * @memberof google.bigtable.admin.v2 + * @interface IRestoreInfo + * @property {google.bigtable.admin.v2.RestoreSourceType|null} [sourceType] RestoreInfo sourceType + * @property {google.bigtable.admin.v2.IBackupInfo|null} [backupInfo] RestoreInfo backupInfo + */ + + /** + * Constructs a new RestoreInfo. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a RestoreInfo. + * @implements IRestoreInfo + * @constructor + * @param {google.bigtable.admin.v2.IRestoreInfo=} [properties] Properties to set + */ + function RestoreInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreInfo sourceType. + * @member {google.bigtable.admin.v2.RestoreSourceType} sourceType + * @memberof google.bigtable.admin.v2.RestoreInfo + * @instance + */ + RestoreInfo.prototype.sourceType = 0; + + /** + * RestoreInfo backupInfo. + * @member {google.bigtable.admin.v2.IBackupInfo|null|undefined} backupInfo + * @memberof google.bigtable.admin.v2.RestoreInfo + * @instance + */ + RestoreInfo.prototype.backupInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreInfo sourceInfo. + * @member {"backupInfo"|undefined} sourceInfo + * @memberof google.bigtable.admin.v2.RestoreInfo + * @instance + */ + Object.defineProperty(RestoreInfo.prototype, "sourceInfo", { + get: $util.oneOfGetter($oneOfFields = ["backupInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreInfo instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {google.bigtable.admin.v2.IRestoreInfo=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.RestoreInfo} RestoreInfo instance + */ + RestoreInfo.create = function create(properties) { + return new RestoreInfo(properties); + }; + + /** + * Encodes the specified RestoreInfo message. Does not implicitly {@link google.bigtable.admin.v2.RestoreInfo.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {google.bigtable.admin.v2.IRestoreInfo} message RestoreInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sourceType); + if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) + $root.google.bigtable.admin.v2.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreInfo message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.RestoreInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {google.bigtable.admin.v2.IRestoreInfo} message RestoreInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.RestoreInfo} RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.RestoreInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sourceType = reader.int32(); + break; + } + case 2: { + message.backupInfo = $root.google.bigtable.admin.v2.BackupInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.RestoreInfo} RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreInfo message. + * @function verify + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + properties.sourceInfo = 1; + { + var error = $root.google.bigtable.admin.v2.BackupInfo.verify(message.backupInfo); + if (error) + return "backupInfo." + error; + } + } + return null; + }; + + /** + * Creates a RestoreInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.RestoreInfo} RestoreInfo + */ + RestoreInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.RestoreInfo) + return object; + var message = new $root.google.bigtable.admin.v2.RestoreInfo(); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "RESTORE_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "BACKUP": + case 1: + message.sourceType = 1; + break; + } + if (object.backupInfo != null) { + if (typeof object.backupInfo !== "object") + throw TypeError(".google.bigtable.admin.v2.RestoreInfo.backupInfo: object expected"); + message.backupInfo = $root.google.bigtable.admin.v2.BackupInfo.fromObject(object.backupInfo); + } + return message; + }; + + /** + * Creates a plain object from a RestoreInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {google.bigtable.admin.v2.RestoreInfo} message RestoreInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sourceType = options.enums === String ? "RESTORE_SOURCE_TYPE_UNSPECIFIED" : 0; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.bigtable.admin.v2.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.bigtable.admin.v2.RestoreSourceType[message.sourceType] : message.sourceType; + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + object.backupInfo = $root.google.bigtable.admin.v2.BackupInfo.toObject(message.backupInfo, options); + if (options.oneofs) + object.sourceInfo = "backupInfo"; + } + return object; + }; + + /** + * Converts this RestoreInfo to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.RestoreInfo + * @instance + * @returns {Object.} JSON object + */ + RestoreInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreInfo + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.RestoreInfo"; + }; + + return RestoreInfo; + })(); + + v2.ChangeStreamConfig = (function() { + + /** + * Properties of a ChangeStreamConfig. + * @memberof google.bigtable.admin.v2 + * @interface IChangeStreamConfig + * @property {google.protobuf.IDuration|null} [retentionPeriod] ChangeStreamConfig retentionPeriod + */ + + /** + * Constructs a new ChangeStreamConfig. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ChangeStreamConfig. + * @implements IChangeStreamConfig + * @constructor + * @param {google.bigtable.admin.v2.IChangeStreamConfig=} [properties] Properties to set + */ + function ChangeStreamConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChangeStreamConfig retentionPeriod. + * @member {google.protobuf.IDuration|null|undefined} retentionPeriod + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @instance + */ + ChangeStreamConfig.prototype.retentionPeriod = null; + + /** + * Creates a new ChangeStreamConfig instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {google.bigtable.admin.v2.IChangeStreamConfig=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ChangeStreamConfig} ChangeStreamConfig instance + */ + ChangeStreamConfig.create = function create(properties) { + return new ChangeStreamConfig(properties); + }; + + /** + * Encodes the specified ChangeStreamConfig message. Does not implicitly {@link google.bigtable.admin.v2.ChangeStreamConfig.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {google.bigtable.admin.v2.IChangeStreamConfig} message ChangeStreamConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeStreamConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) + $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChangeStreamConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ChangeStreamConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {google.bigtable.admin.v2.IChangeStreamConfig} message ChangeStreamConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeStreamConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChangeStreamConfig message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ChangeStreamConfig} ChangeStreamConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeStreamConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ChangeStreamConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChangeStreamConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ChangeStreamConfig} ChangeStreamConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeStreamConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChangeStreamConfig message. + * @function verify + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChangeStreamConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); + if (error) + return "retentionPeriod." + error; + } + return null; + }; + + /** + * Creates a ChangeStreamConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ChangeStreamConfig} ChangeStreamConfig + */ + ChangeStreamConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ChangeStreamConfig) + return object; + var message = new $root.google.bigtable.admin.v2.ChangeStreamConfig(); + if (object.retentionPeriod != null) { + if (typeof object.retentionPeriod !== "object") + throw TypeError(".google.bigtable.admin.v2.ChangeStreamConfig.retentionPeriod: object expected"); + message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); + } + return message; + }; + + /** + * Creates a plain object from a ChangeStreamConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {google.bigtable.admin.v2.ChangeStreamConfig} message ChangeStreamConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChangeStreamConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.retentionPeriod = null; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) + object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); + return object; + }; + + /** + * Converts this ChangeStreamConfig to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @instance + * @returns {Object.} JSON object + */ + ChangeStreamConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChangeStreamConfig + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChangeStreamConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ChangeStreamConfig"; + }; + + return ChangeStreamConfig; + })(); + + v2.Table = (function() { + + /** + * Properties of a Table. + * @memberof google.bigtable.admin.v2 + * @interface ITable + * @property {string|null} [name] Table name + * @property {Object.|null} [clusterStates] Table clusterStates + * @property {Object.|null} [columnFamilies] Table columnFamilies + * @property {google.bigtable.admin.v2.Table.TimestampGranularity|null} [granularity] Table granularity + * @property {google.bigtable.admin.v2.IRestoreInfo|null} [restoreInfo] Table restoreInfo + * @property {google.bigtable.admin.v2.IChangeStreamConfig|null} [changeStreamConfig] Table changeStreamConfig + * @property {boolean|null} [deletionProtection] Table deletionProtection + * @property {google.bigtable.admin.v2.Table.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Table automatedBackupPolicy + * @property {google.bigtable.admin.v2.Type.IStruct|null} [rowKeySchema] Table rowKeySchema + */ + + /** + * Constructs a new Table. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a Table. + * @implements ITable + * @constructor + * @param {google.bigtable.admin.v2.ITable=} [properties] Properties to set + */ + function Table(properties) { + this.clusterStates = {}; + this.columnFamilies = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Table name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.name = ""; + + /** + * Table clusterStates. + * @member {Object.} clusterStates + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.clusterStates = $util.emptyObject; + + /** + * Table columnFamilies. + * @member {Object.} columnFamilies + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.columnFamilies = $util.emptyObject; + + /** + * Table granularity. + * @member {google.bigtable.admin.v2.Table.TimestampGranularity} granularity + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.granularity = 0; + + /** + * Table restoreInfo. + * @member {google.bigtable.admin.v2.IRestoreInfo|null|undefined} restoreInfo + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.restoreInfo = null; + + /** + * Table changeStreamConfig. + * @member {google.bigtable.admin.v2.IChangeStreamConfig|null|undefined} changeStreamConfig + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.changeStreamConfig = null; + + /** + * Table deletionProtection. + * @member {boolean} deletionProtection + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.deletionProtection = false; + + /** + * Table automatedBackupPolicy. + * @member {google.bigtable.admin.v2.Table.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.automatedBackupPolicy = null; + + /** + * Table rowKeySchema. + * @member {google.bigtable.admin.v2.Type.IStruct|null|undefined} rowKeySchema + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.rowKeySchema = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Table automatedBackupConfig. + * @member {"automatedBackupPolicy"|undefined} automatedBackupConfig + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Object.defineProperty(Table.prototype, "automatedBackupConfig", { + get: $util.oneOfGetter($oneOfFields = ["automatedBackupPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Table instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {google.bigtable.admin.v2.ITable=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Table} Table instance + */ + Table.create = function create(properties) { + return new Table(properties); + }; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.bigtable.admin.v2.Table.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {google.bigtable.admin.v2.ITable} message Table message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Table.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.clusterStates != null && Object.hasOwnProperty.call(message, "clusterStates")) + for (var keys = Object.keys(message.clusterStates), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.admin.v2.Table.ClusterState.encode(message.clusterStates[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.columnFamilies != null && Object.hasOwnProperty.call(message, "columnFamilies")) + for (var keys = Object.keys(message.columnFamilies), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.admin.v2.ColumnFamily.encode(message.columnFamilies[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.granularity != null && Object.hasOwnProperty.call(message, "granularity")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.granularity); + if (message.restoreInfo != null && Object.hasOwnProperty.call(message, "restoreInfo")) + $root.google.bigtable.admin.v2.RestoreInfo.encode(message.restoreInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.changeStreamConfig != null && Object.hasOwnProperty.call(message, "changeStreamConfig")) + $root.google.bigtable.admin.v2.ChangeStreamConfig.encode(message.changeStreamConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.deletionProtection); + if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) + $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.rowKeySchema != null && Object.hasOwnProperty.call(message, "rowKeySchema")) + $root.google.bigtable.admin.v2.Type.Struct.encode(message.rowKeySchema, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Table.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {google.bigtable.admin.v2.ITable} message Table message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Table.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Table message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Table} Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Table.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Table(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.clusterStates === $util.emptyObject) + message.clusterStates = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.admin.v2.Table.ClusterState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.clusterStates[key] = value; + break; + } + case 3: { + if (message.columnFamilies === $util.emptyObject) + message.columnFamilies = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.admin.v2.ColumnFamily.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.columnFamilies[key] = value; + break; + } + case 4: { + message.granularity = reader.int32(); + break; + } + case 6: { + message.restoreInfo = $root.google.bigtable.admin.v2.RestoreInfo.decode(reader, reader.uint32()); + break; + } + case 8: { + message.changeStreamConfig = $root.google.bigtable.admin.v2.ChangeStreamConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.deletionProtection = reader.bool(); + break; + } + case 13: { + message.automatedBackupPolicy = $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.decode(reader, reader.uint32()); + break; + } + case 15: { + message.rowKeySchema = $root.google.bigtable.admin.v2.Type.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Table message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Table} Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Table.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Table message. + * @function verify + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Table.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.clusterStates != null && message.hasOwnProperty("clusterStates")) { + if (!$util.isObject(message.clusterStates)) + return "clusterStates: object expected"; + var key = Object.keys(message.clusterStates); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.admin.v2.Table.ClusterState.verify(message.clusterStates[key[i]]); + if (error) + return "clusterStates." + error; + } + } + if (message.columnFamilies != null && message.hasOwnProperty("columnFamilies")) { + if (!$util.isObject(message.columnFamilies)) + return "columnFamilies: object expected"; + var key = Object.keys(message.columnFamilies); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.admin.v2.ColumnFamily.verify(message.columnFamilies[key[i]]); + if (error) + return "columnFamilies." + error; + } + } + if (message.granularity != null && message.hasOwnProperty("granularity")) + switch (message.granularity) { + default: + return "granularity: enum value expected"; + case 0: + case 1: + break; + } + if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) { + var error = $root.google.bigtable.admin.v2.RestoreInfo.verify(message.restoreInfo); + if (error) + return "restoreInfo." + error; + } + if (message.changeStreamConfig != null && message.hasOwnProperty("changeStreamConfig")) { + var error = $root.google.bigtable.admin.v2.ChangeStreamConfig.verify(message.changeStreamConfig); + if (error) + return "changeStreamConfig." + error; + } + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { + properties.automatedBackupConfig = 1; + { + var error = $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); + if (error) + return "automatedBackupPolicy." + error; + } + } + if (message.rowKeySchema != null && message.hasOwnProperty("rowKeySchema")) { + var error = $root.google.bigtable.admin.v2.Type.Struct.verify(message.rowKeySchema); + if (error) + return "rowKeySchema." + error; + } + return null; + }; + + /** + * Creates a Table message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Table} Table + */ + Table.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Table) + return object; + var message = new $root.google.bigtable.admin.v2.Table(); + if (object.name != null) + message.name = String(object.name); + if (object.clusterStates) { + if (typeof object.clusterStates !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.clusterStates: object expected"); + message.clusterStates = {}; + for (var keys = Object.keys(object.clusterStates), i = 0; i < keys.length; ++i) { + if (typeof object.clusterStates[keys[i]] !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.clusterStates: object expected"); + message.clusterStates[keys[i]] = $root.google.bigtable.admin.v2.Table.ClusterState.fromObject(object.clusterStates[keys[i]]); + } + } + if (object.columnFamilies) { + if (typeof object.columnFamilies !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.columnFamilies: object expected"); + message.columnFamilies = {}; + for (var keys = Object.keys(object.columnFamilies), i = 0; i < keys.length; ++i) { + if (typeof object.columnFamilies[keys[i]] !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.columnFamilies: object expected"); + message.columnFamilies[keys[i]] = $root.google.bigtable.admin.v2.ColumnFamily.fromObject(object.columnFamilies[keys[i]]); + } + } + switch (object.granularity) { + default: + if (typeof object.granularity === "number") { + message.granularity = object.granularity; + break; + } + break; + case "TIMESTAMP_GRANULARITY_UNSPECIFIED": + case 0: + message.granularity = 0; + break; + case "MILLIS": + case 1: + message.granularity = 1; + break; + } + if (object.restoreInfo != null) { + if (typeof object.restoreInfo !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.restoreInfo: object expected"); + message.restoreInfo = $root.google.bigtable.admin.v2.RestoreInfo.fromObject(object.restoreInfo); + } + if (object.changeStreamConfig != null) { + if (typeof object.changeStreamConfig !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.changeStreamConfig: object expected"); + message.changeStreamConfig = $root.google.bigtable.admin.v2.ChangeStreamConfig.fromObject(object.changeStreamConfig); + } + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + if (object.automatedBackupPolicy != null) { + if (typeof object.automatedBackupPolicy !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.automatedBackupPolicy: object expected"); + message.automatedBackupPolicy = $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); + } + if (object.rowKeySchema != null) { + if (typeof object.rowKeySchema !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.rowKeySchema: object expected"); + message.rowKeySchema = $root.google.bigtable.admin.v2.Type.Struct.fromObject(object.rowKeySchema); + } + return message; + }; + + /** + * Creates a plain object from a Table message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {google.bigtable.admin.v2.Table} message Table + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Table.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.clusterStates = {}; + object.columnFamilies = {}; + } + if (options.defaults) { + object.name = ""; + object.granularity = options.enums === String ? "TIMESTAMP_GRANULARITY_UNSPECIFIED" : 0; + object.restoreInfo = null; + object.changeStreamConfig = null; + object.deletionProtection = false; + object.rowKeySchema = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.clusterStates && (keys2 = Object.keys(message.clusterStates)).length) { + object.clusterStates = {}; + for (var j = 0; j < keys2.length; ++j) + object.clusterStates[keys2[j]] = $root.google.bigtable.admin.v2.Table.ClusterState.toObject(message.clusterStates[keys2[j]], options); + } + if (message.columnFamilies && (keys2 = Object.keys(message.columnFamilies)).length) { + object.columnFamilies = {}; + for (var j = 0; j < keys2.length; ++j) + object.columnFamilies[keys2[j]] = $root.google.bigtable.admin.v2.ColumnFamily.toObject(message.columnFamilies[keys2[j]], options); + } + if (message.granularity != null && message.hasOwnProperty("granularity")) + object.granularity = options.enums === String ? $root.google.bigtable.admin.v2.Table.TimestampGranularity[message.granularity] === undefined ? message.granularity : $root.google.bigtable.admin.v2.Table.TimestampGranularity[message.granularity] : message.granularity; + if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) + object.restoreInfo = $root.google.bigtable.admin.v2.RestoreInfo.toObject(message.restoreInfo, options); + if (message.changeStreamConfig != null && message.hasOwnProperty("changeStreamConfig")) + object.changeStreamConfig = $root.google.bigtable.admin.v2.ChangeStreamConfig.toObject(message.changeStreamConfig, options); + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + object.deletionProtection = message.deletionProtection; + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { + object.automatedBackupPolicy = $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); + if (options.oneofs) + object.automatedBackupConfig = "automatedBackupPolicy"; + } + if (message.rowKeySchema != null && message.hasOwnProperty("rowKeySchema")) + object.rowKeySchema = $root.google.bigtable.admin.v2.Type.Struct.toObject(message.rowKeySchema, options); + return object; + }; + + /** + * Converts this Table to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Table + * @instance + * @returns {Object.} JSON object + */ + Table.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Table + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Table.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Table"; + }; + + Table.ClusterState = (function() { + + /** + * Properties of a ClusterState. + * @memberof google.bigtable.admin.v2.Table + * @interface IClusterState + * @property {google.bigtable.admin.v2.Table.ClusterState.ReplicationState|null} [replicationState] ClusterState replicationState + * @property {Array.|null} [encryptionInfo] ClusterState encryptionInfo + */ + + /** + * Constructs a new ClusterState. + * @memberof google.bigtable.admin.v2.Table + * @classdesc Represents a ClusterState. + * @implements IClusterState + * @constructor + * @param {google.bigtable.admin.v2.Table.IClusterState=} [properties] Properties to set + */ + function ClusterState(properties) { + this.encryptionInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterState replicationState. + * @member {google.bigtable.admin.v2.Table.ClusterState.ReplicationState} replicationState + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @instance + */ + ClusterState.prototype.replicationState = 0; + + /** + * ClusterState encryptionInfo. + * @member {Array.} encryptionInfo + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @instance + */ + ClusterState.prototype.encryptionInfo = $util.emptyArray; + + /** + * Creates a new ClusterState instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {google.bigtable.admin.v2.Table.IClusterState=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Table.ClusterState} ClusterState instance + */ + ClusterState.create = function create(properties) { + return new ClusterState(properties); + }; + + /** + * Encodes the specified ClusterState message. Does not implicitly {@link google.bigtable.admin.v2.Table.ClusterState.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {google.bigtable.admin.v2.Table.IClusterState} message ClusterState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicationState != null && Object.hasOwnProperty.call(message, "replicationState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.replicationState); + if (message.encryptionInfo != null && message.encryptionInfo.length) + for (var i = 0; i < message.encryptionInfo.length; ++i) + $root.google.bigtable.admin.v2.EncryptionInfo.encode(message.encryptionInfo[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterState message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Table.ClusterState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {google.bigtable.admin.v2.Table.IClusterState} message ClusterState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterState message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Table.ClusterState} ClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterState.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Table.ClusterState(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.replicationState = reader.int32(); + break; + } + case 2: { + if (!(message.encryptionInfo && message.encryptionInfo.length)) + message.encryptionInfo = []; + message.encryptionInfo.push($root.google.bigtable.admin.v2.EncryptionInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Table.ClusterState} ClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterState message. + * @function verify + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replicationState != null && message.hasOwnProperty("replicationState")) + switch (message.replicationState) { + default: + return "replicationState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + if (!Array.isArray(message.encryptionInfo)) + return "encryptionInfo: array expected"; + for (var i = 0; i < message.encryptionInfo.length; ++i) { + var error = $root.google.bigtable.admin.v2.EncryptionInfo.verify(message.encryptionInfo[i]); + if (error) + return "encryptionInfo." + error; + } + } + return null; + }; + + /** + * Creates a ClusterState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Table.ClusterState} ClusterState + */ + ClusterState.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Table.ClusterState) + return object; + var message = new $root.google.bigtable.admin.v2.Table.ClusterState(); + switch (object.replicationState) { + default: + if (typeof object.replicationState === "number") { + message.replicationState = object.replicationState; + break; + } + break; + case "STATE_NOT_KNOWN": + case 0: + message.replicationState = 0; + break; + case "INITIALIZING": + case 1: + message.replicationState = 1; + break; + case "PLANNED_MAINTENANCE": + case 2: + message.replicationState = 2; + break; + case "UNPLANNED_MAINTENANCE": + case 3: + message.replicationState = 3; + break; + case "READY": + case 4: + message.replicationState = 4; + break; + case "READY_OPTIMIZING": + case 5: + message.replicationState = 5; + break; + } + if (object.encryptionInfo) { + if (!Array.isArray(object.encryptionInfo)) + throw TypeError(".google.bigtable.admin.v2.Table.ClusterState.encryptionInfo: array expected"); + message.encryptionInfo = []; + for (var i = 0; i < object.encryptionInfo.length; ++i) { + if (typeof object.encryptionInfo[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.ClusterState.encryptionInfo: object expected"); + message.encryptionInfo[i] = $root.google.bigtable.admin.v2.EncryptionInfo.fromObject(object.encryptionInfo[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClusterState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {google.bigtable.admin.v2.Table.ClusterState} message ClusterState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.encryptionInfo = []; + if (options.defaults) + object.replicationState = options.enums === String ? "STATE_NOT_KNOWN" : 0; + if (message.replicationState != null && message.hasOwnProperty("replicationState")) + object.replicationState = options.enums === String ? $root.google.bigtable.admin.v2.Table.ClusterState.ReplicationState[message.replicationState] === undefined ? message.replicationState : $root.google.bigtable.admin.v2.Table.ClusterState.ReplicationState[message.replicationState] : message.replicationState; + if (message.encryptionInfo && message.encryptionInfo.length) { + object.encryptionInfo = []; + for (var j = 0; j < message.encryptionInfo.length; ++j) + object.encryptionInfo[j] = $root.google.bigtable.admin.v2.EncryptionInfo.toObject(message.encryptionInfo[j], options); + } + return object; + }; + + /** + * Converts this ClusterState to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @instance + * @returns {Object.} JSON object + */ + ClusterState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterState + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Table.ClusterState"; + }; + + /** + * ReplicationState enum. + * @name google.bigtable.admin.v2.Table.ClusterState.ReplicationState + * @enum {number} + * @property {number} STATE_NOT_KNOWN=0 STATE_NOT_KNOWN value + * @property {number} INITIALIZING=1 INITIALIZING value + * @property {number} PLANNED_MAINTENANCE=2 PLANNED_MAINTENANCE value + * @property {number} UNPLANNED_MAINTENANCE=3 UNPLANNED_MAINTENANCE value + * @property {number} READY=4 READY value + * @property {number} READY_OPTIMIZING=5 READY_OPTIMIZING value + */ + ClusterState.ReplicationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_NOT_KNOWN"] = 0; + values[valuesById[1] = "INITIALIZING"] = 1; + values[valuesById[2] = "PLANNED_MAINTENANCE"] = 2; + values[valuesById[3] = "UNPLANNED_MAINTENANCE"] = 3; + values[valuesById[4] = "READY"] = 4; + values[valuesById[5] = "READY_OPTIMIZING"] = 5; + return values; + })(); + + return ClusterState; + })(); + + /** + * TimestampGranularity enum. + * @name google.bigtable.admin.v2.Table.TimestampGranularity + * @enum {number} + * @property {number} TIMESTAMP_GRANULARITY_UNSPECIFIED=0 TIMESTAMP_GRANULARITY_UNSPECIFIED value + * @property {number} MILLIS=1 MILLIS value + */ + Table.TimestampGranularity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIMESTAMP_GRANULARITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "MILLIS"] = 1; + return values; + })(); + + /** + * View enum. + * @name google.bigtable.admin.v2.Table.View + * @enum {number} + * @property {number} VIEW_UNSPECIFIED=0 VIEW_UNSPECIFIED value + * @property {number} NAME_ONLY=1 NAME_ONLY value + * @property {number} SCHEMA_VIEW=2 SCHEMA_VIEW value + * @property {number} REPLICATION_VIEW=3 REPLICATION_VIEW value + * @property {number} ENCRYPTION_VIEW=5 ENCRYPTION_VIEW value + * @property {number} FULL=4 FULL value + */ + Table.View = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "NAME_ONLY"] = 1; + values[valuesById[2] = "SCHEMA_VIEW"] = 2; + values[valuesById[3] = "REPLICATION_VIEW"] = 3; + values[valuesById[5] = "ENCRYPTION_VIEW"] = 5; + values[valuesById[4] = "FULL"] = 4; + return values; + })(); + + Table.AutomatedBackupPolicy = (function() { + + /** + * Properties of an AutomatedBackupPolicy. + * @memberof google.bigtable.admin.v2.Table + * @interface IAutomatedBackupPolicy + * @property {google.protobuf.IDuration|null} [retentionPeriod] AutomatedBackupPolicy retentionPeriod + * @property {google.protobuf.IDuration|null} [frequency] AutomatedBackupPolicy frequency + */ + + /** + * Constructs a new AutomatedBackupPolicy. + * @memberof google.bigtable.admin.v2.Table + * @classdesc Represents an AutomatedBackupPolicy. + * @implements IAutomatedBackupPolicy + * @constructor + * @param {google.bigtable.admin.v2.Table.IAutomatedBackupPolicy=} [properties] Properties to set + */ + function AutomatedBackupPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutomatedBackupPolicy retentionPeriod. + * @member {google.protobuf.IDuration|null|undefined} retentionPeriod + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.retentionPeriod = null; + + /** + * AutomatedBackupPolicy frequency. + * @member {google.protobuf.IDuration|null|undefined} frequency + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.frequency = null; + + /** + * Creates a new AutomatedBackupPolicy instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {google.bigtable.admin.v2.Table.IAutomatedBackupPolicy=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Table.AutomatedBackupPolicy} AutomatedBackupPolicy instance + */ + AutomatedBackupPolicy.create = function create(properties) { + return new AutomatedBackupPolicy(properties); + }; + + /** + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.bigtable.admin.v2.Table.AutomatedBackupPolicy.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {google.bigtable.admin.v2.Table.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) + $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.frequency != null && Object.hasOwnProperty.call(message, "frequency")) + $root.google.protobuf.Duration.encode(message.frequency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Table.AutomatedBackupPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {google.bigtable.admin.v2.Table.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Table.AutomatedBackupPolicy} AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedBackupPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.frequency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Table.AutomatedBackupPolicy} AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutomatedBackupPolicy message. + * @function verify + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomatedBackupPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); + if (error) + return "retentionPeriod." + error; + } + if (message.frequency != null && message.hasOwnProperty("frequency")) { + var error = $root.google.protobuf.Duration.verify(message.frequency); + if (error) + return "frequency." + error; + } + return null; + }; + + /** + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Table.AutomatedBackupPolicy} AutomatedBackupPolicy + */ + AutomatedBackupPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) + return object; + var message = new $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy(); + if (object.retentionPeriod != null) { + if (typeof object.retentionPeriod !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.AutomatedBackupPolicy.retentionPeriod: object expected"); + message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); + } + if (object.frequency != null) { + if (typeof object.frequency !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.AutomatedBackupPolicy.frequency: object expected"); + message.frequency = $root.google.protobuf.Duration.fromObject(object.frequency); + } + return message; + }; + + /** + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {google.bigtable.admin.v2.Table.AutomatedBackupPolicy} message AutomatedBackupPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomatedBackupPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.retentionPeriod = null; + object.frequency = null; + } + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) + object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); + if (message.frequency != null && message.hasOwnProperty("frequency")) + object.frequency = $root.google.protobuf.Duration.toObject(message.frequency, options); + return object; + }; + + /** + * Converts this AutomatedBackupPolicy to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @instance + * @returns {Object.} JSON object + */ + AutomatedBackupPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutomatedBackupPolicy + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Table.AutomatedBackupPolicy"; + }; + + return AutomatedBackupPolicy; + })(); + + return Table; + })(); + + v2.AuthorizedView = (function() { + + /** + * Properties of an AuthorizedView. + * @memberof google.bigtable.admin.v2 + * @interface IAuthorizedView + * @property {string|null} [name] AuthorizedView name + * @property {google.bigtable.admin.v2.AuthorizedView.ISubsetView|null} [subsetView] AuthorizedView subsetView + * @property {string|null} [etag] AuthorizedView etag + * @property {boolean|null} [deletionProtection] AuthorizedView deletionProtection + */ + + /** + * Constructs a new AuthorizedView. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an AuthorizedView. + * @implements IAuthorizedView + * @constructor + * @param {google.bigtable.admin.v2.IAuthorizedView=} [properties] Properties to set + */ + function AuthorizedView(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthorizedView name. + * @member {string} name + * @memberof google.bigtable.admin.v2.AuthorizedView + * @instance + */ + AuthorizedView.prototype.name = ""; + + /** + * AuthorizedView subsetView. + * @member {google.bigtable.admin.v2.AuthorizedView.ISubsetView|null|undefined} subsetView + * @memberof google.bigtable.admin.v2.AuthorizedView + * @instance + */ + AuthorizedView.prototype.subsetView = null; + + /** + * AuthorizedView etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.AuthorizedView + * @instance + */ + AuthorizedView.prototype.etag = ""; + + /** + * AuthorizedView deletionProtection. + * @member {boolean} deletionProtection + * @memberof google.bigtable.admin.v2.AuthorizedView + * @instance + */ + AuthorizedView.prototype.deletionProtection = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AuthorizedView authorizedView. + * @member {"subsetView"|undefined} authorizedView + * @memberof google.bigtable.admin.v2.AuthorizedView + * @instance + */ + Object.defineProperty(AuthorizedView.prototype, "authorizedView", { + get: $util.oneOfGetter($oneOfFields = ["subsetView"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AuthorizedView instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {google.bigtable.admin.v2.IAuthorizedView=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AuthorizedView} AuthorizedView instance + */ + AuthorizedView.create = function create(properties) { + return new AuthorizedView(properties); + }; + + /** + * Encodes the specified AuthorizedView message. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {google.bigtable.admin.v2.IAuthorizedView} message AuthorizedView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedView.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.subsetView != null && Object.hasOwnProperty.call(message, "subsetView")) + $root.google.bigtable.admin.v2.AuthorizedView.SubsetView.encode(message.subsetView, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.deletionProtection); + return writer; + }; + + /** + * Encodes the specified AuthorizedView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {google.bigtable.admin.v2.IAuthorizedView} message AuthorizedView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizedView message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AuthorizedView} AuthorizedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedView.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AuthorizedView(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.subsetView = $root.google.bigtable.admin.v2.AuthorizedView.SubsetView.decode(reader, reader.uint32()); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.deletionProtection = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizedView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AuthorizedView} AuthorizedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizedView message. + * @function verify + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizedView.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.subsetView != null && message.hasOwnProperty("subsetView")) { + properties.authorizedView = 1; + { + var error = $root.google.bigtable.admin.v2.AuthorizedView.SubsetView.verify(message.subsetView); + if (error) + return "subsetView." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + return null; + }; + + /** + * Creates an AuthorizedView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AuthorizedView} AuthorizedView + */ + AuthorizedView.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AuthorizedView) + return object; + var message = new $root.google.bigtable.admin.v2.AuthorizedView(); + if (object.name != null) + message.name = String(object.name); + if (object.subsetView != null) { + if (typeof object.subsetView !== "object") + throw TypeError(".google.bigtable.admin.v2.AuthorizedView.subsetView: object expected"); + message.subsetView = $root.google.bigtable.admin.v2.AuthorizedView.SubsetView.fromObject(object.subsetView); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + return message; + }; + + /** + * Creates a plain object from an AuthorizedView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {google.bigtable.admin.v2.AuthorizedView} message AuthorizedView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizedView.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + object.deletionProtection = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.subsetView != null && message.hasOwnProperty("subsetView")) { + object.subsetView = $root.google.bigtable.admin.v2.AuthorizedView.SubsetView.toObject(message.subsetView, options); + if (options.oneofs) + object.authorizedView = "subsetView"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + object.deletionProtection = message.deletionProtection; + return object; + }; + + /** + * Converts this AuthorizedView to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AuthorizedView + * @instance + * @returns {Object.} JSON object + */ + AuthorizedView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizedView + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizedView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AuthorizedView"; + }; + + AuthorizedView.FamilySubsets = (function() { + + /** + * Properties of a FamilySubsets. + * @memberof google.bigtable.admin.v2.AuthorizedView + * @interface IFamilySubsets + * @property {Array.|null} [qualifiers] FamilySubsets qualifiers + * @property {Array.|null} [qualifierPrefixes] FamilySubsets qualifierPrefixes + */ + + /** + * Constructs a new FamilySubsets. + * @memberof google.bigtable.admin.v2.AuthorizedView + * @classdesc Represents a FamilySubsets. + * @implements IFamilySubsets + * @constructor + * @param {google.bigtable.admin.v2.AuthorizedView.IFamilySubsets=} [properties] Properties to set + */ + function FamilySubsets(properties) { + this.qualifiers = []; + this.qualifierPrefixes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FamilySubsets qualifiers. + * @member {Array.} qualifiers + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @instance + */ + FamilySubsets.prototype.qualifiers = $util.emptyArray; + + /** + * FamilySubsets qualifierPrefixes. + * @member {Array.} qualifierPrefixes + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @instance + */ + FamilySubsets.prototype.qualifierPrefixes = $util.emptyArray; + + /** + * Creates a new FamilySubsets instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.IFamilySubsets=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AuthorizedView.FamilySubsets} FamilySubsets instance + */ + FamilySubsets.create = function create(properties) { + return new FamilySubsets(properties); + }; + + /** + * Encodes the specified FamilySubsets message. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.FamilySubsets.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.IFamilySubsets} message FamilySubsets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FamilySubsets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.qualifiers != null && message.qualifiers.length) + for (var i = 0; i < message.qualifiers.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.qualifiers[i]); + if (message.qualifierPrefixes != null && message.qualifierPrefixes.length) + for (var i = 0; i < message.qualifierPrefixes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.qualifierPrefixes[i]); + return writer; + }; + + /** + * Encodes the specified FamilySubsets message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.FamilySubsets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.IFamilySubsets} message FamilySubsets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FamilySubsets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FamilySubsets message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AuthorizedView.FamilySubsets} FamilySubsets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FamilySubsets.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.qualifiers && message.qualifiers.length)) + message.qualifiers = []; + message.qualifiers.push(reader.bytes()); + break; + } + case 2: { + if (!(message.qualifierPrefixes && message.qualifierPrefixes.length)) + message.qualifierPrefixes = []; + message.qualifierPrefixes.push(reader.bytes()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FamilySubsets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AuthorizedView.FamilySubsets} FamilySubsets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FamilySubsets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FamilySubsets message. + * @function verify + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FamilySubsets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.qualifiers != null && message.hasOwnProperty("qualifiers")) { + if (!Array.isArray(message.qualifiers)) + return "qualifiers: array expected"; + for (var i = 0; i < message.qualifiers.length; ++i) + if (!(message.qualifiers[i] && typeof message.qualifiers[i].length === "number" || $util.isString(message.qualifiers[i]))) + return "qualifiers: buffer[] expected"; + } + if (message.qualifierPrefixes != null && message.hasOwnProperty("qualifierPrefixes")) { + if (!Array.isArray(message.qualifierPrefixes)) + return "qualifierPrefixes: array expected"; + for (var i = 0; i < message.qualifierPrefixes.length; ++i) + if (!(message.qualifierPrefixes[i] && typeof message.qualifierPrefixes[i].length === "number" || $util.isString(message.qualifierPrefixes[i]))) + return "qualifierPrefixes: buffer[] expected"; + } + return null; + }; + + /** + * Creates a FamilySubsets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AuthorizedView.FamilySubsets} FamilySubsets + */ + FamilySubsets.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets) + return object; + var message = new $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets(); + if (object.qualifiers) { + if (!Array.isArray(object.qualifiers)) + throw TypeError(".google.bigtable.admin.v2.AuthorizedView.FamilySubsets.qualifiers: array expected"); + message.qualifiers = []; + for (var i = 0; i < object.qualifiers.length; ++i) + if (typeof object.qualifiers[i] === "string") + $util.base64.decode(object.qualifiers[i], message.qualifiers[i] = $util.newBuffer($util.base64.length(object.qualifiers[i])), 0); + else if (object.qualifiers[i].length >= 0) + message.qualifiers[i] = object.qualifiers[i]; + } + if (object.qualifierPrefixes) { + if (!Array.isArray(object.qualifierPrefixes)) + throw TypeError(".google.bigtable.admin.v2.AuthorizedView.FamilySubsets.qualifierPrefixes: array expected"); + message.qualifierPrefixes = []; + for (var i = 0; i < object.qualifierPrefixes.length; ++i) + if (typeof object.qualifierPrefixes[i] === "string") + $util.base64.decode(object.qualifierPrefixes[i], message.qualifierPrefixes[i] = $util.newBuffer($util.base64.length(object.qualifierPrefixes[i])), 0); + else if (object.qualifierPrefixes[i].length >= 0) + message.qualifierPrefixes[i] = object.qualifierPrefixes[i]; + } + return message; + }; + + /** + * Creates a plain object from a FamilySubsets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.FamilySubsets} message FamilySubsets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FamilySubsets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.qualifiers = []; + object.qualifierPrefixes = []; + } + if (message.qualifiers && message.qualifiers.length) { + object.qualifiers = []; + for (var j = 0; j < message.qualifiers.length; ++j) + object.qualifiers[j] = options.bytes === String ? $util.base64.encode(message.qualifiers[j], 0, message.qualifiers[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.qualifiers[j]) : message.qualifiers[j]; + } + if (message.qualifierPrefixes && message.qualifierPrefixes.length) { + object.qualifierPrefixes = []; + for (var j = 0; j < message.qualifierPrefixes.length; ++j) + object.qualifierPrefixes[j] = options.bytes === String ? $util.base64.encode(message.qualifierPrefixes[j], 0, message.qualifierPrefixes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.qualifierPrefixes[j]) : message.qualifierPrefixes[j]; + } + return object; + }; + + /** + * Converts this FamilySubsets to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @instance + * @returns {Object.} JSON object + */ + FamilySubsets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FamilySubsets + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FamilySubsets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AuthorizedView.FamilySubsets"; + }; + + return FamilySubsets; + })(); + + AuthorizedView.SubsetView = (function() { + + /** + * Properties of a SubsetView. + * @memberof google.bigtable.admin.v2.AuthorizedView + * @interface ISubsetView + * @property {Array.|null} [rowPrefixes] SubsetView rowPrefixes + * @property {Object.|null} [familySubsets] SubsetView familySubsets + */ + + /** + * Constructs a new SubsetView. + * @memberof google.bigtable.admin.v2.AuthorizedView + * @classdesc Represents a SubsetView. + * @implements ISubsetView + * @constructor + * @param {google.bigtable.admin.v2.AuthorizedView.ISubsetView=} [properties] Properties to set + */ + function SubsetView(properties) { + this.rowPrefixes = []; + this.familySubsets = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubsetView rowPrefixes. + * @member {Array.} rowPrefixes + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @instance + */ + SubsetView.prototype.rowPrefixes = $util.emptyArray; + + /** + * SubsetView familySubsets. + * @member {Object.} familySubsets + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @instance + */ + SubsetView.prototype.familySubsets = $util.emptyObject; + + /** + * Creates a new SubsetView instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.ISubsetView=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AuthorizedView.SubsetView} SubsetView instance + */ + SubsetView.create = function create(properties) { + return new SubsetView(properties); + }; + + /** + * Encodes the specified SubsetView message. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.SubsetView.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.ISubsetView} message SubsetView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubsetView.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowPrefixes != null && message.rowPrefixes.length) + for (var i = 0; i < message.rowPrefixes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rowPrefixes[i]); + if (message.familySubsets != null && Object.hasOwnProperty.call(message, "familySubsets")) + for (var keys = Object.keys(message.familySubsets), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.encode(message.familySubsets[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SubsetView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.SubsetView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.ISubsetView} message SubsetView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubsetView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubsetView message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AuthorizedView.SubsetView} SubsetView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubsetView.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AuthorizedView.SubsetView(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rowPrefixes && message.rowPrefixes.length)) + message.rowPrefixes = []; + message.rowPrefixes.push(reader.bytes()); + break; + } + case 2: { + if (message.familySubsets === $util.emptyObject) + message.familySubsets = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.familySubsets[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubsetView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AuthorizedView.SubsetView} SubsetView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubsetView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubsetView message. + * @function verify + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubsetView.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowPrefixes != null && message.hasOwnProperty("rowPrefixes")) { + if (!Array.isArray(message.rowPrefixes)) + return "rowPrefixes: array expected"; + for (var i = 0; i < message.rowPrefixes.length; ++i) + if (!(message.rowPrefixes[i] && typeof message.rowPrefixes[i].length === "number" || $util.isString(message.rowPrefixes[i]))) + return "rowPrefixes: buffer[] expected"; + } + if (message.familySubsets != null && message.hasOwnProperty("familySubsets")) { + if (!$util.isObject(message.familySubsets)) + return "familySubsets: object expected"; + var key = Object.keys(message.familySubsets); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.verify(message.familySubsets[key[i]]); + if (error) + return "familySubsets." + error; + } + } + return null; + }; + + /** + * Creates a SubsetView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AuthorizedView.SubsetView} SubsetView + */ + SubsetView.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AuthorizedView.SubsetView) + return object; + var message = new $root.google.bigtable.admin.v2.AuthorizedView.SubsetView(); + if (object.rowPrefixes) { + if (!Array.isArray(object.rowPrefixes)) + throw TypeError(".google.bigtable.admin.v2.AuthorizedView.SubsetView.rowPrefixes: array expected"); + message.rowPrefixes = []; + for (var i = 0; i < object.rowPrefixes.length; ++i) + if (typeof object.rowPrefixes[i] === "string") + $util.base64.decode(object.rowPrefixes[i], message.rowPrefixes[i] = $util.newBuffer($util.base64.length(object.rowPrefixes[i])), 0); + else if (object.rowPrefixes[i].length >= 0) + message.rowPrefixes[i] = object.rowPrefixes[i]; + } + if (object.familySubsets) { + if (typeof object.familySubsets !== "object") + throw TypeError(".google.bigtable.admin.v2.AuthorizedView.SubsetView.familySubsets: object expected"); + message.familySubsets = {}; + for (var keys = Object.keys(object.familySubsets), i = 0; i < keys.length; ++i) { + if (typeof object.familySubsets[keys[i]] !== "object") + throw TypeError(".google.bigtable.admin.v2.AuthorizedView.SubsetView.familySubsets: object expected"); + message.familySubsets[keys[i]] = $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.fromObject(object.familySubsets[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a SubsetView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.SubsetView} message SubsetView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubsetView.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rowPrefixes = []; + if (options.objects || options.defaults) + object.familySubsets = {}; + if (message.rowPrefixes && message.rowPrefixes.length) { + object.rowPrefixes = []; + for (var j = 0; j < message.rowPrefixes.length; ++j) + object.rowPrefixes[j] = options.bytes === String ? $util.base64.encode(message.rowPrefixes[j], 0, message.rowPrefixes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.rowPrefixes[j]) : message.rowPrefixes[j]; + } + var keys2; + if (message.familySubsets && (keys2 = Object.keys(message.familySubsets)).length) { + object.familySubsets = {}; + for (var j = 0; j < keys2.length; ++j) + object.familySubsets[keys2[j]] = $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.toObject(message.familySubsets[keys2[j]], options); + } + return object; + }; + + /** + * Converts this SubsetView to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @instance + * @returns {Object.} JSON object + */ + SubsetView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubsetView + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubsetView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AuthorizedView.SubsetView"; + }; + + return SubsetView; + })(); + + /** + * ResponseView enum. + * @name google.bigtable.admin.v2.AuthorizedView.ResponseView + * @enum {number} + * @property {number} RESPONSE_VIEW_UNSPECIFIED=0 RESPONSE_VIEW_UNSPECIFIED value + * @property {number} NAME_ONLY=1 NAME_ONLY value + * @property {number} BASIC=2 BASIC value + * @property {number} FULL=3 FULL value + */ + AuthorizedView.ResponseView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESPONSE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "NAME_ONLY"] = 1; + values[valuesById[2] = "BASIC"] = 2; + values[valuesById[3] = "FULL"] = 3; + return values; + })(); + + return AuthorizedView; + })(); + + v2.ColumnFamily = (function() { + + /** + * Properties of a ColumnFamily. + * @memberof google.bigtable.admin.v2 + * @interface IColumnFamily + * @property {google.bigtable.admin.v2.IGcRule|null} [gcRule] ColumnFamily gcRule + * @property {google.bigtable.admin.v2.IType|null} [valueType] ColumnFamily valueType + */ + + /** + * Constructs a new ColumnFamily. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ColumnFamily. + * @implements IColumnFamily + * @constructor + * @param {google.bigtable.admin.v2.IColumnFamily=} [properties] Properties to set + */ + function ColumnFamily(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnFamily gcRule. + * @member {google.bigtable.admin.v2.IGcRule|null|undefined} gcRule + * @memberof google.bigtable.admin.v2.ColumnFamily + * @instance + */ + ColumnFamily.prototype.gcRule = null; + + /** + * ColumnFamily valueType. + * @member {google.bigtable.admin.v2.IType|null|undefined} valueType + * @memberof google.bigtable.admin.v2.ColumnFamily + * @instance + */ + ColumnFamily.prototype.valueType = null; + + /** + * Creates a new ColumnFamily instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {google.bigtable.admin.v2.IColumnFamily=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ColumnFamily} ColumnFamily instance + */ + ColumnFamily.create = function create(properties) { + return new ColumnFamily(properties); + }; + + /** + * Encodes the specified ColumnFamily message. Does not implicitly {@link google.bigtable.admin.v2.ColumnFamily.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {google.bigtable.admin.v2.IColumnFamily} message ColumnFamily message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnFamily.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcRule != null && Object.hasOwnProperty.call(message, "gcRule")) + $root.google.bigtable.admin.v2.GcRule.encode(message.gcRule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + $root.google.bigtable.admin.v2.Type.encode(message.valueType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ColumnFamily message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ColumnFamily.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {google.bigtable.admin.v2.IColumnFamily} message ColumnFamily message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnFamily.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnFamily message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ColumnFamily} ColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnFamily.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ColumnFamily(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcRule = $root.google.bigtable.admin.v2.GcRule.decode(reader, reader.uint32()); + break; + } + case 3: { + message.valueType = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnFamily message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ColumnFamily} ColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnFamily.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnFamily message. + * @function verify + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnFamily.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcRule != null && message.hasOwnProperty("gcRule")) { + var error = $root.google.bigtable.admin.v2.GcRule.verify(message.gcRule); + if (error) + return "gcRule." + error; + } + if (message.valueType != null && message.hasOwnProperty("valueType")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.valueType); + if (error) + return "valueType." + error; + } + return null; + }; + + /** + * Creates a ColumnFamily message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ColumnFamily} ColumnFamily + */ + ColumnFamily.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ColumnFamily) + return object; + var message = new $root.google.bigtable.admin.v2.ColumnFamily(); + if (object.gcRule != null) { + if (typeof object.gcRule !== "object") + throw TypeError(".google.bigtable.admin.v2.ColumnFamily.gcRule: object expected"); + message.gcRule = $root.google.bigtable.admin.v2.GcRule.fromObject(object.gcRule); + } + if (object.valueType != null) { + if (typeof object.valueType !== "object") + throw TypeError(".google.bigtable.admin.v2.ColumnFamily.valueType: object expected"); + message.valueType = $root.google.bigtable.admin.v2.Type.fromObject(object.valueType); + } + return message; + }; + + /** + * Creates a plain object from a ColumnFamily message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {google.bigtable.admin.v2.ColumnFamily} message ColumnFamily + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnFamily.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcRule = null; + object.valueType = null; + } + if (message.gcRule != null && message.hasOwnProperty("gcRule")) + object.gcRule = $root.google.bigtable.admin.v2.GcRule.toObject(message.gcRule, options); + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = $root.google.bigtable.admin.v2.Type.toObject(message.valueType, options); + return object; + }; + + /** + * Converts this ColumnFamily to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ColumnFamily + * @instance + * @returns {Object.} JSON object + */ + ColumnFamily.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnFamily + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnFamily.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ColumnFamily"; + }; + + return ColumnFamily; + })(); + + v2.GcRule = (function() { + + /** + * Properties of a GcRule. + * @memberof google.bigtable.admin.v2 + * @interface IGcRule + * @property {number|null} [maxNumVersions] GcRule maxNumVersions + * @property {google.protobuf.IDuration|null} [maxAge] GcRule maxAge + * @property {google.bigtable.admin.v2.GcRule.IIntersection|null} [intersection] GcRule intersection + * @property {google.bigtable.admin.v2.GcRule.IUnion|null} [union] GcRule union + */ + + /** + * Constructs a new GcRule. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GcRule. + * @implements IGcRule + * @constructor + * @param {google.bigtable.admin.v2.IGcRule=} [properties] Properties to set + */ + function GcRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcRule maxNumVersions. + * @member {number|null|undefined} maxNumVersions + * @memberof google.bigtable.admin.v2.GcRule + * @instance + */ + GcRule.prototype.maxNumVersions = null; + + /** + * GcRule maxAge. + * @member {google.protobuf.IDuration|null|undefined} maxAge + * @memberof google.bigtable.admin.v2.GcRule + * @instance + */ + GcRule.prototype.maxAge = null; + + /** + * GcRule intersection. + * @member {google.bigtable.admin.v2.GcRule.IIntersection|null|undefined} intersection + * @memberof google.bigtable.admin.v2.GcRule + * @instance + */ + GcRule.prototype.intersection = null; + + /** + * GcRule union. + * @member {google.bigtable.admin.v2.GcRule.IUnion|null|undefined} union + * @memberof google.bigtable.admin.v2.GcRule + * @instance + */ + GcRule.prototype.union = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GcRule rule. + * @member {"maxNumVersions"|"maxAge"|"intersection"|"union"|undefined} rule + * @memberof google.bigtable.admin.v2.GcRule + * @instance + */ + Object.defineProperty(GcRule.prototype, "rule", { + get: $util.oneOfGetter($oneOfFields = ["maxNumVersions", "maxAge", "intersection", "union"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GcRule instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {google.bigtable.admin.v2.IGcRule=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GcRule} GcRule instance + */ + GcRule.create = function create(properties) { + return new GcRule(properties); + }; + + /** + * Encodes the specified GcRule message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {google.bigtable.admin.v2.IGcRule} message GcRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxNumVersions != null && Object.hasOwnProperty.call(message, "maxNumVersions")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxNumVersions); + if (message.maxAge != null && Object.hasOwnProperty.call(message, "maxAge")) + $root.google.protobuf.Duration.encode(message.maxAge, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.intersection != null && Object.hasOwnProperty.call(message, "intersection")) + $root.google.bigtable.admin.v2.GcRule.Intersection.encode(message.intersection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.union != null && Object.hasOwnProperty.call(message, "union")) + $root.google.bigtable.admin.v2.GcRule.Union.encode(message.union, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GcRule message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {google.bigtable.admin.v2.IGcRule} message GcRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcRule message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GcRule} GcRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GcRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.maxNumVersions = reader.int32(); + break; + } + case 2: { + message.maxAge = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.intersection = $root.google.bigtable.admin.v2.GcRule.Intersection.decode(reader, reader.uint32()); + break; + } + case 4: { + message.union = $root.google.bigtable.admin.v2.GcRule.Union.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GcRule} GcRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcRule message. + * @function verify + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.maxNumVersions != null && message.hasOwnProperty("maxNumVersions")) { + properties.rule = 1; + if (!$util.isInteger(message.maxNumVersions)) + return "maxNumVersions: integer expected"; + } + if (message.maxAge != null && message.hasOwnProperty("maxAge")) { + if (properties.rule === 1) + return "rule: multiple values"; + properties.rule = 1; + { + var error = $root.google.protobuf.Duration.verify(message.maxAge); + if (error) + return "maxAge." + error; + } + } + if (message.intersection != null && message.hasOwnProperty("intersection")) { + if (properties.rule === 1) + return "rule: multiple values"; + properties.rule = 1; + { + var error = $root.google.bigtable.admin.v2.GcRule.Intersection.verify(message.intersection); + if (error) + return "intersection." + error; + } + } + if (message.union != null && message.hasOwnProperty("union")) { + if (properties.rule === 1) + return "rule: multiple values"; + properties.rule = 1; + { + var error = $root.google.bigtable.admin.v2.GcRule.Union.verify(message.union); + if (error) + return "union." + error; + } + } + return null; + }; + + /** + * Creates a GcRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GcRule} GcRule + */ + GcRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GcRule) + return object; + var message = new $root.google.bigtable.admin.v2.GcRule(); + if (object.maxNumVersions != null) + message.maxNumVersions = object.maxNumVersions | 0; + if (object.maxAge != null) { + if (typeof object.maxAge !== "object") + throw TypeError(".google.bigtable.admin.v2.GcRule.maxAge: object expected"); + message.maxAge = $root.google.protobuf.Duration.fromObject(object.maxAge); + } + if (object.intersection != null) { + if (typeof object.intersection !== "object") + throw TypeError(".google.bigtable.admin.v2.GcRule.intersection: object expected"); + message.intersection = $root.google.bigtable.admin.v2.GcRule.Intersection.fromObject(object.intersection); + } + if (object.union != null) { + if (typeof object.union !== "object") + throw TypeError(".google.bigtable.admin.v2.GcRule.union: object expected"); + message.union = $root.google.bigtable.admin.v2.GcRule.Union.fromObject(object.union); + } + return message; + }; + + /** + * Creates a plain object from a GcRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {google.bigtable.admin.v2.GcRule} message GcRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.maxNumVersions != null && message.hasOwnProperty("maxNumVersions")) { + object.maxNumVersions = message.maxNumVersions; + if (options.oneofs) + object.rule = "maxNumVersions"; + } + if (message.maxAge != null && message.hasOwnProperty("maxAge")) { + object.maxAge = $root.google.protobuf.Duration.toObject(message.maxAge, options); + if (options.oneofs) + object.rule = "maxAge"; + } + if (message.intersection != null && message.hasOwnProperty("intersection")) { + object.intersection = $root.google.bigtable.admin.v2.GcRule.Intersection.toObject(message.intersection, options); + if (options.oneofs) + object.rule = "intersection"; + } + if (message.union != null && message.hasOwnProperty("union")) { + object.union = $root.google.bigtable.admin.v2.GcRule.Union.toObject(message.union, options); + if (options.oneofs) + object.rule = "union"; + } + return object; + }; + + /** + * Converts this GcRule to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GcRule + * @instance + * @returns {Object.} JSON object + */ + GcRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcRule + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GcRule"; + }; + + GcRule.Intersection = (function() { + + /** + * Properties of an Intersection. + * @memberof google.bigtable.admin.v2.GcRule + * @interface IIntersection + * @property {Array.|null} [rules] Intersection rules + */ + + /** + * Constructs a new Intersection. + * @memberof google.bigtable.admin.v2.GcRule + * @classdesc Represents an Intersection. + * @implements IIntersection + * @constructor + * @param {google.bigtable.admin.v2.GcRule.IIntersection=} [properties] Properties to set + */ + function Intersection(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]]; + } + + /** + * Intersection rules. + * @member {Array.} rules + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @instance + */ + Intersection.prototype.rules = $util.emptyArray; + + /** + * Creates a new Intersection instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {google.bigtable.admin.v2.GcRule.IIntersection=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GcRule.Intersection} Intersection instance + */ + Intersection.create = function create(properties) { + return new Intersection(properties); + }; + + /** + * Encodes the specified Intersection message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Intersection.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {google.bigtable.admin.v2.GcRule.IIntersection} message Intersection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intersection.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.bigtable.admin.v2.GcRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Intersection message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Intersection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {google.bigtable.admin.v2.GcRule.IIntersection} message Intersection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intersection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Intersection message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GcRule.Intersection} Intersection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intersection.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GcRule.Intersection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.bigtable.admin.v2.GcRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Intersection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GcRule.Intersection} Intersection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intersection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Intersection message. + * @function verify + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Intersection.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.bigtable.admin.v2.GcRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates an Intersection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GcRule.Intersection} Intersection + */ + Intersection.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GcRule.Intersection) + return object; + var message = new $root.google.bigtable.admin.v2.GcRule.Intersection(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.bigtable.admin.v2.GcRule.Intersection.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.GcRule.Intersection.rules: object expected"); + message.rules[i] = $root.google.bigtable.admin.v2.GcRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Intersection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {google.bigtable.admin.v2.GcRule.Intersection} message Intersection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Intersection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.bigtable.admin.v2.GcRule.toObject(message.rules[j], options); + } + return object; + }; + + /** + * Converts this Intersection to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @instance + * @returns {Object.} JSON object + */ + Intersection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Intersection + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Intersection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GcRule.Intersection"; + }; + + return Intersection; + })(); + + GcRule.Union = (function() { + + /** + * Properties of an Union. + * @memberof google.bigtable.admin.v2.GcRule + * @interface IUnion + * @property {Array.|null} [rules] Union rules + */ + + /** + * Constructs a new Union. + * @memberof google.bigtable.admin.v2.GcRule + * @classdesc Represents an Union. + * @implements IUnion + * @constructor + * @param {google.bigtable.admin.v2.GcRule.IUnion=} [properties] Properties to set + */ + function Union(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]]; + } + + /** + * Union rules. + * @member {Array.} rules + * @memberof google.bigtable.admin.v2.GcRule.Union + * @instance + */ + Union.prototype.rules = $util.emptyArray; + + /** + * Creates a new Union instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {google.bigtable.admin.v2.GcRule.IUnion=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GcRule.Union} Union instance + */ + Union.create = function create(properties) { + return new Union(properties); + }; + + /** + * Encodes the specified Union message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Union.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {google.bigtable.admin.v2.GcRule.IUnion} message Union message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Union.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.bigtable.admin.v2.GcRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Union message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Union.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {google.bigtable.admin.v2.GcRule.IUnion} message Union message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Union.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Union message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GcRule.Union} Union + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Union.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GcRule.Union(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.bigtable.admin.v2.GcRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Union message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GcRule.Union} Union + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Union.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Union message. + * @function verify + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Union.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.bigtable.admin.v2.GcRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates an Union message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GcRule.Union} Union + */ + Union.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GcRule.Union) + return object; + var message = new $root.google.bigtable.admin.v2.GcRule.Union(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.bigtable.admin.v2.GcRule.Union.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.GcRule.Union.rules: object expected"); + message.rules[i] = $root.google.bigtable.admin.v2.GcRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Union message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {google.bigtable.admin.v2.GcRule.Union} message Union + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Union.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.bigtable.admin.v2.GcRule.toObject(message.rules[j], options); + } + return object; + }; + + /** + * Converts this Union to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GcRule.Union + * @instance + * @returns {Object.} JSON object + */ + Union.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Union + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Union.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GcRule.Union"; + }; + + return Union; + })(); + + return GcRule; + })(); + + v2.EncryptionInfo = (function() { + + /** + * Properties of an EncryptionInfo. + * @memberof google.bigtable.admin.v2 + * @interface IEncryptionInfo + * @property {google.bigtable.admin.v2.EncryptionInfo.EncryptionType|null} [encryptionType] EncryptionInfo encryptionType + * @property {google.rpc.IStatus|null} [encryptionStatus] EncryptionInfo encryptionStatus + * @property {string|null} [kmsKeyVersion] EncryptionInfo kmsKeyVersion + */ + + /** + * Constructs a new EncryptionInfo. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an EncryptionInfo. + * @implements IEncryptionInfo + * @constructor + * @param {google.bigtable.admin.v2.IEncryptionInfo=} [properties] Properties to set + */ + function EncryptionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionInfo encryptionType. + * @member {google.bigtable.admin.v2.EncryptionInfo.EncryptionType} encryptionType + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionType = 0; + + /** + * EncryptionInfo encryptionStatus. + * @member {google.rpc.IStatus|null|undefined} encryptionStatus + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionStatus = null; + + /** + * EncryptionInfo kmsKeyVersion. + * @member {string} kmsKeyVersion + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.kmsKeyVersion = ""; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {google.bigtable.admin.v2.IEncryptionInfo=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.EncryptionInfo} EncryptionInfo instance + */ + EncryptionInfo.create = function create(properties) { + return new EncryptionInfo(properties); + }; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.bigtable.admin.v2.EncryptionInfo.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {google.bigtable.admin.v2.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersion); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encryptionType); + if (message.encryptionStatus != null && Object.hasOwnProperty.call(message, "encryptionStatus")) + $root.google.rpc.Status.encode(message.encryptionStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.EncryptionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {google.bigtable.admin.v2.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.EncryptionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.encryptionType = reader.int32(); + break; + } + case 4: { + message.encryptionStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.kmsKeyVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionInfo message. + * @function verify + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) { + var error = $root.google.rpc.Status.verify(message.encryptionStatus); + if (error) + return "encryptionStatus." + error; + } + if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) + if (!$util.isString(message.kmsKeyVersion)) + return "kmsKeyVersion: string expected"; + return null; + }; + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.EncryptionInfo} EncryptionInfo + */ + EncryptionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.EncryptionInfo) + return object; + var message = new $root.google.bigtable.admin.v2.EncryptionInfo(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "ENCRYPTION_TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + } + if (object.encryptionStatus != null) { + if (typeof object.encryptionStatus !== "object") + throw TypeError(".google.bigtable.admin.v2.EncryptionInfo.encryptionStatus: object expected"); + message.encryptionStatus = $root.google.rpc.Status.fromObject(object.encryptionStatus); + } + if (object.kmsKeyVersion != null) + message.kmsKeyVersion = String(object.kmsKeyVersion); + return message; + }; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {google.bigtable.admin.v2.EncryptionInfo} message EncryptionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kmsKeyVersion = ""; + object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; + object.encryptionStatus = null; + } + if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) + object.kmsKeyVersion = message.kmsKeyVersion; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.bigtable.admin.v2.EncryptionInfo.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.bigtable.admin.v2.EncryptionInfo.EncryptionType[message.encryptionType] : message.encryptionType; + if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) + object.encryptionStatus = $root.google.rpc.Status.toObject(message.encryptionStatus, options); + return object; + }; + + /** + * Converts this EncryptionInfo to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @instance + * @returns {Object.} JSON object + */ + EncryptionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionInfo + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.EncryptionInfo"; + }; + + /** + * EncryptionType enum. + * @name google.bigtable.admin.v2.EncryptionInfo.EncryptionType + * @enum {number} + * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value + */ + EncryptionInfo.EncryptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; + values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; + return values; + })(); + + return EncryptionInfo; + })(); + + v2.Snapshot = (function() { + + /** + * Properties of a Snapshot. + * @memberof google.bigtable.admin.v2 + * @interface ISnapshot + * @property {string|null} [name] Snapshot name + * @property {google.bigtable.admin.v2.ITable|null} [sourceTable] Snapshot sourceTable + * @property {number|Long|null} [dataSizeBytes] Snapshot dataSizeBytes + * @property {google.protobuf.ITimestamp|null} [createTime] Snapshot createTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Snapshot deleteTime + * @property {google.bigtable.admin.v2.Snapshot.State|null} [state] Snapshot state + * @property {string|null} [description] Snapshot description + */ + + /** + * Constructs a new Snapshot. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a Snapshot. + * @implements ISnapshot + * @constructor + * @param {google.bigtable.admin.v2.ISnapshot=} [properties] Properties to set + */ + function Snapshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Snapshot name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.name = ""; + + /** + * Snapshot sourceTable. + * @member {google.bigtable.admin.v2.ITable|null|undefined} sourceTable + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.sourceTable = null; + + /** + * Snapshot dataSizeBytes. + * @member {number|Long} dataSizeBytes + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.dataSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Snapshot createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.createTime = null; + + /** + * Snapshot deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.deleteTime = null; + + /** + * Snapshot state. + * @member {google.bigtable.admin.v2.Snapshot.State} state + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.state = 0; + + /** + * Snapshot description. + * @member {string} description + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.description = ""; + + /** + * Creates a new Snapshot instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {google.bigtable.admin.v2.ISnapshot=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Snapshot} Snapshot instance + */ + Snapshot.create = function create(properties) { + return new Snapshot(properties); + }; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.bigtable.admin.v2.Snapshot.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {google.bigtable.admin.v2.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + $root.google.bigtable.admin.v2.Table.encode(message.sourceTable, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dataSizeBytes != null && Object.hasOwnProperty.call(message, "dataSizeBytes")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.dataSizeBytes); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + return writer; + }; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Snapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {google.bigtable.admin.v2.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Snapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceTable = $root.google.bigtable.admin.v2.Table.decode(reader, reader.uint32()); + break; + } + case 3: { + message.dataSizeBytes = reader.int64(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Snapshot message. + * @function verify + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Snapshot.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.sourceTable != null && message.hasOwnProperty("sourceTable")) { + var error = $root.google.bigtable.admin.v2.Table.verify(message.sourceTable); + if (error) + return "sourceTable." + error; + } + if (message.dataSizeBytes != null && message.hasOwnProperty("dataSizeBytes")) + if (!$util.isInteger(message.dataSizeBytes) && !(message.dataSizeBytes && $util.isInteger(message.dataSizeBytes.low) && $util.isInteger(message.dataSizeBytes.high))) + return "dataSizeBytes: integer|Long expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Snapshot} Snapshot + */ + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Snapshot) + return object; + var message = new $root.google.bigtable.admin.v2.Snapshot(); + if (object.name != null) + message.name = String(object.name); + if (object.sourceTable != null) { + if (typeof object.sourceTable !== "object") + throw TypeError(".google.bigtable.admin.v2.Snapshot.sourceTable: object expected"); + message.sourceTable = $root.google.bigtable.admin.v2.Table.fromObject(object.sourceTable); + } + if (object.dataSizeBytes != null) + if ($util.Long) + (message.dataSizeBytes = $util.Long.fromValue(object.dataSizeBytes)).unsigned = false; + else if (typeof object.dataSizeBytes === "string") + message.dataSizeBytes = parseInt(object.dataSizeBytes, 10); + else if (typeof object.dataSizeBytes === "number") + message.dataSizeBytes = object.dataSizeBytes; + else if (typeof object.dataSizeBytes === "object") + message.dataSizeBytes = new $util.LongBits(object.dataSizeBytes.low >>> 0, object.dataSizeBytes.high >>> 0).toNumber(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Snapshot.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Snapshot.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_NOT_KNOWN": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {google.bigtable.admin.v2.Snapshot} message Snapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Snapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceTable = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.dataSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.dataSizeBytes = options.longs === String ? "0" : 0; + object.createTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_NOT_KNOWN" : 0; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) + object.sourceTable = $root.google.bigtable.admin.v2.Table.toObject(message.sourceTable, options); + if (message.dataSizeBytes != null && message.hasOwnProperty("dataSizeBytes")) + if (typeof message.dataSizeBytes === "number") + object.dataSizeBytes = options.longs === String ? String(message.dataSizeBytes) : message.dataSizeBytes; + else + object.dataSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.dataSizeBytes) : options.longs === Number ? new $util.LongBits(message.dataSizeBytes.low >>> 0, message.dataSizeBytes.high >>> 0).toNumber() : message.dataSizeBytes; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.bigtable.admin.v2.Snapshot.State[message.state] === undefined ? message.state : $root.google.bigtable.admin.v2.Snapshot.State[message.state] : message.state; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Snapshot to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + * @returns {Object.} JSON object + */ + Snapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Snapshot + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Snapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Snapshot"; + }; + + /** + * State enum. + * @name google.bigtable.admin.v2.Snapshot.State + * @enum {number} + * @property {number} STATE_NOT_KNOWN=0 STATE_NOT_KNOWN value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + */ + Snapshot.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_NOT_KNOWN"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + return values; + })(); + + return Snapshot; + })(); + + v2.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.bigtable.admin.v2 + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [sourceTable] Backup sourceTable + * @property {string|null} [sourceBackup] Backup sourceBackup + * @property {google.protobuf.ITimestamp|null} [expireTime] Backup expireTime + * @property {google.protobuf.ITimestamp|null} [startTime] Backup startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Backup endTime + * @property {number|Long|null} [sizeBytes] Backup sizeBytes + * @property {google.bigtable.admin.v2.Backup.State|null} [state] Backup state + * @property {google.bigtable.admin.v2.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo + * @property {google.bigtable.admin.v2.Backup.BackupType|null} [backupType] Backup backupType + * @property {google.protobuf.ITimestamp|null} [hotToStandardTime] Backup hotToStandardTime + */ + + /** + * Constructs a new Backup. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.bigtable.admin.v2.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup sourceTable. + * @member {string} sourceTable + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.sourceTable = ""; + + /** + * Backup sourceBackup. + * @member {string} sourceBackup + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.sourceBackup = ""; + + /** + * Backup expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.expireTime = null; + + /** + * Backup startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.startTime = null; + + /** + * Backup endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.endTime = null; + + /** + * Backup sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup state. + * @member {google.bigtable.admin.v2.Backup.State} state + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup encryptionInfo. + * @member {google.bigtable.admin.v2.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.encryptionInfo = null; + + /** + * Backup backupType. + * @member {google.bigtable.admin.v2.Backup.BackupType} backupType + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.backupType = 0; + + /** + * Backup hotToStandardTime. + * @member {google.protobuf.ITimestamp|null|undefined} hotToStandardTime + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.hotToStandardTime = null; + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {google.bigtable.admin.v2.IBackup=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.bigtable.admin.v2.Backup.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {google.bigtable.admin.v2.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceTable); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.sizeBytes); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.bigtable.admin.v2.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.sourceBackup); + if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.backupType); + if (message.hotToStandardTime != null && Object.hasOwnProperty.call(message, "hotToStandardTime")) + $root.google.protobuf.Timestamp.encode(message.hotToStandardTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {google.bigtable.admin.v2.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Backup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceTable = reader.string(); + break; + } + case 10: { + message.sourceBackup = reader.string(); + break; + } + case 3: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.sizeBytes = reader.int64(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 9: { + message.encryptionInfo = $root.google.bigtable.admin.v2.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 11: { + message.backupType = reader.int32(); + break; + } + case 12: { + message.hotToStandardTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.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.sourceTable != null && message.hasOwnProperty("sourceTable")) + if (!$util.isString(message.sourceTable)) + return "sourceTable: string expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: 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.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.bigtable.admin.v2.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.backupType != null && message.hasOwnProperty("backupType")) + switch (message.backupType) { + default: + return "backupType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.hotToStandardTime != null && message.hasOwnProperty("hotToStandardTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.hotToStandardTime); + if (error) + return "hotToStandardTime." + error; + } + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Backup) + return object; + var message = new $root.google.bigtable.admin.v2.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.sourceTable != null) + message.sourceTable = String(object.sourceTable); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Backup.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Backup.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Backup.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.bigtable.admin.v2.Backup.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.bigtable.admin.v2.EncryptionInfo.fromObject(object.encryptionInfo); + } + switch (object.backupType) { + default: + if (typeof object.backupType === "number") { + message.backupType = object.backupType; + break; + } + break; + case "BACKUP_TYPE_UNSPECIFIED": + case 0: + message.backupType = 0; + break; + case "STANDARD": + case 1: + message.backupType = 1; + break; + case "HOT": + case 2: + message.backupType = 2; + break; + } + if (object.hotToStandardTime != null) { + if (typeof object.hotToStandardTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Backup.hotToStandardTime: object expected"); + message.hotToStandardTime = $root.google.protobuf.Timestamp.fromObject(object.hotToStandardTime); + } + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {google.bigtable.admin.v2.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceTable = ""; + object.expireTime = null; + object.startTime = null; + object.endTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.encryptionInfo = null; + object.sourceBackup = ""; + object.backupType = options.enums === String ? "BACKUP_TYPE_UNSPECIFIED" : 0; + object.hotToStandardTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) + object.sourceTable = message.sourceTable; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.bigtable.admin.v2.Backup.State[message.state] === undefined ? message.state : $root.google.bigtable.admin.v2.Backup.State[message.state] : message.state; + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.bigtable.admin.v2.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + object.sourceBackup = message.sourceBackup; + if (message.backupType != null && message.hasOwnProperty("backupType")) + object.backupType = options.enums === String ? $root.google.bigtable.admin.v2.Backup.BackupType[message.backupType] === undefined ? message.backupType : $root.google.bigtable.admin.v2.Backup.BackupType[message.backupType] : message.backupType; + if (message.hotToStandardTime != null && message.hasOwnProperty("hotToStandardTime")) + object.hotToStandardTime = $root.google.protobuf.Timestamp.toObject(message.hotToStandardTime, options); + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Backup"; + }; + + /** + * State enum. + * @name google.bigtable.admin.v2.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + return values; + })(); + + /** + * BackupType enum. + * @name google.bigtable.admin.v2.Backup.BackupType + * @enum {number} + * @property {number} BACKUP_TYPE_UNSPECIFIED=0 BACKUP_TYPE_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} HOT=2 HOT value + */ + Backup.BackupType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "HOT"] = 2; + return values; + })(); + + return Backup; + })(); + + v2.BackupInfo = (function() { + + /** + * Properties of a BackupInfo. + * @memberof google.bigtable.admin.v2 + * @interface IBackupInfo + * @property {string|null} [backup] BackupInfo backup + * @property {google.protobuf.ITimestamp|null} [startTime] BackupInfo startTime + * @property {google.protobuf.ITimestamp|null} [endTime] BackupInfo endTime + * @property {string|null} [sourceTable] BackupInfo sourceTable + * @property {string|null} [sourceBackup] BackupInfo sourceBackup + */ + + /** + * Constructs a new BackupInfo. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a BackupInfo. + * @implements IBackupInfo + * @constructor + * @param {google.bigtable.admin.v2.IBackupInfo=} [properties] Properties to set + */ + function BackupInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupInfo backup. + * @member {string} backup + * @memberof google.bigtable.admin.v2.BackupInfo + * @instance + */ + BackupInfo.prototype.backup = ""; + + /** + * BackupInfo startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.BackupInfo + * @instance + */ + BackupInfo.prototype.startTime = null; + + /** + * BackupInfo endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.BackupInfo + * @instance + */ + BackupInfo.prototype.endTime = null; + + /** + * BackupInfo sourceTable. + * @member {string} sourceTable + * @memberof google.bigtable.admin.v2.BackupInfo + * @instance + */ + BackupInfo.prototype.sourceTable = ""; + + /** + * BackupInfo sourceBackup. + * @member {string} sourceBackup + * @memberof google.bigtable.admin.v2.BackupInfo + * @instance + */ + BackupInfo.prototype.sourceBackup = ""; + + /** + * Creates a new BackupInfo instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {google.bigtable.admin.v2.IBackupInfo=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.BackupInfo} BackupInfo instance + */ + BackupInfo.create = function create(properties) { + return new BackupInfo(properties); + }; + + /** + * Encodes the specified BackupInfo message. Does not implicitly {@link google.bigtable.admin.v2.BackupInfo.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {google.bigtable.admin.v2.IBackupInfo} message BackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backup); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceTable); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.sourceBackup); + return writer; + }; + + /** + * Encodes the specified BackupInfo message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.BackupInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {google.bigtable.admin.v2.IBackupInfo} message BackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupInfo message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.BackupInfo} BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.BackupInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backup = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.sourceTable = reader.string(); + break; + } + case 10: { + message.sourceBackup = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.BackupInfo} BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupInfo message. + * @function verify + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backup != null && message.hasOwnProperty("backup")) + if (!$util.isString(message.backup)) + return "backup: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) + if (!$util.isString(message.sourceTable)) + return "sourceTable: string expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + return null; + }; + + /** + * Creates a BackupInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.BackupInfo} BackupInfo + */ + BackupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.BackupInfo) + return object; + var message = new $root.google.bigtable.admin.v2.BackupInfo(); + if (object.backup != null) + message.backup = String(object.backup); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.BackupInfo.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.BackupInfo.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.sourceTable != null) + message.sourceTable = String(object.sourceTable); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + return message; + }; + + /** + * Creates a plain object from a BackupInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {google.bigtable.admin.v2.BackupInfo} message BackupInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backup = ""; + object.startTime = null; + object.endTime = null; + object.sourceTable = ""; + object.sourceBackup = ""; + } + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = message.backup; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) + object.sourceTable = message.sourceTable; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + object.sourceBackup = message.sourceBackup; + return object; + }; + + /** + * Converts this BackupInfo to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.BackupInfo + * @instance + * @returns {Object.} JSON object + */ + BackupInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupInfo + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.BackupInfo"; + }; + + return BackupInfo; + })(); + + /** + * RestoreSourceType enum. + * @name google.bigtable.admin.v2.RestoreSourceType + * @enum {number} + * @property {number} RESTORE_SOURCE_TYPE_UNSPECIFIED=0 RESTORE_SOURCE_TYPE_UNSPECIFIED value + * @property {number} BACKUP=1 BACKUP value + */ + v2.RestoreSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTORE_SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKUP"] = 1; + return values; + })(); + + v2.ProtoSchema = (function() { + + /** + * Properties of a ProtoSchema. + * @memberof google.bigtable.admin.v2 + * @interface IProtoSchema + * @property {Uint8Array|null} [protoDescriptors] ProtoSchema protoDescriptors + */ + + /** + * Constructs a new ProtoSchema. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ProtoSchema. + * @implements IProtoSchema + * @constructor + * @param {google.bigtable.admin.v2.IProtoSchema=} [properties] Properties to set + */ + function ProtoSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtoSchema protoDescriptors. + * @member {Uint8Array} protoDescriptors + * @memberof google.bigtable.admin.v2.ProtoSchema + * @instance + */ + ProtoSchema.prototype.protoDescriptors = $util.newBuffer([]); + + /** + * Creates a new ProtoSchema instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {google.bigtable.admin.v2.IProtoSchema=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ProtoSchema} ProtoSchema instance + */ + ProtoSchema.create = function create(properties) { + return new ProtoSchema(properties); + }; + + /** + * Encodes the specified ProtoSchema message. Does not implicitly {@link google.bigtable.admin.v2.ProtoSchema.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {google.bigtable.admin.v2.IProtoSchema} message ProtoSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.protoDescriptors); + return writer; + }; + + /** + * Encodes the specified ProtoSchema message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ProtoSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {google.bigtable.admin.v2.IProtoSchema} message ProtoSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ProtoSchema} ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoSchema.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ProtoSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.protoDescriptors = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ProtoSchema} ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoSchema message. + * @function verify + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) + return "protoDescriptors: buffer expected"; + return null; + }; + + /** + * Creates a ProtoSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ProtoSchema} ProtoSchema + */ + ProtoSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ProtoSchema) + return object; + var message = new $root.google.bigtable.admin.v2.ProtoSchema(); + if (object.protoDescriptors != null) + if (typeof object.protoDescriptors === "string") + $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); + else if (object.protoDescriptors.length >= 0) + message.protoDescriptors = object.protoDescriptors; + return message; + }; + + /** + * Creates a plain object from a ProtoSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {google.bigtable.admin.v2.ProtoSchema} message ProtoSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.protoDescriptors = ""; + else { + object.protoDescriptors = []; + if (options.bytes !== Array) + object.protoDescriptors = $util.newBuffer(object.protoDescriptors); + } + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; + return object; + }; + + /** + * Converts this ProtoSchema to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ProtoSchema + * @instance + * @returns {Object.} JSON object + */ + ProtoSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProtoSchema + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ProtoSchema"; + }; + + return ProtoSchema; + })(); + + v2.SchemaBundle = (function() { + + /** + * Properties of a SchemaBundle. + * @memberof google.bigtable.admin.v2 + * @interface ISchemaBundle + * @property {string|null} [name] SchemaBundle name + * @property {google.bigtable.admin.v2.IProtoSchema|null} [protoSchema] SchemaBundle protoSchema + * @property {string|null} [etag] SchemaBundle etag + */ + + /** + * Constructs a new SchemaBundle. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a SchemaBundle. + * @implements ISchemaBundle + * @constructor + * @param {google.bigtable.admin.v2.ISchemaBundle=} [properties] Properties to set + */ + function SchemaBundle(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SchemaBundle name. + * @member {string} name + * @memberof google.bigtable.admin.v2.SchemaBundle + * @instance + */ + SchemaBundle.prototype.name = ""; + + /** + * SchemaBundle protoSchema. + * @member {google.bigtable.admin.v2.IProtoSchema|null|undefined} protoSchema + * @memberof google.bigtable.admin.v2.SchemaBundle + * @instance + */ + SchemaBundle.prototype.protoSchema = null; + + /** + * SchemaBundle etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.SchemaBundle + * @instance + */ + SchemaBundle.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SchemaBundle type. + * @member {"protoSchema"|undefined} type + * @memberof google.bigtable.admin.v2.SchemaBundle + * @instance + */ + Object.defineProperty(SchemaBundle.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["protoSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SchemaBundle instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {google.bigtable.admin.v2.ISchemaBundle=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.SchemaBundle} SchemaBundle instance + */ + SchemaBundle.create = function create(properties) { + return new SchemaBundle(properties); + }; + + /** + * Encodes the specified SchemaBundle message. Does not implicitly {@link google.bigtable.admin.v2.SchemaBundle.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {google.bigtable.admin.v2.ISchemaBundle} message SchemaBundle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaBundle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.protoSchema != null && Object.hasOwnProperty.call(message, "protoSchema")) + $root.google.bigtable.admin.v2.ProtoSchema.encode(message.protoSchema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified SchemaBundle message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SchemaBundle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {google.bigtable.admin.v2.ISchemaBundle} message SchemaBundle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaBundle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchemaBundle message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.SchemaBundle} SchemaBundle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaBundle.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.SchemaBundle(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.protoSchema = $root.google.bigtable.admin.v2.ProtoSchema.decode(reader, reader.uint32()); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchemaBundle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.SchemaBundle} SchemaBundle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaBundle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchemaBundle message. + * @function verify + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchemaBundle.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.protoSchema != null && message.hasOwnProperty("protoSchema")) { + properties.type = 1; + { + var error = $root.google.bigtable.admin.v2.ProtoSchema.verify(message.protoSchema); + if (error) + return "protoSchema." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a SchemaBundle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.SchemaBundle} SchemaBundle + */ + SchemaBundle.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.SchemaBundle) + return object; + var message = new $root.google.bigtable.admin.v2.SchemaBundle(); + if (object.name != null) + message.name = String(object.name); + if (object.protoSchema != null) { + if (typeof object.protoSchema !== "object") + throw TypeError(".google.bigtable.admin.v2.SchemaBundle.protoSchema: object expected"); + message.protoSchema = $root.google.bigtable.admin.v2.ProtoSchema.fromObject(object.protoSchema); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a SchemaBundle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {google.bigtable.admin.v2.SchemaBundle} message SchemaBundle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchemaBundle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.protoSchema != null && message.hasOwnProperty("protoSchema")) { + object.protoSchema = $root.google.bigtable.admin.v2.ProtoSchema.toObject(message.protoSchema, options); + if (options.oneofs) + object.type = "protoSchema"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this SchemaBundle to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.SchemaBundle + * @instance + * @returns {Object.} JSON object + */ + SchemaBundle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchemaBundle + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchemaBundle.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.SchemaBundle"; + }; + + return SchemaBundle; + })(); + + v2.Type = (function() { + + /** + * Properties of a Type. + * @memberof google.bigtable.admin.v2 + * @interface IType + * @property {google.bigtable.admin.v2.Type.IBytes|null} [bytesType] Type bytesType + * @property {google.bigtable.admin.v2.Type.IString|null} [stringType] Type stringType + * @property {google.bigtable.admin.v2.Type.IInt64|null} [int64Type] Type int64Type + * @property {google.bigtable.admin.v2.Type.IFloat32|null} [float32Type] Type float32Type + * @property {google.bigtable.admin.v2.Type.IFloat64|null} [float64Type] Type float64Type + * @property {google.bigtable.admin.v2.Type.IBool|null} [boolType] Type boolType + * @property {google.bigtable.admin.v2.Type.ITimestamp|null} [timestampType] Type timestampType + * @property {google.bigtable.admin.v2.Type.IDate|null} [dateType] Type dateType + * @property {google.bigtable.admin.v2.Type.IAggregate|null} [aggregateType] Type aggregateType + * @property {google.bigtable.admin.v2.Type.IStruct|null} [structType] Type structType + * @property {google.bigtable.admin.v2.Type.IArray|null} [arrayType] Type arrayType + * @property {google.bigtable.admin.v2.Type.IMap|null} [mapType] Type mapType + * @property {google.bigtable.admin.v2.Type.IProto|null} [protoType] Type protoType + * @property {google.bigtable.admin.v2.Type.IEnum|null} [enumType] Type enumType + */ + + /** + * Constructs a new Type. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a Type. + * @implements IType + * @constructor + * @param {google.bigtable.admin.v2.IType=} [properties] Properties to set + */ + function Type(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Type bytesType. + * @member {google.bigtable.admin.v2.Type.IBytes|null|undefined} bytesType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.bytesType = null; + + /** + * Type stringType. + * @member {google.bigtable.admin.v2.Type.IString|null|undefined} stringType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.stringType = null; + + /** + * Type int64Type. + * @member {google.bigtable.admin.v2.Type.IInt64|null|undefined} int64Type + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.int64Type = null; + + /** + * Type float32Type. + * @member {google.bigtable.admin.v2.Type.IFloat32|null|undefined} float32Type + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.float32Type = null; + + /** + * Type float64Type. + * @member {google.bigtable.admin.v2.Type.IFloat64|null|undefined} float64Type + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.float64Type = null; + + /** + * Type boolType. + * @member {google.bigtable.admin.v2.Type.IBool|null|undefined} boolType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.boolType = null; + + /** + * Type timestampType. + * @member {google.bigtable.admin.v2.Type.ITimestamp|null|undefined} timestampType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.timestampType = null; + + /** + * Type dateType. + * @member {google.bigtable.admin.v2.Type.IDate|null|undefined} dateType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.dateType = null; + + /** + * Type aggregateType. + * @member {google.bigtable.admin.v2.Type.IAggregate|null|undefined} aggregateType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.aggregateType = null; + + /** + * Type structType. + * @member {google.bigtable.admin.v2.Type.IStruct|null|undefined} structType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.structType = null; + + /** + * Type arrayType. + * @member {google.bigtable.admin.v2.Type.IArray|null|undefined} arrayType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.arrayType = null; + + /** + * Type mapType. + * @member {google.bigtable.admin.v2.Type.IMap|null|undefined} mapType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.mapType = null; + + /** + * Type protoType. + * @member {google.bigtable.admin.v2.Type.IProto|null|undefined} protoType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.protoType = null; + + /** + * Type enumType. + * @member {google.bigtable.admin.v2.Type.IEnum|null|undefined} enumType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.enumType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Type kind. + * @member {"bytesType"|"stringType"|"int64Type"|"float32Type"|"float64Type"|"boolType"|"timestampType"|"dateType"|"aggregateType"|"structType"|"arrayType"|"mapType"|"protoType"|"enumType"|undefined} kind + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Object.defineProperty(Type.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["bytesType", "stringType", "int64Type", "float32Type", "float64Type", "boolType", "timestampType", "dateType", "aggregateType", "structType", "arrayType", "mapType", "protoType", "enumType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Type instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {google.bigtable.admin.v2.IType=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type} Type instance + */ + Type.create = function create(properties) { + return new Type(properties); + }; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.bigtable.admin.v2.Type.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {google.bigtable.admin.v2.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesType != null && Object.hasOwnProperty.call(message, "bytesType")) + $root.google.bigtable.admin.v2.Type.Bytes.encode(message.bytesType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stringType != null && Object.hasOwnProperty.call(message, "stringType")) + $root.google.bigtable.admin.v2.Type.String.encode(message.stringType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.arrayType != null && Object.hasOwnProperty.call(message, "arrayType")) + $root.google.bigtable.admin.v2.Type.Array.encode(message.arrayType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mapType != null && Object.hasOwnProperty.call(message, "mapType")) + $root.google.bigtable.admin.v2.Type.Map.encode(message.mapType, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.int64Type != null && Object.hasOwnProperty.call(message, "int64Type")) + $root.google.bigtable.admin.v2.Type.Int64.encode(message.int64Type, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.aggregateType != null && Object.hasOwnProperty.call(message, "aggregateType")) + $root.google.bigtable.admin.v2.Type.Aggregate.encode(message.aggregateType, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) + $root.google.bigtable.admin.v2.Type.Struct.encode(message.structType, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.boolType != null && Object.hasOwnProperty.call(message, "boolType")) + $root.google.bigtable.admin.v2.Type.Bool.encode(message.boolType, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.float64Type != null && Object.hasOwnProperty.call(message, "float64Type")) + $root.google.bigtable.admin.v2.Type.Float64.encode(message.float64Type, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.timestampType != null && Object.hasOwnProperty.call(message, "timestampType")) + $root.google.bigtable.admin.v2.Type.Timestamp.encode(message.timestampType, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.dateType != null && Object.hasOwnProperty.call(message, "dateType")) + $root.google.bigtable.admin.v2.Type.Date.encode(message.dateType, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.float32Type != null && Object.hasOwnProperty.call(message, "float32Type")) + $root.google.bigtable.admin.v2.Type.Float32.encode(message.float32Type, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.protoType != null && Object.hasOwnProperty.call(message, "protoType")) + $root.google.bigtable.admin.v2.Type.Proto.encode(message.protoType, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + $root.google.bigtable.admin.v2.Type.Enum.encode(message.enumType, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {google.bigtable.admin.v2.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Type message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bytesType = $root.google.bigtable.admin.v2.Type.Bytes.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stringType = $root.google.bigtable.admin.v2.Type.String.decode(reader, reader.uint32()); + break; + } + case 5: { + message.int64Type = $root.google.bigtable.admin.v2.Type.Int64.decode(reader, reader.uint32()); + break; + } + case 12: { + message.float32Type = $root.google.bigtable.admin.v2.Type.Float32.decode(reader, reader.uint32()); + break; + } + case 9: { + message.float64Type = $root.google.bigtable.admin.v2.Type.Float64.decode(reader, reader.uint32()); + break; + } + case 8: { + message.boolType = $root.google.bigtable.admin.v2.Type.Bool.decode(reader, reader.uint32()); + break; + } + case 10: { + message.timestampType = $root.google.bigtable.admin.v2.Type.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.dateType = $root.google.bigtable.admin.v2.Type.Date.decode(reader, reader.uint32()); + break; + } + case 6: { + message.aggregateType = $root.google.bigtable.admin.v2.Type.Aggregate.decode(reader, reader.uint32()); + break; + } + case 7: { + message.structType = $root.google.bigtable.admin.v2.Type.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.arrayType = $root.google.bigtable.admin.v2.Type.Array.decode(reader, reader.uint32()); + break; + } + case 4: { + message.mapType = $root.google.bigtable.admin.v2.Type.Map.decode(reader, reader.uint32()); + break; + } + case 13: { + message.protoType = $root.google.bigtable.admin.v2.Type.Proto.decode(reader, reader.uint32()); + break; + } + case 14: { + message.enumType = $root.google.bigtable.admin.v2.Type.Enum.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Type message. + * @function verify + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Type.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) { + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Bytes.verify(message.bytesType); + if (error) + return "bytesType." + error; + } + } + if (message.stringType != null && message.hasOwnProperty("stringType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.String.verify(message.stringType); + if (error) + return "stringType." + error; + } + } + if (message.int64Type != null && message.hasOwnProperty("int64Type")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Int64.verify(message.int64Type); + if (error) + return "int64Type." + error; + } + } + if (message.float32Type != null && message.hasOwnProperty("float32Type")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Float32.verify(message.float32Type); + if (error) + return "float32Type." + error; + } + } + if (message.float64Type != null && message.hasOwnProperty("float64Type")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Float64.verify(message.float64Type); + if (error) + return "float64Type." + error; + } + } + if (message.boolType != null && message.hasOwnProperty("boolType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Bool.verify(message.boolType); + if (error) + return "boolType." + error; + } + } + if (message.timestampType != null && message.hasOwnProperty("timestampType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Timestamp.verify(message.timestampType); + if (error) + return "timestampType." + error; + } + } + if (message.dateType != null && message.hasOwnProperty("dateType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Date.verify(message.dateType); + if (error) + return "dateType." + error; + } + } + if (message.aggregateType != null && message.hasOwnProperty("aggregateType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Aggregate.verify(message.aggregateType); + if (error) + return "aggregateType." + error; + } + } + if (message.structType != null && message.hasOwnProperty("structType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Struct.verify(message.structType); + if (error) + return "structType." + error; + } + } + if (message.arrayType != null && message.hasOwnProperty("arrayType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Array.verify(message.arrayType); + if (error) + return "arrayType." + error; + } + } + if (message.mapType != null && message.hasOwnProperty("mapType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Map.verify(message.mapType); + if (error) + return "mapType." + error; + } + } + if (message.protoType != null && message.hasOwnProperty("protoType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Proto.verify(message.protoType); + if (error) + return "protoType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Enum.verify(message.enumType); + if (error) + return "enumType." + error; + } + } + return null; + }; + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type} Type + */ + Type.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type) + return object; + var message = new $root.google.bigtable.admin.v2.Type(); + if (object.bytesType != null) { + if (typeof object.bytesType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.bytesType: object expected"); + message.bytesType = $root.google.bigtable.admin.v2.Type.Bytes.fromObject(object.bytesType); + } + if (object.stringType != null) { + if (typeof object.stringType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.stringType: object expected"); + message.stringType = $root.google.bigtable.admin.v2.Type.String.fromObject(object.stringType); + } + if (object.int64Type != null) { + if (typeof object.int64Type !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.int64Type: object expected"); + message.int64Type = $root.google.bigtable.admin.v2.Type.Int64.fromObject(object.int64Type); + } + if (object.float32Type != null) { + if (typeof object.float32Type !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.float32Type: object expected"); + message.float32Type = $root.google.bigtable.admin.v2.Type.Float32.fromObject(object.float32Type); + } + if (object.float64Type != null) { + if (typeof object.float64Type !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.float64Type: object expected"); + message.float64Type = $root.google.bigtable.admin.v2.Type.Float64.fromObject(object.float64Type); + } + if (object.boolType != null) { + if (typeof object.boolType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.boolType: object expected"); + message.boolType = $root.google.bigtable.admin.v2.Type.Bool.fromObject(object.boolType); + } + if (object.timestampType != null) { + if (typeof object.timestampType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.timestampType: object expected"); + message.timestampType = $root.google.bigtable.admin.v2.Type.Timestamp.fromObject(object.timestampType); + } + if (object.dateType != null) { + if (typeof object.dateType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.dateType: object expected"); + message.dateType = $root.google.bigtable.admin.v2.Type.Date.fromObject(object.dateType); + } + if (object.aggregateType != null) { + if (typeof object.aggregateType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.aggregateType: object expected"); + message.aggregateType = $root.google.bigtable.admin.v2.Type.Aggregate.fromObject(object.aggregateType); + } + if (object.structType != null) { + if (typeof object.structType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.structType: object expected"); + message.structType = $root.google.bigtable.admin.v2.Type.Struct.fromObject(object.structType); + } + if (object.arrayType != null) { + if (typeof object.arrayType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.arrayType: object expected"); + message.arrayType = $root.google.bigtable.admin.v2.Type.Array.fromObject(object.arrayType); + } + if (object.mapType != null) { + if (typeof object.mapType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.mapType: object expected"); + message.mapType = $root.google.bigtable.admin.v2.Type.Map.fromObject(object.mapType); + } + if (object.protoType != null) { + if (typeof object.protoType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.protoType: object expected"); + message.protoType = $root.google.bigtable.admin.v2.Type.Proto.fromObject(object.protoType); + } + if (object.enumType != null) { + if (typeof object.enumType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.enumType: object expected"); + message.enumType = $root.google.bigtable.admin.v2.Type.Enum.fromObject(object.enumType); + } + return message; + }; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {google.bigtable.admin.v2.Type} message Type + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Type.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) { + object.bytesType = $root.google.bigtable.admin.v2.Type.Bytes.toObject(message.bytesType, options); + if (options.oneofs) + object.kind = "bytesType"; + } + if (message.stringType != null && message.hasOwnProperty("stringType")) { + object.stringType = $root.google.bigtable.admin.v2.Type.String.toObject(message.stringType, options); + if (options.oneofs) + object.kind = "stringType"; + } + if (message.arrayType != null && message.hasOwnProperty("arrayType")) { + object.arrayType = $root.google.bigtable.admin.v2.Type.Array.toObject(message.arrayType, options); + if (options.oneofs) + object.kind = "arrayType"; + } + if (message.mapType != null && message.hasOwnProperty("mapType")) { + object.mapType = $root.google.bigtable.admin.v2.Type.Map.toObject(message.mapType, options); + if (options.oneofs) + object.kind = "mapType"; + } + if (message.int64Type != null && message.hasOwnProperty("int64Type")) { + object.int64Type = $root.google.bigtable.admin.v2.Type.Int64.toObject(message.int64Type, options); + if (options.oneofs) + object.kind = "int64Type"; + } + if (message.aggregateType != null && message.hasOwnProperty("aggregateType")) { + object.aggregateType = $root.google.bigtable.admin.v2.Type.Aggregate.toObject(message.aggregateType, options); + if (options.oneofs) + object.kind = "aggregateType"; + } + if (message.structType != null && message.hasOwnProperty("structType")) { + object.structType = $root.google.bigtable.admin.v2.Type.Struct.toObject(message.structType, options); + if (options.oneofs) + object.kind = "structType"; + } + if (message.boolType != null && message.hasOwnProperty("boolType")) { + object.boolType = $root.google.bigtable.admin.v2.Type.Bool.toObject(message.boolType, options); + if (options.oneofs) + object.kind = "boolType"; + } + if (message.float64Type != null && message.hasOwnProperty("float64Type")) { + object.float64Type = $root.google.bigtable.admin.v2.Type.Float64.toObject(message.float64Type, options); + if (options.oneofs) + object.kind = "float64Type"; + } + if (message.timestampType != null && message.hasOwnProperty("timestampType")) { + object.timestampType = $root.google.bigtable.admin.v2.Type.Timestamp.toObject(message.timestampType, options); + if (options.oneofs) + object.kind = "timestampType"; + } + if (message.dateType != null && message.hasOwnProperty("dateType")) { + object.dateType = $root.google.bigtable.admin.v2.Type.Date.toObject(message.dateType, options); + if (options.oneofs) + object.kind = "dateType"; + } + if (message.float32Type != null && message.hasOwnProperty("float32Type")) { + object.float32Type = $root.google.bigtable.admin.v2.Type.Float32.toObject(message.float32Type, options); + if (options.oneofs) + object.kind = "float32Type"; + } + if (message.protoType != null && message.hasOwnProperty("protoType")) { + object.protoType = $root.google.bigtable.admin.v2.Type.Proto.toObject(message.protoType, options); + if (options.oneofs) + object.kind = "protoType"; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + object.enumType = $root.google.bigtable.admin.v2.Type.Enum.toObject(message.enumType, options); + if (options.oneofs) + object.kind = "enumType"; + } + return object; + }; + + /** + * Converts this Type to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type + * @instance + * @returns {Object.} JSON object + */ + Type.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Type + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Type.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type"; + }; + + Type.Bytes = (function() { + + /** + * Properties of a Bytes. + * @memberof google.bigtable.admin.v2.Type + * @interface IBytes + * @property {google.bigtable.admin.v2.Type.Bytes.IEncoding|null} [encoding] Bytes encoding + */ + + /** + * Constructs a new Bytes. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Bytes. + * @implements IBytes + * @constructor + * @param {google.bigtable.admin.v2.Type.IBytes=} [properties] Properties to set + */ + function Bytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bytes encoding. + * @member {google.bigtable.admin.v2.Type.Bytes.IEncoding|null|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Bytes + * @instance + */ + Bytes.prototype.encoding = null; + + /** + * Creates a new Bytes instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {google.bigtable.admin.v2.Type.IBytes=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Bytes} Bytes instance + */ + Bytes.create = function create(properties) { + return new Bytes(properties); + }; + + /** + * Encodes the specified Bytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {google.bigtable.admin.v2.Type.IBytes} message Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.admin.v2.Type.Bytes.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Bytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {google.bigtable.admin.v2.Type.IBytes} message Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Bytes} Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Bytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Bytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Bytes} Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bytes message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a Bytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Bytes} Bytes + */ + Bytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Bytes) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Bytes(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Bytes.encoding: object expected"); + message.encoding = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a Bytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {google.bigtable.admin.v2.Type.Bytes} message Bytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Bytes to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Bytes + * @instance + * @returns {Object.} JSON object + */ + Bytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bytes + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Bytes"; + }; + + Bytes.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.admin.v2.Type.Bytes + * @interface IEncoding + * @property {google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw|null} [raw] Encoding raw + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.admin.v2.Type.Bytes + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.admin.v2.Type.Bytes.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding raw. + * @member {google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw|null|undefined} raw + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @instance + */ + Encoding.prototype.raw = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"raw"|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["raw"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.raw != null && Object.hasOwnProperty.call(message, "raw")) + $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.encode(message.raw, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Bytes.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.raw = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.raw != null && message.hasOwnProperty("raw")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.verify(message.raw); + if (error) + return "raw." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Bytes.Encoding) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Bytes.Encoding(); + if (object.raw != null) { + if (typeof object.raw !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Bytes.Encoding.raw: object expected"); + message.raw = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.fromObject(object.raw); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.raw != null && message.hasOwnProperty("raw")) { + object.raw = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.toObject(message.raw, options); + if (options.oneofs) + object.encoding = "raw"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Bytes.Encoding"; + }; + + Encoding.Raw = (function() { + + /** + * Properties of a Raw. + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @interface IRaw + */ + + /** + * Constructs a new Raw. + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @classdesc Represents a Raw. + * @implements IRaw + * @constructor + * @param {google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw=} [properties] Properties to set + */ + function Raw(properties) { + if (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 Raw instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} Raw instance + */ + Raw.create = function create(properties) { + return new Raw(properties); + }; + + /** + * Encodes the specified Raw message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw} message Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Raw.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Raw message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw} message Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Raw.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Raw message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Raw.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Raw message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Raw.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Raw message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Raw.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Raw message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} Raw + */ + Raw.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) + return object; + return new $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw(); + }; + + /** + * Creates a plain object from a Raw message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} message Raw + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Raw.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Raw to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @instance + * @returns {Object.} JSON object + */ + Raw.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Raw + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Raw.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Bytes.Encoding.Raw"; + }; + + return Raw; + })(); + + return Encoding; + })(); + + return Bytes; + })(); + + Type.String = (function() { + + /** + * Properties of a String. + * @memberof google.bigtable.admin.v2.Type + * @interface IString + * @property {google.bigtable.admin.v2.Type.String.IEncoding|null} [encoding] String encoding + */ + + /** + * Constructs a new String. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a String. + * @implements IString + * @constructor + * @param {google.bigtable.admin.v2.Type.IString=} [properties] Properties to set + */ + function String(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * String encoding. + * @member {google.bigtable.admin.v2.Type.String.IEncoding|null|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.String + * @instance + */ + String.prototype.encoding = null; + + /** + * Creates a new String instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {google.bigtable.admin.v2.Type.IString=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.String} String instance + */ + String.create = function create(properties) { + return new String(properties); + }; + + /** + * Encodes the specified String message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {google.bigtable.admin.v2.Type.IString} message String message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + String.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.admin.v2.Type.String.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified String message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {google.bigtable.admin.v2.Type.IString} message String message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + String.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a String message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.String} String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + String.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.String(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.admin.v2.Type.String.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a String message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.String} String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + String.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a String message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + String.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.admin.v2.Type.String.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a String message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.String} String + */ + String.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.String) + return object; + var message = new $root.google.bigtable.admin.v2.Type.String(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.String.encoding: object expected"); + message.encoding = $root.google.bigtable.admin.v2.Type.String.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a String message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {google.bigtable.admin.v2.Type.String} message String + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + String.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.admin.v2.Type.String.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this String to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.String + * @instance + * @returns {Object.} JSON object + */ + String.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for String + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + String.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.String"; + }; + + String.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.admin.v2.Type.String + * @interface IEncoding + * @property {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw|null} [utf8Raw] Encoding utf8Raw + * @property {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes|null} [utf8Bytes] Encoding utf8Bytes + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.admin.v2.Type.String + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.admin.v2.Type.String.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding utf8Raw. + * @member {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw|null|undefined} utf8Raw + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @instance + */ + Encoding.prototype.utf8Raw = null; + + /** + * Encoding utf8Bytes. + * @member {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes|null|undefined} utf8Bytes + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @instance + */ + Encoding.prototype.utf8Bytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"utf8Raw"|"utf8Bytes"|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["utf8Raw", "utf8Bytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.String.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.String.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.String.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.utf8Raw != null && Object.hasOwnProperty.call(message, "utf8Raw")) + $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.encode(message.utf8Raw, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.utf8Bytes != null && Object.hasOwnProperty.call(message, "utf8Bytes")) + $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.encode(message.utf8Bytes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.String.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.String.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.String.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.utf8Raw = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.decode(reader, reader.uint32()); + break; + } + case 2: { + message.utf8Bytes = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.String.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.utf8Raw != null && message.hasOwnProperty("utf8Raw")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.verify(message.utf8Raw); + if (error) + return "utf8Raw." + error; + } + } + if (message.utf8Bytes != null && message.hasOwnProperty("utf8Bytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.verify(message.utf8Bytes); + if (error) + return "utf8Bytes." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.String.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.String.Encoding) + return object; + var message = new $root.google.bigtable.admin.v2.Type.String.Encoding(); + if (object.utf8Raw != null) { + if (typeof object.utf8Raw !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.String.Encoding.utf8Raw: object expected"); + message.utf8Raw = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.fromObject(object.utf8Raw); + } + if (object.utf8Bytes != null) { + if (typeof object.utf8Bytes !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.String.Encoding.utf8Bytes: object expected"); + message.utf8Bytes = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.fromObject(object.utf8Bytes); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.utf8Raw != null && message.hasOwnProperty("utf8Raw")) { + object.utf8Raw = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.toObject(message.utf8Raw, options); + if (options.oneofs) + object.encoding = "utf8Raw"; + } + if (message.utf8Bytes != null && message.hasOwnProperty("utf8Bytes")) { + object.utf8Bytes = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.toObject(message.utf8Bytes, options); + if (options.oneofs) + object.encoding = "utf8Bytes"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.String.Encoding"; + }; + + Encoding.Utf8Raw = (function() { + + /** + * Properties of an Utf8Raw. + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @interface IUtf8Raw + */ + + /** + * Constructs a new Utf8Raw. + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @classdesc Represents an Utf8Raw. + * @implements IUtf8Raw + * @constructor + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw=} [properties] Properties to set + */ + function Utf8Raw(properties) { + if (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 Utf8Raw instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw} Utf8Raw instance + */ + Utf8Raw.create = function create(properties) { + return new Utf8Raw(properties); + }; + + /** + * Encodes the specified Utf8Raw message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw} message Utf8Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Raw.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Utf8Raw message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw} message Utf8Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Raw.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw} Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Raw.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw} Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Raw.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Utf8Raw message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Utf8Raw.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Utf8Raw message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw} Utf8Raw + */ + Utf8Raw.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) + return object; + return new $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw(); + }; + + /** + * Creates a plain object from an Utf8Raw message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw} message Utf8Raw + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Utf8Raw.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Utf8Raw to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @instance + * @returns {Object.} JSON object + */ + Utf8Raw.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Utf8Raw + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Utf8Raw.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw"; + }; + + return Utf8Raw; + })(); + + Encoding.Utf8Bytes = (function() { + + /** + * Properties of an Utf8Bytes. + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @interface IUtf8Bytes + */ + + /** + * Constructs a new Utf8Bytes. + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @classdesc Represents an Utf8Bytes. + * @implements IUtf8Bytes + * @constructor + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes=} [properties] Properties to set + */ + function Utf8Bytes(properties) { + if (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 Utf8Bytes instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes instance + */ + Utf8Bytes.create = function create(properties) { + return new Utf8Bytes(properties); + }; + + /** + * Encodes the specified Utf8Bytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes} message Utf8Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Bytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Utf8Bytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes} message Utf8Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Bytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Bytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Bytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Utf8Bytes message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Utf8Bytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Utf8Bytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes + */ + Utf8Bytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) + return object; + return new $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes(); + }; + + /** + * Creates a plain object from an Utf8Bytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes} message Utf8Bytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Utf8Bytes.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Utf8Bytes to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @instance + * @returns {Object.} JSON object + */ + Utf8Bytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Utf8Bytes + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Utf8Bytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes"; + }; + + return Utf8Bytes; + })(); + + return Encoding; + })(); + + return String; + })(); + + Type.Int64 = (function() { + + /** + * Properties of an Int64. + * @memberof google.bigtable.admin.v2.Type + * @interface IInt64 + * @property {google.bigtable.admin.v2.Type.Int64.IEncoding|null} [encoding] Int64 encoding + */ + + /** + * Constructs a new Int64. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents an Int64. + * @implements IInt64 + * @constructor + * @param {google.bigtable.admin.v2.Type.IInt64=} [properties] Properties to set + */ + function Int64(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64 encoding. + * @member {google.bigtable.admin.v2.Type.Int64.IEncoding|null|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Int64 + * @instance + */ + Int64.prototype.encoding = null; + + /** + * Creates a new Int64 instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {google.bigtable.admin.v2.Type.IInt64=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Int64} Int64 instance + */ + Int64.create = function create(properties) { + return new Int64(properties); + }; + + /** + * Encodes the specified Int64 message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {google.bigtable.admin.v2.Type.IInt64} message Int64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.admin.v2.Type.Int64.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Int64 message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {google.bigtable.admin.v2.Type.IInt64} message Int64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64 message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Int64} Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Int64(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.admin.v2.Type.Int64.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Int64} Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64 message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.admin.v2.Type.Int64.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates an Int64 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Int64} Int64 + */ + Int64.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Int64) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Int64(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Int64.encoding: object expected"); + message.encoding = $root.google.bigtable.admin.v2.Type.Int64.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from an Int64 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {google.bigtable.admin.v2.Type.Int64} message Int64 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.admin.v2.Type.Int64.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Int64 to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Int64 + * @instance + * @returns {Object.} JSON object + */ + Int64.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64 + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Int64"; + }; + + Int64.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.admin.v2.Type.Int64 + * @interface IEncoding + * @property {google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes|null} [bigEndianBytes] Encoding bigEndianBytes + * @property {google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes|null} [orderedCodeBytes] Encoding orderedCodeBytes + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.admin.v2.Type.Int64 + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.admin.v2.Type.Int64.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding bigEndianBytes. + * @member {google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes|null|undefined} bigEndianBytes + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @instance + */ + Encoding.prototype.bigEndianBytes = null; + + /** + * Encoding orderedCodeBytes. + * @member {google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes|null|undefined} orderedCodeBytes + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @instance + */ + Encoding.prototype.orderedCodeBytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"bigEndianBytes"|"orderedCodeBytes"|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["bigEndianBytes", "orderedCodeBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Int64.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Int64.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigEndianBytes != null && Object.hasOwnProperty.call(message, "bigEndianBytes")) + $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.encode(message.bigEndianBytes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.orderedCodeBytes != null && Object.hasOwnProperty.call(message, "orderedCodeBytes")) + $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.encode(message.orderedCodeBytes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Int64.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Int64.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bigEndianBytes = $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.decode(reader, reader.uint32()); + break; + } + case 2: { + message.orderedCodeBytes = $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bigEndianBytes != null && message.hasOwnProperty("bigEndianBytes")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.verify(message.bigEndianBytes); + if (error) + return "bigEndianBytes." + error; + } + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.verify(message.orderedCodeBytes); + if (error) + return "orderedCodeBytes." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Int64.Encoding) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Int64.Encoding(); + if (object.bigEndianBytes != null) { + if (typeof object.bigEndianBytes !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Int64.Encoding.bigEndianBytes: object expected"); + message.bigEndianBytes = $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.fromObject(object.bigEndianBytes); + } + if (object.orderedCodeBytes != null) { + if (typeof object.orderedCodeBytes !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Int64.Encoding.orderedCodeBytes: object expected"); + message.orderedCodeBytes = $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.fromObject(object.orderedCodeBytes); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bigEndianBytes != null && message.hasOwnProperty("bigEndianBytes")) { + object.bigEndianBytes = $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.toObject(message.bigEndianBytes, options); + if (options.oneofs) + object.encoding = "bigEndianBytes"; + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + object.orderedCodeBytes = $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.toObject(message.orderedCodeBytes, options); + if (options.oneofs) + object.encoding = "orderedCodeBytes"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Int64.Encoding"; + }; + + Encoding.BigEndianBytes = (function() { + + /** + * Properties of a BigEndianBytes. + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @interface IBigEndianBytes + * @property {google.bigtable.admin.v2.Type.IBytes|null} [bytesType] BigEndianBytes bytesType + */ + + /** + * Constructs a new BigEndianBytes. + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @classdesc Represents a BigEndianBytes. + * @implements IBigEndianBytes + * @constructor + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes=} [properties] Properties to set + */ + function BigEndianBytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigEndianBytes bytesType. + * @member {google.bigtable.admin.v2.Type.IBytes|null|undefined} bytesType + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @instance + */ + BigEndianBytes.prototype.bytesType = null; + + /** + * Creates a new BigEndianBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes instance + */ + BigEndianBytes.create = function create(properties) { + return new BigEndianBytes(properties); + }; + + /** + * Encodes the specified BigEndianBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes} message BigEndianBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigEndianBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesType != null && Object.hasOwnProperty.call(message, "bytesType")) + $root.google.bigtable.admin.v2.Type.Bytes.encode(message.bytesType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BigEndianBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes} message BigEndianBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigEndianBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigEndianBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bytesType = $root.google.bigtable.admin.v2.Type.Bytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigEndianBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigEndianBytes message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigEndianBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) { + var error = $root.google.bigtable.admin.v2.Type.Bytes.verify(message.bytesType); + if (error) + return "bytesType." + error; + } + return null; + }; + + /** + * Creates a BigEndianBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes + */ + BigEndianBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes(); + if (object.bytesType != null) { + if (typeof object.bytesType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.bytesType: object expected"); + message.bytesType = $root.google.bigtable.admin.v2.Type.Bytes.fromObject(object.bytesType); + } + return message; + }; + + /** + * Creates a plain object from a BigEndianBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes} message BigEndianBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigEndianBytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.bytesType = null; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) + object.bytesType = $root.google.bigtable.admin.v2.Type.Bytes.toObject(message.bytesType, options); + return object; + }; + + /** + * Converts this BigEndianBytes to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @instance + * @returns {Object.} JSON object + */ + BigEndianBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigEndianBytes + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigEndianBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes"; + }; + + return BigEndianBytes; + })(); + + Encoding.OrderedCodeBytes = (function() { + + /** + * Properties of an OrderedCodeBytes. + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @interface IOrderedCodeBytes + */ + + /** + * Constructs a new OrderedCodeBytes. + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @classdesc Represents an OrderedCodeBytes. + * @implements IOrderedCodeBytes + * @constructor + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes=} [properties] Properties to set + */ + function OrderedCodeBytes(properties) { + if (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 OrderedCodeBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes instance + */ + OrderedCodeBytes.create = function create(properties) { + return new OrderedCodeBytes(properties); + }; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrderedCodeBytes message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrderedCodeBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes + */ + OrderedCodeBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) + return object; + return new $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes(); + }; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes} message OrderedCodeBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrderedCodeBytes.toObject = function toObject() { + return {}; + }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @instance + * @returns {Object.} JSON object + */ + OrderedCodeBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrderedCodeBytes + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrderedCodeBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes"; + }; + + return OrderedCodeBytes; + })(); + + return Encoding; + })(); + + return Int64; + })(); + + Type.Bool = (function() { + + /** + * Properties of a Bool. + * @memberof google.bigtable.admin.v2.Type + * @interface IBool + */ + + /** + * Constructs a new Bool. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Bool. + * @implements IBool + * @constructor + * @param {google.bigtable.admin.v2.Type.IBool=} [properties] Properties to set + */ + function Bool(properties) { + if (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 Bool instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {google.bigtable.admin.v2.Type.IBool=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Bool} Bool instance + */ + Bool.create = function create(properties) { + return new Bool(properties); + }; + + /** + * Encodes the specified Bool message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bool.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {google.bigtable.admin.v2.Type.IBool} message Bool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Bool message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {google.bigtable.admin.v2.Type.IBool} message Bool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bool message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Bool} Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Bool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Bool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Bool} Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bool message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Bool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Bool} Bool + */ + Bool.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Bool) + return object; + return new $root.google.bigtable.admin.v2.Type.Bool(); + }; + + /** + * Creates a plain object from a Bool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {google.bigtable.admin.v2.Type.Bool} message Bool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bool.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Bool to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Bool + * @instance + * @returns {Object.} JSON object + */ + Bool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bool + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Bool"; + }; + + return Bool; + })(); + + Type.Float32 = (function() { + + /** + * Properties of a Float32. + * @memberof google.bigtable.admin.v2.Type + * @interface IFloat32 + */ + + /** + * Constructs a new Float32. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Float32. + * @implements IFloat32 + * @constructor + * @param {google.bigtable.admin.v2.Type.IFloat32=} [properties] Properties to set + */ + function Float32(properties) { + if (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 Float32 instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {google.bigtable.admin.v2.Type.IFloat32=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Float32} Float32 instance + */ + Float32.create = function create(properties) { + return new Float32(properties); + }; + + /** + * Encodes the specified Float32 message. Does not implicitly {@link google.bigtable.admin.v2.Type.Float32.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {google.bigtable.admin.v2.Type.IFloat32} message Float32 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float32.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Float32 message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Float32.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {google.bigtable.admin.v2.Type.IFloat32} message Float32 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float32.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Float32 message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Float32} Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float32.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Float32(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Float32 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Float32} Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float32.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Float32 message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Float32.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Float32 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Float32} Float32 + */ + Float32.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Float32) + return object; + return new $root.google.bigtable.admin.v2.Type.Float32(); + }; + + /** + * Creates a plain object from a Float32 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {google.bigtable.admin.v2.Type.Float32} message Float32 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Float32.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Float32 to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Float32 + * @instance + * @returns {Object.} JSON object + */ + Float32.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Float32 + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Float32.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Float32"; + }; + + return Float32; + })(); + + Type.Float64 = (function() { + + /** + * Properties of a Float64. + * @memberof google.bigtable.admin.v2.Type + * @interface IFloat64 + */ + + /** + * Constructs a new Float64. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Float64. + * @implements IFloat64 + * @constructor + * @param {google.bigtable.admin.v2.Type.IFloat64=} [properties] Properties to set + */ + function Float64(properties) { + if (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 Float64 instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {google.bigtable.admin.v2.Type.IFloat64=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Float64} Float64 instance + */ + Float64.create = function create(properties) { + return new Float64(properties); + }; + + /** + * Encodes the specified Float64 message. Does not implicitly {@link google.bigtable.admin.v2.Type.Float64.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {google.bigtable.admin.v2.Type.IFloat64} message Float64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float64.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Float64 message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Float64.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {google.bigtable.admin.v2.Type.IFloat64} message Float64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float64.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Float64 message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Float64} Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float64.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Float64(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Float64 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Float64} Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float64.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Float64 message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Float64.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Float64 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Float64} Float64 + */ + Float64.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Float64) + return object; + return new $root.google.bigtable.admin.v2.Type.Float64(); + }; + + /** + * Creates a plain object from a Float64 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {google.bigtable.admin.v2.Type.Float64} message Float64 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Float64.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Float64 to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Float64 + * @instance + * @returns {Object.} JSON object + */ + Float64.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Float64 + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Float64.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Float64"; + }; + + return Float64; + })(); + + Type.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.bigtable.admin.v2.Type + * @interface ITimestamp + * @property {google.bigtable.admin.v2.Type.Timestamp.IEncoding|null} [encoding] Timestamp encoding + */ + + /** + * Constructs a new Timestamp. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.bigtable.admin.v2.Type.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 encoding. + * @member {google.bigtable.admin.v2.Type.Timestamp.IEncoding|null|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @instance + */ + Timestamp.prototype.encoding = null; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @static + * @param {google.bigtable.admin.v2.Type.ITimestamp=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.bigtable.admin.v2.Type.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @static + * @param {google.bigtable.admin.v2.Type.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.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.admin.v2.Type.Timestamp.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @static + * @param {google.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.admin.v2.Type.Timestamp.Encoding.decode(reader, reader.uint32()); + 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.bigtable.admin.v2.Type.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.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.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.admin.v2.Type.Timestamp.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Timestamp) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Timestamp(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Timestamp.encoding: object expected"); + message.encoding = $root.google.bigtable.admin.v2.Type.Timestamp.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @static + * @param {google.bigtable.admin.v2.Type.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) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.admin.v2.Type.Timestamp.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Timestamp"; + }; + + Timestamp.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @interface IEncoding + * @property {google.bigtable.admin.v2.Type.Int64.IEncoding|null} [unixMicrosInt64] Encoding unixMicrosInt64 + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.admin.v2.Type.Timestamp.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding unixMicrosInt64. + * @member {google.bigtable.admin.v2.Type.Int64.IEncoding|null|undefined} unixMicrosInt64 + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @instance + */ + Encoding.prototype.unixMicrosInt64 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"unixMicrosInt64"|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["unixMicrosInt64"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Timestamp.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Timestamp.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Timestamp.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unixMicrosInt64 != null && Object.hasOwnProperty.call(message, "unixMicrosInt64")) + $root.google.bigtable.admin.v2.Type.Int64.Encoding.encode(message.unixMicrosInt64, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Timestamp.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Timestamp.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Timestamp.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.unixMicrosInt64 = $root.google.bigtable.admin.v2.Type.Int64.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Timestamp.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.unixMicrosInt64 != null && message.hasOwnProperty("unixMicrosInt64")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Int64.Encoding.verify(message.unixMicrosInt64); + if (error) + return "unixMicrosInt64." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Timestamp.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Timestamp.Encoding) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Timestamp.Encoding(); + if (object.unixMicrosInt64 != null) { + if (typeof object.unixMicrosInt64 !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Timestamp.Encoding.unixMicrosInt64: object expected"); + message.unixMicrosInt64 = $root.google.bigtable.admin.v2.Type.Int64.Encoding.fromObject(object.unixMicrosInt64); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Timestamp.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.unixMicrosInt64 != null && message.hasOwnProperty("unixMicrosInt64")) { + object.unixMicrosInt64 = $root.google.bigtable.admin.v2.Type.Int64.Encoding.toObject(message.unixMicrosInt64, options); + if (options.oneofs) + object.encoding = "unixMicrosInt64"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Timestamp.Encoding"; + }; + + return Encoding; + })(); + + return Timestamp; + })(); + + Type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.bigtable.admin.v2.Type + * @interface IDate + */ + + /** + * Constructs a new Date. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.bigtable.admin.v2.Type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {google.bigtable.admin.v2.Type.IDate=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.bigtable.admin.v2.Type.Date.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {google.bigtable.admin.v2.Type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {google.bigtable.admin.v2.Type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Date) + return object; + return new $root.google.bigtable.admin.v2.Type.Date(); + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {google.bigtable.admin.v2.Type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Date"; + }; + + return Date; + })(); + + Type.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.bigtable.admin.v2.Type + * @interface IStruct + * @property {Array.|null} [fields] Struct fields + * @property {google.bigtable.admin.v2.Type.Struct.IEncoding|null} [encoding] Struct encoding + */ + + /** + * Constructs a new Struct. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.bigtable.admin.v2.Type.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Array.} fields + * @memberof google.bigtable.admin.v2.Type.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyArray; + + /** + * Struct encoding. + * @member {google.bigtable.admin.v2.Type.Struct.IEncoding|null|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Struct + * @instance + */ + Struct.prototype.encoding = null; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {google.bigtable.admin.v2.Type.IStruct=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {google.bigtable.admin.v2.Type.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.bigtable.admin.v2.Type.Struct.Field.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.admin.v2.Type.Struct.Encoding.encode(message.encoding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {google.bigtable.admin.v2.Type.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Struct(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.bigtable.admin.v2.Type.Struct.Field.decode(reader, reader.uint32())); + break; + } + case 2: { + message.encoding = $root.google.bigtable.admin.v2.Type.Struct.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.bigtable.admin.v2.Type.Struct.Field.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.admin.v2.Type.Struct.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Struct) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Struct(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.bigtable.admin.v2.Type.Struct.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Struct.fields: object expected"); + message.fields[i] = $root.google.bigtable.admin.v2.Type.Struct.Field.fromObject(object.fields[i]); + } + } + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Struct.encoding: object expected"); + message.encoding = $root.google.bigtable.admin.v2.Type.Struct.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {google.bigtable.admin.v2.Type.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) + object.encoding = null; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.bigtable.admin.v2.Type.Struct.Field.toObject(message.fields[j], options); + } + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.admin.v2.Type.Struct.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Struct"; + }; + + Struct.Field = (function() { + + /** + * Properties of a Field. + * @memberof google.bigtable.admin.v2.Type.Struct + * @interface IField + * @property {string|null} [fieldName] Field fieldName + * @property {google.bigtable.admin.v2.IType|null} [type] Field type + */ + + /** + * Constructs a new Field. + * @memberof google.bigtable.admin.v2.Type.Struct + * @classdesc Represents a Field. + * @implements IField + * @constructor + * @param {google.bigtable.admin.v2.Type.Struct.IField=} [properties] Properties to set + */ + function Field(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Field fieldName. + * @member {string} fieldName + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @instance + */ + Field.prototype.fieldName = ""; + + /** + * Field type. + * @member {google.bigtable.admin.v2.IType|null|undefined} type + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @instance + */ + Field.prototype.type = null; + + /** + * Creates a new Field instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {google.bigtable.admin.v2.Type.Struct.IField=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Struct.Field} Field instance + */ + Field.create = function create(properties) { + return new Field(properties); + }; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Field.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {google.bigtable.admin.v2.Type.Struct.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.bigtable.admin.v2.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Field.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {google.bigtable.admin.v2.Type.Struct.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Field message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Struct.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Struct.Field(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 2: { + message.type = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Struct.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Field message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Field.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.type); + if (error) + return "type." + error; + } + return null; + }; + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Struct.Field} Field + */ + Field.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Struct.Field) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Struct.Field(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Struct.Field.type: object expected"); + message.type = $root.google.bigtable.admin.v2.Type.fromObject(object.type); + } + return message; + }; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Field} message Field + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Field.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldName = ""; + object.type = null; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.bigtable.admin.v2.Type.toObject(message.type, options); + return object; + }; + + /** + * Converts this Field to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @instance + * @returns {Object.} JSON object + */ + Field.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Field + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Struct.Field"; + }; + + return Field; + })(); + + Struct.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.admin.v2.Type.Struct + * @interface IEncoding + * @property {google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton|null} [singleton] Encoding singleton + * @property {google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes|null} [delimitedBytes] Encoding delimitedBytes + * @property {google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes|null} [orderedCodeBytes] Encoding orderedCodeBytes + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.admin.v2.Type.Struct + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.admin.v2.Type.Struct.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding singleton. + * @member {google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton|null|undefined} singleton + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @instance + */ + Encoding.prototype.singleton = null; + + /** + * Encoding delimitedBytes. + * @member {google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes|null|undefined} delimitedBytes + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @instance + */ + Encoding.prototype.delimitedBytes = null; + + /** + * Encoding orderedCodeBytes. + * @member {google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes|null|undefined} orderedCodeBytes + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @instance + */ + Encoding.prototype.orderedCodeBytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"singleton"|"delimitedBytes"|"orderedCodeBytes"|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["singleton", "delimitedBytes", "orderedCodeBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Struct.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Struct.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.singleton != null && Object.hasOwnProperty.call(message, "singleton")) + $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.encode(message.singleton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.delimitedBytes != null && Object.hasOwnProperty.call(message, "delimitedBytes")) + $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.encode(message.delimitedBytes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.orderedCodeBytes != null && Object.hasOwnProperty.call(message, "orderedCodeBytes")) + $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.encode(message.orderedCodeBytes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Struct.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Struct.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.singleton = $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.decode(reader, reader.uint32()); + break; + } + case 2: { + message.delimitedBytes = $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.decode(reader, reader.uint32()); + break; + } + case 3: { + message.orderedCodeBytes = $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.singleton != null && message.hasOwnProperty("singleton")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.verify(message.singleton); + if (error) + return "singleton." + error; + } + } + if (message.delimitedBytes != null && message.hasOwnProperty("delimitedBytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.verify(message.delimitedBytes); + if (error) + return "delimitedBytes." + error; + } + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.verify(message.orderedCodeBytes); + if (error) + return "orderedCodeBytes." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Struct.Encoding) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Struct.Encoding(); + if (object.singleton != null) { + if (typeof object.singleton !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Struct.Encoding.singleton: object expected"); + message.singleton = $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.fromObject(object.singleton); + } + if (object.delimitedBytes != null) { + if (typeof object.delimitedBytes !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Struct.Encoding.delimitedBytes: object expected"); + message.delimitedBytes = $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.fromObject(object.delimitedBytes); + } + if (object.orderedCodeBytes != null) { + if (typeof object.orderedCodeBytes !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Struct.Encoding.orderedCodeBytes: object expected"); + message.orderedCodeBytes = $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.fromObject(object.orderedCodeBytes); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.singleton != null && message.hasOwnProperty("singleton")) { + object.singleton = $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.toObject(message.singleton, options); + if (options.oneofs) + object.encoding = "singleton"; + } + if (message.delimitedBytes != null && message.hasOwnProperty("delimitedBytes")) { + object.delimitedBytes = $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.toObject(message.delimitedBytes, options); + if (options.oneofs) + object.encoding = "delimitedBytes"; + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + object.orderedCodeBytes = $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.toObject(message.orderedCodeBytes, options); + if (options.oneofs) + object.encoding = "orderedCodeBytes"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Struct.Encoding"; + }; + + Encoding.Singleton = (function() { + + /** + * Properties of a Singleton. + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @interface ISingleton + */ + + /** + * Constructs a new Singleton. + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @classdesc Represents a Singleton. + * @implements ISingleton + * @constructor + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton=} [properties] Properties to set + */ + function Singleton(properties) { + if (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 Singleton instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.Singleton} Singleton instance + */ + Singleton.create = function create(properties) { + return new Singleton(properties); + }; + + /** + * Encodes the specified Singleton message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton} message Singleton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Singleton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Singleton message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton} message Singleton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Singleton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Singleton message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.Singleton} Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Singleton.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Singleton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.Singleton} Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Singleton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Singleton message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Singleton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Singleton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.Singleton} Singleton + */ + Singleton.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) + return object; + return new $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton(); + }; + + /** + * Creates a plain object from a Singleton message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.Singleton} message Singleton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Singleton.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Singleton to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @instance + * @returns {Object.} JSON object + */ + Singleton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Singleton + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Singleton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Struct.Encoding.Singleton"; + }; + + return Singleton; + })(); + + Encoding.DelimitedBytes = (function() { + + /** + * Properties of a DelimitedBytes. + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @interface IDelimitedBytes + * @property {Uint8Array|null} [delimiter] DelimitedBytes delimiter + */ + + /** + * Constructs a new DelimitedBytes. + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @classdesc Represents a DelimitedBytes. + * @implements IDelimitedBytes + * @constructor + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes=} [properties] Properties to set + */ + function DelimitedBytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DelimitedBytes delimiter. + * @member {Uint8Array} delimiter + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @instance + */ + DelimitedBytes.prototype.delimiter = $util.newBuffer([]); + + /** + * Creates a new DelimitedBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes instance + */ + DelimitedBytes.create = function create(properties) { + return new DelimitedBytes(properties); + }; + + /** + * Encodes the specified DelimitedBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes} message DelimitedBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelimitedBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.delimiter); + return writer; + }; + + /** + * Encodes the specified DelimitedBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes} message DelimitedBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelimitedBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelimitedBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.delimiter = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelimitedBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DelimitedBytes message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DelimitedBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + if (!(message.delimiter && typeof message.delimiter.length === "number" || $util.isString(message.delimiter))) + return "delimiter: buffer expected"; + return null; + }; + + /** + * Creates a DelimitedBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes + */ + DelimitedBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes(); + if (object.delimiter != null) + if (typeof object.delimiter === "string") + $util.base64.decode(object.delimiter, message.delimiter = $util.newBuffer($util.base64.length(object.delimiter)), 0); + else if (object.delimiter.length >= 0) + message.delimiter = object.delimiter; + return message; + }; + + /** + * Creates a plain object from a DelimitedBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes} message DelimitedBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DelimitedBytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.delimiter = ""; + else { + object.delimiter = []; + if (options.bytes !== Array) + object.delimiter = $util.newBuffer(object.delimiter); + } + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + object.delimiter = options.bytes === String ? $util.base64.encode(message.delimiter, 0, message.delimiter.length) : options.bytes === Array ? Array.prototype.slice.call(message.delimiter) : message.delimiter; + return object; + }; + + /** + * Converts this DelimitedBytes to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @instance + * @returns {Object.} JSON object + */ + DelimitedBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DelimitedBytes + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DelimitedBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes"; + }; + + return DelimitedBytes; + })(); + + Encoding.OrderedCodeBytes = (function() { + + /** + * Properties of an OrderedCodeBytes. + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @interface IOrderedCodeBytes + */ + + /** + * Constructs a new OrderedCodeBytes. + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @classdesc Represents an OrderedCodeBytes. + * @implements IOrderedCodeBytes + * @constructor + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes=} [properties] Properties to set + */ + function OrderedCodeBytes(properties) { + if (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 OrderedCodeBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes instance + */ + OrderedCodeBytes.create = function create(properties) { + return new OrderedCodeBytes(properties); + }; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrderedCodeBytes message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrderedCodeBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes + */ + OrderedCodeBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) + return object; + return new $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes(); + }; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes} message OrderedCodeBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrderedCodeBytes.toObject = function toObject() { + return {}; + }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @instance + * @returns {Object.} JSON object + */ + OrderedCodeBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrderedCodeBytes + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrderedCodeBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes"; + }; + + return OrderedCodeBytes; + })(); + + return Encoding; + })(); + + return Struct; + })(); + + Type.Proto = (function() { + + /** + * Properties of a Proto. + * @memberof google.bigtable.admin.v2.Type + * @interface IProto + * @property {string|null} [schemaBundleId] Proto schemaBundleId + * @property {string|null} [messageName] Proto messageName + */ + + /** + * Constructs a new Proto. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Proto. + * @implements IProto + * @constructor + * @param {google.bigtable.admin.v2.Type.IProto=} [properties] Properties to set + */ + function Proto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proto schemaBundleId. + * @member {string} schemaBundleId + * @memberof google.bigtable.admin.v2.Type.Proto + * @instance + */ + Proto.prototype.schemaBundleId = ""; + + /** + * Proto messageName. + * @member {string} messageName + * @memberof google.bigtable.admin.v2.Type.Proto + * @instance + */ + Proto.prototype.messageName = ""; + + /** + * Creates a new Proto instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {google.bigtable.admin.v2.Type.IProto=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Proto} Proto instance + */ + Proto.create = function create(properties) { + return new Proto(properties); + }; + + /** + * Encodes the specified Proto message. Does not implicitly {@link google.bigtable.admin.v2.Type.Proto.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {google.bigtable.admin.v2.Type.IProto} message Proto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schemaBundleId); + if (message.messageName != null && Object.hasOwnProperty.call(message, "messageName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.messageName); + return writer; + }; + + /** + * Encodes the specified Proto message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Proto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {google.bigtable.admin.v2.Type.IProto} message Proto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proto message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Proto} Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Proto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schemaBundleId = reader.string(); + break; + } + case 2: { + message.messageName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Proto} Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proto message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + if (!$util.isString(message.schemaBundleId)) + return "schemaBundleId: string expected"; + if (message.messageName != null && message.hasOwnProperty("messageName")) + if (!$util.isString(message.messageName)) + return "messageName: string expected"; + return null; + }; + + /** + * Creates a Proto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Proto} Proto + */ + Proto.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Proto) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Proto(); + if (object.schemaBundleId != null) + message.schemaBundleId = String(object.schemaBundleId); + if (object.messageName != null) + message.messageName = String(object.messageName); + return message; + }; + + /** + * Creates a plain object from a Proto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {google.bigtable.admin.v2.Type.Proto} message Proto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schemaBundleId = ""; + object.messageName = ""; + } + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + object.schemaBundleId = message.schemaBundleId; + if (message.messageName != null && message.hasOwnProperty("messageName")) + object.messageName = message.messageName; + return object; + }; + + /** + * Converts this Proto to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Proto + * @instance + * @returns {Object.} JSON object + */ + Proto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Proto + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Proto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Proto"; + }; + + return Proto; + })(); + + Type.Enum = (function() { + + /** + * Properties of an Enum. + * @memberof google.bigtable.admin.v2.Type + * @interface IEnum + * @property {string|null} [schemaBundleId] Enum schemaBundleId + * @property {string|null} [enumName] Enum enumName + */ + + /** + * Constructs a new Enum. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents an Enum. + * @implements IEnum + * @constructor + * @param {google.bigtable.admin.v2.Type.IEnum=} [properties] Properties to set + */ + function Enum(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Enum schemaBundleId. + * @member {string} schemaBundleId + * @memberof google.bigtable.admin.v2.Type.Enum + * @instance + */ + Enum.prototype.schemaBundleId = ""; + + /** + * Enum enumName. + * @member {string} enumName + * @memberof google.bigtable.admin.v2.Type.Enum + * @instance + */ + Enum.prototype.enumName = ""; + + /** + * Creates a new Enum instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {google.bigtable.admin.v2.Type.IEnum=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Enum} Enum instance + */ + Enum.create = function create(properties) { + return new Enum(properties); + }; + + /** + * Encodes the specified Enum message. Does not implicitly {@link google.bigtable.admin.v2.Type.Enum.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {google.bigtable.admin.v2.Type.IEnum} message Enum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Enum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schemaBundleId); + if (message.enumName != null && Object.hasOwnProperty.call(message, "enumName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.enumName); + return writer; + }; + + /** + * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Enum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {google.bigtable.admin.v2.Type.IEnum} message Enum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Enum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Enum message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Enum} Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Enum.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Enum(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schemaBundleId = reader.string(); + break; + } + case 2: { + message.enumName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Enum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Enum} Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Enum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Enum message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Enum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + if (!$util.isString(message.schemaBundleId)) + return "schemaBundleId: string expected"; + if (message.enumName != null && message.hasOwnProperty("enumName")) + if (!$util.isString(message.enumName)) + return "enumName: string expected"; + return null; + }; + + /** + * Creates an Enum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Enum} Enum + */ + Enum.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Enum) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Enum(); + if (object.schemaBundleId != null) + message.schemaBundleId = String(object.schemaBundleId); + if (object.enumName != null) + message.enumName = String(object.enumName); + return message; + }; + + /** + * Creates a plain object from an Enum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {google.bigtable.admin.v2.Type.Enum} message Enum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Enum.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schemaBundleId = ""; + object.enumName = ""; + } + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + object.schemaBundleId = message.schemaBundleId; + if (message.enumName != null && message.hasOwnProperty("enumName")) + object.enumName = message.enumName; + return object; + }; + + /** + * Converts this Enum to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Enum + * @instance + * @returns {Object.} JSON object + */ + Enum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Enum + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Enum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Enum"; + }; + + return Enum; + })(); + + Type.Array = (function() { + + /** + * Properties of an Array. + * @memberof google.bigtable.admin.v2.Type + * @interface IArray + * @property {google.bigtable.admin.v2.IType|null} [elementType] Array elementType + */ + + /** + * Constructs a new Array. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents an Array. + * @implements IArray + * @constructor + * @param {google.bigtable.admin.v2.Type.IArray=} [properties] Properties to set + */ + function Array(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Array elementType. + * @member {google.bigtable.admin.v2.IType|null|undefined} elementType + * @memberof google.bigtable.admin.v2.Type.Array + * @instance + */ + Array.prototype.elementType = null; + + /** + * Creates a new Array instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {google.bigtable.admin.v2.Type.IArray=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Array} Array instance + */ + Array.create = function create(properties) { + return new Array(properties); + }; + + /** + * Encodes the specified Array message. Does not implicitly {@link google.bigtable.admin.v2.Type.Array.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {google.bigtable.admin.v2.Type.IArray} message Array message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Array.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.elementType != null && Object.hasOwnProperty.call(message, "elementType")) + $root.google.bigtable.admin.v2.Type.encode(message.elementType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Array message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Array.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {google.bigtable.admin.v2.Type.IArray} message Array message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Array.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Array message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Array} Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Array.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Array(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.elementType = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Array message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Array} Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Array.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Array message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Array.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.elementType != null && message.hasOwnProperty("elementType")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.elementType); + if (error) + return "elementType." + error; + } + return null; + }; + + /** + * Creates an Array message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Array} Array + */ + Array.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Array) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Array(); + if (object.elementType != null) { + if (typeof object.elementType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Array.elementType: object expected"); + message.elementType = $root.google.bigtable.admin.v2.Type.fromObject(object.elementType); + } + return message; + }; + + /** + * Creates a plain object from an Array message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {google.bigtable.admin.v2.Type.Array} message Array + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Array.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.elementType = null; + if (message.elementType != null && message.hasOwnProperty("elementType")) + object.elementType = $root.google.bigtable.admin.v2.Type.toObject(message.elementType, options); + return object; + }; + + /** + * Converts this Array to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Array + * @instance + * @returns {Object.} JSON object + */ + Array.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Array + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Array.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Array"; + }; + + return Array; + })(); + + Type.Map = (function() { + + /** + * Properties of a Map. + * @memberof google.bigtable.admin.v2.Type + * @interface IMap + * @property {google.bigtable.admin.v2.IType|null} [keyType] Map keyType + * @property {google.bigtable.admin.v2.IType|null} [valueType] Map valueType + */ + + /** + * Constructs a new Map. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Map. + * @implements IMap + * @constructor + * @param {google.bigtable.admin.v2.Type.IMap=} [properties] Properties to set + */ + function Map(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Map keyType. + * @member {google.bigtable.admin.v2.IType|null|undefined} keyType + * @memberof google.bigtable.admin.v2.Type.Map + * @instance + */ + Map.prototype.keyType = null; + + /** + * Map valueType. + * @member {google.bigtable.admin.v2.IType|null|undefined} valueType + * @memberof google.bigtable.admin.v2.Type.Map + * @instance + */ + Map.prototype.valueType = null; + + /** + * Creates a new Map instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {google.bigtable.admin.v2.Type.IMap=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Map} Map instance + */ + Map.create = function create(properties) { + return new Map(properties); + }; + + /** + * Encodes the specified Map message. Does not implicitly {@link google.bigtable.admin.v2.Type.Map.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {google.bigtable.admin.v2.Type.IMap} message Map message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Map.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyType != null && Object.hasOwnProperty.call(message, "keyType")) + $root.google.bigtable.admin.v2.Type.encode(message.keyType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + $root.google.bigtable.admin.v2.Type.encode(message.valueType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Map message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Map.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {google.bigtable.admin.v2.Type.IMap} message Map message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Map.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Map message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Map} Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Map.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Map(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyType = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + case 2: { + message.valueType = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Map message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Map} Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Map.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Map message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Map.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyType != null && message.hasOwnProperty("keyType")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.keyType); + if (error) + return "keyType." + error; + } + if (message.valueType != null && message.hasOwnProperty("valueType")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.valueType); + if (error) + return "valueType." + error; + } + return null; + }; + + /** + * Creates a Map message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Map} Map + */ + Map.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Map) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Map(); + if (object.keyType != null) { + if (typeof object.keyType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Map.keyType: object expected"); + message.keyType = $root.google.bigtable.admin.v2.Type.fromObject(object.keyType); + } + if (object.valueType != null) { + if (typeof object.valueType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Map.valueType: object expected"); + message.valueType = $root.google.bigtable.admin.v2.Type.fromObject(object.valueType); + } + return message; + }; + + /** + * Creates a plain object from a Map message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {google.bigtable.admin.v2.Type.Map} message Map + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Map.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyType = null; + object.valueType = null; + } + if (message.keyType != null && message.hasOwnProperty("keyType")) + object.keyType = $root.google.bigtable.admin.v2.Type.toObject(message.keyType, options); + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = $root.google.bigtable.admin.v2.Type.toObject(message.valueType, options); + return object; + }; + + /** + * Converts this Map to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Map + * @instance + * @returns {Object.} JSON object + */ + Map.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Map + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Map.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Map"; + }; + + return Map; + })(); + + Type.Aggregate = (function() { + + /** + * Properties of an Aggregate. + * @memberof google.bigtable.admin.v2.Type + * @interface IAggregate + * @property {google.bigtable.admin.v2.IType|null} [inputType] Aggregate inputType + * @property {google.bigtable.admin.v2.IType|null} [stateType] Aggregate stateType + * @property {google.bigtable.admin.v2.Type.Aggregate.ISum|null} [sum] Aggregate sum + * @property {google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null} [hllppUniqueCount] Aggregate hllppUniqueCount + * @property {google.bigtable.admin.v2.Type.Aggregate.IMax|null} [max] Aggregate max + * @property {google.bigtable.admin.v2.Type.Aggregate.IMin|null} [min] Aggregate min + */ + + /** + * Constructs a new Aggregate. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents an Aggregate. + * @implements IAggregate + * @constructor + * @param {google.bigtable.admin.v2.Type.IAggregate=} [properties] Properties to set + */ + function Aggregate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Aggregate inputType. + * @member {google.bigtable.admin.v2.IType|null|undefined} inputType + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.inputType = null; + + /** + * Aggregate stateType. + * @member {google.bigtable.admin.v2.IType|null|undefined} stateType + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.stateType = null; + + /** + * Aggregate sum. + * @member {google.bigtable.admin.v2.Type.Aggregate.ISum|null|undefined} sum + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.sum = null; + + /** + * Aggregate hllppUniqueCount. + * @member {google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null|undefined} hllppUniqueCount + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.hllppUniqueCount = null; + + /** + * Aggregate max. + * @member {google.bigtable.admin.v2.Type.Aggregate.IMax|null|undefined} max + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.max = null; + + /** + * Aggregate min. + * @member {google.bigtable.admin.v2.Type.Aggregate.IMin|null|undefined} min + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.min = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Aggregate aggregator. + * @member {"sum"|"hllppUniqueCount"|"max"|"min"|undefined} aggregator + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Object.defineProperty(Aggregate.prototype, "aggregator", { + get: $util.oneOfGetter($oneOfFields = ["sum", "hllppUniqueCount", "max", "min"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Aggregate instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {google.bigtable.admin.v2.Type.IAggregate=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Aggregate} Aggregate instance + */ + Aggregate.create = function create(properties) { + return new Aggregate(properties); + }; + + /** + * Encodes the specified Aggregate message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {google.bigtable.admin.v2.Type.IAggregate} message Aggregate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + $root.google.bigtable.admin.v2.Type.encode(message.inputType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateType != null && Object.hasOwnProperty.call(message, "stateType")) + $root.google.bigtable.admin.v2.Type.encode(message.stateType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + $root.google.bigtable.admin.v2.Type.Aggregate.Sum.encode(message.sum, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hllppUniqueCount != null && Object.hasOwnProperty.call(message, "hllppUniqueCount")) + $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.encode(message.hllppUniqueCount, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + $root.google.bigtable.admin.v2.Type.Aggregate.Max.encode(message.max, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + $root.google.bigtable.admin.v2.Type.Aggregate.Min.encode(message.min, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Aggregate message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {google.bigtable.admin.v2.Type.IAggregate} message Aggregate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Aggregate message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Aggregate} Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Aggregate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputType = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stateType = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + case 4: { + message.sum = $root.google.bigtable.admin.v2.Type.Aggregate.Sum.decode(reader, reader.uint32()); + break; + } + case 5: { + message.hllppUniqueCount = $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.decode(reader, reader.uint32()); + break; + } + case 6: { + message.max = $root.google.bigtable.admin.v2.Type.Aggregate.Max.decode(reader, reader.uint32()); + break; + } + case 7: { + message.min = $root.google.bigtable.admin.v2.Type.Aggregate.Min.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Aggregate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Aggregate} Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Aggregate message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Aggregate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inputType != null && message.hasOwnProperty("inputType")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.inputType); + if (error) + return "inputType." + error; + } + if (message.stateType != null && message.hasOwnProperty("stateType")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.stateType); + if (error) + return "stateType." + error; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + properties.aggregator = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Aggregate.Sum.verify(message.sum); + if (error) + return "sum." + error; + } + } + if (message.hllppUniqueCount != null && message.hasOwnProperty("hllppUniqueCount")) { + if (properties.aggregator === 1) + return "aggregator: multiple values"; + properties.aggregator = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify(message.hllppUniqueCount); + if (error) + return "hllppUniqueCount." + error; + } + } + if (message.max != null && message.hasOwnProperty("max")) { + if (properties.aggregator === 1) + return "aggregator: multiple values"; + properties.aggregator = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Aggregate.Max.verify(message.max); + if (error) + return "max." + error; + } + } + if (message.min != null && message.hasOwnProperty("min")) { + if (properties.aggregator === 1) + return "aggregator: multiple values"; + properties.aggregator = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Aggregate.Min.verify(message.min); + if (error) + return "min." + error; + } + } + return null; + }; + + /** + * Creates an Aggregate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Aggregate} Aggregate + */ + Aggregate.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Aggregate) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Aggregate(); + if (object.inputType != null) { + if (typeof object.inputType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Aggregate.inputType: object expected"); + message.inputType = $root.google.bigtable.admin.v2.Type.fromObject(object.inputType); + } + if (object.stateType != null) { + if (typeof object.stateType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Aggregate.stateType: object expected"); + message.stateType = $root.google.bigtable.admin.v2.Type.fromObject(object.stateType); + } + if (object.sum != null) { + if (typeof object.sum !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Aggregate.sum: object expected"); + message.sum = $root.google.bigtable.admin.v2.Type.Aggregate.Sum.fromObject(object.sum); + } + if (object.hllppUniqueCount != null) { + if (typeof object.hllppUniqueCount !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Aggregate.hllppUniqueCount: object expected"); + message.hllppUniqueCount = $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.fromObject(object.hllppUniqueCount); + } + if (object.max != null) { + if (typeof object.max !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Aggregate.max: object expected"); + message.max = $root.google.bigtable.admin.v2.Type.Aggregate.Max.fromObject(object.max); + } + if (object.min != null) { + if (typeof object.min !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Aggregate.min: object expected"); + message.min = $root.google.bigtable.admin.v2.Type.Aggregate.Min.fromObject(object.min); + } + return message; + }; + + /** + * Creates a plain object from an Aggregate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate} message Aggregate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Aggregate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputType = null; + object.stateType = null; + } + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = $root.google.bigtable.admin.v2.Type.toObject(message.inputType, options); + if (message.stateType != null && message.hasOwnProperty("stateType")) + object.stateType = $root.google.bigtable.admin.v2.Type.toObject(message.stateType, options); + if (message.sum != null && message.hasOwnProperty("sum")) { + object.sum = $root.google.bigtable.admin.v2.Type.Aggregate.Sum.toObject(message.sum, options); + if (options.oneofs) + object.aggregator = "sum"; + } + if (message.hllppUniqueCount != null && message.hasOwnProperty("hllppUniqueCount")) { + object.hllppUniqueCount = $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.toObject(message.hllppUniqueCount, options); + if (options.oneofs) + object.aggregator = "hllppUniqueCount"; + } + if (message.max != null && message.hasOwnProperty("max")) { + object.max = $root.google.bigtable.admin.v2.Type.Aggregate.Max.toObject(message.max, options); + if (options.oneofs) + object.aggregator = "max"; + } + if (message.min != null && message.hasOwnProperty("min")) { + object.min = $root.google.bigtable.admin.v2.Type.Aggregate.Min.toObject(message.min, options); + if (options.oneofs) + object.aggregator = "min"; + } + return object; + }; + + /** + * Converts this Aggregate to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + * @returns {Object.} JSON object + */ + Aggregate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Aggregate + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Aggregate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Aggregate"; + }; + + Aggregate.Sum = (function() { + + /** + * Properties of a Sum. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @interface ISum + */ + + /** + * Constructs a new Sum. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @classdesc Represents a Sum. + * @implements ISum + * @constructor + * @param {google.bigtable.admin.v2.Type.Aggregate.ISum=} [properties] Properties to set + */ + function Sum(properties) { + if (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 Sum instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.ISum=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Aggregate.Sum} Sum instance + */ + Sum.create = function create(properties) { + return new Sum(properties); + }; + + /** + * Encodes the specified Sum message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Sum.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Sum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sum message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Aggregate.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Aggregate.Sum(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Aggregate.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sum message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Aggregate.Sum} Sum + */ + Sum.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Aggregate.Sum) + return object; + return new $root.google.bigtable.admin.v2.Type.Aggregate.Sum(); + }; + + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.Sum} message Sum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sum.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Sum to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @instance + * @returns {Object.} JSON object + */ + Sum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Sum + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Aggregate.Sum"; + }; + + return Sum; + })(); + + Aggregate.Max = (function() { + + /** + * Properties of a Max. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @interface IMax + */ + + /** + * Constructs a new Max. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @classdesc Represents a Max. + * @implements IMax + * @constructor + * @param {google.bigtable.admin.v2.Type.Aggregate.IMax=} [properties] Properties to set + */ + function Max(properties) { + if (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 Max instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IMax=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Aggregate.Max} Max instance + */ + Max.create = function create(properties) { + return new Max(properties); + }; + + /** + * Encodes the specified Max message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Max.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IMax} message Max message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Max.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Max message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Max.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IMax} message Max message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Max.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Max message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Aggregate.Max} Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Max.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Aggregate.Max(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Max message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Aggregate.Max} Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Max.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Max message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Max.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Max message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Aggregate.Max} Max + */ + Max.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Aggregate.Max) + return object; + return new $root.google.bigtable.admin.v2.Type.Aggregate.Max(); + }; + + /** + * Creates a plain object from a Max message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.Max} message Max + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Max.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Max to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @instance + * @returns {Object.} JSON object + */ + Max.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Max + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Max.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Aggregate.Max"; + }; + + return Max; + })(); + + Aggregate.Min = (function() { + + /** + * Properties of a Min. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @interface IMin + */ + + /** + * Constructs a new Min. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @classdesc Represents a Min. + * @implements IMin + * @constructor + * @param {google.bigtable.admin.v2.Type.Aggregate.IMin=} [properties] Properties to set + */ + function Min(properties) { + if (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 Min instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IMin=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Aggregate.Min} Min instance + */ + Min.create = function create(properties) { + return new Min(properties); + }; + + /** + * Encodes the specified Min message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Min.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IMin} message Min message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Min.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Min message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Min.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IMin} message Min message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Min.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Min message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Aggregate.Min} Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Min.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Aggregate.Min(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Min message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Aggregate.Min} Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Min.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Min message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Min.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Min message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Aggregate.Min} Min + */ + Min.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Aggregate.Min) + return object; + return new $root.google.bigtable.admin.v2.Type.Aggregate.Min(); + }; + + /** + * Creates a plain object from a Min message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.Min} message Min + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Min.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Min to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @instance + * @returns {Object.} JSON object + */ + Min.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Min + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Min.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Aggregate.Min"; + }; + + return Min; + })(); + + Aggregate.HyperLogLogPlusPlusUniqueCount = (function() { + + /** + * Properties of a HyperLogLogPlusPlusUniqueCount. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @interface IHyperLogLogPlusPlusUniqueCount + */ + + /** + * Constructs a new HyperLogLogPlusPlusUniqueCount. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @classdesc Represents a HyperLogLogPlusPlusUniqueCount. + * @implements IHyperLogLogPlusPlusUniqueCount + * @constructor + * @param {google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount=} [properties] Properties to set + */ + function HyperLogLogPlusPlusUniqueCount(properties) { + if (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 HyperLogLogPlusPlusUniqueCount instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount instance + */ + HyperLogLogPlusPlusUniqueCount.create = function create(properties) { + return new HyperLogLogPlusPlusUniqueCount(properties); + }; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount} message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HyperLogLogPlusPlusUniqueCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount} message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HyperLogLogPlusPlusUniqueCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HyperLogLogPlusPlusUniqueCount.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HyperLogLogPlusPlusUniqueCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HyperLogLogPlusPlusUniqueCount message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HyperLogLogPlusPlusUniqueCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a HyperLogLogPlusPlusUniqueCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount + */ + HyperLogLogPlusPlusUniqueCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + return object; + return new $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount(); + }; + + /** + * Creates a plain object from a HyperLogLogPlusPlusUniqueCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} message HyperLogLogPlusPlusUniqueCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HyperLogLogPlusPlusUniqueCount.toObject = function toObject() { + return {}; + }; + + /** + * Converts this HyperLogLogPlusPlusUniqueCount to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @instance + * @returns {Object.} JSON object + */ + HyperLogLogPlusPlusUniqueCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HyperLogLogPlusPlusUniqueCount + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HyperLogLogPlusPlusUniqueCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount"; + }; + + return HyperLogLogPlusPlusUniqueCount; + })(); + + return Aggregate; + })(); + + return Type; + })(); + + return v2; + })(); + + return admin; + })(); + + bigtable.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.bigtable + * @namespace + */ + var v2 = {}; + + v2.Bigtable = (function() { + + /** + * Constructs a new Bigtable service. + * @memberof google.bigtable.v2 + * @classdesc Represents a Bigtable + * @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 Bigtable(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Bigtable.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Bigtable; + + /** + * Creates new Bigtable service using the specified rpc implementation. + * @function create + * @memberof google.bigtable.v2.Bigtable + * @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 {Bigtable} RPC service. Useful where requests and/or responses are streamed. + */ + Bigtable.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|readRows}. + * @memberof google.bigtable.v2.Bigtable + * @typedef ReadRowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.ReadRowsResponse} [response] ReadRowsResponse + */ + + /** + * Calls ReadRows. + * @function readRows + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IReadRowsRequest} request ReadRowsRequest message or plain object + * @param {google.bigtable.v2.Bigtable.ReadRowsCallback} callback Node-style callback called with the error, if any, and ReadRowsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.readRows = function readRows(request, callback) { + return this.rpcCall(readRows, $root.google.bigtable.v2.ReadRowsRequest, $root.google.bigtable.v2.ReadRowsResponse, request, callback); + }, "name", { value: "ReadRows" }); + + /** + * Calls ReadRows. + * @function readRows + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IReadRowsRequest} request ReadRowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|sampleRowKeys}. + * @memberof google.bigtable.v2.Bigtable + * @typedef SampleRowKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.SampleRowKeysResponse} [response] SampleRowKeysResponse + */ + + /** + * Calls SampleRowKeys. + * @function sampleRowKeys + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.ISampleRowKeysRequest} request SampleRowKeysRequest message or plain object + * @param {google.bigtable.v2.Bigtable.SampleRowKeysCallback} callback Node-style callback called with the error, if any, and SampleRowKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.sampleRowKeys = function sampleRowKeys(request, callback) { + return this.rpcCall(sampleRowKeys, $root.google.bigtable.v2.SampleRowKeysRequest, $root.google.bigtable.v2.SampleRowKeysResponse, request, callback); + }, "name", { value: "SampleRowKeys" }); + + /** + * Calls SampleRowKeys. + * @function sampleRowKeys + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.ISampleRowKeysRequest} request SampleRowKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|mutateRow}. + * @memberof google.bigtable.v2.Bigtable + * @typedef MutateRowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.MutateRowResponse} [response] MutateRowResponse + */ + + /** + * Calls MutateRow. + * @function mutateRow + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IMutateRowRequest} request MutateRowRequest message or plain object + * @param {google.bigtable.v2.Bigtable.MutateRowCallback} callback Node-style callback called with the error, if any, and MutateRowResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.mutateRow = function mutateRow(request, callback) { + return this.rpcCall(mutateRow, $root.google.bigtable.v2.MutateRowRequest, $root.google.bigtable.v2.MutateRowResponse, request, callback); + }, "name", { value: "MutateRow" }); + + /** + * Calls MutateRow. + * @function mutateRow + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IMutateRowRequest} request MutateRowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|mutateRows}. + * @memberof google.bigtable.v2.Bigtable + * @typedef MutateRowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.MutateRowsResponse} [response] MutateRowsResponse + */ + + /** + * Calls MutateRows. + * @function mutateRows + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IMutateRowsRequest} request MutateRowsRequest message or plain object + * @param {google.bigtable.v2.Bigtable.MutateRowsCallback} callback Node-style callback called with the error, if any, and MutateRowsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.mutateRows = function mutateRows(request, callback) { + return this.rpcCall(mutateRows, $root.google.bigtable.v2.MutateRowsRequest, $root.google.bigtable.v2.MutateRowsResponse, request, callback); + }, "name", { value: "MutateRows" }); + + /** + * Calls MutateRows. + * @function mutateRows + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IMutateRowsRequest} request MutateRowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|checkAndMutateRow}. + * @memberof google.bigtable.v2.Bigtable + * @typedef CheckAndMutateRowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.CheckAndMutateRowResponse} [response] CheckAndMutateRowResponse + */ + + /** + * Calls CheckAndMutateRow. + * @function checkAndMutateRow + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.ICheckAndMutateRowRequest} request CheckAndMutateRowRequest message or plain object + * @param {google.bigtable.v2.Bigtable.CheckAndMutateRowCallback} callback Node-style callback called with the error, if any, and CheckAndMutateRowResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.checkAndMutateRow = function checkAndMutateRow(request, callback) { + return this.rpcCall(checkAndMutateRow, $root.google.bigtable.v2.CheckAndMutateRowRequest, $root.google.bigtable.v2.CheckAndMutateRowResponse, request, callback); + }, "name", { value: "CheckAndMutateRow" }); + + /** + * Calls CheckAndMutateRow. + * @function checkAndMutateRow + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.ICheckAndMutateRowRequest} request CheckAndMutateRowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|pingAndWarm}. + * @memberof google.bigtable.v2.Bigtable + * @typedef PingAndWarmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.PingAndWarmResponse} [response] PingAndWarmResponse + */ + + /** + * Calls PingAndWarm. + * @function pingAndWarm + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IPingAndWarmRequest} request PingAndWarmRequest message or plain object + * @param {google.bigtable.v2.Bigtable.PingAndWarmCallback} callback Node-style callback called with the error, if any, and PingAndWarmResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.pingAndWarm = function pingAndWarm(request, callback) { + return this.rpcCall(pingAndWarm, $root.google.bigtable.v2.PingAndWarmRequest, $root.google.bigtable.v2.PingAndWarmResponse, request, callback); + }, "name", { value: "PingAndWarm" }); + + /** + * Calls PingAndWarm. + * @function pingAndWarm + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IPingAndWarmRequest} request PingAndWarmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|readModifyWriteRow}. + * @memberof google.bigtable.v2.Bigtable + * @typedef ReadModifyWriteRowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.ReadModifyWriteRowResponse} [response] ReadModifyWriteRowResponse + */ + + /** + * Calls ReadModifyWriteRow. + * @function readModifyWriteRow + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IReadModifyWriteRowRequest} request ReadModifyWriteRowRequest message or plain object + * @param {google.bigtable.v2.Bigtable.ReadModifyWriteRowCallback} callback Node-style callback called with the error, if any, and ReadModifyWriteRowResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.readModifyWriteRow = function readModifyWriteRow(request, callback) { + return this.rpcCall(readModifyWriteRow, $root.google.bigtable.v2.ReadModifyWriteRowRequest, $root.google.bigtable.v2.ReadModifyWriteRowResponse, request, callback); + }, "name", { value: "ReadModifyWriteRow" }); + + /** + * Calls ReadModifyWriteRow. + * @function readModifyWriteRow + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IReadModifyWriteRowRequest} request ReadModifyWriteRowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|generateInitialChangeStreamPartitions}. + * @memberof google.bigtable.v2.Bigtable + * @typedef GenerateInitialChangeStreamPartitionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} [response] GenerateInitialChangeStreamPartitionsResponse + */ + + /** + * Calls GenerateInitialChangeStreamPartitions. + * @function generateInitialChangeStreamPartitions + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest} request GenerateInitialChangeStreamPartitionsRequest message or plain object + * @param {google.bigtable.v2.Bigtable.GenerateInitialChangeStreamPartitionsCallback} callback Node-style callback called with the error, if any, and GenerateInitialChangeStreamPartitionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.generateInitialChangeStreamPartitions = function generateInitialChangeStreamPartitions(request, callback) { + return this.rpcCall(generateInitialChangeStreamPartitions, $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest, $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse, request, callback); + }, "name", { value: "GenerateInitialChangeStreamPartitions" }); + + /** + * Calls GenerateInitialChangeStreamPartitions. + * @function generateInitialChangeStreamPartitions + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest} request GenerateInitialChangeStreamPartitionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|readChangeStream}. + * @memberof google.bigtable.v2.Bigtable + * @typedef ReadChangeStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.ReadChangeStreamResponse} [response] ReadChangeStreamResponse + */ + + /** + * Calls ReadChangeStream. + * @function readChangeStream + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IReadChangeStreamRequest} request ReadChangeStreamRequest message or plain object + * @param {google.bigtable.v2.Bigtable.ReadChangeStreamCallback} callback Node-style callback called with the error, if any, and ReadChangeStreamResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.readChangeStream = function readChangeStream(request, callback) { + return this.rpcCall(readChangeStream, $root.google.bigtable.v2.ReadChangeStreamRequest, $root.google.bigtable.v2.ReadChangeStreamResponse, request, callback); + }, "name", { value: "ReadChangeStream" }); + + /** + * Calls ReadChangeStream. + * @function readChangeStream + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IReadChangeStreamRequest} request ReadChangeStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|prepareQuery}. + * @memberof google.bigtable.v2.Bigtable + * @typedef PrepareQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.PrepareQueryResponse} [response] PrepareQueryResponse + */ + + /** + * Calls PrepareQuery. + * @function prepareQuery + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IPrepareQueryRequest} request PrepareQueryRequest message or plain object + * @param {google.bigtable.v2.Bigtable.PrepareQueryCallback} callback Node-style callback called with the error, if any, and PrepareQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.prepareQuery = function prepareQuery(request, callback) { + return this.rpcCall(prepareQuery, $root.google.bigtable.v2.PrepareQueryRequest, $root.google.bigtable.v2.PrepareQueryResponse, request, callback); + }, "name", { value: "PrepareQuery" }); + + /** + * Calls PrepareQuery. + * @function prepareQuery + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IPrepareQueryRequest} request PrepareQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|executeQuery}. + * @memberof google.bigtable.v2.Bigtable + * @typedef ExecuteQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.ExecuteQueryResponse} [response] ExecuteQueryResponse + */ + + /** + * Calls ExecuteQuery. + * @function executeQuery + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IExecuteQueryRequest} request ExecuteQueryRequest message or plain object + * @param {google.bigtable.v2.Bigtable.ExecuteQueryCallback} callback Node-style callback called with the error, if any, and ExecuteQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.executeQuery = function executeQuery(request, callback) { + return this.rpcCall(executeQuery, $root.google.bigtable.v2.ExecuteQueryRequest, $root.google.bigtable.v2.ExecuteQueryResponse, request, callback); + }, "name", { value: "ExecuteQuery" }); + + /** + * Calls ExecuteQuery. + * @function executeQuery + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IExecuteQueryRequest} request ExecuteQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Bigtable; + })(); + + v2.ReadRowsRequest = (function() { + + /** + * Properties of a ReadRowsRequest. + * @memberof google.bigtable.v2 + * @interface IReadRowsRequest + * @property {string|null} [tableName] ReadRowsRequest tableName + * @property {string|null} [authorizedViewName] ReadRowsRequest authorizedViewName + * @property {string|null} [materializedViewName] ReadRowsRequest materializedViewName + * @property {string|null} [appProfileId] ReadRowsRequest appProfileId + * @property {google.bigtable.v2.IRowSet|null} [rows] ReadRowsRequest rows + * @property {google.bigtable.v2.IRowFilter|null} [filter] ReadRowsRequest filter + * @property {number|Long|null} [rowsLimit] ReadRowsRequest rowsLimit + * @property {google.bigtable.v2.ReadRowsRequest.RequestStatsView|null} [requestStatsView] ReadRowsRequest requestStatsView + * @property {boolean|null} [reversed] ReadRowsRequest reversed + */ + + /** + * Constructs a new ReadRowsRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadRowsRequest. + * @implements IReadRowsRequest + * @constructor + * @param {google.bigtable.v2.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 tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.tableName = ""; + + /** + * ReadRowsRequest authorizedViewName. + * @member {string} authorizedViewName + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.authorizedViewName = ""; + + /** + * ReadRowsRequest materializedViewName. + * @member {string} materializedViewName + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.materializedViewName = ""; + + /** + * ReadRowsRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.appProfileId = ""; + + /** + * ReadRowsRequest rows. + * @member {google.bigtable.v2.IRowSet|null|undefined} rows + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.rows = null; + + /** + * ReadRowsRequest filter. + * @member {google.bigtable.v2.IRowFilter|null|undefined} filter + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.filter = null; + + /** + * ReadRowsRequest rowsLimit. + * @member {number|Long} rowsLimit + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.rowsLimit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadRowsRequest requestStatsView. + * @member {google.bigtable.v2.ReadRowsRequest.RequestStatsView} requestStatsView + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.requestStatsView = 0; + + /** + * ReadRowsRequest reversed. + * @member {boolean} reversed + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.reversed = false; + + /** + * Creates a new ReadRowsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadRowsRequest + * @static + * @param {google.bigtable.v2.IReadRowsRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadRowsRequest} ReadRowsRequest instance + */ + ReadRowsRequest.create = function create(properties) { + return new ReadRowsRequest(properties); + }; + + /** + * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.bigtable.v2.ReadRowsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadRowsRequest + * @static + * @param {google.bigtable.v2.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.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.rows != null && Object.hasOwnProperty.call(message, "rows")) + $root.google.bigtable.v2.RowSet.encode(message.rows, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.bigtable.v2.RowFilter.encode(message.filter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rowsLimit != null && Object.hasOwnProperty.call(message, "rowsLimit")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.rowsLimit); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.appProfileId); + if (message.requestStatsView != null && Object.hasOwnProperty.call(message, "requestStatsView")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.requestStatsView); + if (message.reversed != null && Object.hasOwnProperty.call(message, "reversed")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.reversed); + if (message.authorizedViewName != null && Object.hasOwnProperty.call(message, "authorizedViewName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.authorizedViewName); + if (message.materializedViewName != null && Object.hasOwnProperty.call(message, "materializedViewName")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.materializedViewName); + return writer; + }; + + /** + * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadRowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadRowsRequest + * @static + * @param {google.bigtable.v2.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.bigtable.v2.ReadRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadRowsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 9: { + message.authorizedViewName = reader.string(); + break; + } + case 11: { + message.materializedViewName = reader.string(); + break; + } + case 5: { + message.appProfileId = reader.string(); + break; + } + case 2: { + message.rows = $root.google.bigtable.v2.RowSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.filter = $root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32()); + break; + } + case 4: { + message.rowsLimit = reader.int64(); + break; + } + case 6: { + message.requestStatsView = reader.int32(); + break; + } + case 7: { + message.reversed = reader.bool(); + 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.bigtable.v2.ReadRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.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.bigtable.v2.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.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + if (!$util.isString(message.authorizedViewName)) + return "authorizedViewName: string expected"; + if (message.materializedViewName != null && message.hasOwnProperty("materializedViewName")) + if (!$util.isString(message.materializedViewName)) + return "materializedViewName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.rows != null && message.hasOwnProperty("rows")) { + var error = $root.google.bigtable.v2.RowSet.verify(message.rows); + if (error) + return "rows." + error; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.filter); + if (error) + return "filter." + error; + } + if (message.rowsLimit != null && message.hasOwnProperty("rowsLimit")) + if (!$util.isInteger(message.rowsLimit) && !(message.rowsLimit && $util.isInteger(message.rowsLimit.low) && $util.isInteger(message.rowsLimit.high))) + return "rowsLimit: integer|Long expected"; + if (message.requestStatsView != null && message.hasOwnProperty("requestStatsView")) + switch (message.requestStatsView) { + default: + return "requestStatsView: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.reversed != null && message.hasOwnProperty("reversed")) + if (typeof message.reversed !== "boolean") + return "reversed: boolean expected"; + return null; + }; + + /** + * Creates a ReadRowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadRowsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadRowsRequest} ReadRowsRequest + */ + ReadRowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadRowsRequest) + return object; + var message = new $root.google.bigtable.v2.ReadRowsRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.authorizedViewName != null) + message.authorizedViewName = String(object.authorizedViewName); + if (object.materializedViewName != null) + message.materializedViewName = String(object.materializedViewName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.rows != null) { + if (typeof object.rows !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsRequest.rows: object expected"); + message.rows = $root.google.bigtable.v2.RowSet.fromObject(object.rows); + } + if (object.filter != null) { + if (typeof object.filter !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsRequest.filter: object expected"); + message.filter = $root.google.bigtable.v2.RowFilter.fromObject(object.filter); + } + if (object.rowsLimit != null) + if ($util.Long) + (message.rowsLimit = $util.Long.fromValue(object.rowsLimit)).unsigned = false; + else if (typeof object.rowsLimit === "string") + message.rowsLimit = parseInt(object.rowsLimit, 10); + else if (typeof object.rowsLimit === "number") + message.rowsLimit = object.rowsLimit; + else if (typeof object.rowsLimit === "object") + message.rowsLimit = new $util.LongBits(object.rowsLimit.low >>> 0, object.rowsLimit.high >>> 0).toNumber(); + switch (object.requestStatsView) { + default: + if (typeof object.requestStatsView === "number") { + message.requestStatsView = object.requestStatsView; + break; + } + break; + case "REQUEST_STATS_VIEW_UNSPECIFIED": + case 0: + message.requestStatsView = 0; + break; + case "REQUEST_STATS_NONE": + case 1: + message.requestStatsView = 1; + break; + case "REQUEST_STATS_FULL": + case 2: + message.requestStatsView = 2; + break; + } + if (object.reversed != null) + message.reversed = Boolean(object.reversed); + return message; + }; + + /** + * Creates a plain object from a ReadRowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadRowsRequest + * @static + * @param {google.bigtable.v2.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.tableName = ""; + object.rows = null; + object.filter = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowsLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowsLimit = options.longs === String ? "0" : 0; + object.appProfileId = ""; + object.requestStatsView = options.enums === String ? "REQUEST_STATS_VIEW_UNSPECIFIED" : 0; + object.reversed = false; + object.authorizedViewName = ""; + object.materializedViewName = ""; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.rows != null && message.hasOwnProperty("rows")) + object.rows = $root.google.bigtable.v2.RowSet.toObject(message.rows, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = $root.google.bigtable.v2.RowFilter.toObject(message.filter, options); + if (message.rowsLimit != null && message.hasOwnProperty("rowsLimit")) + if (typeof message.rowsLimit === "number") + object.rowsLimit = options.longs === String ? String(message.rowsLimit) : message.rowsLimit; + else + object.rowsLimit = options.longs === String ? $util.Long.prototype.toString.call(message.rowsLimit) : options.longs === Number ? new $util.LongBits(message.rowsLimit.low >>> 0, message.rowsLimit.high >>> 0).toNumber() : message.rowsLimit; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.requestStatsView != null && message.hasOwnProperty("requestStatsView")) + object.requestStatsView = options.enums === String ? $root.google.bigtable.v2.ReadRowsRequest.RequestStatsView[message.requestStatsView] === undefined ? message.requestStatsView : $root.google.bigtable.v2.ReadRowsRequest.RequestStatsView[message.requestStatsView] : message.requestStatsView; + if (message.reversed != null && message.hasOwnProperty("reversed")) + object.reversed = message.reversed; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + object.authorizedViewName = message.authorizedViewName; + if (message.materializedViewName != null && message.hasOwnProperty("materializedViewName")) + object.materializedViewName = message.materializedViewName; + return object; + }; + + /** + * Converts this ReadRowsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + * @returns {Object.} JSON object + */ + ReadRowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadRowsRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadRowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadRowsRequest"; + }; + + /** + * RequestStatsView enum. + * @name google.bigtable.v2.ReadRowsRequest.RequestStatsView + * @enum {number} + * @property {number} REQUEST_STATS_VIEW_UNSPECIFIED=0 REQUEST_STATS_VIEW_UNSPECIFIED value + * @property {number} REQUEST_STATS_NONE=1 REQUEST_STATS_NONE value + * @property {number} REQUEST_STATS_FULL=2 REQUEST_STATS_FULL value + */ + ReadRowsRequest.RequestStatsView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REQUEST_STATS_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "REQUEST_STATS_NONE"] = 1; + values[valuesById[2] = "REQUEST_STATS_FULL"] = 2; + return values; + })(); + + return ReadRowsRequest; + })(); + + v2.ReadRowsResponse = (function() { + + /** + * Properties of a ReadRowsResponse. + * @memberof google.bigtable.v2 + * @interface IReadRowsResponse + * @property {Array.|null} [chunks] ReadRowsResponse chunks + * @property {Uint8Array|null} [lastScannedRowKey] ReadRowsResponse lastScannedRowKey + * @property {google.bigtable.v2.IRequestStats|null} [requestStats] ReadRowsResponse requestStats + */ + + /** + * Constructs a new ReadRowsResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadRowsResponse. + * @implements IReadRowsResponse + * @constructor + * @param {google.bigtable.v2.IReadRowsResponse=} [properties] Properties to set + */ + function ReadRowsResponse(properties) { + this.chunks = []; + if (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 chunks. + * @member {Array.} chunks + * @memberof google.bigtable.v2.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.chunks = $util.emptyArray; + + /** + * ReadRowsResponse lastScannedRowKey. + * @member {Uint8Array} lastScannedRowKey + * @memberof google.bigtable.v2.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.lastScannedRowKey = $util.newBuffer([]); + + /** + * ReadRowsResponse requestStats. + * @member {google.bigtable.v2.IRequestStats|null|undefined} requestStats + * @memberof google.bigtable.v2.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.requestStats = null; + + /** + * Creates a new ReadRowsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadRowsResponse + * @static + * @param {google.bigtable.v2.IReadRowsResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadRowsResponse} ReadRowsResponse instance + */ + ReadRowsResponse.create = function create(properties) { + return new ReadRowsResponse(properties); + }; + + /** + * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.bigtable.v2.ReadRowsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadRowsResponse + * @static + * @param {google.bigtable.v2.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.chunks != null && message.chunks.length) + for (var i = 0; i < message.chunks.length; ++i) + $root.google.bigtable.v2.ReadRowsResponse.CellChunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lastScannedRowKey != null && Object.hasOwnProperty.call(message, "lastScannedRowKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.lastScannedRowKey); + if (message.requestStats != null && Object.hasOwnProperty.call(message, "requestStats")) + $root.google.bigtable.v2.RequestStats.encode(message.requestStats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadRowsResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadRowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadRowsResponse + * @static + * @param {google.bigtable.v2.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.bigtable.v2.ReadRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadRowsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.chunks && message.chunks.length)) + message.chunks = []; + message.chunks.push($root.google.bigtable.v2.ReadRowsResponse.CellChunk.decode(reader, reader.uint32())); + break; + } + case 2: { + message.lastScannedRowKey = reader.bytes(); + break; + } + case 3: { + message.requestStats = $root.google.bigtable.v2.RequestStats.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.bigtable.v2.ReadRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.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.bigtable.v2.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"; + if (message.chunks != null && message.hasOwnProperty("chunks")) { + if (!Array.isArray(message.chunks)) + return "chunks: array expected"; + for (var i = 0; i < message.chunks.length; ++i) { + var error = $root.google.bigtable.v2.ReadRowsResponse.CellChunk.verify(message.chunks[i]); + if (error) + return "chunks." + error; + } + } + if (message.lastScannedRowKey != null && message.hasOwnProperty("lastScannedRowKey")) + if (!(message.lastScannedRowKey && typeof message.lastScannedRowKey.length === "number" || $util.isString(message.lastScannedRowKey))) + return "lastScannedRowKey: buffer expected"; + if (message.requestStats != null && message.hasOwnProperty("requestStats")) { + var error = $root.google.bigtable.v2.RequestStats.verify(message.requestStats); + if (error) + return "requestStats." + error; + } + return null; + }; + + /** + * Creates a ReadRowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadRowsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadRowsResponse} ReadRowsResponse + */ + ReadRowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadRowsResponse) + return object; + var message = new $root.google.bigtable.v2.ReadRowsResponse(); + if (object.chunks) { + if (!Array.isArray(object.chunks)) + throw TypeError(".google.bigtable.v2.ReadRowsResponse.chunks: array expected"); + message.chunks = []; + for (var i = 0; i < object.chunks.length; ++i) { + if (typeof object.chunks[i] !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsResponse.chunks: object expected"); + message.chunks[i] = $root.google.bigtable.v2.ReadRowsResponse.CellChunk.fromObject(object.chunks[i]); + } + } + if (object.lastScannedRowKey != null) + if (typeof object.lastScannedRowKey === "string") + $util.base64.decode(object.lastScannedRowKey, message.lastScannedRowKey = $util.newBuffer($util.base64.length(object.lastScannedRowKey)), 0); + else if (object.lastScannedRowKey.length >= 0) + message.lastScannedRowKey = object.lastScannedRowKey; + if (object.requestStats != null) { + if (typeof object.requestStats !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsResponse.requestStats: object expected"); + message.requestStats = $root.google.bigtable.v2.RequestStats.fromObject(object.requestStats); + } + return message; + }; + + /** + * Creates a plain object from a ReadRowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadRowsResponse + * @static + * @param {google.bigtable.v2.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.arrays || options.defaults) + object.chunks = []; + if (options.defaults) { + if (options.bytes === String) + object.lastScannedRowKey = ""; + else { + object.lastScannedRowKey = []; + if (options.bytes !== Array) + object.lastScannedRowKey = $util.newBuffer(object.lastScannedRowKey); + } + object.requestStats = null; + } + if (message.chunks && message.chunks.length) { + object.chunks = []; + for (var j = 0; j < message.chunks.length; ++j) + object.chunks[j] = $root.google.bigtable.v2.ReadRowsResponse.CellChunk.toObject(message.chunks[j], options); + } + if (message.lastScannedRowKey != null && message.hasOwnProperty("lastScannedRowKey")) + object.lastScannedRowKey = options.bytes === String ? $util.base64.encode(message.lastScannedRowKey, 0, message.lastScannedRowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastScannedRowKey) : message.lastScannedRowKey; + if (message.requestStats != null && message.hasOwnProperty("requestStats")) + object.requestStats = $root.google.bigtable.v2.RequestStats.toObject(message.requestStats, options); + return object; + }; + + /** + * Converts this ReadRowsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadRowsResponse + * @instance + * @returns {Object.} JSON object + */ + ReadRowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadRowsResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadRowsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadRowsResponse"; + }; + + ReadRowsResponse.CellChunk = (function() { + + /** + * Properties of a CellChunk. + * @memberof google.bigtable.v2.ReadRowsResponse + * @interface ICellChunk + * @property {Uint8Array|null} [rowKey] CellChunk rowKey + * @property {google.protobuf.IStringValue|null} [familyName] CellChunk familyName + * @property {google.protobuf.IBytesValue|null} [qualifier] CellChunk qualifier + * @property {number|Long|null} [timestampMicros] CellChunk timestampMicros + * @property {Array.|null} [labels] CellChunk labels + * @property {Uint8Array|null} [value] CellChunk value + * @property {number|null} [valueSize] CellChunk valueSize + * @property {boolean|null} [resetRow] CellChunk resetRow + * @property {boolean|null} [commitRow] CellChunk commitRow + */ + + /** + * Constructs a new CellChunk. + * @memberof google.bigtable.v2.ReadRowsResponse + * @classdesc Represents a CellChunk. + * @implements ICellChunk + * @constructor + * @param {google.bigtable.v2.ReadRowsResponse.ICellChunk=} [properties] Properties to set + */ + function CellChunk(properties) { + this.labels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CellChunk rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.rowKey = $util.newBuffer([]); + + /** + * CellChunk familyName. + * @member {google.protobuf.IStringValue|null|undefined} familyName + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.familyName = null; + + /** + * CellChunk qualifier. + * @member {google.protobuf.IBytesValue|null|undefined} qualifier + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.qualifier = null; + + /** + * CellChunk timestampMicros. + * @member {number|Long} timestampMicros + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.timestampMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CellChunk labels. + * @member {Array.} labels + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.labels = $util.emptyArray; + + /** + * CellChunk value. + * @member {Uint8Array} value + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.value = $util.newBuffer([]); + + /** + * CellChunk valueSize. + * @member {number} valueSize + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.valueSize = 0; + + /** + * CellChunk resetRow. + * @member {boolean|null|undefined} resetRow + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.resetRow = null; + + /** + * CellChunk commitRow. + * @member {boolean|null|undefined} commitRow + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.commitRow = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CellChunk rowStatus. + * @member {"resetRow"|"commitRow"|undefined} rowStatus + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + Object.defineProperty(CellChunk.prototype, "rowStatus", { + get: $util.oneOfGetter($oneOfFields = ["resetRow", "commitRow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CellChunk instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {google.bigtable.v2.ReadRowsResponse.ICellChunk=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadRowsResponse.CellChunk} CellChunk instance + */ + CellChunk.create = function create(properties) { + return new CellChunk(properties); + }; + + /** + * Encodes the specified CellChunk message. Does not implicitly {@link google.bigtable.v2.ReadRowsResponse.CellChunk.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {google.bigtable.v2.ReadRowsResponse.ICellChunk} message CellChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CellChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rowKey); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + $root.google.protobuf.StringValue.encode(message.familyName, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.qualifier != null && Object.hasOwnProperty.call(message, "qualifier")) + $root.google.protobuf.BytesValue.encode(message.qualifier, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timestampMicros != null && Object.hasOwnProperty.call(message, "timestampMicros")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.timestampMicros); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.labels[i]); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.value); + if (message.valueSize != null && Object.hasOwnProperty.call(message, "valueSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.valueSize); + if (message.resetRow != null && Object.hasOwnProperty.call(message, "resetRow")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.resetRow); + if (message.commitRow != null && Object.hasOwnProperty.call(message, "commitRow")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.commitRow); + return writer; + }; + + /** + * Encodes the specified CellChunk message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadRowsResponse.CellChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {google.bigtable.v2.ReadRowsResponse.ICellChunk} message CellChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CellChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CellChunk message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadRowsResponse.CellChunk} CellChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CellChunk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadRowsResponse.CellChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowKey = reader.bytes(); + break; + } + case 2: { + message.familyName = $root.google.protobuf.StringValue.decode(reader, reader.uint32()); + break; + } + case 3: { + message.qualifier = $root.google.protobuf.BytesValue.decode(reader, reader.uint32()); + break; + } + case 4: { + message.timestampMicros = reader.int64(); + break; + } + case 5: { + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push(reader.string()); + break; + } + case 6: { + message.value = reader.bytes(); + break; + } + case 7: { + message.valueSize = reader.int32(); + break; + } + case 8: { + message.resetRow = reader.bool(); + break; + } + case 9: { + message.commitRow = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CellChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadRowsResponse.CellChunk} CellChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CellChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CellChunk message. + * @function verify + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CellChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) { + var error = $root.google.protobuf.StringValue.verify(message.familyName); + if (error) + return "familyName." + error; + } + if (message.qualifier != null && message.hasOwnProperty("qualifier")) { + var error = $root.google.protobuf.BytesValue.verify(message.qualifier); + if (error) + return "qualifier." + error; + } + if (message.timestampMicros != null && message.hasOwnProperty("timestampMicros")) + if (!$util.isInteger(message.timestampMicros) && !(message.timestampMicros && $util.isInteger(message.timestampMicros.low) && $util.isInteger(message.timestampMicros.high))) + return "timestampMicros: integer|Long expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) + if (!$util.isString(message.labels[i])) + return "labels: string[] expected"; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.valueSize != null && message.hasOwnProperty("valueSize")) + if (!$util.isInteger(message.valueSize)) + return "valueSize: integer expected"; + if (message.resetRow != null && message.hasOwnProperty("resetRow")) { + properties.rowStatus = 1; + if (typeof message.resetRow !== "boolean") + return "resetRow: boolean expected"; + } + if (message.commitRow != null && message.hasOwnProperty("commitRow")) { + if (properties.rowStatus === 1) + return "rowStatus: multiple values"; + properties.rowStatus = 1; + if (typeof message.commitRow !== "boolean") + return "commitRow: boolean expected"; + } + return null; + }; + + /** + * Creates a CellChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadRowsResponse.CellChunk} CellChunk + */ + CellChunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadRowsResponse.CellChunk) + return object; + var message = new $root.google.bigtable.v2.ReadRowsResponse.CellChunk(); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.familyName != null) { + if (typeof object.familyName !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsResponse.CellChunk.familyName: object expected"); + message.familyName = $root.google.protobuf.StringValue.fromObject(object.familyName); + } + if (object.qualifier != null) { + if (typeof object.qualifier !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsResponse.CellChunk.qualifier: object expected"); + message.qualifier = $root.google.protobuf.BytesValue.fromObject(object.qualifier); + } + if (object.timestampMicros != null) + if ($util.Long) + (message.timestampMicros = $util.Long.fromValue(object.timestampMicros)).unsigned = false; + else if (typeof object.timestampMicros === "string") + message.timestampMicros = parseInt(object.timestampMicros, 10); + else if (typeof object.timestampMicros === "number") + message.timestampMicros = object.timestampMicros; + else if (typeof object.timestampMicros === "object") + message.timestampMicros = new $util.LongBits(object.timestampMicros.low >>> 0, object.timestampMicros.high >>> 0).toNumber(); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.bigtable.v2.ReadRowsResponse.CellChunk.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) + message.labels[i] = String(object.labels[i]); + } + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + if (object.valueSize != null) + message.valueSize = object.valueSize | 0; + if (object.resetRow != null) + message.resetRow = Boolean(object.resetRow); + if (object.commitRow != null) + message.commitRow = Boolean(object.commitRow); + return message; + }; + + /** + * Creates a plain object from a CellChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {google.bigtable.v2.ReadRowsResponse.CellChunk} message CellChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CellChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.labels = []; + if (options.defaults) { + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + object.familyName = null; + object.qualifier = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestampMicros = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + object.valueSize = 0; + } + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = $root.google.protobuf.StringValue.toObject(message.familyName, options); + if (message.qualifier != null && message.hasOwnProperty("qualifier")) + object.qualifier = $root.google.protobuf.BytesValue.toObject(message.qualifier, options); + if (message.timestampMicros != null && message.hasOwnProperty("timestampMicros")) + if (typeof message.timestampMicros === "number") + object.timestampMicros = options.longs === String ? String(message.timestampMicros) : message.timestampMicros; + else + object.timestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.timestampMicros) : options.longs === Number ? new $util.LongBits(message.timestampMicros.low >>> 0, message.timestampMicros.high >>> 0).toNumber() : message.timestampMicros; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = message.labels[j]; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.valueSize != null && message.hasOwnProperty("valueSize")) + object.valueSize = message.valueSize; + if (message.resetRow != null && message.hasOwnProperty("resetRow")) { + object.resetRow = message.resetRow; + if (options.oneofs) + object.rowStatus = "resetRow"; + } + if (message.commitRow != null && message.hasOwnProperty("commitRow")) { + object.commitRow = message.commitRow; + if (options.oneofs) + object.rowStatus = "commitRow"; + } + return object; + }; + + /** + * Converts this CellChunk to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + * @returns {Object.} JSON object + */ + CellChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CellChunk + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CellChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadRowsResponse.CellChunk"; + }; + + return CellChunk; + })(); + + return ReadRowsResponse; + })(); + + v2.SampleRowKeysRequest = (function() { + + /** + * Properties of a SampleRowKeysRequest. + * @memberof google.bigtable.v2 + * @interface ISampleRowKeysRequest + * @property {string|null} [tableName] SampleRowKeysRequest tableName + * @property {string|null} [authorizedViewName] SampleRowKeysRequest authorizedViewName + * @property {string|null} [materializedViewName] SampleRowKeysRequest materializedViewName + * @property {string|null} [appProfileId] SampleRowKeysRequest appProfileId + */ + + /** + * Constructs a new SampleRowKeysRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a SampleRowKeysRequest. + * @implements ISampleRowKeysRequest + * @constructor + * @param {google.bigtable.v2.ISampleRowKeysRequest=} [properties] Properties to set + */ + function SampleRowKeysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SampleRowKeysRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @instance + */ + SampleRowKeysRequest.prototype.tableName = ""; + + /** + * SampleRowKeysRequest authorizedViewName. + * @member {string} authorizedViewName + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @instance + */ + SampleRowKeysRequest.prototype.authorizedViewName = ""; + + /** + * SampleRowKeysRequest materializedViewName. + * @member {string} materializedViewName + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @instance + */ + SampleRowKeysRequest.prototype.materializedViewName = ""; + + /** + * SampleRowKeysRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @instance + */ + SampleRowKeysRequest.prototype.appProfileId = ""; + + /** + * Creates a new SampleRowKeysRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {google.bigtable.v2.ISampleRowKeysRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.SampleRowKeysRequest} SampleRowKeysRequest instance + */ + SampleRowKeysRequest.create = function create(properties) { + return new SampleRowKeysRequest(properties); + }; + + /** + * Encodes the specified SampleRowKeysRequest message. Does not implicitly {@link google.bigtable.v2.SampleRowKeysRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {google.bigtable.v2.ISampleRowKeysRequest} message SampleRowKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleRowKeysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + if (message.authorizedViewName != null && Object.hasOwnProperty.call(message, "authorizedViewName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.authorizedViewName); + if (message.materializedViewName != null && Object.hasOwnProperty.call(message, "materializedViewName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.materializedViewName); + return writer; + }; + + /** + * Encodes the specified SampleRowKeysRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.SampleRowKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {google.bigtable.v2.ISampleRowKeysRequest} message SampleRowKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleRowKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SampleRowKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.SampleRowKeysRequest} SampleRowKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleRowKeysRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.SampleRowKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 4: { + message.authorizedViewName = reader.string(); + break; + } + case 5: { + message.materializedViewName = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SampleRowKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.SampleRowKeysRequest} SampleRowKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleRowKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SampleRowKeysRequest message. + * @function verify + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SampleRowKeysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + if (!$util.isString(message.authorizedViewName)) + return "authorizedViewName: string expected"; + if (message.materializedViewName != null && message.hasOwnProperty("materializedViewName")) + if (!$util.isString(message.materializedViewName)) + return "materializedViewName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + return null; + }; + + /** + * Creates a SampleRowKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.SampleRowKeysRequest} SampleRowKeysRequest + */ + SampleRowKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.SampleRowKeysRequest) + return object; + var message = new $root.google.bigtable.v2.SampleRowKeysRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.authorizedViewName != null) + message.authorizedViewName = String(object.authorizedViewName); + if (object.materializedViewName != null) + message.materializedViewName = String(object.materializedViewName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + return message; + }; + + /** + * Creates a plain object from a SampleRowKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {google.bigtable.v2.SampleRowKeysRequest} message SampleRowKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SampleRowKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tableName = ""; + object.appProfileId = ""; + object.authorizedViewName = ""; + object.materializedViewName = ""; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + object.authorizedViewName = message.authorizedViewName; + if (message.materializedViewName != null && message.hasOwnProperty("materializedViewName")) + object.materializedViewName = message.materializedViewName; + return object; + }; + + /** + * Converts this SampleRowKeysRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @instance + * @returns {Object.} JSON object + */ + SampleRowKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SampleRowKeysRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SampleRowKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.SampleRowKeysRequest"; + }; + + return SampleRowKeysRequest; + })(); + + v2.SampleRowKeysResponse = (function() { + + /** + * Properties of a SampleRowKeysResponse. + * @memberof google.bigtable.v2 + * @interface ISampleRowKeysResponse + * @property {Uint8Array|null} [rowKey] SampleRowKeysResponse rowKey + * @property {number|Long|null} [offsetBytes] SampleRowKeysResponse offsetBytes + */ + + /** + * Constructs a new SampleRowKeysResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a SampleRowKeysResponse. + * @implements ISampleRowKeysResponse + * @constructor + * @param {google.bigtable.v2.ISampleRowKeysResponse=} [properties] Properties to set + */ + function SampleRowKeysResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SampleRowKeysResponse rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @instance + */ + SampleRowKeysResponse.prototype.rowKey = $util.newBuffer([]); + + /** + * SampleRowKeysResponse offsetBytes. + * @member {number|Long} offsetBytes + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @instance + */ + SampleRowKeysResponse.prototype.offsetBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SampleRowKeysResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {google.bigtable.v2.ISampleRowKeysResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.SampleRowKeysResponse} SampleRowKeysResponse instance + */ + SampleRowKeysResponse.create = function create(properties) { + return new SampleRowKeysResponse(properties); + }; + + /** + * Encodes the specified SampleRowKeysResponse message. Does not implicitly {@link google.bigtable.v2.SampleRowKeysResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {google.bigtable.v2.ISampleRowKeysResponse} message SampleRowKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleRowKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rowKey); + if (message.offsetBytes != null && Object.hasOwnProperty.call(message, "offsetBytes")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.offsetBytes); + return writer; + }; + + /** + * Encodes the specified SampleRowKeysResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.SampleRowKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {google.bigtable.v2.ISampleRowKeysResponse} message SampleRowKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleRowKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SampleRowKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.SampleRowKeysResponse} SampleRowKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleRowKeysResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.SampleRowKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowKey = reader.bytes(); + break; + } + case 2: { + message.offsetBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SampleRowKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.SampleRowKeysResponse} SampleRowKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleRowKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SampleRowKeysResponse message. + * @function verify + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SampleRowKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer expected"; + if (message.offsetBytes != null && message.hasOwnProperty("offsetBytes")) + if (!$util.isInteger(message.offsetBytes) && !(message.offsetBytes && $util.isInteger(message.offsetBytes.low) && $util.isInteger(message.offsetBytes.high))) + return "offsetBytes: integer|Long expected"; + return null; + }; + + /** + * Creates a SampleRowKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.SampleRowKeysResponse} SampleRowKeysResponse + */ + SampleRowKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.SampleRowKeysResponse) + return object; + var message = new $root.google.bigtable.v2.SampleRowKeysResponse(); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.offsetBytes != null) + if ($util.Long) + (message.offsetBytes = $util.Long.fromValue(object.offsetBytes)).unsigned = false; + else if (typeof object.offsetBytes === "string") + message.offsetBytes = parseInt(object.offsetBytes, 10); + else if (typeof object.offsetBytes === "number") + message.offsetBytes = object.offsetBytes; + else if (typeof object.offsetBytes === "object") + message.offsetBytes = new $util.LongBits(object.offsetBytes.low >>> 0, object.offsetBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SampleRowKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {google.bigtable.v2.SampleRowKeysResponse} message SampleRowKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SampleRowKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.offsetBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offsetBytes = options.longs === String ? "0" : 0; + } + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.offsetBytes != null && message.hasOwnProperty("offsetBytes")) + if (typeof message.offsetBytes === "number") + object.offsetBytes = options.longs === String ? String(message.offsetBytes) : message.offsetBytes; + else + object.offsetBytes = options.longs === String ? $util.Long.prototype.toString.call(message.offsetBytes) : options.longs === Number ? new $util.LongBits(message.offsetBytes.low >>> 0, message.offsetBytes.high >>> 0).toNumber() : message.offsetBytes; + return object; + }; + + /** + * Converts this SampleRowKeysResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @instance + * @returns {Object.} JSON object + */ + SampleRowKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SampleRowKeysResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SampleRowKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.SampleRowKeysResponse"; + }; + + return SampleRowKeysResponse; + })(); + + v2.MutateRowRequest = (function() { + + /** + * Properties of a MutateRowRequest. + * @memberof google.bigtable.v2 + * @interface IMutateRowRequest + * @property {string|null} [tableName] MutateRowRequest tableName + * @property {string|null} [authorizedViewName] MutateRowRequest authorizedViewName + * @property {string|null} [appProfileId] MutateRowRequest appProfileId + * @property {Uint8Array|null} [rowKey] MutateRowRequest rowKey + * @property {Array.|null} [mutations] MutateRowRequest mutations + * @property {google.bigtable.v2.IIdempotency|null} [idempotency] MutateRowRequest idempotency + */ + + /** + * Constructs a new MutateRowRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a MutateRowRequest. + * @implements IMutateRowRequest + * @constructor + * @param {google.bigtable.v2.IMutateRowRequest=} [properties] Properties to set + */ + function MutateRowRequest(properties) { + this.mutations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateRowRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.tableName = ""; + + /** + * MutateRowRequest authorizedViewName. + * @member {string} authorizedViewName + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.authorizedViewName = ""; + + /** + * MutateRowRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.appProfileId = ""; + + /** + * MutateRowRequest rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.rowKey = $util.newBuffer([]); + + /** + * MutateRowRequest mutations. + * @member {Array.} mutations + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.mutations = $util.emptyArray; + + /** + * MutateRowRequest idempotency. + * @member {google.bigtable.v2.IIdempotency|null|undefined} idempotency + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.idempotency = null; + + /** + * Creates a new MutateRowRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {google.bigtable.v2.IMutateRowRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.MutateRowRequest} MutateRowRequest instance + */ + MutateRowRequest.create = function create(properties) { + return new MutateRowRequest(properties); + }; + + /** + * Encodes the specified MutateRowRequest message. Does not implicitly {@link google.bigtable.v2.MutateRowRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {google.bigtable.v2.IMutateRowRequest} message MutateRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rowKey); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.bigtable.v2.Mutation.encode(message.mutations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.appProfileId); + if (message.authorizedViewName != null && Object.hasOwnProperty.call(message, "authorizedViewName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.authorizedViewName); + if (message.idempotency != null && Object.hasOwnProperty.call(message, "idempotency")) + $root.google.bigtable.v2.Idempotency.encode(message.idempotency, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateRowRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {google.bigtable.v2.IMutateRowRequest} message MutateRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateRowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.MutateRowRequest} MutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.MutateRowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 6: { + message.authorizedViewName = reader.string(); + break; + } + case 4: { + message.appProfileId = reader.string(); + break; + } + case 2: { + message.rowKey = reader.bytes(); + break; + } + case 3: { + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.bigtable.v2.Mutation.decode(reader, reader.uint32())); + break; + } + case 8: { + message.idempotency = $root.google.bigtable.v2.Idempotency.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateRowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.MutateRowRequest} MutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateRowRequest message. + * @function verify + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateRowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + if (!$util.isString(message.authorizedViewName)) + return "authorizedViewName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer expected"; + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.bigtable.v2.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } + if (message.idempotency != null && message.hasOwnProperty("idempotency")) { + var error = $root.google.bigtable.v2.Idempotency.verify(message.idempotency); + if (error) + return "idempotency." + error; + } + return null; + }; + + /** + * Creates a MutateRowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.MutateRowRequest} MutateRowRequest + */ + MutateRowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.MutateRowRequest) + return object; + var message = new $root.google.bigtable.v2.MutateRowRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.authorizedViewName != null) + message.authorizedViewName = String(object.authorizedViewName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.bigtable.v2.MutateRowRequest.mutations: array expected"); + message.mutations = []; + for (var i = 0; i < object.mutations.length; ++i) { + if (typeof object.mutations[i] !== "object") + throw TypeError(".google.bigtable.v2.MutateRowRequest.mutations: object expected"); + message.mutations[i] = $root.google.bigtable.v2.Mutation.fromObject(object.mutations[i]); + } + } + if (object.idempotency != null) { + if (typeof object.idempotency !== "object") + throw TypeError(".google.bigtable.v2.MutateRowRequest.idempotency: object expected"); + message.idempotency = $root.google.bigtable.v2.Idempotency.fromObject(object.idempotency); + } + return message; + }; + + /** + * Creates a plain object from a MutateRowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {google.bigtable.v2.MutateRowRequest} message MutateRowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateRowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mutations = []; + if (options.defaults) { + object.tableName = ""; + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + object.appProfileId = ""; + object.authorizedViewName = ""; + object.idempotency = null; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.bigtable.v2.Mutation.toObject(message.mutations[j], options); + } + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + object.authorizedViewName = message.authorizedViewName; + if (message.idempotency != null && message.hasOwnProperty("idempotency")) + object.idempotency = $root.google.bigtable.v2.Idempotency.toObject(message.idempotency, options); + return object; + }; + + /** + * Converts this MutateRowRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + * @returns {Object.} JSON object + */ + MutateRowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateRowRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateRowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.MutateRowRequest"; + }; + + return MutateRowRequest; + })(); + + v2.MutateRowResponse = (function() { + + /** + * Properties of a MutateRowResponse. + * @memberof google.bigtable.v2 + * @interface IMutateRowResponse + */ + + /** + * Constructs a new MutateRowResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a MutateRowResponse. + * @implements IMutateRowResponse + * @constructor + * @param {google.bigtable.v2.IMutateRowResponse=} [properties] Properties to set + */ + function MutateRowResponse(properties) { + if (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 MutateRowResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {google.bigtable.v2.IMutateRowResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.MutateRowResponse} MutateRowResponse instance + */ + MutateRowResponse.create = function create(properties) { + return new MutateRowResponse(properties); + }; + + /** + * Encodes the specified MutateRowResponse message. Does not implicitly {@link google.bigtable.v2.MutateRowResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {google.bigtable.v2.IMutateRowResponse} message MutateRowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MutateRowResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {google.bigtable.v2.IMutateRowResponse} message MutateRowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateRowResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.MutateRowResponse} MutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.MutateRowResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateRowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.MutateRowResponse} MutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateRowResponse message. + * @function verify + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateRowResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MutateRowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.MutateRowResponse} MutateRowResponse + */ + MutateRowResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.MutateRowResponse) + return object; + return new $root.google.bigtable.v2.MutateRowResponse(); + }; + + /** + * Creates a plain object from a MutateRowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {google.bigtable.v2.MutateRowResponse} message MutateRowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateRowResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MutateRowResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.MutateRowResponse + * @instance + * @returns {Object.} JSON object + */ + MutateRowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateRowResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateRowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.MutateRowResponse"; + }; + + return MutateRowResponse; + })(); + + v2.MutateRowsRequest = (function() { + + /** + * Properties of a MutateRowsRequest. + * @memberof google.bigtable.v2 + * @interface IMutateRowsRequest + * @property {string|null} [tableName] MutateRowsRequest tableName + * @property {string|null} [authorizedViewName] MutateRowsRequest authorizedViewName + * @property {string|null} [appProfileId] MutateRowsRequest appProfileId + * @property {Array.|null} [entries] MutateRowsRequest entries + */ + + /** + * Constructs a new MutateRowsRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a MutateRowsRequest. + * @implements IMutateRowsRequest + * @constructor + * @param {google.bigtable.v2.IMutateRowsRequest=} [properties] Properties to set + */ + function MutateRowsRequest(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateRowsRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.MutateRowsRequest + * @instance + */ + MutateRowsRequest.prototype.tableName = ""; + + /** + * MutateRowsRequest authorizedViewName. + * @member {string} authorizedViewName + * @memberof google.bigtable.v2.MutateRowsRequest + * @instance + */ + MutateRowsRequest.prototype.authorizedViewName = ""; + + /** + * MutateRowsRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.MutateRowsRequest + * @instance + */ + MutateRowsRequest.prototype.appProfileId = ""; + + /** + * MutateRowsRequest entries. + * @member {Array.} entries + * @memberof google.bigtable.v2.MutateRowsRequest + * @instance + */ + MutateRowsRequest.prototype.entries = $util.emptyArray; + + /** + * Creates a new MutateRowsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {google.bigtable.v2.IMutateRowsRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.MutateRowsRequest} MutateRowsRequest instance + */ + MutateRowsRequest.create = function create(properties) { + return new MutateRowsRequest(properties); + }; + + /** + * Encodes the specified MutateRowsRequest message. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {google.bigtable.v2.IMutateRowsRequest} message MutateRowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.bigtable.v2.MutateRowsRequest.Entry.encode(message.entries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.appProfileId); + if (message.authorizedViewName != null && Object.hasOwnProperty.call(message, "authorizedViewName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.authorizedViewName); + return writer; + }; + + /** + * Encodes the specified MutateRowsRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {google.bigtable.v2.IMutateRowsRequest} message MutateRowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateRowsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.MutateRowsRequest} MutateRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.MutateRowsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 5: { + message.authorizedViewName = reader.string(); + break; + } + case 3: { + message.appProfileId = reader.string(); + break; + } + case 2: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.bigtable.v2.MutateRowsRequest.Entry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateRowsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.MutateRowsRequest} MutateRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateRowsRequest message. + * @function verify + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateRowsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + if (!$util.isString(message.authorizedViewName)) + return "authorizedViewName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.bigtable.v2.MutateRowsRequest.Entry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a MutateRowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.MutateRowsRequest} MutateRowsRequest + */ + MutateRowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.MutateRowsRequest) + return object; + var message = new $root.google.bigtable.v2.MutateRowsRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.authorizedViewName != null) + message.authorizedViewName = String(object.authorizedViewName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.bigtable.v2.MutateRowsRequest.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.bigtable.v2.MutateRowsRequest.entries: object expected"); + message.entries[i] = $root.google.bigtable.v2.MutateRowsRequest.Entry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MutateRowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {google.bigtable.v2.MutateRowsRequest} message MutateRowsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateRowsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) { + object.tableName = ""; + object.appProfileId = ""; + object.authorizedViewName = ""; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.bigtable.v2.MutateRowsRequest.Entry.toObject(message.entries[j], options); + } + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + object.authorizedViewName = message.authorizedViewName; + return object; + }; + + /** + * Converts this MutateRowsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.MutateRowsRequest + * @instance + * @returns {Object.} JSON object + */ + MutateRowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateRowsRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateRowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.MutateRowsRequest"; + }; + + MutateRowsRequest.Entry = (function() { + + /** + * Properties of an Entry. + * @memberof google.bigtable.v2.MutateRowsRequest + * @interface IEntry + * @property {Uint8Array|null} [rowKey] Entry rowKey + * @property {Array.|null} [mutations] Entry mutations + * @property {google.bigtable.v2.IIdempotency|null} [idempotency] Entry idempotency + */ + + /** + * Constructs a new Entry. + * @memberof google.bigtable.v2.MutateRowsRequest + * @classdesc Represents an Entry. + * @implements IEntry + * @constructor + * @param {google.bigtable.v2.MutateRowsRequest.IEntry=} [properties] Properties to set + */ + function Entry(properties) { + this.mutations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entry rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @instance + */ + Entry.prototype.rowKey = $util.newBuffer([]); + + /** + * Entry mutations. + * @member {Array.} mutations + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @instance + */ + Entry.prototype.mutations = $util.emptyArray; + + /** + * Entry idempotency. + * @member {google.bigtable.v2.IIdempotency|null|undefined} idempotency + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @instance + */ + Entry.prototype.idempotency = null; + + /** + * Creates a new Entry instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {google.bigtable.v2.MutateRowsRequest.IEntry=} [properties] Properties to set + * @returns {google.bigtable.v2.MutateRowsRequest.Entry} Entry instance + */ + Entry.create = function create(properties) { + return new Entry(properties); + }; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.Entry.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {google.bigtable.v2.MutateRowsRequest.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rowKey); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.bigtable.v2.Mutation.encode(message.mutations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.idempotency != null && Object.hasOwnProperty.call(message, "idempotency")) + $root.google.bigtable.v2.Idempotency.encode(message.idempotency, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.Entry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {google.bigtable.v2.MutateRowsRequest.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.MutateRowsRequest.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.MutateRowsRequest.Entry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowKey = reader.bytes(); + break; + } + case 2: { + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.bigtable.v2.Mutation.decode(reader, reader.uint32())); + break; + } + case 3: { + message.idempotency = $root.google.bigtable.v2.Idempotency.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.MutateRowsRequest.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entry message. + * @function verify + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer expected"; + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.bigtable.v2.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } + if (message.idempotency != null && message.hasOwnProperty("idempotency")) { + var error = $root.google.bigtable.v2.Idempotency.verify(message.idempotency); + if (error) + return "idempotency." + error; + } + return null; + }; + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.MutateRowsRequest.Entry} Entry + */ + Entry.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.MutateRowsRequest.Entry) + return object; + var message = new $root.google.bigtable.v2.MutateRowsRequest.Entry(); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.bigtable.v2.MutateRowsRequest.Entry.mutations: array expected"); + message.mutations = []; + for (var i = 0; i < object.mutations.length; ++i) { + if (typeof object.mutations[i] !== "object") + throw TypeError(".google.bigtable.v2.MutateRowsRequest.Entry.mutations: object expected"); + message.mutations[i] = $root.google.bigtable.v2.Mutation.fromObject(object.mutations[i]); + } + } + if (object.idempotency != null) { + if (typeof object.idempotency !== "object") + throw TypeError(".google.bigtable.v2.MutateRowsRequest.Entry.idempotency: object expected"); + message.idempotency = $root.google.bigtable.v2.Idempotency.fromObject(object.idempotency); + } + return message; + }; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {google.bigtable.v2.MutateRowsRequest.Entry} message Entry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mutations = []; + if (options.defaults) { + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + object.idempotency = null; + } + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.bigtable.v2.Mutation.toObject(message.mutations[j], options); + } + if (message.idempotency != null && message.hasOwnProperty("idempotency")) + object.idempotency = $root.google.bigtable.v2.Idempotency.toObject(message.idempotency, options); + return object; + }; + + /** + * Converts this Entry to JSON. + * @function toJSON + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @instance + * @returns {Object.} JSON object + */ + Entry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entry + * @function getTypeUrl + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.MutateRowsRequest.Entry"; + }; + + return Entry; + })(); + + return MutateRowsRequest; + })(); + + v2.MutateRowsResponse = (function() { + + /** + * Properties of a MutateRowsResponse. + * @memberof google.bigtable.v2 + * @interface IMutateRowsResponse + * @property {Array.|null} [entries] MutateRowsResponse entries + * @property {google.bigtable.v2.IRateLimitInfo|null} [rateLimitInfo] MutateRowsResponse rateLimitInfo + */ + + /** + * Constructs a new MutateRowsResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a MutateRowsResponse. + * @implements IMutateRowsResponse + * @constructor + * @param {google.bigtable.v2.IMutateRowsResponse=} [properties] Properties to set + */ + function MutateRowsResponse(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateRowsResponse entries. + * @member {Array.} entries + * @memberof google.bigtable.v2.MutateRowsResponse + * @instance + */ + MutateRowsResponse.prototype.entries = $util.emptyArray; + + /** + * MutateRowsResponse rateLimitInfo. + * @member {google.bigtable.v2.IRateLimitInfo|null|undefined} rateLimitInfo + * @memberof google.bigtable.v2.MutateRowsResponse + * @instance + */ + MutateRowsResponse.prototype.rateLimitInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MutateRowsResponse.prototype, "_rateLimitInfo", { + get: $util.oneOfGetter($oneOfFields = ["rateLimitInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MutateRowsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {google.bigtable.v2.IMutateRowsResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.MutateRowsResponse} MutateRowsResponse instance + */ + MutateRowsResponse.create = function create(properties) { + return new MutateRowsResponse(properties); + }; + + /** + * Encodes the specified MutateRowsResponse message. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {google.bigtable.v2.IMutateRowsResponse} message MutateRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.bigtable.v2.MutateRowsResponse.Entry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rateLimitInfo != null && Object.hasOwnProperty.call(message, "rateLimitInfo")) + $root.google.bigtable.v2.RateLimitInfo.encode(message.rateLimitInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateRowsResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {google.bigtable.v2.IMutateRowsResponse} message MutateRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateRowsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.MutateRowsResponse} MutateRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.MutateRowsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.bigtable.v2.MutateRowsResponse.Entry.decode(reader, reader.uint32())); + break; + } + case 3: { + message.rateLimitInfo = $root.google.bigtable.v2.RateLimitInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateRowsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.MutateRowsResponse} MutateRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateRowsResponse message. + * @function verify + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateRowsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.bigtable.v2.MutateRowsResponse.Entry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + if (message.rateLimitInfo != null && message.hasOwnProperty("rateLimitInfo")) { + properties._rateLimitInfo = 1; + { + var error = $root.google.bigtable.v2.RateLimitInfo.verify(message.rateLimitInfo); + if (error) + return "rateLimitInfo." + error; + } + } + return null; + }; + + /** + * Creates a MutateRowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.MutateRowsResponse} MutateRowsResponse + */ + MutateRowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.MutateRowsResponse) + return object; + var message = new $root.google.bigtable.v2.MutateRowsResponse(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.bigtable.v2.MutateRowsResponse.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.bigtable.v2.MutateRowsResponse.entries: object expected"); + message.entries[i] = $root.google.bigtable.v2.MutateRowsResponse.Entry.fromObject(object.entries[i]); + } + } + if (object.rateLimitInfo != null) { + if (typeof object.rateLimitInfo !== "object") + throw TypeError(".google.bigtable.v2.MutateRowsResponse.rateLimitInfo: object expected"); + message.rateLimitInfo = $root.google.bigtable.v2.RateLimitInfo.fromObject(object.rateLimitInfo); + } + return message; + }; + + /** + * Creates a plain object from a MutateRowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {google.bigtable.v2.MutateRowsResponse} message MutateRowsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateRowsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.bigtable.v2.MutateRowsResponse.Entry.toObject(message.entries[j], options); + } + if (message.rateLimitInfo != null && message.hasOwnProperty("rateLimitInfo")) { + object.rateLimitInfo = $root.google.bigtable.v2.RateLimitInfo.toObject(message.rateLimitInfo, options); + if (options.oneofs) + object._rateLimitInfo = "rateLimitInfo"; + } + return object; + }; + + /** + * Converts this MutateRowsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.MutateRowsResponse + * @instance + * @returns {Object.} JSON object + */ + MutateRowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateRowsResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateRowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.MutateRowsResponse"; + }; + + MutateRowsResponse.Entry = (function() { + + /** + * Properties of an Entry. + * @memberof google.bigtable.v2.MutateRowsResponse + * @interface IEntry + * @property {number|Long|null} [index] Entry index + * @property {google.rpc.IStatus|null} [status] Entry status + */ + + /** + * Constructs a new Entry. + * @memberof google.bigtable.v2.MutateRowsResponse + * @classdesc Represents an Entry. + * @implements IEntry + * @constructor + * @param {google.bigtable.v2.MutateRowsResponse.IEntry=} [properties] Properties to set + */ + function Entry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entry index. + * @member {number|Long} index + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @instance + */ + Entry.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Entry status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @instance + */ + Entry.prototype.status = null; + + /** + * Creates a new Entry instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {google.bigtable.v2.MutateRowsResponse.IEntry=} [properties] Properties to set + * @returns {google.bigtable.v2.MutateRowsResponse.Entry} Entry instance + */ + Entry.create = function create(properties) { + return new Entry(properties); + }; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.Entry.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {google.bigtable.v2.MutateRowsResponse.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.index); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.Entry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {google.bigtable.v2.MutateRowsResponse.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.MutateRowsResponse.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.MutateRowsResponse.Entry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.index = reader.int64(); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.MutateRowsResponse.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entry message. + * @function verify + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.MutateRowsResponse.Entry} Entry + */ + Entry.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.MutateRowsResponse.Entry) + return object; + var message = new $root.google.bigtable.v2.MutateRowsResponse.Entry(); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.bigtable.v2.MutateRowsResponse.Entry.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {google.bigtable.v2.MutateRowsResponse.Entry} message Entry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + object.status = null; + } + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this Entry to JSON. + * @function toJSON + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @instance + * @returns {Object.} JSON object + */ + Entry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entry + * @function getTypeUrl + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.MutateRowsResponse.Entry"; + }; + + return Entry; + })(); + + return MutateRowsResponse; + })(); + + v2.RateLimitInfo = (function() { + + /** + * Properties of a RateLimitInfo. + * @memberof google.bigtable.v2 + * @interface IRateLimitInfo + * @property {google.protobuf.IDuration|null} [period] RateLimitInfo period + * @property {number|null} [factor] RateLimitInfo factor + */ + + /** + * Constructs a new RateLimitInfo. + * @memberof google.bigtable.v2 + * @classdesc Represents a RateLimitInfo. + * @implements IRateLimitInfo + * @constructor + * @param {google.bigtable.v2.IRateLimitInfo=} [properties] Properties to set + */ + function RateLimitInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RateLimitInfo period. + * @member {google.protobuf.IDuration|null|undefined} period + * @memberof google.bigtable.v2.RateLimitInfo + * @instance + */ + RateLimitInfo.prototype.period = null; + + /** + * RateLimitInfo factor. + * @member {number} factor + * @memberof google.bigtable.v2.RateLimitInfo + * @instance + */ + RateLimitInfo.prototype.factor = 0; + + /** + * Creates a new RateLimitInfo instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {google.bigtable.v2.IRateLimitInfo=} [properties] Properties to set + * @returns {google.bigtable.v2.RateLimitInfo} RateLimitInfo instance + */ + RateLimitInfo.create = function create(properties) { + return new RateLimitInfo(properties); + }; + + /** + * Encodes the specified RateLimitInfo message. Does not implicitly {@link google.bigtable.v2.RateLimitInfo.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {google.bigtable.v2.IRateLimitInfo} message RateLimitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RateLimitInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.period != null && Object.hasOwnProperty.call(message, "period")) + $root.google.protobuf.Duration.encode(message.period, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.factor != null && Object.hasOwnProperty.call(message, "factor")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.factor); + return writer; + }; + + /** + * Encodes the specified RateLimitInfo message, length delimited. Does not implicitly {@link google.bigtable.v2.RateLimitInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {google.bigtable.v2.IRateLimitInfo} message RateLimitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RateLimitInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RateLimitInfo message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RateLimitInfo} RateLimitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RateLimitInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RateLimitInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.factor = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RateLimitInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RateLimitInfo} RateLimitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RateLimitInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RateLimitInfo message. + * @function verify + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RateLimitInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.period != null && message.hasOwnProperty("period")) { + var error = $root.google.protobuf.Duration.verify(message.period); + if (error) + return "period." + error; + } + if (message.factor != null && message.hasOwnProperty("factor")) + if (typeof message.factor !== "number") + return "factor: number expected"; + return null; + }; + + /** + * Creates a RateLimitInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RateLimitInfo} RateLimitInfo + */ + RateLimitInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RateLimitInfo) + return object; + var message = new $root.google.bigtable.v2.RateLimitInfo(); + if (object.period != null) { + if (typeof object.period !== "object") + throw TypeError(".google.bigtable.v2.RateLimitInfo.period: object expected"); + message.period = $root.google.protobuf.Duration.fromObject(object.period); + } + if (object.factor != null) + message.factor = Number(object.factor); + return message; + }; + + /** + * Creates a plain object from a RateLimitInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {google.bigtable.v2.RateLimitInfo} message RateLimitInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RateLimitInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.period = null; + object.factor = 0; + } + if (message.period != null && message.hasOwnProperty("period")) + object.period = $root.google.protobuf.Duration.toObject(message.period, options); + if (message.factor != null && message.hasOwnProperty("factor")) + object.factor = options.json && !isFinite(message.factor) ? String(message.factor) : message.factor; + return object; + }; + + /** + * Converts this RateLimitInfo to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RateLimitInfo + * @instance + * @returns {Object.} JSON object + */ + RateLimitInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RateLimitInfo + * @function getTypeUrl + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RateLimitInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RateLimitInfo"; + }; + + return RateLimitInfo; + })(); + + v2.CheckAndMutateRowRequest = (function() { + + /** + * Properties of a CheckAndMutateRowRequest. + * @memberof google.bigtable.v2 + * @interface ICheckAndMutateRowRequest + * @property {string|null} [tableName] CheckAndMutateRowRequest tableName + * @property {string|null} [authorizedViewName] CheckAndMutateRowRequest authorizedViewName + * @property {string|null} [appProfileId] CheckAndMutateRowRequest appProfileId + * @property {Uint8Array|null} [rowKey] CheckAndMutateRowRequest rowKey + * @property {google.bigtable.v2.IRowFilter|null} [predicateFilter] CheckAndMutateRowRequest predicateFilter + * @property {Array.|null} [trueMutations] CheckAndMutateRowRequest trueMutations + * @property {Array.|null} [falseMutations] CheckAndMutateRowRequest falseMutations + */ + + /** + * Constructs a new CheckAndMutateRowRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a CheckAndMutateRowRequest. + * @implements ICheckAndMutateRowRequest + * @constructor + * @param {google.bigtable.v2.ICheckAndMutateRowRequest=} [properties] Properties to set + */ + function CheckAndMutateRowRequest(properties) { + this.trueMutations = []; + this.falseMutations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckAndMutateRowRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.tableName = ""; + + /** + * CheckAndMutateRowRequest authorizedViewName. + * @member {string} authorizedViewName + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.authorizedViewName = ""; + + /** + * CheckAndMutateRowRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.appProfileId = ""; + + /** + * CheckAndMutateRowRequest rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.rowKey = $util.newBuffer([]); + + /** + * CheckAndMutateRowRequest predicateFilter. + * @member {google.bigtable.v2.IRowFilter|null|undefined} predicateFilter + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.predicateFilter = null; + + /** + * CheckAndMutateRowRequest trueMutations. + * @member {Array.} trueMutations + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.trueMutations = $util.emptyArray; + + /** + * CheckAndMutateRowRequest falseMutations. + * @member {Array.} falseMutations + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.falseMutations = $util.emptyArray; + + /** + * Creates a new CheckAndMutateRowRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {google.bigtable.v2.ICheckAndMutateRowRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.CheckAndMutateRowRequest} CheckAndMutateRowRequest instance + */ + CheckAndMutateRowRequest.create = function create(properties) { + return new CheckAndMutateRowRequest(properties); + }; + + /** + * Encodes the specified CheckAndMutateRowRequest message. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {google.bigtable.v2.ICheckAndMutateRowRequest} message CheckAndMutateRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAndMutateRowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rowKey); + if (message.trueMutations != null && message.trueMutations.length) + for (var i = 0; i < message.trueMutations.length; ++i) + $root.google.bigtable.v2.Mutation.encode(message.trueMutations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.falseMutations != null && message.falseMutations.length) + for (var i = 0; i < message.falseMutations.length; ++i) + $root.google.bigtable.v2.Mutation.encode(message.falseMutations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.predicateFilter != null && Object.hasOwnProperty.call(message, "predicateFilter")) + $root.google.bigtable.v2.RowFilter.encode(message.predicateFilter, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.appProfileId); + if (message.authorizedViewName != null && Object.hasOwnProperty.call(message, "authorizedViewName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.authorizedViewName); + return writer; + }; + + /** + * Encodes the specified CheckAndMutateRowRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {google.bigtable.v2.ICheckAndMutateRowRequest} message CheckAndMutateRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAndMutateRowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckAndMutateRowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.CheckAndMutateRowRequest} CheckAndMutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAndMutateRowRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.CheckAndMutateRowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 9: { + message.authorizedViewName = reader.string(); + break; + } + case 7: { + message.appProfileId = reader.string(); + break; + } + case 2: { + message.rowKey = reader.bytes(); + break; + } + case 6: { + message.predicateFilter = $root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.trueMutations && message.trueMutations.length)) + message.trueMutations = []; + message.trueMutations.push($root.google.bigtable.v2.Mutation.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.falseMutations && message.falseMutations.length)) + message.falseMutations = []; + message.falseMutations.push($root.google.bigtable.v2.Mutation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckAndMutateRowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.CheckAndMutateRowRequest} CheckAndMutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAndMutateRowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckAndMutateRowRequest message. + * @function verify + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckAndMutateRowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + if (!$util.isString(message.authorizedViewName)) + return "authorizedViewName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer expected"; + if (message.predicateFilter != null && message.hasOwnProperty("predicateFilter")) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.predicateFilter); + if (error) + return "predicateFilter." + error; + } + if (message.trueMutations != null && message.hasOwnProperty("trueMutations")) { + if (!Array.isArray(message.trueMutations)) + return "trueMutations: array expected"; + for (var i = 0; i < message.trueMutations.length; ++i) { + var error = $root.google.bigtable.v2.Mutation.verify(message.trueMutations[i]); + if (error) + return "trueMutations." + error; + } + } + if (message.falseMutations != null && message.hasOwnProperty("falseMutations")) { + if (!Array.isArray(message.falseMutations)) + return "falseMutations: array expected"; + for (var i = 0; i < message.falseMutations.length; ++i) { + var error = $root.google.bigtable.v2.Mutation.verify(message.falseMutations[i]); + if (error) + return "falseMutations." + error; + } + } + return null; + }; + + /** + * Creates a CheckAndMutateRowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.CheckAndMutateRowRequest} CheckAndMutateRowRequest + */ + CheckAndMutateRowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.CheckAndMutateRowRequest) + return object; + var message = new $root.google.bigtable.v2.CheckAndMutateRowRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.authorizedViewName != null) + message.authorizedViewName = String(object.authorizedViewName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.predicateFilter != null) { + if (typeof object.predicateFilter !== "object") + throw TypeError(".google.bigtable.v2.CheckAndMutateRowRequest.predicateFilter: object expected"); + message.predicateFilter = $root.google.bigtable.v2.RowFilter.fromObject(object.predicateFilter); + } + if (object.trueMutations) { + if (!Array.isArray(object.trueMutations)) + throw TypeError(".google.bigtable.v2.CheckAndMutateRowRequest.trueMutations: array expected"); + message.trueMutations = []; + for (var i = 0; i < object.trueMutations.length; ++i) { + if (typeof object.trueMutations[i] !== "object") + throw TypeError(".google.bigtable.v2.CheckAndMutateRowRequest.trueMutations: object expected"); + message.trueMutations[i] = $root.google.bigtable.v2.Mutation.fromObject(object.trueMutations[i]); + } + } + if (object.falseMutations) { + if (!Array.isArray(object.falseMutations)) + throw TypeError(".google.bigtable.v2.CheckAndMutateRowRequest.falseMutations: array expected"); + message.falseMutations = []; + for (var i = 0; i < object.falseMutations.length; ++i) { + if (typeof object.falseMutations[i] !== "object") + throw TypeError(".google.bigtable.v2.CheckAndMutateRowRequest.falseMutations: object expected"); + message.falseMutations[i] = $root.google.bigtable.v2.Mutation.fromObject(object.falseMutations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CheckAndMutateRowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {google.bigtable.v2.CheckAndMutateRowRequest} message CheckAndMutateRowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckAndMutateRowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.trueMutations = []; + object.falseMutations = []; + } + if (options.defaults) { + object.tableName = ""; + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + object.predicateFilter = null; + object.appProfileId = ""; + object.authorizedViewName = ""; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.trueMutations && message.trueMutations.length) { + object.trueMutations = []; + for (var j = 0; j < message.trueMutations.length; ++j) + object.trueMutations[j] = $root.google.bigtable.v2.Mutation.toObject(message.trueMutations[j], options); + } + if (message.falseMutations && message.falseMutations.length) { + object.falseMutations = []; + for (var j = 0; j < message.falseMutations.length; ++j) + object.falseMutations[j] = $root.google.bigtable.v2.Mutation.toObject(message.falseMutations[j], options); + } + if (message.predicateFilter != null && message.hasOwnProperty("predicateFilter")) + object.predicateFilter = $root.google.bigtable.v2.RowFilter.toObject(message.predicateFilter, options); + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + object.authorizedViewName = message.authorizedViewName; + return object; + }; + + /** + * Converts this CheckAndMutateRowRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + * @returns {Object.} JSON object + */ + CheckAndMutateRowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckAndMutateRowRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckAndMutateRowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.CheckAndMutateRowRequest"; + }; + + return CheckAndMutateRowRequest; + })(); + + v2.CheckAndMutateRowResponse = (function() { + + /** + * Properties of a CheckAndMutateRowResponse. + * @memberof google.bigtable.v2 + * @interface ICheckAndMutateRowResponse + * @property {boolean|null} [predicateMatched] CheckAndMutateRowResponse predicateMatched + */ + + /** + * Constructs a new CheckAndMutateRowResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a CheckAndMutateRowResponse. + * @implements ICheckAndMutateRowResponse + * @constructor + * @param {google.bigtable.v2.ICheckAndMutateRowResponse=} [properties] Properties to set + */ + function CheckAndMutateRowResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckAndMutateRowResponse predicateMatched. + * @member {boolean} predicateMatched + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @instance + */ + CheckAndMutateRowResponse.prototype.predicateMatched = false; + + /** + * Creates a new CheckAndMutateRowResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {google.bigtable.v2.ICheckAndMutateRowResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.CheckAndMutateRowResponse} CheckAndMutateRowResponse instance + */ + CheckAndMutateRowResponse.create = function create(properties) { + return new CheckAndMutateRowResponse(properties); + }; + + /** + * Encodes the specified CheckAndMutateRowResponse message. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {google.bigtable.v2.ICheckAndMutateRowResponse} message CheckAndMutateRowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAndMutateRowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.predicateMatched != null && Object.hasOwnProperty.call(message, "predicateMatched")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.predicateMatched); + return writer; + }; + + /** + * Encodes the specified CheckAndMutateRowResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {google.bigtable.v2.ICheckAndMutateRowResponse} message CheckAndMutateRowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAndMutateRowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckAndMutateRowResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.CheckAndMutateRowResponse} CheckAndMutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAndMutateRowResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.CheckAndMutateRowResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.predicateMatched = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckAndMutateRowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.CheckAndMutateRowResponse} CheckAndMutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAndMutateRowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckAndMutateRowResponse message. + * @function verify + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckAndMutateRowResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.predicateMatched != null && message.hasOwnProperty("predicateMatched")) + if (typeof message.predicateMatched !== "boolean") + return "predicateMatched: boolean expected"; + return null; + }; + + /** + * Creates a CheckAndMutateRowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.CheckAndMutateRowResponse} CheckAndMutateRowResponse + */ + CheckAndMutateRowResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.CheckAndMutateRowResponse) + return object; + var message = new $root.google.bigtable.v2.CheckAndMutateRowResponse(); + if (object.predicateMatched != null) + message.predicateMatched = Boolean(object.predicateMatched); + return message; + }; + + /** + * Creates a plain object from a CheckAndMutateRowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {google.bigtable.v2.CheckAndMutateRowResponse} message CheckAndMutateRowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckAndMutateRowResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.predicateMatched = false; + if (message.predicateMatched != null && message.hasOwnProperty("predicateMatched")) + object.predicateMatched = message.predicateMatched; + return object; + }; + + /** + * Converts this CheckAndMutateRowResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @instance + * @returns {Object.} JSON object + */ + CheckAndMutateRowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckAndMutateRowResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckAndMutateRowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.CheckAndMutateRowResponse"; + }; + + return CheckAndMutateRowResponse; + })(); + + v2.PingAndWarmRequest = (function() { + + /** + * Properties of a PingAndWarmRequest. + * @memberof google.bigtable.v2 + * @interface IPingAndWarmRequest + * @property {string|null} [name] PingAndWarmRequest name + * @property {string|null} [appProfileId] PingAndWarmRequest appProfileId + */ + + /** + * Constructs a new PingAndWarmRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a PingAndWarmRequest. + * @implements IPingAndWarmRequest + * @constructor + * @param {google.bigtable.v2.IPingAndWarmRequest=} [properties] Properties to set + */ + function PingAndWarmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PingAndWarmRequest name. + * @member {string} name + * @memberof google.bigtable.v2.PingAndWarmRequest + * @instance + */ + PingAndWarmRequest.prototype.name = ""; + + /** + * PingAndWarmRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.PingAndWarmRequest + * @instance + */ + PingAndWarmRequest.prototype.appProfileId = ""; + + /** + * Creates a new PingAndWarmRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {google.bigtable.v2.IPingAndWarmRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.PingAndWarmRequest} PingAndWarmRequest instance + */ + PingAndWarmRequest.create = function create(properties) { + return new PingAndWarmRequest(properties); + }; + + /** + * Encodes the specified PingAndWarmRequest message. Does not implicitly {@link google.bigtable.v2.PingAndWarmRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {google.bigtable.v2.IPingAndWarmRequest} message PingAndWarmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PingAndWarmRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + return writer; + }; + + /** + * Encodes the specified PingAndWarmRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.PingAndWarmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {google.bigtable.v2.IPingAndWarmRequest} message PingAndWarmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PingAndWarmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PingAndWarmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.PingAndWarmRequest} PingAndWarmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PingAndWarmRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.PingAndWarmRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PingAndWarmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.PingAndWarmRequest} PingAndWarmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PingAndWarmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PingAndWarmRequest message. + * @function verify + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PingAndWarmRequest.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.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + return null; + }; + + /** + * Creates a PingAndWarmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.PingAndWarmRequest} PingAndWarmRequest + */ + PingAndWarmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.PingAndWarmRequest) + return object; + var message = new $root.google.bigtable.v2.PingAndWarmRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + return message; + }; + + /** + * Creates a plain object from a PingAndWarmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {google.bigtable.v2.PingAndWarmRequest} message PingAndWarmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PingAndWarmRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.appProfileId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + return object; + }; + + /** + * Converts this PingAndWarmRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.PingAndWarmRequest + * @instance + * @returns {Object.} JSON object + */ + PingAndWarmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PingAndWarmRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PingAndWarmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.PingAndWarmRequest"; + }; + + return PingAndWarmRequest; + })(); + + v2.PingAndWarmResponse = (function() { + + /** + * Properties of a PingAndWarmResponse. + * @memberof google.bigtable.v2 + * @interface IPingAndWarmResponse + */ + + /** + * Constructs a new PingAndWarmResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a PingAndWarmResponse. + * @implements IPingAndWarmResponse + * @constructor + * @param {google.bigtable.v2.IPingAndWarmResponse=} [properties] Properties to set + */ + function PingAndWarmResponse(properties) { + if (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 PingAndWarmResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {google.bigtable.v2.IPingAndWarmResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.PingAndWarmResponse} PingAndWarmResponse instance + */ + PingAndWarmResponse.create = function create(properties) { + return new PingAndWarmResponse(properties); + }; + + /** + * Encodes the specified PingAndWarmResponse message. Does not implicitly {@link google.bigtable.v2.PingAndWarmResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {google.bigtable.v2.IPingAndWarmResponse} message PingAndWarmResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PingAndWarmResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PingAndWarmResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.PingAndWarmResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {google.bigtable.v2.IPingAndWarmResponse} message PingAndWarmResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PingAndWarmResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PingAndWarmResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.PingAndWarmResponse} PingAndWarmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PingAndWarmResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.PingAndWarmResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PingAndWarmResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.PingAndWarmResponse} PingAndWarmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PingAndWarmResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PingAndWarmResponse message. + * @function verify + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PingAndWarmResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PingAndWarmResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.PingAndWarmResponse} PingAndWarmResponse + */ + PingAndWarmResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.PingAndWarmResponse) + return object; + return new $root.google.bigtable.v2.PingAndWarmResponse(); + }; + + /** + * Creates a plain object from a PingAndWarmResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {google.bigtable.v2.PingAndWarmResponse} message PingAndWarmResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PingAndWarmResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PingAndWarmResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.PingAndWarmResponse + * @instance + * @returns {Object.} JSON object + */ + PingAndWarmResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PingAndWarmResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PingAndWarmResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.PingAndWarmResponse"; + }; + + return PingAndWarmResponse; + })(); + + v2.ReadModifyWriteRowRequest = (function() { + + /** + * Properties of a ReadModifyWriteRowRequest. + * @memberof google.bigtable.v2 + * @interface IReadModifyWriteRowRequest + * @property {string|null} [tableName] ReadModifyWriteRowRequest tableName + * @property {string|null} [authorizedViewName] ReadModifyWriteRowRequest authorizedViewName + * @property {string|null} [appProfileId] ReadModifyWriteRowRequest appProfileId + * @property {Uint8Array|null} [rowKey] ReadModifyWriteRowRequest rowKey + * @property {Array.|null} [rules] ReadModifyWriteRowRequest rules + */ + + /** + * Constructs a new ReadModifyWriteRowRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadModifyWriteRowRequest. + * @implements IReadModifyWriteRowRequest + * @constructor + * @param {google.bigtable.v2.IReadModifyWriteRowRequest=} [properties] Properties to set + */ + function ReadModifyWriteRowRequest(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]]; + } + + /** + * ReadModifyWriteRowRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @instance + */ + ReadModifyWriteRowRequest.prototype.tableName = ""; + + /** + * ReadModifyWriteRowRequest authorizedViewName. + * @member {string} authorizedViewName + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @instance + */ + ReadModifyWriteRowRequest.prototype.authorizedViewName = ""; + + /** + * ReadModifyWriteRowRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @instance + */ + ReadModifyWriteRowRequest.prototype.appProfileId = ""; + + /** + * ReadModifyWriteRowRequest rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @instance + */ + ReadModifyWriteRowRequest.prototype.rowKey = $util.newBuffer([]); + + /** + * ReadModifyWriteRowRequest rules. + * @member {Array.} rules + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @instance + */ + ReadModifyWriteRowRequest.prototype.rules = $util.emptyArray; + + /** + * Creates a new ReadModifyWriteRowRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {google.bigtable.v2.IReadModifyWriteRowRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadModifyWriteRowRequest} ReadModifyWriteRowRequest instance + */ + ReadModifyWriteRowRequest.create = function create(properties) { + return new ReadModifyWriteRowRequest(properties); + }; + + /** + * Encodes the specified ReadModifyWriteRowRequest message. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {google.bigtable.v2.IReadModifyWriteRowRequest} message ReadModifyWriteRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rowKey); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.bigtable.v2.ReadModifyWriteRule.encode(message.rules[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.appProfileId); + if (message.authorizedViewName != null && Object.hasOwnProperty.call(message, "authorizedViewName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.authorizedViewName); + return writer; + }; + + /** + * Encodes the specified ReadModifyWriteRowRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {google.bigtable.v2.IReadModifyWriteRowRequest} message ReadModifyWriteRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadModifyWriteRowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadModifyWriteRowRequest} ReadModifyWriteRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRowRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadModifyWriteRowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 6: { + message.authorizedViewName = reader.string(); + break; + } + case 4: { + message.appProfileId = reader.string(); + break; + } + case 2: { + message.rowKey = reader.bytes(); + break; + } + case 3: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.bigtable.v2.ReadModifyWriteRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadModifyWriteRowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadModifyWriteRowRequest} ReadModifyWriteRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadModifyWriteRowRequest message. + * @function verify + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadModifyWriteRowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + if (!$util.isString(message.authorizedViewName)) + return "authorizedViewName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer 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.bigtable.v2.ReadModifyWriteRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates a ReadModifyWriteRowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadModifyWriteRowRequest} ReadModifyWriteRowRequest + */ + ReadModifyWriteRowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadModifyWriteRowRequest) + return object; + var message = new $root.google.bigtable.v2.ReadModifyWriteRowRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.authorizedViewName != null) + message.authorizedViewName = String(object.authorizedViewName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.bigtable.v2.ReadModifyWriteRowRequest.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.bigtable.v2.ReadModifyWriteRowRequest.rules: object expected"); + message.rules[i] = $root.google.bigtable.v2.ReadModifyWriteRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ReadModifyWriteRowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {google.bigtable.v2.ReadModifyWriteRowRequest} message ReadModifyWriteRowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadModifyWriteRowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) { + object.tableName = ""; + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + object.appProfileId = ""; + object.authorizedViewName = ""; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.bigtable.v2.ReadModifyWriteRule.toObject(message.rules[j], options); + } + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + object.authorizedViewName = message.authorizedViewName; + return object; + }; + + /** + * Converts this ReadModifyWriteRowRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @instance + * @returns {Object.} JSON object + */ + ReadModifyWriteRowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadModifyWriteRowRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadModifyWriteRowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadModifyWriteRowRequest"; + }; + + return ReadModifyWriteRowRequest; + })(); + + v2.ReadModifyWriteRowResponse = (function() { + + /** + * Properties of a ReadModifyWriteRowResponse. + * @memberof google.bigtable.v2 + * @interface IReadModifyWriteRowResponse + * @property {google.bigtable.v2.IRow|null} [row] ReadModifyWriteRowResponse row + */ + + /** + * Constructs a new ReadModifyWriteRowResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadModifyWriteRowResponse. + * @implements IReadModifyWriteRowResponse + * @constructor + * @param {google.bigtable.v2.IReadModifyWriteRowResponse=} [properties] Properties to set + */ + function ReadModifyWriteRowResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadModifyWriteRowResponse row. + * @member {google.bigtable.v2.IRow|null|undefined} row + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @instance + */ + ReadModifyWriteRowResponse.prototype.row = null; + + /** + * Creates a new ReadModifyWriteRowResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {google.bigtable.v2.IReadModifyWriteRowResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadModifyWriteRowResponse} ReadModifyWriteRowResponse instance + */ + ReadModifyWriteRowResponse.create = function create(properties) { + return new ReadModifyWriteRowResponse(properties); + }; + + /** + * Encodes the specified ReadModifyWriteRowResponse message. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {google.bigtable.v2.IReadModifyWriteRowResponse} message ReadModifyWriteRowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.row != null && Object.hasOwnProperty.call(message, "row")) + $root.google.bigtable.v2.Row.encode(message.row, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadModifyWriteRowResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {google.bigtable.v2.IReadModifyWriteRowResponse} message ReadModifyWriteRowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadModifyWriteRowResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadModifyWriteRowResponse} ReadModifyWriteRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRowResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadModifyWriteRowResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.row = $root.google.bigtable.v2.Row.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadModifyWriteRowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadModifyWriteRowResponse} ReadModifyWriteRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadModifyWriteRowResponse message. + * @function verify + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadModifyWriteRowResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.row != null && message.hasOwnProperty("row")) { + var error = $root.google.bigtable.v2.Row.verify(message.row); + if (error) + return "row." + error; + } + return null; + }; + + /** + * Creates a ReadModifyWriteRowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadModifyWriteRowResponse} ReadModifyWriteRowResponse + */ + ReadModifyWriteRowResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadModifyWriteRowResponse) + return object; + var message = new $root.google.bigtable.v2.ReadModifyWriteRowResponse(); + if (object.row != null) { + if (typeof object.row !== "object") + throw TypeError(".google.bigtable.v2.ReadModifyWriteRowResponse.row: object expected"); + message.row = $root.google.bigtable.v2.Row.fromObject(object.row); + } + return message; + }; + + /** + * Creates a plain object from a ReadModifyWriteRowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {google.bigtable.v2.ReadModifyWriteRowResponse} message ReadModifyWriteRowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadModifyWriteRowResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.row = null; + if (message.row != null && message.hasOwnProperty("row")) + object.row = $root.google.bigtable.v2.Row.toObject(message.row, options); + return object; + }; + + /** + * Converts this ReadModifyWriteRowResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @instance + * @returns {Object.} JSON object + */ + ReadModifyWriteRowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadModifyWriteRowResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadModifyWriteRowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadModifyWriteRowResponse"; + }; + + return ReadModifyWriteRowResponse; + })(); + + v2.GenerateInitialChangeStreamPartitionsRequest = (function() { + + /** + * Properties of a GenerateInitialChangeStreamPartitionsRequest. + * @memberof google.bigtable.v2 + * @interface IGenerateInitialChangeStreamPartitionsRequest + * @property {string|null} [tableName] GenerateInitialChangeStreamPartitionsRequest tableName + * @property {string|null} [appProfileId] GenerateInitialChangeStreamPartitionsRequest appProfileId + */ + + /** + * Constructs a new GenerateInitialChangeStreamPartitionsRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a GenerateInitialChangeStreamPartitionsRequest. + * @implements IGenerateInitialChangeStreamPartitionsRequest + * @constructor + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest=} [properties] Properties to set + */ + function GenerateInitialChangeStreamPartitionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateInitialChangeStreamPartitionsRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @instance + */ + GenerateInitialChangeStreamPartitionsRequest.prototype.tableName = ""; + + /** + * GenerateInitialChangeStreamPartitionsRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @instance + */ + GenerateInitialChangeStreamPartitionsRequest.prototype.appProfileId = ""; + + /** + * Creates a new GenerateInitialChangeStreamPartitionsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest} GenerateInitialChangeStreamPartitionsRequest instance + */ + GenerateInitialChangeStreamPartitionsRequest.create = function create(properties) { + return new GenerateInitialChangeStreamPartitionsRequest(properties); + }; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsRequest message. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest} message GenerateInitialChangeStreamPartitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateInitialChangeStreamPartitionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + return writer; + }; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest} message GenerateInitialChangeStreamPartitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateInitialChangeStreamPartitionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest} GenerateInitialChangeStreamPartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateInitialChangeStreamPartitionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest} GenerateInitialChangeStreamPartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateInitialChangeStreamPartitionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateInitialChangeStreamPartitionsRequest message. + * @function verify + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateInitialChangeStreamPartitionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + return null; + }; + + /** + * Creates a GenerateInitialChangeStreamPartitionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest} GenerateInitialChangeStreamPartitionsRequest + */ + GenerateInitialChangeStreamPartitionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest) + return object; + var message = new $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + return message; + }; + + /** + * Creates a plain object from a GenerateInitialChangeStreamPartitionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest} message GenerateInitialChangeStreamPartitionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateInitialChangeStreamPartitionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tableName = ""; + object.appProfileId = ""; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + return object; + }; + + /** + * Converts this GenerateInitialChangeStreamPartitionsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateInitialChangeStreamPartitionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateInitialChangeStreamPartitionsRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateInitialChangeStreamPartitionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest"; + }; + + return GenerateInitialChangeStreamPartitionsRequest; + })(); + + v2.GenerateInitialChangeStreamPartitionsResponse = (function() { + + /** + * Properties of a GenerateInitialChangeStreamPartitionsResponse. + * @memberof google.bigtable.v2 + * @interface IGenerateInitialChangeStreamPartitionsResponse + * @property {google.bigtable.v2.IStreamPartition|null} [partition] GenerateInitialChangeStreamPartitionsResponse partition + */ + + /** + * Constructs a new GenerateInitialChangeStreamPartitionsResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a GenerateInitialChangeStreamPartitionsResponse. + * @implements IGenerateInitialChangeStreamPartitionsResponse + * @constructor + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse=} [properties] Properties to set + */ + function GenerateInitialChangeStreamPartitionsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateInitialChangeStreamPartitionsResponse partition. + * @member {google.bigtable.v2.IStreamPartition|null|undefined} partition + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @instance + */ + GenerateInitialChangeStreamPartitionsResponse.prototype.partition = null; + + /** + * Creates a new GenerateInitialChangeStreamPartitionsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} GenerateInitialChangeStreamPartitionsResponse instance + */ + GenerateInitialChangeStreamPartitionsResponse.create = function create(properties) { + return new GenerateInitialChangeStreamPartitionsResponse(properties); + }; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsResponse message. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse} message GenerateInitialChangeStreamPartitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateInitialChangeStreamPartitionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) + $root.google.bigtable.v2.StreamPartition.encode(message.partition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse} message GenerateInitialChangeStreamPartitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateInitialChangeStreamPartitionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} GenerateInitialChangeStreamPartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateInitialChangeStreamPartitionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partition = $root.google.bigtable.v2.StreamPartition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} GenerateInitialChangeStreamPartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateInitialChangeStreamPartitionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateInitialChangeStreamPartitionsResponse message. + * @function verify + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateInitialChangeStreamPartitionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partition != null && message.hasOwnProperty("partition")) { + var error = $root.google.bigtable.v2.StreamPartition.verify(message.partition); + if (error) + return "partition." + error; + } + return null; + }; + + /** + * Creates a GenerateInitialChangeStreamPartitionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} GenerateInitialChangeStreamPartitionsResponse + */ + GenerateInitialChangeStreamPartitionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) + return object; + var message = new $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse(); + if (object.partition != null) { + if (typeof object.partition !== "object") + throw TypeError(".google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.partition: object expected"); + message.partition = $root.google.bigtable.v2.StreamPartition.fromObject(object.partition); + } + return message; + }; + + /** + * Creates a plain object from a GenerateInitialChangeStreamPartitionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} message GenerateInitialChangeStreamPartitionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateInitialChangeStreamPartitionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.partition = null; + if (message.partition != null && message.hasOwnProperty("partition")) + object.partition = $root.google.bigtable.v2.StreamPartition.toObject(message.partition, options); + return object; + }; + + /** + * Converts this GenerateInitialChangeStreamPartitionsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateInitialChangeStreamPartitionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateInitialChangeStreamPartitionsResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateInitialChangeStreamPartitionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse"; + }; + + return GenerateInitialChangeStreamPartitionsResponse; + })(); + + v2.ReadChangeStreamRequest = (function() { + + /** + * Properties of a ReadChangeStreamRequest. + * @memberof google.bigtable.v2 + * @interface IReadChangeStreamRequest + * @property {string|null} [tableName] ReadChangeStreamRequest tableName + * @property {string|null} [appProfileId] ReadChangeStreamRequest appProfileId + * @property {google.bigtable.v2.IStreamPartition|null} [partition] ReadChangeStreamRequest partition + * @property {google.protobuf.ITimestamp|null} [startTime] ReadChangeStreamRequest startTime + * @property {google.bigtable.v2.IStreamContinuationTokens|null} [continuationTokens] ReadChangeStreamRequest continuationTokens + * @property {google.protobuf.ITimestamp|null} [endTime] ReadChangeStreamRequest endTime + * @property {google.protobuf.IDuration|null} [heartbeatDuration] ReadChangeStreamRequest heartbeatDuration + */ + + /** + * Constructs a new ReadChangeStreamRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadChangeStreamRequest. + * @implements IReadChangeStreamRequest + * @constructor + * @param {google.bigtable.v2.IReadChangeStreamRequest=} [properties] Properties to set + */ + function ReadChangeStreamRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadChangeStreamRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.tableName = ""; + + /** + * ReadChangeStreamRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.appProfileId = ""; + + /** + * ReadChangeStreamRequest partition. + * @member {google.bigtable.v2.IStreamPartition|null|undefined} partition + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.partition = null; + + /** + * ReadChangeStreamRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.startTime = null; + + /** + * ReadChangeStreamRequest continuationTokens. + * @member {google.bigtable.v2.IStreamContinuationTokens|null|undefined} continuationTokens + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.continuationTokens = null; + + /** + * ReadChangeStreamRequest endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.endTime = null; + + /** + * ReadChangeStreamRequest heartbeatDuration. + * @member {google.protobuf.IDuration|null|undefined} heartbeatDuration + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.heartbeatDuration = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadChangeStreamRequest startFrom. + * @member {"startTime"|"continuationTokens"|undefined} startFrom + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + Object.defineProperty(ReadChangeStreamRequest.prototype, "startFrom", { + get: $util.oneOfGetter($oneOfFields = ["startTime", "continuationTokens"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadChangeStreamRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {google.bigtable.v2.IReadChangeStreamRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamRequest} ReadChangeStreamRequest instance + */ + ReadChangeStreamRequest.create = function create(properties) { + return new ReadChangeStreamRequest(properties); + }; + + /** + * Encodes the specified ReadChangeStreamRequest message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {google.bigtable.v2.IReadChangeStreamRequest} message ReadChangeStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadChangeStreamRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) + $root.google.bigtable.v2.StreamPartition.encode(message.partition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.continuationTokens != null && Object.hasOwnProperty.call(message, "continuationTokens")) + $root.google.bigtable.v2.StreamContinuationTokens.encode(message.continuationTokens, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.heartbeatDuration != null && Object.hasOwnProperty.call(message, "heartbeatDuration")) + $root.google.protobuf.Duration.encode(message.heartbeatDuration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadChangeStreamRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {google.bigtable.v2.IReadChangeStreamRequest} message ReadChangeStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadChangeStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadChangeStreamRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamRequest} ReadChangeStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadChangeStreamRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + case 3: { + message.partition = $root.google.bigtable.v2.StreamPartition.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.continuationTokens = $root.google.bigtable.v2.StreamContinuationTokens.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.heartbeatDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadChangeStreamRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamRequest} ReadChangeStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadChangeStreamRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadChangeStreamRequest message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadChangeStreamRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.partition != null && message.hasOwnProperty("partition")) { + var error = $root.google.bigtable.v2.StreamPartition.verify(message.partition); + if (error) + return "partition." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + properties.startFrom = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + } + if (message.continuationTokens != null && message.hasOwnProperty("continuationTokens")) { + if (properties.startFrom === 1) + return "startFrom: multiple values"; + properties.startFrom = 1; + { + var error = $root.google.bigtable.v2.StreamContinuationTokens.verify(message.continuationTokens); + if (error) + return "continuationTokens." + error; + } + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.heartbeatDuration != null && message.hasOwnProperty("heartbeatDuration")) { + var error = $root.google.protobuf.Duration.verify(message.heartbeatDuration); + if (error) + return "heartbeatDuration." + error; + } + return null; + }; + + /** + * Creates a ReadChangeStreamRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamRequest} ReadChangeStreamRequest + */ + ReadChangeStreamRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamRequest) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.partition != null) { + if (typeof object.partition !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamRequest.partition: object expected"); + message.partition = $root.google.bigtable.v2.StreamPartition.fromObject(object.partition); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.continuationTokens != null) { + if (typeof object.continuationTokens !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamRequest.continuationTokens: object expected"); + message.continuationTokens = $root.google.bigtable.v2.StreamContinuationTokens.fromObject(object.continuationTokens); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamRequest.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.heartbeatDuration != null) { + if (typeof object.heartbeatDuration !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamRequest.heartbeatDuration: object expected"); + message.heartbeatDuration = $root.google.protobuf.Duration.fromObject(object.heartbeatDuration); + } + return message; + }; + + /** + * Creates a plain object from a ReadChangeStreamRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {google.bigtable.v2.ReadChangeStreamRequest} message ReadChangeStreamRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadChangeStreamRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tableName = ""; + object.appProfileId = ""; + object.partition = null; + object.endTime = null; + object.heartbeatDuration = null; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.partition != null && message.hasOwnProperty("partition")) + object.partition = $root.google.bigtable.v2.StreamPartition.toObject(message.partition, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) { + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (options.oneofs) + object.startFrom = "startTime"; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.continuationTokens != null && message.hasOwnProperty("continuationTokens")) { + object.continuationTokens = $root.google.bigtable.v2.StreamContinuationTokens.toObject(message.continuationTokens, options); + if (options.oneofs) + object.startFrom = "continuationTokens"; + } + if (message.heartbeatDuration != null && message.hasOwnProperty("heartbeatDuration")) + object.heartbeatDuration = $root.google.protobuf.Duration.toObject(message.heartbeatDuration, options); + return object; + }; + + /** + * Converts this ReadChangeStreamRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + * @returns {Object.} JSON object + */ + ReadChangeStreamRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadChangeStreamRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadChangeStreamRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamRequest"; + }; + + return ReadChangeStreamRequest; + })(); + + v2.ReadChangeStreamResponse = (function() { + + /** + * Properties of a ReadChangeStreamResponse. + * @memberof google.bigtable.v2 + * @interface IReadChangeStreamResponse + * @property {google.bigtable.v2.ReadChangeStreamResponse.IDataChange|null} [dataChange] ReadChangeStreamResponse dataChange + * @property {google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat|null} [heartbeat] ReadChangeStreamResponse heartbeat + * @property {google.bigtable.v2.ReadChangeStreamResponse.ICloseStream|null} [closeStream] ReadChangeStreamResponse closeStream + */ + + /** + * Constructs a new ReadChangeStreamResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadChangeStreamResponse. + * @implements IReadChangeStreamResponse + * @constructor + * @param {google.bigtable.v2.IReadChangeStreamResponse=} [properties] Properties to set + */ + function ReadChangeStreamResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadChangeStreamResponse dataChange. + * @member {google.bigtable.v2.ReadChangeStreamResponse.IDataChange|null|undefined} dataChange + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @instance + */ + ReadChangeStreamResponse.prototype.dataChange = null; + + /** + * ReadChangeStreamResponse heartbeat. + * @member {google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat|null|undefined} heartbeat + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @instance + */ + ReadChangeStreamResponse.prototype.heartbeat = null; + + /** + * ReadChangeStreamResponse closeStream. + * @member {google.bigtable.v2.ReadChangeStreamResponse.ICloseStream|null|undefined} closeStream + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @instance + */ + ReadChangeStreamResponse.prototype.closeStream = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadChangeStreamResponse streamRecord. + * @member {"dataChange"|"heartbeat"|"closeStream"|undefined} streamRecord + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @instance + */ + Object.defineProperty(ReadChangeStreamResponse.prototype, "streamRecord", { + get: $util.oneOfGetter($oneOfFields = ["dataChange", "heartbeat", "closeStream"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadChangeStreamResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {google.bigtable.v2.IReadChangeStreamResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamResponse} ReadChangeStreamResponse instance + */ + ReadChangeStreamResponse.create = function create(properties) { + return new ReadChangeStreamResponse(properties); + }; + + /** + * Encodes the specified ReadChangeStreamResponse message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {google.bigtable.v2.IReadChangeStreamResponse} message ReadChangeStreamResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadChangeStreamResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataChange != null && Object.hasOwnProperty.call(message, "dataChange")) + $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.encode(message.dataChange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.heartbeat != null && Object.hasOwnProperty.call(message, "heartbeat")) + $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.encode(message.heartbeat, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.closeStream != null && Object.hasOwnProperty.call(message, "closeStream")) + $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.encode(message.closeStream, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadChangeStreamResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {google.bigtable.v2.IReadChangeStreamResponse} message ReadChangeStreamResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadChangeStreamResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadChangeStreamResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamResponse} ReadChangeStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadChangeStreamResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataChange = $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.decode(reader, reader.uint32()); + break; + } + case 2: { + message.heartbeat = $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.decode(reader, reader.uint32()); + break; + } + case 3: { + message.closeStream = $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadChangeStreamResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamResponse} ReadChangeStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadChangeStreamResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadChangeStreamResponse message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadChangeStreamResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataChange != null && message.hasOwnProperty("dataChange")) { + properties.streamRecord = 1; + { + var error = $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.verify(message.dataChange); + if (error) + return "dataChange." + error; + } + } + if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { + if (properties.streamRecord === 1) + return "streamRecord: multiple values"; + properties.streamRecord = 1; + { + var error = $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.verify(message.heartbeat); + if (error) + return "heartbeat." + error; + } + } + if (message.closeStream != null && message.hasOwnProperty("closeStream")) { + if (properties.streamRecord === 1) + return "streamRecord: multiple values"; + properties.streamRecord = 1; + { + var error = $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.verify(message.closeStream); + if (error) + return "closeStream." + error; + } + } + return null; + }; + + /** + * Creates a ReadChangeStreamResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamResponse} ReadChangeStreamResponse + */ + ReadChangeStreamResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamResponse) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamResponse(); + if (object.dataChange != null) { + if (typeof object.dataChange !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.dataChange: object expected"); + message.dataChange = $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.fromObject(object.dataChange); + } + if (object.heartbeat != null) { + if (typeof object.heartbeat !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.heartbeat: object expected"); + message.heartbeat = $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.fromObject(object.heartbeat); + } + if (object.closeStream != null) { + if (typeof object.closeStream !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.closeStream: object expected"); + message.closeStream = $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.fromObject(object.closeStream); + } + return message; + }; + + /** + * Creates a plain object from a ReadChangeStreamResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse} message ReadChangeStreamResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadChangeStreamResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.dataChange != null && message.hasOwnProperty("dataChange")) { + object.dataChange = $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.toObject(message.dataChange, options); + if (options.oneofs) + object.streamRecord = "dataChange"; + } + if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { + object.heartbeat = $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.toObject(message.heartbeat, options); + if (options.oneofs) + object.streamRecord = "heartbeat"; + } + if (message.closeStream != null && message.hasOwnProperty("closeStream")) { + object.closeStream = $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.toObject(message.closeStream, options); + if (options.oneofs) + object.streamRecord = "closeStream"; + } + return object; + }; + + /** + * Converts this ReadChangeStreamResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @instance + * @returns {Object.} JSON object + */ + ReadChangeStreamResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadChangeStreamResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadChangeStreamResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamResponse"; + }; + + ReadChangeStreamResponse.MutationChunk = (function() { + + /** + * Properties of a MutationChunk. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @interface IMutationChunk + * @property {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo|null} [chunkInfo] MutationChunk chunkInfo + * @property {google.bigtable.v2.IMutation|null} [mutation] MutationChunk mutation + */ + + /** + * Constructs a new MutationChunk. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @classdesc Represents a MutationChunk. + * @implements IMutationChunk + * @constructor + * @param {google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk=} [properties] Properties to set + */ + function MutationChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutationChunk chunkInfo. + * @member {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo|null|undefined} chunkInfo + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @instance + */ + MutationChunk.prototype.chunkInfo = null; + + /** + * MutationChunk mutation. + * @member {google.bigtable.v2.IMutation|null|undefined} mutation + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @instance + */ + MutationChunk.prototype.mutation = null; + + /** + * Creates a new MutationChunk instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk} MutationChunk instance + */ + MutationChunk.create = function create(properties) { + return new MutationChunk(properties); + }; + + /** + * Encodes the specified MutationChunk message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk} message MutationChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkInfo != null && Object.hasOwnProperty.call(message, "chunkInfo")) + $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.encode(message.chunkInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mutation != null && Object.hasOwnProperty.call(message, "mutation")) + $root.google.bigtable.v2.Mutation.encode(message.mutation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutationChunk message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk} message MutationChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutationChunk message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk} MutationChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationChunk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chunkInfo = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + message.mutation = $root.google.bigtable.v2.Mutation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutationChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk} MutationChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutationChunk message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutationChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkInfo != null && message.hasOwnProperty("chunkInfo")) { + var error = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.verify(message.chunkInfo); + if (error) + return "chunkInfo." + error; + } + if (message.mutation != null && message.hasOwnProperty("mutation")) { + var error = $root.google.bigtable.v2.Mutation.verify(message.mutation); + if (error) + return "mutation." + error; + } + return null; + }; + + /** + * Creates a MutationChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk} MutationChunk + */ + MutationChunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk(); + if (object.chunkInfo != null) { + if (typeof object.chunkInfo !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.chunkInfo: object expected"); + message.chunkInfo = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.fromObject(object.chunkInfo); + } + if (object.mutation != null) { + if (typeof object.mutation !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.mutation: object expected"); + message.mutation = $root.google.bigtable.v2.Mutation.fromObject(object.mutation); + } + return message; + }; + + /** + * Creates a plain object from a MutationChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk} message MutationChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutationChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chunkInfo = null; + object.mutation = null; + } + if (message.chunkInfo != null && message.hasOwnProperty("chunkInfo")) + object.chunkInfo = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.toObject(message.chunkInfo, options); + if (message.mutation != null && message.hasOwnProperty("mutation")) + object.mutation = $root.google.bigtable.v2.Mutation.toObject(message.mutation, options); + return object; + }; + + /** + * Converts this MutationChunk to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @instance + * @returns {Object.} JSON object + */ + MutationChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutationChunk + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutationChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamResponse.MutationChunk"; + }; + + MutationChunk.ChunkInfo = (function() { + + /** + * Properties of a ChunkInfo. + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @interface IChunkInfo + * @property {number|null} [chunkedValueSize] ChunkInfo chunkedValueSize + * @property {number|null} [chunkedValueOffset] ChunkInfo chunkedValueOffset + * @property {boolean|null} [lastChunk] ChunkInfo lastChunk + */ + + /** + * Constructs a new ChunkInfo. + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @classdesc Represents a ChunkInfo. + * @implements IChunkInfo + * @constructor + * @param {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo=} [properties] Properties to set + */ + function ChunkInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChunkInfo chunkedValueSize. + * @member {number} chunkedValueSize + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @instance + */ + ChunkInfo.prototype.chunkedValueSize = 0; + + /** + * ChunkInfo chunkedValueOffset. + * @member {number} chunkedValueOffset + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @instance + */ + ChunkInfo.prototype.chunkedValueOffset = 0; + + /** + * ChunkInfo lastChunk. + * @member {boolean} lastChunk + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @instance + */ + ChunkInfo.prototype.lastChunk = false; + + /** + * Creates a new ChunkInfo instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo} ChunkInfo instance + */ + ChunkInfo.create = function create(properties) { + return new ChunkInfo(properties); + }; + + /** + * Encodes the specified ChunkInfo message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo} message ChunkInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkedValueSize != null && Object.hasOwnProperty.call(message, "chunkedValueSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.chunkedValueSize); + if (message.chunkedValueOffset != null && Object.hasOwnProperty.call(message, "chunkedValueOffset")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.chunkedValueOffset); + if (message.lastChunk != null && Object.hasOwnProperty.call(message, "lastChunk")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.lastChunk); + return writer; + }; + + /** + * Encodes the specified ChunkInfo message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo} message ChunkInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkInfo message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo} ChunkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chunkedValueSize = reader.int32(); + break; + } + case 2: { + message.chunkedValueOffset = reader.int32(); + break; + } + case 3: { + message.lastChunk = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo} ChunkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkInfo message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkedValueSize != null && message.hasOwnProperty("chunkedValueSize")) + if (!$util.isInteger(message.chunkedValueSize)) + return "chunkedValueSize: integer expected"; + if (message.chunkedValueOffset != null && message.hasOwnProperty("chunkedValueOffset")) + if (!$util.isInteger(message.chunkedValueOffset)) + return "chunkedValueOffset: integer expected"; + if (message.lastChunk != null && message.hasOwnProperty("lastChunk")) + if (typeof message.lastChunk !== "boolean") + return "lastChunk: boolean expected"; + return null; + }; + + /** + * Creates a ChunkInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo} ChunkInfo + */ + ChunkInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo(); + if (object.chunkedValueSize != null) + message.chunkedValueSize = object.chunkedValueSize | 0; + if (object.chunkedValueOffset != null) + message.chunkedValueOffset = object.chunkedValueOffset | 0; + if (object.lastChunk != null) + message.lastChunk = Boolean(object.lastChunk); + return message; + }; + + /** + * Creates a plain object from a ChunkInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo} message ChunkInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chunkedValueSize = 0; + object.chunkedValueOffset = 0; + object.lastChunk = false; + } + if (message.chunkedValueSize != null && message.hasOwnProperty("chunkedValueSize")) + object.chunkedValueSize = message.chunkedValueSize; + if (message.chunkedValueOffset != null && message.hasOwnProperty("chunkedValueOffset")) + object.chunkedValueOffset = message.chunkedValueOffset; + if (message.lastChunk != null && message.hasOwnProperty("lastChunk")) + object.lastChunk = message.lastChunk; + return object; + }; + + /** + * Converts this ChunkInfo to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @instance + * @returns {Object.} JSON object + */ + ChunkInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkInfo + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo"; + }; + + return ChunkInfo; + })(); + + return MutationChunk; + })(); + + ReadChangeStreamResponse.DataChange = (function() { + + /** + * Properties of a DataChange. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @interface IDataChange + * @property {google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type|null} [type] DataChange type + * @property {string|null} [sourceClusterId] DataChange sourceClusterId + * @property {Uint8Array|null} [rowKey] DataChange rowKey + * @property {google.protobuf.ITimestamp|null} [commitTimestamp] DataChange commitTimestamp + * @property {number|null} [tiebreaker] DataChange tiebreaker + * @property {Array.|null} [chunks] DataChange chunks + * @property {boolean|null} [done] DataChange done + * @property {string|null} [token] DataChange token + * @property {google.protobuf.ITimestamp|null} [estimatedLowWatermark] DataChange estimatedLowWatermark + */ + + /** + * Constructs a new DataChange. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @classdesc Represents a DataChange. + * @implements IDataChange + * @constructor + * @param {google.bigtable.v2.ReadChangeStreamResponse.IDataChange=} [properties] Properties to set + */ + function DataChange(properties) { + this.chunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataChange type. + * @member {google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type} type + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.type = 0; + + /** + * DataChange sourceClusterId. + * @member {string} sourceClusterId + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.sourceClusterId = ""; + + /** + * DataChange rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.rowKey = $util.newBuffer([]); + + /** + * DataChange commitTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.commitTimestamp = null; + + /** + * DataChange tiebreaker. + * @member {number} tiebreaker + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.tiebreaker = 0; + + /** + * DataChange chunks. + * @member {Array.} chunks + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.chunks = $util.emptyArray; + + /** + * DataChange done. + * @member {boolean} done + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.done = false; + + /** + * DataChange token. + * @member {string} token + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.token = ""; + + /** + * DataChange estimatedLowWatermark. + * @member {google.protobuf.ITimestamp|null|undefined} estimatedLowWatermark + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.estimatedLowWatermark = null; + + /** + * Creates a new DataChange instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IDataChange=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamResponse.DataChange} DataChange instance + */ + DataChange.create = function create(properties) { + return new DataChange(properties); + }; + + /** + * Encodes the specified DataChange message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.DataChange.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IDataChange} message DataChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataChange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.sourceClusterId != null && Object.hasOwnProperty.call(message, "sourceClusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceClusterId); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.rowKey); + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tiebreaker != null && Object.hasOwnProperty.call(message, "tiebreaker")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.tiebreaker); + if (message.chunks != null && message.chunks.length) + for (var i = 0; i < message.chunks.length; ++i) + $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.encode(message.chunks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.done); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.token); + if (message.estimatedLowWatermark != null && Object.hasOwnProperty.call(message, "estimatedLowWatermark")) + $root.google.protobuf.Timestamp.encode(message.estimatedLowWatermark, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataChange message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.DataChange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IDataChange} message DataChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataChange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataChange message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamResponse.DataChange} DataChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataChange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.sourceClusterId = reader.string(); + break; + } + case 3: { + message.rowKey = reader.bytes(); + break; + } + case 4: { + message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.tiebreaker = reader.int32(); + break; + } + case 6: { + if (!(message.chunks && message.chunks.length)) + message.chunks = []; + message.chunks.push($root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.decode(reader, reader.uint32())); + break; + } + case 8: { + message.done = reader.bool(); + break; + } + case 9: { + message.token = reader.string(); + break; + } + case 10: { + message.estimatedLowWatermark = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataChange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamResponse.DataChange} DataChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataChange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataChange message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataChange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sourceClusterId != null && message.hasOwnProperty("sourceClusterId")) + if (!$util.isString(message.sourceClusterId)) + return "sourceClusterId: string expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer expected"; + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); + if (error) + return "commitTimestamp." + error; + } + if (message.tiebreaker != null && message.hasOwnProperty("tiebreaker")) + if (!$util.isInteger(message.tiebreaker)) + return "tiebreaker: integer expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) { + if (!Array.isArray(message.chunks)) + return "chunks: array expected"; + for (var i = 0; i < message.chunks.length; ++i) { + var error = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.verify(message.chunks[i]); + if (error) + return "chunks." + error; + } + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.estimatedLowWatermark != null && message.hasOwnProperty("estimatedLowWatermark")) { + var error = $root.google.protobuf.Timestamp.verify(message.estimatedLowWatermark); + if (error) + return "estimatedLowWatermark." + error; + } + return null; + }; + + /** + * Creates a DataChange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamResponse.DataChange} DataChange + */ + DataChange.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "USER": + case 1: + message.type = 1; + break; + case "GARBAGE_COLLECTION": + case 2: + message.type = 2; + break; + case "CONTINUATION": + case 3: + message.type = 3; + break; + } + if (object.sourceClusterId != null) + message.sourceClusterId = String(object.sourceClusterId); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.commitTimestamp != null) { + if (typeof object.commitTimestamp !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.DataChange.commitTimestamp: object expected"); + message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); + } + if (object.tiebreaker != null) + message.tiebreaker = object.tiebreaker | 0; + if (object.chunks) { + if (!Array.isArray(object.chunks)) + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.DataChange.chunks: array expected"); + message.chunks = []; + for (var i = 0; i < object.chunks.length; ++i) { + if (typeof object.chunks[i] !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.DataChange.chunks: object expected"); + message.chunks[i] = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.fromObject(object.chunks[i]); + } + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.token != null) + message.token = String(object.token); + if (object.estimatedLowWatermark != null) { + if (typeof object.estimatedLowWatermark !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.DataChange.estimatedLowWatermark: object expected"); + message.estimatedLowWatermark = $root.google.protobuf.Timestamp.fromObject(object.estimatedLowWatermark); + } + return message; + }; + + /** + * Creates a plain object from a DataChange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.DataChange} message DataChange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataChange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.chunks = []; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.sourceClusterId = ""; + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + object.commitTimestamp = null; + object.tiebreaker = 0; + object.done = false; + object.token = ""; + object.estimatedLowWatermark = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type[message.type] === undefined ? message.type : $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type[message.type] : message.type; + if (message.sourceClusterId != null && message.hasOwnProperty("sourceClusterId")) + object.sourceClusterId = message.sourceClusterId; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); + if (message.tiebreaker != null && message.hasOwnProperty("tiebreaker")) + object.tiebreaker = message.tiebreaker; + if (message.chunks && message.chunks.length) { + object.chunks = []; + for (var j = 0; j < message.chunks.length; ++j) + object.chunks[j] = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.toObject(message.chunks[j], options); + } + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.estimatedLowWatermark != null && message.hasOwnProperty("estimatedLowWatermark")) + object.estimatedLowWatermark = $root.google.protobuf.Timestamp.toObject(message.estimatedLowWatermark, options); + return object; + }; + + /** + * Converts this DataChange to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + * @returns {Object.} JSON object + */ + DataChange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataChange + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataChange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamResponse.DataChange"; + }; + + /** + * Type enum. + * @name google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} USER=1 USER value + * @property {number} GARBAGE_COLLECTION=2 GARBAGE_COLLECTION value + * @property {number} CONTINUATION=3 CONTINUATION value + */ + DataChange.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER"] = 1; + values[valuesById[2] = "GARBAGE_COLLECTION"] = 2; + values[valuesById[3] = "CONTINUATION"] = 3; + return values; + })(); + + return DataChange; + })(); + + ReadChangeStreamResponse.Heartbeat = (function() { + + /** + * Properties of a Heartbeat. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @interface IHeartbeat + * @property {google.bigtable.v2.IStreamContinuationToken|null} [continuationToken] Heartbeat continuationToken + * @property {google.protobuf.ITimestamp|null} [estimatedLowWatermark] Heartbeat estimatedLowWatermark + */ + + /** + * Constructs a new Heartbeat. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @classdesc Represents a Heartbeat. + * @implements IHeartbeat + * @constructor + * @param {google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat=} [properties] Properties to set + */ + function Heartbeat(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Heartbeat continuationToken. + * @member {google.bigtable.v2.IStreamContinuationToken|null|undefined} continuationToken + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @instance + */ + Heartbeat.prototype.continuationToken = null; + + /** + * Heartbeat estimatedLowWatermark. + * @member {google.protobuf.ITimestamp|null|undefined} estimatedLowWatermark + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @instance + */ + Heartbeat.prototype.estimatedLowWatermark = null; + + /** + * Creates a new Heartbeat instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamResponse.Heartbeat} Heartbeat instance + */ + Heartbeat.create = function create(properties) { + return new Heartbeat(properties); + }; + + /** + * Encodes the specified Heartbeat message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat} message Heartbeat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Heartbeat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.continuationToken != null && Object.hasOwnProperty.call(message, "continuationToken")) + $root.google.bigtable.v2.StreamContinuationToken.encode(message.continuationToken, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.estimatedLowWatermark != null && Object.hasOwnProperty.call(message, "estimatedLowWatermark")) + $root.google.protobuf.Timestamp.encode(message.estimatedLowWatermark, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Heartbeat message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat} message Heartbeat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Heartbeat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Heartbeat message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamResponse.Heartbeat} Heartbeat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Heartbeat.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.continuationToken = $root.google.bigtable.v2.StreamContinuationToken.decode(reader, reader.uint32()); + break; + } + case 2: { + message.estimatedLowWatermark = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Heartbeat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamResponse.Heartbeat} Heartbeat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Heartbeat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Heartbeat message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Heartbeat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.continuationToken != null && message.hasOwnProperty("continuationToken")) { + var error = $root.google.bigtable.v2.StreamContinuationToken.verify(message.continuationToken); + if (error) + return "continuationToken." + error; + } + if (message.estimatedLowWatermark != null && message.hasOwnProperty("estimatedLowWatermark")) { + var error = $root.google.protobuf.Timestamp.verify(message.estimatedLowWatermark); + if (error) + return "estimatedLowWatermark." + error; + } + return null; + }; + + /** + * Creates a Heartbeat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamResponse.Heartbeat} Heartbeat + */ + Heartbeat.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat(); + if (object.continuationToken != null) { + if (typeof object.continuationToken !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.continuationToken: object expected"); + message.continuationToken = $root.google.bigtable.v2.StreamContinuationToken.fromObject(object.continuationToken); + } + if (object.estimatedLowWatermark != null) { + if (typeof object.estimatedLowWatermark !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.estimatedLowWatermark: object expected"); + message.estimatedLowWatermark = $root.google.protobuf.Timestamp.fromObject(object.estimatedLowWatermark); + } + return message; + }; + + /** + * Creates a plain object from a Heartbeat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.Heartbeat} message Heartbeat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Heartbeat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.continuationToken = null; + object.estimatedLowWatermark = null; + } + if (message.continuationToken != null && message.hasOwnProperty("continuationToken")) + object.continuationToken = $root.google.bigtable.v2.StreamContinuationToken.toObject(message.continuationToken, options); + if (message.estimatedLowWatermark != null && message.hasOwnProperty("estimatedLowWatermark")) + object.estimatedLowWatermark = $root.google.protobuf.Timestamp.toObject(message.estimatedLowWatermark, options); + return object; + }; + + /** + * Converts this Heartbeat to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @instance + * @returns {Object.} JSON object + */ + Heartbeat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Heartbeat + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Heartbeat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamResponse.Heartbeat"; + }; + + return Heartbeat; + })(); + + ReadChangeStreamResponse.CloseStream = (function() { + + /** + * Properties of a CloseStream. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @interface ICloseStream + * @property {google.rpc.IStatus|null} [status] CloseStream status + * @property {Array.|null} [continuationTokens] CloseStream continuationTokens + * @property {Array.|null} [newPartitions] CloseStream newPartitions + */ + + /** + * Constructs a new CloseStream. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @classdesc Represents a CloseStream. + * @implements ICloseStream + * @constructor + * @param {google.bigtable.v2.ReadChangeStreamResponse.ICloseStream=} [properties] Properties to set + */ + function CloseStream(properties) { + this.continuationTokens = []; + this.newPartitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloseStream status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @instance + */ + CloseStream.prototype.status = null; + + /** + * CloseStream continuationTokens. + * @member {Array.} continuationTokens + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @instance + */ + CloseStream.prototype.continuationTokens = $util.emptyArray; + + /** + * CloseStream newPartitions. + * @member {Array.} newPartitions + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @instance + */ + CloseStream.prototype.newPartitions = $util.emptyArray; + + /** + * Creates a new CloseStream instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.ICloseStream=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamResponse.CloseStream} CloseStream instance + */ + CloseStream.create = function create(properties) { + return new CloseStream(properties); + }; + + /** + * Encodes the specified CloseStream message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.CloseStream.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.ICloseStream} message CloseStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseStream.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.continuationTokens != null && message.continuationTokens.length) + for (var i = 0; i < message.continuationTokens.length; ++i) + $root.google.bigtable.v2.StreamContinuationToken.encode(message.continuationTokens[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newPartitions != null && message.newPartitions.length) + for (var i = 0; i < message.newPartitions.length; ++i) + $root.google.bigtable.v2.StreamPartition.encode(message.newPartitions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloseStream message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.CloseStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.ICloseStream} message CloseStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseStream.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloseStream message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamResponse.CloseStream} CloseStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseStream.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.continuationTokens && message.continuationTokens.length)) + message.continuationTokens = []; + message.continuationTokens.push($root.google.bigtable.v2.StreamContinuationToken.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.newPartitions && message.newPartitions.length)) + message.newPartitions = []; + message.newPartitions.push($root.google.bigtable.v2.StreamPartition.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloseStream message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamResponse.CloseStream} CloseStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseStream.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloseStream message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloseStream.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.continuationTokens != null && message.hasOwnProperty("continuationTokens")) { + if (!Array.isArray(message.continuationTokens)) + return "continuationTokens: array expected"; + for (var i = 0; i < message.continuationTokens.length; ++i) { + var error = $root.google.bigtable.v2.StreamContinuationToken.verify(message.continuationTokens[i]); + if (error) + return "continuationTokens." + error; + } + } + if (message.newPartitions != null && message.hasOwnProperty("newPartitions")) { + if (!Array.isArray(message.newPartitions)) + return "newPartitions: array expected"; + for (var i = 0; i < message.newPartitions.length; ++i) { + var error = $root.google.bigtable.v2.StreamPartition.verify(message.newPartitions[i]); + if (error) + return "newPartitions." + error; + } + } + return null; + }; + + /** + * Creates a CloseStream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamResponse.CloseStream} CloseStream + */ + CloseStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.CloseStream.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.continuationTokens) { + if (!Array.isArray(object.continuationTokens)) + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.CloseStream.continuationTokens: array expected"); + message.continuationTokens = []; + for (var i = 0; i < object.continuationTokens.length; ++i) { + if (typeof object.continuationTokens[i] !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.CloseStream.continuationTokens: object expected"); + message.continuationTokens[i] = $root.google.bigtable.v2.StreamContinuationToken.fromObject(object.continuationTokens[i]); + } + } + if (object.newPartitions) { + if (!Array.isArray(object.newPartitions)) + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.CloseStream.newPartitions: array expected"); + message.newPartitions = []; + for (var i = 0; i < object.newPartitions.length; ++i) { + if (typeof object.newPartitions[i] !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.CloseStream.newPartitions: object expected"); + message.newPartitions[i] = $root.google.bigtable.v2.StreamPartition.fromObject(object.newPartitions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CloseStream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.CloseStream} message CloseStream + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloseStream.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.continuationTokens = []; + object.newPartitions = []; + } + if (options.defaults) + object.status = null; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.continuationTokens && message.continuationTokens.length) { + object.continuationTokens = []; + for (var j = 0; j < message.continuationTokens.length; ++j) + object.continuationTokens[j] = $root.google.bigtable.v2.StreamContinuationToken.toObject(message.continuationTokens[j], options); + } + if (message.newPartitions && message.newPartitions.length) { + object.newPartitions = []; + for (var j = 0; j < message.newPartitions.length; ++j) + object.newPartitions[j] = $root.google.bigtable.v2.StreamPartition.toObject(message.newPartitions[j], options); + } + return object; + }; + + /** + * Converts this CloseStream to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @instance + * @returns {Object.} JSON object + */ + CloseStream.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloseStream + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseStream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamResponse.CloseStream"; + }; + + return CloseStream; + })(); + + return ReadChangeStreamResponse; + })(); + + v2.ExecuteQueryRequest = (function() { + + /** + * Properties of an ExecuteQueryRequest. + * @memberof google.bigtable.v2 + * @interface IExecuteQueryRequest + * @property {string|null} [instanceName] ExecuteQueryRequest instanceName + * @property {string|null} [appProfileId] ExecuteQueryRequest appProfileId + * @property {string|null} [query] ExecuteQueryRequest query + * @property {Uint8Array|null} [preparedQuery] ExecuteQueryRequest preparedQuery + * @property {google.bigtable.v2.IProtoFormat|null} [protoFormat] ExecuteQueryRequest protoFormat + * @property {Uint8Array|null} [resumeToken] ExecuteQueryRequest resumeToken + * @property {Object.|null} [params] ExecuteQueryRequest params + */ + + /** + * Constructs a new ExecuteQueryRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents an ExecuteQueryRequest. + * @implements IExecuteQueryRequest + * @constructor + * @param {google.bigtable.v2.IExecuteQueryRequest=} [properties] Properties to set + */ + function ExecuteQueryRequest(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteQueryRequest instanceName. + * @member {string} instanceName + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.instanceName = ""; + + /** + * ExecuteQueryRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.appProfileId = ""; + + /** + * ExecuteQueryRequest query. + * @member {string} query + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.query = ""; + + /** + * ExecuteQueryRequest preparedQuery. + * @member {Uint8Array} preparedQuery + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.preparedQuery = $util.newBuffer([]); + + /** + * ExecuteQueryRequest protoFormat. + * @member {google.bigtable.v2.IProtoFormat|null|undefined} protoFormat + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.protoFormat = null; + + /** + * ExecuteQueryRequest resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.resumeToken = $util.newBuffer([]); + + /** + * ExecuteQueryRequest params. + * @member {Object.} params + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.params = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteQueryRequest dataFormat. + * @member {"protoFormat"|undefined} dataFormat + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + Object.defineProperty(ExecuteQueryRequest.prototype, "dataFormat", { + get: $util.oneOfGetter($oneOfFields = ["protoFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteQueryRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {google.bigtable.v2.IExecuteQueryRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.ExecuteQueryRequest} ExecuteQueryRequest instance + */ + ExecuteQueryRequest.create = function create(properties) { + return new ExecuteQueryRequest(properties); + }; + + /** + * Encodes the specified ExecuteQueryRequest message. Does not implicitly {@link google.bigtable.v2.ExecuteQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {google.bigtable.v2.IExecuteQueryRequest} message ExecuteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceName != null && Object.hasOwnProperty.call(message, "instanceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceName); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + if (message.protoFormat != null && Object.hasOwnProperty.call(message, "protoFormat")) + $root.google.bigtable.v2.ProtoFormat.encode(message.protoFormat, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.v2.Value.encode(message.params[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.resumeToken); + if (message.preparedQuery != null && Object.hasOwnProperty.call(message, "preparedQuery")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.preparedQuery); + return writer; + }; + + /** + * Encodes the specified ExecuteQueryRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ExecuteQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {google.bigtable.v2.IExecuteQueryRequest} message ExecuteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ExecuteQueryRequest} ExecuteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQueryRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ExecuteQueryRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceName = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + case 3: { + message.query = reader.string(); + break; + } + case 9: { + message.preparedQuery = reader.bytes(); + break; + } + case 4: { + message.protoFormat = $root.google.bigtable.v2.ProtoFormat.decode(reader, reader.uint32()); + break; + } + case 8: { + message.resumeToken = reader.bytes(); + break; + } + case 7: { + if (message.params === $util.emptyObject) + message.params = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ExecuteQueryRequest} ExecuteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteQueryRequest message. + * @function verify + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceName != null && message.hasOwnProperty("instanceName")) + if (!$util.isString(message.instanceName)) + return "instanceName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.preparedQuery != null && message.hasOwnProperty("preparedQuery")) + if (!(message.preparedQuery && typeof message.preparedQuery.length === "number" || $util.isString(message.preparedQuery))) + return "preparedQuery: buffer expected"; + if (message.protoFormat != null && message.hasOwnProperty("protoFormat")) { + properties.dataFormat = 1; + { + var error = $root.google.bigtable.v2.ProtoFormat.verify(message.protoFormat); + if (error) + return "protoFormat." + error; + } + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.v2.Value.verify(message.params[key[i]]); + if (error) + return "params." + error; + } + } + return null; + }; + + /** + * Creates an ExecuteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ExecuteQueryRequest} ExecuteQueryRequest + */ + ExecuteQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ExecuteQueryRequest) + return object; + var message = new $root.google.bigtable.v2.ExecuteQueryRequest(); + if (object.instanceName != null) + message.instanceName = String(object.instanceName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.query != null) + message.query = String(object.query); + if (object.preparedQuery != null) + if (typeof object.preparedQuery === "string") + $util.base64.decode(object.preparedQuery, message.preparedQuery = $util.newBuffer($util.base64.length(object.preparedQuery)), 0); + else if (object.preparedQuery.length >= 0) + message.preparedQuery = object.preparedQuery; + if (object.protoFormat != null) { + if (typeof object.protoFormat !== "object") + throw TypeError(".google.bigtable.v2.ExecuteQueryRequest.protoFormat: object expected"); + message.protoFormat = $root.google.bigtable.v2.ProtoFormat.fromObject(object.protoFormat); + } + if (object.resumeToken != null) + if (typeof object.resumeToken === "string") + $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); + else if (object.resumeToken.length >= 0) + message.resumeToken = object.resumeToken; + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.bigtable.v2.ExecuteQueryRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) { + if (typeof object.params[keys[i]] !== "object") + throw TypeError(".google.bigtable.v2.ExecuteQueryRequest.params: object expected"); + message.params[keys[i]] = $root.google.bigtable.v2.Value.fromObject(object.params[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExecuteQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {google.bigtable.v2.ExecuteQueryRequest} message ExecuteQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) { + object.instanceName = ""; + object.appProfileId = ""; + object.query = ""; + if (options.bytes === String) + object.resumeToken = ""; + else { + object.resumeToken = []; + if (options.bytes !== Array) + object.resumeToken = $util.newBuffer(object.resumeToken); + } + if (options.bytes === String) + object.preparedQuery = ""; + else { + object.preparedQuery = []; + if (options.bytes !== Array) + object.preparedQuery = $util.newBuffer(object.preparedQuery); + } + } + if (message.instanceName != null && message.hasOwnProperty("instanceName")) + object.instanceName = message.instanceName; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.protoFormat != null && message.hasOwnProperty("protoFormat")) { + object.protoFormat = $root.google.bigtable.v2.ProtoFormat.toObject(message.protoFormat, options); + if (options.oneofs) + object.dataFormat = "protoFormat"; + } + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = $root.google.bigtable.v2.Value.toObject(message.params[keys2[j]], options); + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; + if (message.preparedQuery != null && message.hasOwnProperty("preparedQuery")) + object.preparedQuery = options.bytes === String ? $util.base64.encode(message.preparedQuery, 0, message.preparedQuery.length) : options.bytes === Array ? Array.prototype.slice.call(message.preparedQuery) : message.preparedQuery; + return object; + }; + + /** + * Converts this ExecuteQueryRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteQueryRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ExecuteQueryRequest"; + }; + + return ExecuteQueryRequest; + })(); + + v2.ExecuteQueryResponse = (function() { + + /** + * Properties of an ExecuteQueryResponse. + * @memberof google.bigtable.v2 + * @interface IExecuteQueryResponse + * @property {google.bigtable.v2.IResultSetMetadata|null} [metadata] ExecuteQueryResponse metadata + * @property {google.bigtable.v2.IPartialResultSet|null} [results] ExecuteQueryResponse results + */ + + /** + * Constructs a new ExecuteQueryResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents an ExecuteQueryResponse. + * @implements IExecuteQueryResponse + * @constructor + * @param {google.bigtable.v2.IExecuteQueryResponse=} [properties] Properties to set + */ + function ExecuteQueryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteQueryResponse metadata. + * @member {google.bigtable.v2.IResultSetMetadata|null|undefined} metadata + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @instance + */ + ExecuteQueryResponse.prototype.metadata = null; + + /** + * ExecuteQueryResponse results. + * @member {google.bigtable.v2.IPartialResultSet|null|undefined} results + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @instance + */ + ExecuteQueryResponse.prototype.results = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteQueryResponse response. + * @member {"metadata"|"results"|undefined} response + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @instance + */ + Object.defineProperty(ExecuteQueryResponse.prototype, "response", { + get: $util.oneOfGetter($oneOfFields = ["metadata", "results"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteQueryResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {google.bigtable.v2.IExecuteQueryResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.ExecuteQueryResponse} ExecuteQueryResponse instance + */ + ExecuteQueryResponse.create = function create(properties) { + return new ExecuteQueryResponse(properties); + }; + + /** + * Encodes the specified ExecuteQueryResponse message. Does not implicitly {@link google.bigtable.v2.ExecuteQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {google.bigtable.v2.IExecuteQueryResponse} message ExecuteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.bigtable.v2.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.results != null && Object.hasOwnProperty.call(message, "results")) + $root.google.bigtable.v2.PartialResultSet.encode(message.results, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteQueryResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ExecuteQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {google.bigtable.v2.IExecuteQueryResponse} message ExecuteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ExecuteQueryResponse} ExecuteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQueryResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ExecuteQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.bigtable.v2.ResultSetMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.results = $root.google.bigtable.v2.PartialResultSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ExecuteQueryResponse} ExecuteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteQueryResponse message. + * @function verify + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties.response = 1; + { + var error = $root.google.bigtable.v2.ResultSetMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + } + if (message.results != null && message.hasOwnProperty("results")) { + if (properties.response === 1) + return "response: multiple values"; + properties.response = 1; + { + var error = $root.google.bigtable.v2.PartialResultSet.verify(message.results); + if (error) + return "results." + error; + } + } + return null; + }; + + /** + * Creates an ExecuteQueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ExecuteQueryResponse} ExecuteQueryResponse + */ + ExecuteQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ExecuteQueryResponse) + return object; + var message = new $root.google.bigtable.v2.ExecuteQueryResponse(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.bigtable.v2.ExecuteQueryResponse.metadata: object expected"); + message.metadata = $root.google.bigtable.v2.ResultSetMetadata.fromObject(object.metadata); + } + if (object.results != null) { + if (typeof object.results !== "object") + throw TypeError(".google.bigtable.v2.ExecuteQueryResponse.results: object expected"); + message.results = $root.google.bigtable.v2.PartialResultSet.fromObject(object.results); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteQueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {google.bigtable.v2.ExecuteQueryResponse} message ExecuteQueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteQueryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = $root.google.bigtable.v2.ResultSetMetadata.toObject(message.metadata, options); + if (options.oneofs) + object.response = "metadata"; + } + if (message.results != null && message.hasOwnProperty("results")) { + object.results = $root.google.bigtable.v2.PartialResultSet.toObject(message.results, options); + if (options.oneofs) + object.response = "results"; + } + return object; + }; + + /** + * Converts this ExecuteQueryResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @instance + * @returns {Object.} JSON object + */ + ExecuteQueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteQueryResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteQueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ExecuteQueryResponse"; + }; + + return ExecuteQueryResponse; + })(); + + v2.PrepareQueryRequest = (function() { + + /** + * Properties of a PrepareQueryRequest. + * @memberof google.bigtable.v2 + * @interface IPrepareQueryRequest + * @property {string|null} [instanceName] PrepareQueryRequest instanceName + * @property {string|null} [appProfileId] PrepareQueryRequest appProfileId + * @property {string|null} [query] PrepareQueryRequest query + * @property {google.bigtable.v2.IProtoFormat|null} [protoFormat] PrepareQueryRequest protoFormat + * @property {Object.|null} [paramTypes] PrepareQueryRequest paramTypes + */ + + /** + * Constructs a new PrepareQueryRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a PrepareQueryRequest. + * @implements IPrepareQueryRequest + * @constructor + * @param {google.bigtable.v2.IPrepareQueryRequest=} [properties] Properties to set + */ + function PrepareQueryRequest(properties) { + this.paramTypes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrepareQueryRequest instanceName. + * @member {string} instanceName + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + */ + PrepareQueryRequest.prototype.instanceName = ""; + + /** + * PrepareQueryRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + */ + PrepareQueryRequest.prototype.appProfileId = ""; + + /** + * PrepareQueryRequest query. + * @member {string} query + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + */ + PrepareQueryRequest.prototype.query = ""; + + /** + * PrepareQueryRequest protoFormat. + * @member {google.bigtable.v2.IProtoFormat|null|undefined} protoFormat + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + */ + PrepareQueryRequest.prototype.protoFormat = null; + + /** + * PrepareQueryRequest paramTypes. + * @member {Object.} paramTypes + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + */ + PrepareQueryRequest.prototype.paramTypes = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PrepareQueryRequest dataFormat. + * @member {"protoFormat"|undefined} dataFormat + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + */ + Object.defineProperty(PrepareQueryRequest.prototype, "dataFormat", { + get: $util.oneOfGetter($oneOfFields = ["protoFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PrepareQueryRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {google.bigtable.v2.IPrepareQueryRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.PrepareQueryRequest} PrepareQueryRequest instance + */ + PrepareQueryRequest.create = function create(properties) { + return new PrepareQueryRequest(properties); + }; + + /** + * Encodes the specified PrepareQueryRequest message. Does not implicitly {@link google.bigtable.v2.PrepareQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {google.bigtable.v2.IPrepareQueryRequest} message PrepareQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceName != null && Object.hasOwnProperty.call(message, "instanceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceName); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + if (message.protoFormat != null && Object.hasOwnProperty.call(message, "protoFormat")) + $root.google.bigtable.v2.ProtoFormat.encode(message.protoFormat, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) + for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.v2.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified PrepareQueryRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.PrepareQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {google.bigtable.v2.IPrepareQueryRequest} message PrepareQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrepareQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.PrepareQueryRequest} PrepareQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareQueryRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.PrepareQueryRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceName = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + case 3: { + message.query = reader.string(); + break; + } + case 4: { + message.protoFormat = $root.google.bigtable.v2.ProtoFormat.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.paramTypes === $util.emptyObject) + message.paramTypes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.paramTypes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrepareQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.PrepareQueryRequest} PrepareQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrepareQueryRequest message. + * @function verify + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrepareQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceName != null && message.hasOwnProperty("instanceName")) + if (!$util.isString(message.instanceName)) + return "instanceName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.protoFormat != null && message.hasOwnProperty("protoFormat")) { + properties.dataFormat = 1; + { + var error = $root.google.bigtable.v2.ProtoFormat.verify(message.protoFormat); + if (error) + return "protoFormat." + error; + } + } + if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (!$util.isObject(message.paramTypes)) + return "paramTypes: object expected"; + var key = Object.keys(message.paramTypes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.v2.Type.verify(message.paramTypes[key[i]]); + if (error) + return "paramTypes." + error; + } + } + return null; + }; + + /** + * Creates a PrepareQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.PrepareQueryRequest} PrepareQueryRequest + */ + PrepareQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.PrepareQueryRequest) + return object; + var message = new $root.google.bigtable.v2.PrepareQueryRequest(); + if (object.instanceName != null) + message.instanceName = String(object.instanceName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.query != null) + message.query = String(object.query); + if (object.protoFormat != null) { + if (typeof object.protoFormat !== "object") + throw TypeError(".google.bigtable.v2.PrepareQueryRequest.protoFormat: object expected"); + message.protoFormat = $root.google.bigtable.v2.ProtoFormat.fromObject(object.protoFormat); + } + if (object.paramTypes) { + if (typeof object.paramTypes !== "object") + throw TypeError(".google.bigtable.v2.PrepareQueryRequest.paramTypes: object expected"); + message.paramTypes = {}; + for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { + if (typeof object.paramTypes[keys[i]] !== "object") + throw TypeError(".google.bigtable.v2.PrepareQueryRequest.paramTypes: object expected"); + message.paramTypes[keys[i]] = $root.google.bigtable.v2.Type.fromObject(object.paramTypes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a PrepareQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {google.bigtable.v2.PrepareQueryRequest} message PrepareQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrepareQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.paramTypes = {}; + if (options.defaults) { + object.instanceName = ""; + object.appProfileId = ""; + object.query = ""; + } + if (message.instanceName != null && message.hasOwnProperty("instanceName")) + object.instanceName = message.instanceName; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.protoFormat != null && message.hasOwnProperty("protoFormat")) { + object.protoFormat = $root.google.bigtable.v2.ProtoFormat.toObject(message.protoFormat, options); + if (options.oneofs) + object.dataFormat = "protoFormat"; + } + var keys2; + if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { + object.paramTypes = {}; + for (var j = 0; j < keys2.length; ++j) + object.paramTypes[keys2[j]] = $root.google.bigtable.v2.Type.toObject(message.paramTypes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this PrepareQueryRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + * @returns {Object.} JSON object + */ + PrepareQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrepareQueryRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrepareQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.PrepareQueryRequest"; + }; + + return PrepareQueryRequest; + })(); + + v2.PrepareQueryResponse = (function() { + + /** + * Properties of a PrepareQueryResponse. + * @memberof google.bigtable.v2 + * @interface IPrepareQueryResponse + * @property {google.bigtable.v2.IResultSetMetadata|null} [metadata] PrepareQueryResponse metadata + * @property {Uint8Array|null} [preparedQuery] PrepareQueryResponse preparedQuery + * @property {google.protobuf.ITimestamp|null} [validUntil] PrepareQueryResponse validUntil + */ + + /** + * Constructs a new PrepareQueryResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a PrepareQueryResponse. + * @implements IPrepareQueryResponse + * @constructor + * @param {google.bigtable.v2.IPrepareQueryResponse=} [properties] Properties to set + */ + function PrepareQueryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrepareQueryResponse metadata. + * @member {google.bigtable.v2.IResultSetMetadata|null|undefined} metadata + * @memberof google.bigtable.v2.PrepareQueryResponse + * @instance + */ + PrepareQueryResponse.prototype.metadata = null; + + /** + * PrepareQueryResponse preparedQuery. + * @member {Uint8Array} preparedQuery + * @memberof google.bigtable.v2.PrepareQueryResponse + * @instance + */ + PrepareQueryResponse.prototype.preparedQuery = $util.newBuffer([]); + + /** + * PrepareQueryResponse validUntil. + * @member {google.protobuf.ITimestamp|null|undefined} validUntil + * @memberof google.bigtable.v2.PrepareQueryResponse + * @instance + */ + PrepareQueryResponse.prototype.validUntil = null; + + /** + * Creates a new PrepareQueryResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {google.bigtable.v2.IPrepareQueryResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.PrepareQueryResponse} PrepareQueryResponse instance + */ + PrepareQueryResponse.create = function create(properties) { + return new PrepareQueryResponse(properties); + }; + + /** + * Encodes the specified PrepareQueryResponse message. Does not implicitly {@link google.bigtable.v2.PrepareQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {google.bigtable.v2.IPrepareQueryResponse} message PrepareQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.bigtable.v2.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.preparedQuery != null && Object.hasOwnProperty.call(message, "preparedQuery")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.preparedQuery); + if (message.validUntil != null && Object.hasOwnProperty.call(message, "validUntil")) + $root.google.protobuf.Timestamp.encode(message.validUntil, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrepareQueryResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.PrepareQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {google.bigtable.v2.IPrepareQueryResponse} message PrepareQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrepareQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.PrepareQueryResponse} PrepareQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareQueryResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.PrepareQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.bigtable.v2.ResultSetMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.preparedQuery = reader.bytes(); + break; + } + case 3: { + message.validUntil = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrepareQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.PrepareQueryResponse} PrepareQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrepareQueryResponse message. + * @function verify + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrepareQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.bigtable.v2.ResultSetMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.preparedQuery != null && message.hasOwnProperty("preparedQuery")) + if (!(message.preparedQuery && typeof message.preparedQuery.length === "number" || $util.isString(message.preparedQuery))) + return "preparedQuery: buffer expected"; + if (message.validUntil != null && message.hasOwnProperty("validUntil")) { + var error = $root.google.protobuf.Timestamp.verify(message.validUntil); + if (error) + return "validUntil." + error; + } + return null; + }; + + /** + * Creates a PrepareQueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.PrepareQueryResponse} PrepareQueryResponse + */ + PrepareQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.PrepareQueryResponse) + return object; + var message = new $root.google.bigtable.v2.PrepareQueryResponse(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.bigtable.v2.PrepareQueryResponse.metadata: object expected"); + message.metadata = $root.google.bigtable.v2.ResultSetMetadata.fromObject(object.metadata); + } + if (object.preparedQuery != null) + if (typeof object.preparedQuery === "string") + $util.base64.decode(object.preparedQuery, message.preparedQuery = $util.newBuffer($util.base64.length(object.preparedQuery)), 0); + else if (object.preparedQuery.length >= 0) + message.preparedQuery = object.preparedQuery; + if (object.validUntil != null) { + if (typeof object.validUntil !== "object") + throw TypeError(".google.bigtable.v2.PrepareQueryResponse.validUntil: object expected"); + message.validUntil = $root.google.protobuf.Timestamp.fromObject(object.validUntil); + } + return message; + }; + + /** + * Creates a plain object from a PrepareQueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {google.bigtable.v2.PrepareQueryResponse} message PrepareQueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrepareQueryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.metadata = null; + if (options.bytes === String) + object.preparedQuery = ""; + else { + object.preparedQuery = []; + if (options.bytes !== Array) + object.preparedQuery = $util.newBuffer(object.preparedQuery); + } + object.validUntil = null; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.bigtable.v2.ResultSetMetadata.toObject(message.metadata, options); + if (message.preparedQuery != null && message.hasOwnProperty("preparedQuery")) + object.preparedQuery = options.bytes === String ? $util.base64.encode(message.preparedQuery, 0, message.preparedQuery.length) : options.bytes === Array ? Array.prototype.slice.call(message.preparedQuery) : message.preparedQuery; + if (message.validUntil != null && message.hasOwnProperty("validUntil")) + object.validUntil = $root.google.protobuf.Timestamp.toObject(message.validUntil, options); + return object; + }; + + /** + * Converts this PrepareQueryResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.PrepareQueryResponse + * @instance + * @returns {Object.} JSON object + */ + PrepareQueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrepareQueryResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrepareQueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.PrepareQueryResponse"; + }; + + return PrepareQueryResponse; + })(); + + v2.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.bigtable.v2 + * @interface IRow + * @property {Uint8Array|null} [key] Row key + * @property {Array.|null} [families] Row families + */ + + /** + * Constructs a new Row. + * @memberof google.bigtable.v2 + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.bigtable.v2.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.families = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row key. + * @member {Uint8Array} key + * @memberof google.bigtable.v2.Row + * @instance + */ + Row.prototype.key = $util.newBuffer([]); + + /** + * Row families. + * @member {Array.} families + * @memberof google.bigtable.v2.Row + * @instance + */ + Row.prototype.families = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Row + * @static + * @param {google.bigtable.v2.IRow=} [properties] Properties to set + * @returns {google.bigtable.v2.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.bigtable.v2.Row.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Row + * @static + * @param {google.bigtable.v2.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.families != null && message.families.length) + for (var i = 0; i < message.families.length; ++i) + $root.google.bigtable.v2.Family.encode(message.families[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.bigtable.v2.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Row + * @static + * @param {google.bigtable.v2.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.key = reader.bytes(); + break; + } + case 2: { + if (!(message.families && message.families.length)) + message.families = []; + message.families.push($root.google.bigtable.v2.Family.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.bigtable.v2.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.families != null && message.hasOwnProperty("families")) { + if (!Array.isArray(message.families)) + return "families: array expected"; + for (var i = 0; i < message.families.length; ++i) { + var error = $root.google.bigtable.v2.Family.verify(message.families[i]); + if (error) + return "families." + error; + } + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Row + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Row) + return object; + var message = new $root.google.bigtable.v2.Row(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length >= 0) + message.key = object.key; + if (object.families) { + if (!Array.isArray(object.families)) + throw TypeError(".google.bigtable.v2.Row.families: array expected"); + message.families = []; + for (var i = 0; i < object.families.length; ++i) { + if (typeof object.families[i] !== "object") + throw TypeError(".google.bigtable.v2.Row.families: object expected"); + message.families[i] = $root.google.bigtable.v2.Family.fromObject(object.families[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Row + * @static + * @param {google.bigtable.v2.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.families = []; + if (options.defaults) + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.families && message.families.length) { + object.families = []; + for (var j = 0; j < message.families.length; ++j) + object.families[j] = $root.google.bigtable.v2.Family.toObject(message.families[j], options); + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.bigtable.v2.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Row"; + }; + + return Row; + })(); + + v2.Family = (function() { + + /** + * Properties of a Family. + * @memberof google.bigtable.v2 + * @interface IFamily + * @property {string|null} [name] Family name + * @property {Array.|null} [columns] Family columns + */ + + /** + * Constructs a new Family. + * @memberof google.bigtable.v2 + * @classdesc Represents a Family. + * @implements IFamily + * @constructor + * @param {google.bigtable.v2.IFamily=} [properties] Properties to set + */ + function Family(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Family name. + * @member {string} name + * @memberof google.bigtable.v2.Family + * @instance + */ + Family.prototype.name = ""; + + /** + * Family columns. + * @member {Array.} columns + * @memberof google.bigtable.v2.Family + * @instance + */ + Family.prototype.columns = $util.emptyArray; + + /** + * Creates a new Family instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Family + * @static + * @param {google.bigtable.v2.IFamily=} [properties] Properties to set + * @returns {google.bigtable.v2.Family} Family instance + */ + Family.create = function create(properties) { + return new Family(properties); + }; + + /** + * Encodes the specified Family message. Does not implicitly {@link google.bigtable.v2.Family.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Family + * @static + * @param {google.bigtable.v2.IFamily} message Family message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Family.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.bigtable.v2.Column.encode(message.columns[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Family message, length delimited. Does not implicitly {@link google.bigtable.v2.Family.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Family + * @static + * @param {google.bigtable.v2.IFamily} message Family message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Family.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Family message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Family + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Family} Family + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Family.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Family(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.bigtable.v2.Column.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Family message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Family + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Family} Family + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Family.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Family message. + * @function verify + * @memberof google.bigtable.v2.Family + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Family.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.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.bigtable.v2.Column.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + return null; + }; + + /** + * Creates a Family message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Family + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Family} Family + */ + Family.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Family) + return object; + var message = new $root.google.bigtable.v2.Family(); + if (object.name != null) + message.name = String(object.name); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.bigtable.v2.Family.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".google.bigtable.v2.Family.columns: object expected"); + message.columns[i] = $root.google.bigtable.v2.Column.fromObject(object.columns[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Family message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Family + * @static + * @param {google.bigtable.v2.Family} message Family + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Family.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.bigtable.v2.Column.toObject(message.columns[j], options); + } + return object; + }; + + /** + * Converts this Family to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Family + * @instance + * @returns {Object.} JSON object + */ + Family.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Family + * @function getTypeUrl + * @memberof google.bigtable.v2.Family + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Family.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Family"; + }; + + return Family; + })(); + + v2.Column = (function() { + + /** + * Properties of a Column. + * @memberof google.bigtable.v2 + * @interface IColumn + * @property {Uint8Array|null} [qualifier] Column qualifier + * @property {Array.|null} [cells] Column cells + */ + + /** + * Constructs a new Column. + * @memberof google.bigtable.v2 + * @classdesc Represents a Column. + * @implements IColumn + * @constructor + * @param {google.bigtable.v2.IColumn=} [properties] Properties to set + */ + function Column(properties) { + this.cells = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Column qualifier. + * @member {Uint8Array} qualifier + * @memberof google.bigtable.v2.Column + * @instance + */ + Column.prototype.qualifier = $util.newBuffer([]); + + /** + * Column cells. + * @member {Array.} cells + * @memberof google.bigtable.v2.Column + * @instance + */ + Column.prototype.cells = $util.emptyArray; + + /** + * Creates a new Column instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Column + * @static + * @param {google.bigtable.v2.IColumn=} [properties] Properties to set + * @returns {google.bigtable.v2.Column} Column instance + */ + Column.create = function create(properties) { + return new Column(properties); + }; + + /** + * Encodes the specified Column message. Does not implicitly {@link google.bigtable.v2.Column.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Column + * @static + * @param {google.bigtable.v2.IColumn} message Column message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Column.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.qualifier != null && Object.hasOwnProperty.call(message, "qualifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.qualifier); + if (message.cells != null && message.cells.length) + for (var i = 0; i < message.cells.length; ++i) + $root.google.bigtable.v2.Cell.encode(message.cells[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Column message, length delimited. Does not implicitly {@link google.bigtable.v2.Column.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Column + * @static + * @param {google.bigtable.v2.IColumn} message Column message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Column.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Column message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Column + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Column} Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Column.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Column(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.qualifier = reader.bytes(); + break; + } + case 2: { + if (!(message.cells && message.cells.length)) + message.cells = []; + message.cells.push($root.google.bigtable.v2.Cell.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Column message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Column + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Column} Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Column.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Column message. + * @function verify + * @memberof google.bigtable.v2.Column + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Column.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.qualifier != null && message.hasOwnProperty("qualifier")) + if (!(message.qualifier && typeof message.qualifier.length === "number" || $util.isString(message.qualifier))) + return "qualifier: buffer expected"; + if (message.cells != null && message.hasOwnProperty("cells")) { + if (!Array.isArray(message.cells)) + return "cells: array expected"; + for (var i = 0; i < message.cells.length; ++i) { + var error = $root.google.bigtable.v2.Cell.verify(message.cells[i]); + if (error) + return "cells." + error; + } + } + return null; + }; + + /** + * Creates a Column message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Column + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Column} Column + */ + Column.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Column) + return object; + var message = new $root.google.bigtable.v2.Column(); + if (object.qualifier != null) + if (typeof object.qualifier === "string") + $util.base64.decode(object.qualifier, message.qualifier = $util.newBuffer($util.base64.length(object.qualifier)), 0); + else if (object.qualifier.length >= 0) + message.qualifier = object.qualifier; + if (object.cells) { + if (!Array.isArray(object.cells)) + throw TypeError(".google.bigtable.v2.Column.cells: array expected"); + message.cells = []; + for (var i = 0; i < object.cells.length; ++i) { + if (typeof object.cells[i] !== "object") + throw TypeError(".google.bigtable.v2.Column.cells: object expected"); + message.cells[i] = $root.google.bigtable.v2.Cell.fromObject(object.cells[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Column message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Column + * @static + * @param {google.bigtable.v2.Column} message Column + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Column.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cells = []; + if (options.defaults) + if (options.bytes === String) + object.qualifier = ""; + else { + object.qualifier = []; + if (options.bytes !== Array) + object.qualifier = $util.newBuffer(object.qualifier); + } + if (message.qualifier != null && message.hasOwnProperty("qualifier")) + object.qualifier = options.bytes === String ? $util.base64.encode(message.qualifier, 0, message.qualifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.qualifier) : message.qualifier; + if (message.cells && message.cells.length) { + object.cells = []; + for (var j = 0; j < message.cells.length; ++j) + object.cells[j] = $root.google.bigtable.v2.Cell.toObject(message.cells[j], options); + } + return object; + }; + + /** + * Converts this Column to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Column + * @instance + * @returns {Object.} JSON object + */ + Column.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Column + * @function getTypeUrl + * @memberof google.bigtable.v2.Column + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Column.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Column"; + }; + + return Column; + })(); + + v2.Cell = (function() { + + /** + * Properties of a Cell. + * @memberof google.bigtable.v2 + * @interface ICell + * @property {number|Long|null} [timestampMicros] Cell timestampMicros + * @property {Uint8Array|null} [value] Cell value + * @property {Array.|null} [labels] Cell labels + */ + + /** + * Constructs a new Cell. + * @memberof google.bigtable.v2 + * @classdesc Represents a Cell. + * @implements ICell + * @constructor + * @param {google.bigtable.v2.ICell=} [properties] Properties to set + */ + function Cell(properties) { + this.labels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cell timestampMicros. + * @member {number|Long} timestampMicros + * @memberof google.bigtable.v2.Cell + * @instance + */ + Cell.prototype.timestampMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Cell value. + * @member {Uint8Array} value + * @memberof google.bigtable.v2.Cell + * @instance + */ + Cell.prototype.value = $util.newBuffer([]); + + /** + * Cell labels. + * @member {Array.} labels + * @memberof google.bigtable.v2.Cell + * @instance + */ + Cell.prototype.labels = $util.emptyArray; + + /** + * Creates a new Cell instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Cell + * @static + * @param {google.bigtable.v2.ICell=} [properties] Properties to set + * @returns {google.bigtable.v2.Cell} Cell instance + */ + Cell.create = function create(properties) { + return new Cell(properties); + }; + + /** + * Encodes the specified Cell message. Does not implicitly {@link google.bigtable.v2.Cell.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Cell + * @static + * @param {google.bigtable.v2.ICell} message Cell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cell.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestampMicros != null && Object.hasOwnProperty.call(message, "timestampMicros")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.timestampMicros); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.labels[i]); + return writer; + }; + + /** + * Encodes the specified Cell message, length delimited. Does not implicitly {@link google.bigtable.v2.Cell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Cell + * @static + * @param {google.bigtable.v2.ICell} message Cell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cell.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cell message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Cell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Cell} Cell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cell.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Cell(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.timestampMicros = reader.int64(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + case 3: { + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cell message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Cell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Cell} Cell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cell.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cell message. + * @function verify + * @memberof google.bigtable.v2.Cell + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cell.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestampMicros != null && message.hasOwnProperty("timestampMicros")) + if (!$util.isInteger(message.timestampMicros) && !(message.timestampMicros && $util.isInteger(message.timestampMicros.low) && $util.isInteger(message.timestampMicros.high))) + return "timestampMicros: integer|Long expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) + if (!$util.isString(message.labels[i])) + return "labels: string[] expected"; + } + return null; + }; + + /** + * Creates a Cell message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Cell + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Cell} Cell + */ + Cell.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Cell) + return object; + var message = new $root.google.bigtable.v2.Cell(); + if (object.timestampMicros != null) + if ($util.Long) + (message.timestampMicros = $util.Long.fromValue(object.timestampMicros)).unsigned = false; + else if (typeof object.timestampMicros === "string") + message.timestampMicros = parseInt(object.timestampMicros, 10); + else if (typeof object.timestampMicros === "number") + message.timestampMicros = object.timestampMicros; + else if (typeof object.timestampMicros === "object") + message.timestampMicros = new $util.LongBits(object.timestampMicros.low >>> 0, object.timestampMicros.high >>> 0).toNumber(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.bigtable.v2.Cell.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) + message.labels[i] = String(object.labels[i]); + } + return message; + }; + + /** + * Creates a plain object from a Cell message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Cell + * @static + * @param {google.bigtable.v2.Cell} message Cell + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cell.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.labels = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestampMicros = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.timestampMicros != null && message.hasOwnProperty("timestampMicros")) + if (typeof message.timestampMicros === "number") + object.timestampMicros = options.longs === String ? String(message.timestampMicros) : message.timestampMicros; + else + object.timestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.timestampMicros) : options.longs === Number ? new $util.LongBits(message.timestampMicros.low >>> 0, message.timestampMicros.high >>> 0).toNumber() : message.timestampMicros; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = message.labels[j]; + } + return object; + }; + + /** + * Converts this Cell to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Cell + * @instance + * @returns {Object.} JSON object + */ + Cell.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cell + * @function getTypeUrl + * @memberof google.bigtable.v2.Cell + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cell.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Cell"; + }; + + return Cell; + })(); + + v2.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.bigtable.v2 + * @interface IValue + * @property {google.bigtable.v2.IType|null} [type] Value type + * @property {Uint8Array|null} [rawValue] Value rawValue + * @property {number|Long|null} [rawTimestampMicros] Value rawTimestampMicros + * @property {Uint8Array|null} [bytesValue] Value bytesValue + * @property {string|null} [stringValue] Value stringValue + * @property {number|Long|null} [intValue] Value intValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {number|null} [floatValue] Value floatValue + * @property {google.protobuf.ITimestamp|null} [timestampValue] Value timestampValue + * @property {google.type.IDate|null} [dateValue] Value dateValue + * @property {google.bigtable.v2.IArrayValue|null} [arrayValue] Value arrayValue + */ + + /** + * Constructs a new Value. + * @memberof google.bigtable.v2 + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.bigtable.v2.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value type. + * @member {google.bigtable.v2.IType|null|undefined} type + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.type = null; + + /** + * Value rawValue. + * @member {Uint8Array|null|undefined} rawValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.rawValue = null; + + /** + * Value rawTimestampMicros. + * @member {number|Long|null|undefined} rawTimestampMicros + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.rawTimestampMicros = null; + + /** + * Value bytesValue. + * @member {Uint8Array|null|undefined} bytesValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.bytesValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value intValue. + * @member {number|Long|null|undefined} intValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.intValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value floatValue. + * @member {number|null|undefined} floatValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.floatValue = null; + + /** + * Value timestampValue. + * @member {google.protobuf.ITimestamp|null|undefined} timestampValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.timestampValue = null; + + /** + * Value dateValue. + * @member {google.type.IDate|null|undefined} dateValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.dateValue = null; + + /** + * Value arrayValue. + * @member {google.bigtable.v2.IArrayValue|null|undefined} arrayValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.arrayValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"rawValue"|"rawTimestampMicros"|"bytesValue"|"stringValue"|"intValue"|"boolValue"|"floatValue"|"timestampValue"|"dateValue"|"arrayValue"|undefined} kind + * @memberof google.bigtable.v2.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["rawValue", "rawTimestampMicros", "bytesValue", "stringValue", "intValue", "boolValue", "floatValue", "timestampValue", "dateValue", "arrayValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Value + * @static + * @param {google.bigtable.v2.IValue=} [properties] Properties to set + * @returns {google.bigtable.v2.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.bigtable.v2.Value.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Value + * @static + * @param {google.bigtable.v2.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesValue != null && Object.hasOwnProperty.call(message, "bytesValue")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.bytesValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) + $root.google.bigtable.v2.ArrayValue.encode(message.arrayValue, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.intValue); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.bigtable.v2.Type.encode(message.type, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.rawValue != null && Object.hasOwnProperty.call(message, "rawValue")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.rawValue); + if (message.rawTimestampMicros != null && Object.hasOwnProperty.call(message, "rawTimestampMicros")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.rawTimestampMicros); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.boolValue); + if (message.floatValue != null && Object.hasOwnProperty.call(message, "floatValue")) + writer.uint32(/* id 11, wireType 1 =*/89).double(message.floatValue); + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) + $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.dateValue != null && Object.hasOwnProperty.call(message, "dateValue")) + $root.google.type.Date.encode(message.dateValue, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.bigtable.v2.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Value + * @static + * @param {google.bigtable.v2.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 7: { + message.type = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + case 8: { + message.rawValue = reader.bytes(); + break; + } + case 9: { + message.rawTimestampMicros = reader.int64(); + break; + } + case 2: { + message.bytesValue = reader.bytes(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 6: { + message.intValue = reader.int64(); + break; + } + case 10: { + message.boolValue = reader.bool(); + break; + } + case 11: { + message.floatValue = reader.double(); + break; + } + case 12: { + message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.dateValue = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 4: { + message.arrayValue = $root.google.bigtable.v2.ArrayValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.bigtable.v2.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.bigtable.v2.Type.verify(message.type); + if (error) + return "type." + error; + } + if (message.rawValue != null && message.hasOwnProperty("rawValue")) { + properties.kind = 1; + if (!(message.rawValue && typeof message.rawValue.length === "number" || $util.isString(message.rawValue))) + return "rawValue: buffer expected"; + } + if (message.rawTimestampMicros != null && message.hasOwnProperty("rawTimestampMicros")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isInteger(message.rawTimestampMicros) && !(message.rawTimestampMicros && $util.isInteger(message.rawTimestampMicros.low) && $util.isInteger(message.rawTimestampMicros.high))) + return "rawTimestampMicros: integer|Long expected"; + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!(message.bytesValue && typeof message.bytesValue.length === "number" || $util.isString(message.bytesValue))) + return "bytesValue: buffer expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) + return "intValue: integer|Long expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.floatValue !== "number") + return "floatValue: number expected"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.timestampValue); + if (error) + return "timestampValue." + error; + } + } + if (message.dateValue != null && message.hasOwnProperty("dateValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.type.Date.verify(message.dateValue); + if (error) + return "dateValue." + error; + } + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.ArrayValue.verify(message.arrayValue); + if (error) + return "arrayValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Value + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Value) + return object; + var message = new $root.google.bigtable.v2.Value(); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.bigtable.v2.Value.type: object expected"); + message.type = $root.google.bigtable.v2.Type.fromObject(object.type); + } + if (object.rawValue != null) + if (typeof object.rawValue === "string") + $util.base64.decode(object.rawValue, message.rawValue = $util.newBuffer($util.base64.length(object.rawValue)), 0); + else if (object.rawValue.length >= 0) + message.rawValue = object.rawValue; + if (object.rawTimestampMicros != null) + if ($util.Long) + (message.rawTimestampMicros = $util.Long.fromValue(object.rawTimestampMicros)).unsigned = false; + else if (typeof object.rawTimestampMicros === "string") + message.rawTimestampMicros = parseInt(object.rawTimestampMicros, 10); + else if (typeof object.rawTimestampMicros === "number") + message.rawTimestampMicros = object.rawTimestampMicros; + else if (typeof object.rawTimestampMicros === "object") + message.rawTimestampMicros = new $util.LongBits(object.rawTimestampMicros.low >>> 0, object.rawTimestampMicros.high >>> 0).toNumber(); + if (object.bytesValue != null) + if (typeof object.bytesValue === "string") + $util.base64.decode(object.bytesValue, message.bytesValue = $util.newBuffer($util.base64.length(object.bytesValue)), 0); + else if (object.bytesValue.length >= 0) + message.bytesValue = object.bytesValue; + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.intValue != null) + if ($util.Long) + (message.intValue = $util.Long.fromValue(object.intValue)).unsigned = false; + else if (typeof object.intValue === "string") + message.intValue = parseInt(object.intValue, 10); + else if (typeof object.intValue === "number") + message.intValue = object.intValue; + else if (typeof object.intValue === "object") + message.intValue = new $util.LongBits(object.intValue.low >>> 0, object.intValue.high >>> 0).toNumber(); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.floatValue != null) + message.floatValue = Number(object.floatValue); + if (object.timestampValue != null) { + if (typeof object.timestampValue !== "object") + throw TypeError(".google.bigtable.v2.Value.timestampValue: object expected"); + message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); + } + if (object.dateValue != null) { + if (typeof object.dateValue !== "object") + throw TypeError(".google.bigtable.v2.Value.dateValue: object expected"); + message.dateValue = $root.google.type.Date.fromObject(object.dateValue); + } + if (object.arrayValue != null) { + if (typeof object.arrayValue !== "object") + throw TypeError(".google.bigtable.v2.Value.arrayValue: object expected"); + message.arrayValue = $root.google.bigtable.v2.ArrayValue.fromObject(object.arrayValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Value + * @static + * @param {google.bigtable.v2.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.type = null; + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + object.bytesValue = options.bytes === String ? $util.base64.encode(message.bytesValue, 0, message.bytesValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesValue) : message.bytesValue; + if (options.oneofs) + object.kind = "bytesValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + object.arrayValue = $root.google.bigtable.v2.ArrayValue.toObject(message.arrayValue, options); + if (options.oneofs) + object.kind = "arrayValue"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (typeof message.intValue === "number") + object.intValue = options.longs === String ? String(message.intValue) : message.intValue; + else + object.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; + if (options.oneofs) + object.kind = "intValue"; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.bigtable.v2.Type.toObject(message.type, options); + if (message.rawValue != null && message.hasOwnProperty("rawValue")) { + object.rawValue = options.bytes === String ? $util.base64.encode(message.rawValue, 0, message.rawValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawValue) : message.rawValue; + if (options.oneofs) + object.kind = "rawValue"; + } + if (message.rawTimestampMicros != null && message.hasOwnProperty("rawTimestampMicros")) { + if (typeof message.rawTimestampMicros === "number") + object.rawTimestampMicros = options.longs === String ? String(message.rawTimestampMicros) : message.rawTimestampMicros; + else + object.rawTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.rawTimestampMicros) : options.longs === Number ? new $util.LongBits(message.rawTimestampMicros.low >>> 0, message.rawTimestampMicros.high >>> 0).toNumber() : message.rawTimestampMicros; + if (options.oneofs) + object.kind = "rawTimestampMicros"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + object.floatValue = options.json && !isFinite(message.floatValue) ? String(message.floatValue) : message.floatValue; + if (options.oneofs) + object.kind = "floatValue"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options); + if (options.oneofs) + object.kind = "timestampValue"; + } + if (message.dateValue != null && message.hasOwnProperty("dateValue")) { + object.dateValue = $root.google.type.Date.toObject(message.dateValue, options); + if (options.oneofs) + object.kind = "dateValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.bigtable.v2.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Value"; + }; + + return Value; + })(); + + v2.ArrayValue = (function() { + + /** + * Properties of an ArrayValue. + * @memberof google.bigtable.v2 + * @interface IArrayValue + * @property {Array.|null} [values] ArrayValue values + */ + + /** + * Constructs a new ArrayValue. + * @memberof google.bigtable.v2 + * @classdesc Represents an ArrayValue. + * @implements IArrayValue + * @constructor + * @param {google.bigtable.v2.IArrayValue=} [properties] Properties to set + */ + function ArrayValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrayValue values. + * @member {Array.} values + * @memberof google.bigtable.v2.ArrayValue + * @instance + */ + ArrayValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ArrayValue instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {google.bigtable.v2.IArrayValue=} [properties] Properties to set + * @returns {google.bigtable.v2.ArrayValue} ArrayValue instance + */ + ArrayValue.create = function create(properties) { + return new ArrayValue(properties); + }; + + /** + * Encodes the specified ArrayValue message. Does not implicitly {@link google.bigtable.v2.ArrayValue.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {google.bigtable.v2.IArrayValue} message ArrayValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.bigtable.v2.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.bigtable.v2.ArrayValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {google.bigtable.v2.IArrayValue} message ArrayValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrayValue message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ArrayValue} ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ArrayValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.bigtable.v2.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrayValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ArrayValue} ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrayValue message. + * @function verify + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrayValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.bigtable.v2.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ArrayValue} ArrayValue + */ + ArrayValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ArrayValue) + return object; + var message = new $root.google.bigtable.v2.ArrayValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.bigtable.v2.ArrayValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.bigtable.v2.ArrayValue.values: object expected"); + message.values[i] = $root.google.bigtable.v2.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {google.bigtable.v2.ArrayValue} message ArrayValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrayValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.bigtable.v2.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ArrayValue to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ArrayValue + * @instance + * @returns {Object.} JSON object + */ + ArrayValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArrayValue + * @function getTypeUrl + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrayValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ArrayValue"; + }; + + return ArrayValue; + })(); + + v2.RowRange = (function() { + + /** + * Properties of a RowRange. + * @memberof google.bigtable.v2 + * @interface IRowRange + * @property {Uint8Array|null} [startKeyClosed] RowRange startKeyClosed + * @property {Uint8Array|null} [startKeyOpen] RowRange startKeyOpen + * @property {Uint8Array|null} [endKeyOpen] RowRange endKeyOpen + * @property {Uint8Array|null} [endKeyClosed] RowRange endKeyClosed + */ + + /** + * Constructs a new RowRange. + * @memberof google.bigtable.v2 + * @classdesc Represents a RowRange. + * @implements IRowRange + * @constructor + * @param {google.bigtable.v2.IRowRange=} [properties] Properties to set + */ + function RowRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowRange startKeyClosed. + * @member {Uint8Array|null|undefined} startKeyClosed + * @memberof google.bigtable.v2.RowRange + * @instance + */ + RowRange.prototype.startKeyClosed = null; + + /** + * RowRange startKeyOpen. + * @member {Uint8Array|null|undefined} startKeyOpen + * @memberof google.bigtable.v2.RowRange + * @instance + */ + RowRange.prototype.startKeyOpen = null; + + /** + * RowRange endKeyOpen. + * @member {Uint8Array|null|undefined} endKeyOpen + * @memberof google.bigtable.v2.RowRange + * @instance + */ + RowRange.prototype.endKeyOpen = null; + + /** + * RowRange endKeyClosed. + * @member {Uint8Array|null|undefined} endKeyClosed + * @memberof google.bigtable.v2.RowRange + * @instance + */ + RowRange.prototype.endKeyClosed = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RowRange startKey. + * @member {"startKeyClosed"|"startKeyOpen"|undefined} startKey + * @memberof google.bigtable.v2.RowRange + * @instance + */ + Object.defineProperty(RowRange.prototype, "startKey", { + get: $util.oneOfGetter($oneOfFields = ["startKeyClosed", "startKeyOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RowRange endKey. + * @member {"endKeyOpen"|"endKeyClosed"|undefined} endKey + * @memberof google.bigtable.v2.RowRange + * @instance + */ + Object.defineProperty(RowRange.prototype, "endKey", { + get: $util.oneOfGetter($oneOfFields = ["endKeyOpen", "endKeyClosed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RowRange instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RowRange + * @static + * @param {google.bigtable.v2.IRowRange=} [properties] Properties to set + * @returns {google.bigtable.v2.RowRange} RowRange instance + */ + RowRange.create = function create(properties) { + return new RowRange(properties); + }; + + /** + * Encodes the specified RowRange message. Does not implicitly {@link google.bigtable.v2.RowRange.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RowRange + * @static + * @param {google.bigtable.v2.IRowRange} message RowRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startKeyClosed != null && Object.hasOwnProperty.call(message, "startKeyClosed")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startKeyClosed); + if (message.startKeyOpen != null && Object.hasOwnProperty.call(message, "startKeyOpen")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.startKeyOpen); + if (message.endKeyOpen != null && Object.hasOwnProperty.call(message, "endKeyOpen")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.endKeyOpen); + if (message.endKeyClosed != null && Object.hasOwnProperty.call(message, "endKeyClosed")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.endKeyClosed); + return writer; + }; + + /** + * Encodes the specified RowRange message, length delimited. Does not implicitly {@link google.bigtable.v2.RowRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RowRange + * @static + * @param {google.bigtable.v2.IRowRange} message RowRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowRange message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RowRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RowRange} RowRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RowRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startKeyClosed = reader.bytes(); + break; + } + case 2: { + message.startKeyOpen = reader.bytes(); + break; + } + case 3: { + message.endKeyOpen = reader.bytes(); + break; + } + case 4: { + message.endKeyClosed = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RowRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RowRange} RowRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowRange message. + * @function verify + * @memberof google.bigtable.v2.RowRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startKeyClosed != null && message.hasOwnProperty("startKeyClosed")) { + properties.startKey = 1; + if (!(message.startKeyClosed && typeof message.startKeyClosed.length === "number" || $util.isString(message.startKeyClosed))) + return "startKeyClosed: buffer expected"; + } + if (message.startKeyOpen != null && message.hasOwnProperty("startKeyOpen")) { + if (properties.startKey === 1) + return "startKey: multiple values"; + properties.startKey = 1; + if (!(message.startKeyOpen && typeof message.startKeyOpen.length === "number" || $util.isString(message.startKeyOpen))) + return "startKeyOpen: buffer expected"; + } + if (message.endKeyOpen != null && message.hasOwnProperty("endKeyOpen")) { + properties.endKey = 1; + if (!(message.endKeyOpen && typeof message.endKeyOpen.length === "number" || $util.isString(message.endKeyOpen))) + return "endKeyOpen: buffer expected"; + } + if (message.endKeyClosed != null && message.hasOwnProperty("endKeyClosed")) { + if (properties.endKey === 1) + return "endKey: multiple values"; + properties.endKey = 1; + if (!(message.endKeyClosed && typeof message.endKeyClosed.length === "number" || $util.isString(message.endKeyClosed))) + return "endKeyClosed: buffer expected"; + } + return null; + }; + + /** + * Creates a RowRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RowRange + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RowRange} RowRange + */ + RowRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RowRange) + return object; + var message = new $root.google.bigtable.v2.RowRange(); + if (object.startKeyClosed != null) + if (typeof object.startKeyClosed === "string") + $util.base64.decode(object.startKeyClosed, message.startKeyClosed = $util.newBuffer($util.base64.length(object.startKeyClosed)), 0); + else if (object.startKeyClosed.length >= 0) + message.startKeyClosed = object.startKeyClosed; + if (object.startKeyOpen != null) + if (typeof object.startKeyOpen === "string") + $util.base64.decode(object.startKeyOpen, message.startKeyOpen = $util.newBuffer($util.base64.length(object.startKeyOpen)), 0); + else if (object.startKeyOpen.length >= 0) + message.startKeyOpen = object.startKeyOpen; + if (object.endKeyOpen != null) + if (typeof object.endKeyOpen === "string") + $util.base64.decode(object.endKeyOpen, message.endKeyOpen = $util.newBuffer($util.base64.length(object.endKeyOpen)), 0); + else if (object.endKeyOpen.length >= 0) + message.endKeyOpen = object.endKeyOpen; + if (object.endKeyClosed != null) + if (typeof object.endKeyClosed === "string") + $util.base64.decode(object.endKeyClosed, message.endKeyClosed = $util.newBuffer($util.base64.length(object.endKeyClosed)), 0); + else if (object.endKeyClosed.length >= 0) + message.endKeyClosed = object.endKeyClosed; + return message; + }; + + /** + * Creates a plain object from a RowRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RowRange + * @static + * @param {google.bigtable.v2.RowRange} message RowRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startKeyClosed != null && message.hasOwnProperty("startKeyClosed")) { + object.startKeyClosed = options.bytes === String ? $util.base64.encode(message.startKeyClosed, 0, message.startKeyClosed.length) : options.bytes === Array ? Array.prototype.slice.call(message.startKeyClosed) : message.startKeyClosed; + if (options.oneofs) + object.startKey = "startKeyClosed"; + } + if (message.startKeyOpen != null && message.hasOwnProperty("startKeyOpen")) { + object.startKeyOpen = options.bytes === String ? $util.base64.encode(message.startKeyOpen, 0, message.startKeyOpen.length) : options.bytes === Array ? Array.prototype.slice.call(message.startKeyOpen) : message.startKeyOpen; + if (options.oneofs) + object.startKey = "startKeyOpen"; + } + if (message.endKeyOpen != null && message.hasOwnProperty("endKeyOpen")) { + object.endKeyOpen = options.bytes === String ? $util.base64.encode(message.endKeyOpen, 0, message.endKeyOpen.length) : options.bytes === Array ? Array.prototype.slice.call(message.endKeyOpen) : message.endKeyOpen; + if (options.oneofs) + object.endKey = "endKeyOpen"; + } + if (message.endKeyClosed != null && message.hasOwnProperty("endKeyClosed")) { + object.endKeyClosed = options.bytes === String ? $util.base64.encode(message.endKeyClosed, 0, message.endKeyClosed.length) : options.bytes === Array ? Array.prototype.slice.call(message.endKeyClosed) : message.endKeyClosed; + if (options.oneofs) + object.endKey = "endKeyClosed"; + } + return object; + }; + + /** + * Converts this RowRange to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RowRange + * @instance + * @returns {Object.} JSON object + */ + RowRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowRange + * @function getTypeUrl + * @memberof google.bigtable.v2.RowRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RowRange"; + }; + + return RowRange; + })(); + + v2.RowSet = (function() { + + /** + * Properties of a RowSet. + * @memberof google.bigtable.v2 + * @interface IRowSet + * @property {Array.|null} [rowKeys] RowSet rowKeys + * @property {Array.|null} [rowRanges] RowSet rowRanges + */ + + /** + * Constructs a new RowSet. + * @memberof google.bigtable.v2 + * @classdesc Represents a RowSet. + * @implements IRowSet + * @constructor + * @param {google.bigtable.v2.IRowSet=} [properties] Properties to set + */ + function RowSet(properties) { + this.rowKeys = []; + this.rowRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowSet rowKeys. + * @member {Array.} rowKeys + * @memberof google.bigtable.v2.RowSet + * @instance + */ + RowSet.prototype.rowKeys = $util.emptyArray; + + /** + * RowSet rowRanges. + * @member {Array.} rowRanges + * @memberof google.bigtable.v2.RowSet + * @instance + */ + RowSet.prototype.rowRanges = $util.emptyArray; + + /** + * Creates a new RowSet instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RowSet + * @static + * @param {google.bigtable.v2.IRowSet=} [properties] Properties to set + * @returns {google.bigtable.v2.RowSet} RowSet instance + */ + RowSet.create = function create(properties) { + return new RowSet(properties); + }; + + /** + * Encodes the specified RowSet message. Does not implicitly {@link google.bigtable.v2.RowSet.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RowSet + * @static + * @param {google.bigtable.v2.IRowSet} message RowSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowKeys != null && message.rowKeys.length) + for (var i = 0; i < message.rowKeys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rowKeys[i]); + if (message.rowRanges != null && message.rowRanges.length) + for (var i = 0; i < message.rowRanges.length; ++i) + $root.google.bigtable.v2.RowRange.encode(message.rowRanges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RowSet message, length delimited. Does not implicitly {@link google.bigtable.v2.RowSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RowSet + * @static + * @param {google.bigtable.v2.IRowSet} message RowSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowSet message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RowSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RowSet} RowSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RowSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rowKeys && message.rowKeys.length)) + message.rowKeys = []; + message.rowKeys.push(reader.bytes()); + break; + } + case 2: { + if (!(message.rowRanges && message.rowRanges.length)) + message.rowRanges = []; + message.rowRanges.push($root.google.bigtable.v2.RowRange.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RowSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RowSet} RowSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowSet message. + * @function verify + * @memberof google.bigtable.v2.RowSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowKeys != null && message.hasOwnProperty("rowKeys")) { + if (!Array.isArray(message.rowKeys)) + return "rowKeys: array expected"; + for (var i = 0; i < message.rowKeys.length; ++i) + if (!(message.rowKeys[i] && typeof message.rowKeys[i].length === "number" || $util.isString(message.rowKeys[i]))) + return "rowKeys: buffer[] expected"; + } + if (message.rowRanges != null && message.hasOwnProperty("rowRanges")) { + if (!Array.isArray(message.rowRanges)) + return "rowRanges: array expected"; + for (var i = 0; i < message.rowRanges.length; ++i) { + var error = $root.google.bigtable.v2.RowRange.verify(message.rowRanges[i]); + if (error) + return "rowRanges." + error; + } + } + return null; + }; + + /** + * Creates a RowSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RowSet + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RowSet} RowSet + */ + RowSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RowSet) + return object; + var message = new $root.google.bigtable.v2.RowSet(); + if (object.rowKeys) { + if (!Array.isArray(object.rowKeys)) + throw TypeError(".google.bigtable.v2.RowSet.rowKeys: array expected"); + message.rowKeys = []; + for (var i = 0; i < object.rowKeys.length; ++i) + if (typeof object.rowKeys[i] === "string") + $util.base64.decode(object.rowKeys[i], message.rowKeys[i] = $util.newBuffer($util.base64.length(object.rowKeys[i])), 0); + else if (object.rowKeys[i].length >= 0) + message.rowKeys[i] = object.rowKeys[i]; + } + if (object.rowRanges) { + if (!Array.isArray(object.rowRanges)) + throw TypeError(".google.bigtable.v2.RowSet.rowRanges: array expected"); + message.rowRanges = []; + for (var i = 0; i < object.rowRanges.length; ++i) { + if (typeof object.rowRanges[i] !== "object") + throw TypeError(".google.bigtable.v2.RowSet.rowRanges: object expected"); + message.rowRanges[i] = $root.google.bigtable.v2.RowRange.fromObject(object.rowRanges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RowSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RowSet + * @static + * @param {google.bigtable.v2.RowSet} message RowSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.rowKeys = []; + object.rowRanges = []; + } + if (message.rowKeys && message.rowKeys.length) { + object.rowKeys = []; + for (var j = 0; j < message.rowKeys.length; ++j) + object.rowKeys[j] = options.bytes === String ? $util.base64.encode(message.rowKeys[j], 0, message.rowKeys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKeys[j]) : message.rowKeys[j]; + } + if (message.rowRanges && message.rowRanges.length) { + object.rowRanges = []; + for (var j = 0; j < message.rowRanges.length; ++j) + object.rowRanges[j] = $root.google.bigtable.v2.RowRange.toObject(message.rowRanges[j], options); + } + return object; + }; + + /** + * Converts this RowSet to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RowSet + * @instance + * @returns {Object.} JSON object + */ + RowSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowSet + * @function getTypeUrl + * @memberof google.bigtable.v2.RowSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RowSet"; + }; + + return RowSet; + })(); + + v2.ColumnRange = (function() { + + /** + * Properties of a ColumnRange. + * @memberof google.bigtable.v2 + * @interface IColumnRange + * @property {string|null} [familyName] ColumnRange familyName + * @property {Uint8Array|null} [startQualifierClosed] ColumnRange startQualifierClosed + * @property {Uint8Array|null} [startQualifierOpen] ColumnRange startQualifierOpen + * @property {Uint8Array|null} [endQualifierClosed] ColumnRange endQualifierClosed + * @property {Uint8Array|null} [endQualifierOpen] ColumnRange endQualifierOpen + */ + + /** + * Constructs a new ColumnRange. + * @memberof google.bigtable.v2 + * @classdesc Represents a ColumnRange. + * @implements IColumnRange + * @constructor + * @param {google.bigtable.v2.IColumnRange=} [properties] Properties to set + */ + function ColumnRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnRange familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + ColumnRange.prototype.familyName = ""; + + /** + * ColumnRange startQualifierClosed. + * @member {Uint8Array|null|undefined} startQualifierClosed + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + ColumnRange.prototype.startQualifierClosed = null; + + /** + * ColumnRange startQualifierOpen. + * @member {Uint8Array|null|undefined} startQualifierOpen + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + ColumnRange.prototype.startQualifierOpen = null; + + /** + * ColumnRange endQualifierClosed. + * @member {Uint8Array|null|undefined} endQualifierClosed + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + ColumnRange.prototype.endQualifierClosed = null; + + /** + * ColumnRange endQualifierOpen. + * @member {Uint8Array|null|undefined} endQualifierOpen + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + ColumnRange.prototype.endQualifierOpen = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ColumnRange startQualifier. + * @member {"startQualifierClosed"|"startQualifierOpen"|undefined} startQualifier + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + Object.defineProperty(ColumnRange.prototype, "startQualifier", { + get: $util.oneOfGetter($oneOfFields = ["startQualifierClosed", "startQualifierOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ColumnRange endQualifier. + * @member {"endQualifierClosed"|"endQualifierOpen"|undefined} endQualifier + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + Object.defineProperty(ColumnRange.prototype, "endQualifier", { + get: $util.oneOfGetter($oneOfFields = ["endQualifierClosed", "endQualifierOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ColumnRange instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {google.bigtable.v2.IColumnRange=} [properties] Properties to set + * @returns {google.bigtable.v2.ColumnRange} ColumnRange instance + */ + ColumnRange.create = function create(properties) { + return new ColumnRange(properties); + }; + + /** + * Encodes the specified ColumnRange message. Does not implicitly {@link google.bigtable.v2.ColumnRange.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {google.bigtable.v2.IColumnRange} message ColumnRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + if (message.startQualifierClosed != null && Object.hasOwnProperty.call(message, "startQualifierClosed")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.startQualifierClosed); + if (message.startQualifierOpen != null && Object.hasOwnProperty.call(message, "startQualifierOpen")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.startQualifierOpen); + if (message.endQualifierClosed != null && Object.hasOwnProperty.call(message, "endQualifierClosed")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.endQualifierClosed); + if (message.endQualifierOpen != null && Object.hasOwnProperty.call(message, "endQualifierOpen")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.endQualifierOpen); + return writer; + }; + + /** + * Encodes the specified ColumnRange message, length delimited. Does not implicitly {@link google.bigtable.v2.ColumnRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {google.bigtable.v2.IColumnRange} message ColumnRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnRange message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ColumnRange} ColumnRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ColumnRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + case 2: { + message.startQualifierClosed = reader.bytes(); + break; + } + case 3: { + message.startQualifierOpen = reader.bytes(); + break; + } + case 4: { + message.endQualifierClosed = reader.bytes(); + break; + } + case 5: { + message.endQualifierOpen = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ColumnRange} ColumnRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnRange message. + * @function verify + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + if (message.startQualifierClosed != null && message.hasOwnProperty("startQualifierClosed")) { + properties.startQualifier = 1; + if (!(message.startQualifierClosed && typeof message.startQualifierClosed.length === "number" || $util.isString(message.startQualifierClosed))) + return "startQualifierClosed: buffer expected"; + } + if (message.startQualifierOpen != null && message.hasOwnProperty("startQualifierOpen")) { + if (properties.startQualifier === 1) + return "startQualifier: multiple values"; + properties.startQualifier = 1; + if (!(message.startQualifierOpen && typeof message.startQualifierOpen.length === "number" || $util.isString(message.startQualifierOpen))) + return "startQualifierOpen: buffer expected"; + } + if (message.endQualifierClosed != null && message.hasOwnProperty("endQualifierClosed")) { + properties.endQualifier = 1; + if (!(message.endQualifierClosed && typeof message.endQualifierClosed.length === "number" || $util.isString(message.endQualifierClosed))) + return "endQualifierClosed: buffer expected"; + } + if (message.endQualifierOpen != null && message.hasOwnProperty("endQualifierOpen")) { + if (properties.endQualifier === 1) + return "endQualifier: multiple values"; + properties.endQualifier = 1; + if (!(message.endQualifierOpen && typeof message.endQualifierOpen.length === "number" || $util.isString(message.endQualifierOpen))) + return "endQualifierOpen: buffer expected"; + } + return null; + }; + + /** + * Creates a ColumnRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ColumnRange} ColumnRange + */ + ColumnRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ColumnRange) + return object; + var message = new $root.google.bigtable.v2.ColumnRange(); + if (object.familyName != null) + message.familyName = String(object.familyName); + if (object.startQualifierClosed != null) + if (typeof object.startQualifierClosed === "string") + $util.base64.decode(object.startQualifierClosed, message.startQualifierClosed = $util.newBuffer($util.base64.length(object.startQualifierClosed)), 0); + else if (object.startQualifierClosed.length >= 0) + message.startQualifierClosed = object.startQualifierClosed; + if (object.startQualifierOpen != null) + if (typeof object.startQualifierOpen === "string") + $util.base64.decode(object.startQualifierOpen, message.startQualifierOpen = $util.newBuffer($util.base64.length(object.startQualifierOpen)), 0); + else if (object.startQualifierOpen.length >= 0) + message.startQualifierOpen = object.startQualifierOpen; + if (object.endQualifierClosed != null) + if (typeof object.endQualifierClosed === "string") + $util.base64.decode(object.endQualifierClosed, message.endQualifierClosed = $util.newBuffer($util.base64.length(object.endQualifierClosed)), 0); + else if (object.endQualifierClosed.length >= 0) + message.endQualifierClosed = object.endQualifierClosed; + if (object.endQualifierOpen != null) + if (typeof object.endQualifierOpen === "string") + $util.base64.decode(object.endQualifierOpen, message.endQualifierOpen = $util.newBuffer($util.base64.length(object.endQualifierOpen)), 0); + else if (object.endQualifierOpen.length >= 0) + message.endQualifierOpen = object.endQualifierOpen; + return message; + }; + + /** + * Creates a plain object from a ColumnRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {google.bigtable.v2.ColumnRange} message ColumnRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.familyName = ""; + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + if (message.startQualifierClosed != null && message.hasOwnProperty("startQualifierClosed")) { + object.startQualifierClosed = options.bytes === String ? $util.base64.encode(message.startQualifierClosed, 0, message.startQualifierClosed.length) : options.bytes === Array ? Array.prototype.slice.call(message.startQualifierClosed) : message.startQualifierClosed; + if (options.oneofs) + object.startQualifier = "startQualifierClosed"; + } + if (message.startQualifierOpen != null && message.hasOwnProperty("startQualifierOpen")) { + object.startQualifierOpen = options.bytes === String ? $util.base64.encode(message.startQualifierOpen, 0, message.startQualifierOpen.length) : options.bytes === Array ? Array.prototype.slice.call(message.startQualifierOpen) : message.startQualifierOpen; + if (options.oneofs) + object.startQualifier = "startQualifierOpen"; + } + if (message.endQualifierClosed != null && message.hasOwnProperty("endQualifierClosed")) { + object.endQualifierClosed = options.bytes === String ? $util.base64.encode(message.endQualifierClosed, 0, message.endQualifierClosed.length) : options.bytes === Array ? Array.prototype.slice.call(message.endQualifierClosed) : message.endQualifierClosed; + if (options.oneofs) + object.endQualifier = "endQualifierClosed"; + } + if (message.endQualifierOpen != null && message.hasOwnProperty("endQualifierOpen")) { + object.endQualifierOpen = options.bytes === String ? $util.base64.encode(message.endQualifierOpen, 0, message.endQualifierOpen.length) : options.bytes === Array ? Array.prototype.slice.call(message.endQualifierOpen) : message.endQualifierOpen; + if (options.oneofs) + object.endQualifier = "endQualifierOpen"; + } + return object; + }; + + /** + * Converts this ColumnRange to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ColumnRange + * @instance + * @returns {Object.} JSON object + */ + ColumnRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnRange + * @function getTypeUrl + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ColumnRange"; + }; + + return ColumnRange; + })(); + + v2.TimestampRange = (function() { + + /** + * Properties of a TimestampRange. + * @memberof google.bigtable.v2 + * @interface ITimestampRange + * @property {number|Long|null} [startTimestampMicros] TimestampRange startTimestampMicros + * @property {number|Long|null} [endTimestampMicros] TimestampRange endTimestampMicros + */ + + /** + * Constructs a new TimestampRange. + * @memberof google.bigtable.v2 + * @classdesc Represents a TimestampRange. + * @implements ITimestampRange + * @constructor + * @param {google.bigtable.v2.ITimestampRange=} [properties] Properties to set + */ + function TimestampRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimestampRange startTimestampMicros. + * @member {number|Long} startTimestampMicros + * @memberof google.bigtable.v2.TimestampRange + * @instance + */ + TimestampRange.prototype.startTimestampMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TimestampRange endTimestampMicros. + * @member {number|Long} endTimestampMicros + * @memberof google.bigtable.v2.TimestampRange + * @instance + */ + TimestampRange.prototype.endTimestampMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampRange instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {google.bigtable.v2.ITimestampRange=} [properties] Properties to set + * @returns {google.bigtable.v2.TimestampRange} TimestampRange instance + */ + TimestampRange.create = function create(properties) { + return new TimestampRange(properties); + }; + + /** + * Encodes the specified TimestampRange message. Does not implicitly {@link google.bigtable.v2.TimestampRange.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {google.bigtable.v2.ITimestampRange} message TimestampRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimestampMicros != null && Object.hasOwnProperty.call(message, "startTimestampMicros")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.startTimestampMicros); + if (message.endTimestampMicros != null && Object.hasOwnProperty.call(message, "endTimestampMicros")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.endTimestampMicros); + return writer; + }; + + /** + * Encodes the specified TimestampRange message, length delimited. Does not implicitly {@link google.bigtable.v2.TimestampRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {google.bigtable.v2.ITimestampRange} message TimestampRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimestampRange message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.TimestampRange} TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.TimestampRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTimestampMicros = reader.int64(); + break; + } + case 2: { + message.endTimestampMicros = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimestampRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.TimestampRange} TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimestampRange message. + * @function verify + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimestampRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimestampMicros != null && message.hasOwnProperty("startTimestampMicros")) + if (!$util.isInteger(message.startTimestampMicros) && !(message.startTimestampMicros && $util.isInteger(message.startTimestampMicros.low) && $util.isInteger(message.startTimestampMicros.high))) + return "startTimestampMicros: integer|Long expected"; + if (message.endTimestampMicros != null && message.hasOwnProperty("endTimestampMicros")) + if (!$util.isInteger(message.endTimestampMicros) && !(message.endTimestampMicros && $util.isInteger(message.endTimestampMicros.low) && $util.isInteger(message.endTimestampMicros.high))) + return "endTimestampMicros: integer|Long expected"; + return null; + }; + + /** + * Creates a TimestampRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.TimestampRange} TimestampRange + */ + TimestampRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.TimestampRange) + return object; + var message = new $root.google.bigtable.v2.TimestampRange(); + if (object.startTimestampMicros != null) + if ($util.Long) + (message.startTimestampMicros = $util.Long.fromValue(object.startTimestampMicros)).unsigned = false; + else if (typeof object.startTimestampMicros === "string") + message.startTimestampMicros = parseInt(object.startTimestampMicros, 10); + else if (typeof object.startTimestampMicros === "number") + message.startTimestampMicros = object.startTimestampMicros; + else if (typeof object.startTimestampMicros === "object") + message.startTimestampMicros = new $util.LongBits(object.startTimestampMicros.low >>> 0, object.startTimestampMicros.high >>> 0).toNumber(); + if (object.endTimestampMicros != null) + if ($util.Long) + (message.endTimestampMicros = $util.Long.fromValue(object.endTimestampMicros)).unsigned = false; + else if (typeof object.endTimestampMicros === "string") + message.endTimestampMicros = parseInt(object.endTimestampMicros, 10); + else if (typeof object.endTimestampMicros === "number") + message.endTimestampMicros = object.endTimestampMicros; + else if (typeof object.endTimestampMicros === "object") + message.endTimestampMicros = new $util.LongBits(object.endTimestampMicros.low >>> 0, object.endTimestampMicros.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TimestampRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {google.bigtable.v2.TimestampRange} message TimestampRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimestampRange.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.startTimestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTimestampMicros = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endTimestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endTimestampMicros = options.longs === String ? "0" : 0; + } + if (message.startTimestampMicros != null && message.hasOwnProperty("startTimestampMicros")) + if (typeof message.startTimestampMicros === "number") + object.startTimestampMicros = options.longs === String ? String(message.startTimestampMicros) : message.startTimestampMicros; + else + object.startTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.startTimestampMicros) : options.longs === Number ? new $util.LongBits(message.startTimestampMicros.low >>> 0, message.startTimestampMicros.high >>> 0).toNumber() : message.startTimestampMicros; + if (message.endTimestampMicros != null && message.hasOwnProperty("endTimestampMicros")) + if (typeof message.endTimestampMicros === "number") + object.endTimestampMicros = options.longs === String ? String(message.endTimestampMicros) : message.endTimestampMicros; + else + object.endTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.endTimestampMicros) : options.longs === Number ? new $util.LongBits(message.endTimestampMicros.low >>> 0, message.endTimestampMicros.high >>> 0).toNumber() : message.endTimestampMicros; + return object; + }; + + /** + * Converts this TimestampRange to JSON. + * @function toJSON + * @memberof google.bigtable.v2.TimestampRange + * @instance + * @returns {Object.} JSON object + */ + TimestampRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimestampRange + * @function getTypeUrl + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.TimestampRange"; + }; + + return TimestampRange; + })(); + + v2.ValueRange = (function() { + + /** + * Properties of a ValueRange. + * @memberof google.bigtable.v2 + * @interface IValueRange + * @property {Uint8Array|null} [startValueClosed] ValueRange startValueClosed + * @property {Uint8Array|null} [startValueOpen] ValueRange startValueOpen + * @property {Uint8Array|null} [endValueClosed] ValueRange endValueClosed + * @property {Uint8Array|null} [endValueOpen] ValueRange endValueOpen + */ + + /** + * Constructs a new ValueRange. + * @memberof google.bigtable.v2 + * @classdesc Represents a ValueRange. + * @implements IValueRange + * @constructor + * @param {google.bigtable.v2.IValueRange=} [properties] Properties to set + */ + function ValueRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValueRange startValueClosed. + * @member {Uint8Array|null|undefined} startValueClosed + * @memberof google.bigtable.v2.ValueRange + * @instance + */ + ValueRange.prototype.startValueClosed = null; + + /** + * ValueRange startValueOpen. + * @member {Uint8Array|null|undefined} startValueOpen + * @memberof google.bigtable.v2.ValueRange + * @instance + */ + ValueRange.prototype.startValueOpen = null; + + /** + * ValueRange endValueClosed. + * @member {Uint8Array|null|undefined} endValueClosed + * @memberof google.bigtable.v2.ValueRange + * @instance + */ + ValueRange.prototype.endValueClosed = null; + + /** + * ValueRange endValueOpen. + * @member {Uint8Array|null|undefined} endValueOpen + * @memberof google.bigtable.v2.ValueRange + * @instance + */ + ValueRange.prototype.endValueOpen = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ValueRange startValue. + * @member {"startValueClosed"|"startValueOpen"|undefined} startValue + * @memberof google.bigtable.v2.ValueRange + * @instance + */ + Object.defineProperty(ValueRange.prototype, "startValue", { + get: $util.oneOfGetter($oneOfFields = ["startValueClosed", "startValueOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ValueRange endValue. + * @member {"endValueClosed"|"endValueOpen"|undefined} endValue + * @memberof google.bigtable.v2.ValueRange + * @instance + */ + Object.defineProperty(ValueRange.prototype, "endValue", { + get: $util.oneOfGetter($oneOfFields = ["endValueClosed", "endValueOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ValueRange instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {google.bigtable.v2.IValueRange=} [properties] Properties to set + * @returns {google.bigtable.v2.ValueRange} ValueRange instance + */ + ValueRange.create = function create(properties) { + return new ValueRange(properties); + }; + + /** + * Encodes the specified ValueRange message. Does not implicitly {@link google.bigtable.v2.ValueRange.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {google.bigtable.v2.IValueRange} message ValueRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startValueClosed != null && Object.hasOwnProperty.call(message, "startValueClosed")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startValueClosed); + if (message.startValueOpen != null && Object.hasOwnProperty.call(message, "startValueOpen")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.startValueOpen); + if (message.endValueClosed != null && Object.hasOwnProperty.call(message, "endValueClosed")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.endValueClosed); + if (message.endValueOpen != null && Object.hasOwnProperty.call(message, "endValueOpen")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.endValueOpen); + return writer; + }; + + /** + * Encodes the specified ValueRange message, length delimited. Does not implicitly {@link google.bigtable.v2.ValueRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {google.bigtable.v2.IValueRange} message ValueRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValueRange message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ValueRange} ValueRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ValueRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startValueClosed = reader.bytes(); + break; + } + case 2: { + message.startValueOpen = reader.bytes(); + break; + } + case 3: { + message.endValueClosed = reader.bytes(); + break; + } + case 4: { + message.endValueOpen = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValueRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ValueRange} ValueRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValueRange message. + * @function verify + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValueRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startValueClosed != null && message.hasOwnProperty("startValueClosed")) { + properties.startValue = 1; + if (!(message.startValueClosed && typeof message.startValueClosed.length === "number" || $util.isString(message.startValueClosed))) + return "startValueClosed: buffer expected"; + } + if (message.startValueOpen != null && message.hasOwnProperty("startValueOpen")) { + if (properties.startValue === 1) + return "startValue: multiple values"; + properties.startValue = 1; + if (!(message.startValueOpen && typeof message.startValueOpen.length === "number" || $util.isString(message.startValueOpen))) + return "startValueOpen: buffer expected"; + } + if (message.endValueClosed != null && message.hasOwnProperty("endValueClosed")) { + properties.endValue = 1; + if (!(message.endValueClosed && typeof message.endValueClosed.length === "number" || $util.isString(message.endValueClosed))) + return "endValueClosed: buffer expected"; + } + if (message.endValueOpen != null && message.hasOwnProperty("endValueOpen")) { + if (properties.endValue === 1) + return "endValue: multiple values"; + properties.endValue = 1; + if (!(message.endValueOpen && typeof message.endValueOpen.length === "number" || $util.isString(message.endValueOpen))) + return "endValueOpen: buffer expected"; + } + return null; + }; + + /** + * Creates a ValueRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ValueRange} ValueRange + */ + ValueRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ValueRange) + return object; + var message = new $root.google.bigtable.v2.ValueRange(); + if (object.startValueClosed != null) + if (typeof object.startValueClosed === "string") + $util.base64.decode(object.startValueClosed, message.startValueClosed = $util.newBuffer($util.base64.length(object.startValueClosed)), 0); + else if (object.startValueClosed.length >= 0) + message.startValueClosed = object.startValueClosed; + if (object.startValueOpen != null) + if (typeof object.startValueOpen === "string") + $util.base64.decode(object.startValueOpen, message.startValueOpen = $util.newBuffer($util.base64.length(object.startValueOpen)), 0); + else if (object.startValueOpen.length >= 0) + message.startValueOpen = object.startValueOpen; + if (object.endValueClosed != null) + if (typeof object.endValueClosed === "string") + $util.base64.decode(object.endValueClosed, message.endValueClosed = $util.newBuffer($util.base64.length(object.endValueClosed)), 0); + else if (object.endValueClosed.length >= 0) + message.endValueClosed = object.endValueClosed; + if (object.endValueOpen != null) + if (typeof object.endValueOpen === "string") + $util.base64.decode(object.endValueOpen, message.endValueOpen = $util.newBuffer($util.base64.length(object.endValueOpen)), 0); + else if (object.endValueOpen.length >= 0) + message.endValueOpen = object.endValueOpen; + return message; + }; + + /** + * Creates a plain object from a ValueRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {google.bigtable.v2.ValueRange} message ValueRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValueRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startValueClosed != null && message.hasOwnProperty("startValueClosed")) { + object.startValueClosed = options.bytes === String ? $util.base64.encode(message.startValueClosed, 0, message.startValueClosed.length) : options.bytes === Array ? Array.prototype.slice.call(message.startValueClosed) : message.startValueClosed; + if (options.oneofs) + object.startValue = "startValueClosed"; + } + if (message.startValueOpen != null && message.hasOwnProperty("startValueOpen")) { + object.startValueOpen = options.bytes === String ? $util.base64.encode(message.startValueOpen, 0, message.startValueOpen.length) : options.bytes === Array ? Array.prototype.slice.call(message.startValueOpen) : message.startValueOpen; + if (options.oneofs) + object.startValue = "startValueOpen"; + } + if (message.endValueClosed != null && message.hasOwnProperty("endValueClosed")) { + object.endValueClosed = options.bytes === String ? $util.base64.encode(message.endValueClosed, 0, message.endValueClosed.length) : options.bytes === Array ? Array.prototype.slice.call(message.endValueClosed) : message.endValueClosed; + if (options.oneofs) + object.endValue = "endValueClosed"; + } + if (message.endValueOpen != null && message.hasOwnProperty("endValueOpen")) { + object.endValueOpen = options.bytes === String ? $util.base64.encode(message.endValueOpen, 0, message.endValueOpen.length) : options.bytes === Array ? Array.prototype.slice.call(message.endValueOpen) : message.endValueOpen; + if (options.oneofs) + object.endValue = "endValueOpen"; + } + return object; + }; + + /** + * Converts this ValueRange to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ValueRange + * @instance + * @returns {Object.} JSON object + */ + ValueRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValueRange + * @function getTypeUrl + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValueRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ValueRange"; + }; + + return ValueRange; + })(); + + v2.RowFilter = (function() { + + /** + * Properties of a RowFilter. + * @memberof google.bigtable.v2 + * @interface IRowFilter + * @property {google.bigtable.v2.RowFilter.IChain|null} [chain] RowFilter chain + * @property {google.bigtable.v2.RowFilter.IInterleave|null} [interleave] RowFilter interleave + * @property {google.bigtable.v2.RowFilter.ICondition|null} [condition] RowFilter condition + * @property {boolean|null} [sink] RowFilter sink + * @property {boolean|null} [passAllFilter] RowFilter passAllFilter + * @property {boolean|null} [blockAllFilter] RowFilter blockAllFilter + * @property {Uint8Array|null} [rowKeyRegexFilter] RowFilter rowKeyRegexFilter + * @property {number|null} [rowSampleFilter] RowFilter rowSampleFilter + * @property {string|null} [familyNameRegexFilter] RowFilter familyNameRegexFilter + * @property {Uint8Array|null} [columnQualifierRegexFilter] RowFilter columnQualifierRegexFilter + * @property {google.bigtable.v2.IColumnRange|null} [columnRangeFilter] RowFilter columnRangeFilter + * @property {google.bigtable.v2.ITimestampRange|null} [timestampRangeFilter] RowFilter timestampRangeFilter + * @property {Uint8Array|null} [valueRegexFilter] RowFilter valueRegexFilter + * @property {google.bigtable.v2.IValueRange|null} [valueRangeFilter] RowFilter valueRangeFilter + * @property {number|null} [cellsPerRowOffsetFilter] RowFilter cellsPerRowOffsetFilter + * @property {number|null} [cellsPerRowLimitFilter] RowFilter cellsPerRowLimitFilter + * @property {number|null} [cellsPerColumnLimitFilter] RowFilter cellsPerColumnLimitFilter + * @property {boolean|null} [stripValueTransformer] RowFilter stripValueTransformer + * @property {string|null} [applyLabelTransformer] RowFilter applyLabelTransformer + */ + + /** + * Constructs a new RowFilter. + * @memberof google.bigtable.v2 + * @classdesc Represents a RowFilter. + * @implements IRowFilter + * @constructor + * @param {google.bigtable.v2.IRowFilter=} [properties] Properties to set + */ + function RowFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowFilter chain. + * @member {google.bigtable.v2.RowFilter.IChain|null|undefined} chain + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.chain = null; + + /** + * RowFilter interleave. + * @member {google.bigtable.v2.RowFilter.IInterleave|null|undefined} interleave + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.interleave = null; + + /** + * RowFilter condition. + * @member {google.bigtable.v2.RowFilter.ICondition|null|undefined} condition + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.condition = null; + + /** + * RowFilter sink. + * @member {boolean|null|undefined} sink + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.sink = null; + + /** + * RowFilter passAllFilter. + * @member {boolean|null|undefined} passAllFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.passAllFilter = null; + + /** + * RowFilter blockAllFilter. + * @member {boolean|null|undefined} blockAllFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.blockAllFilter = null; + + /** + * RowFilter rowKeyRegexFilter. + * @member {Uint8Array|null|undefined} rowKeyRegexFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.rowKeyRegexFilter = null; + + /** + * RowFilter rowSampleFilter. + * @member {number|null|undefined} rowSampleFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.rowSampleFilter = null; + + /** + * RowFilter familyNameRegexFilter. + * @member {string|null|undefined} familyNameRegexFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.familyNameRegexFilter = null; + + /** + * RowFilter columnQualifierRegexFilter. + * @member {Uint8Array|null|undefined} columnQualifierRegexFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.columnQualifierRegexFilter = null; + + /** + * RowFilter columnRangeFilter. + * @member {google.bigtable.v2.IColumnRange|null|undefined} columnRangeFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.columnRangeFilter = null; + + /** + * RowFilter timestampRangeFilter. + * @member {google.bigtable.v2.ITimestampRange|null|undefined} timestampRangeFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.timestampRangeFilter = null; + + /** + * RowFilter valueRegexFilter. + * @member {Uint8Array|null|undefined} valueRegexFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.valueRegexFilter = null; + + /** + * RowFilter valueRangeFilter. + * @member {google.bigtable.v2.IValueRange|null|undefined} valueRangeFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.valueRangeFilter = null; + + /** + * RowFilter cellsPerRowOffsetFilter. + * @member {number|null|undefined} cellsPerRowOffsetFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.cellsPerRowOffsetFilter = null; + + /** + * RowFilter cellsPerRowLimitFilter. + * @member {number|null|undefined} cellsPerRowLimitFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.cellsPerRowLimitFilter = null; + + /** + * RowFilter cellsPerColumnLimitFilter. + * @member {number|null|undefined} cellsPerColumnLimitFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.cellsPerColumnLimitFilter = null; + + /** + * RowFilter stripValueTransformer. + * @member {boolean|null|undefined} stripValueTransformer + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.stripValueTransformer = null; + + /** + * RowFilter applyLabelTransformer. + * @member {string|null|undefined} applyLabelTransformer + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.applyLabelTransformer = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RowFilter filter. + * @member {"chain"|"interleave"|"condition"|"sink"|"passAllFilter"|"blockAllFilter"|"rowKeyRegexFilter"|"rowSampleFilter"|"familyNameRegexFilter"|"columnQualifierRegexFilter"|"columnRangeFilter"|"timestampRangeFilter"|"valueRegexFilter"|"valueRangeFilter"|"cellsPerRowOffsetFilter"|"cellsPerRowLimitFilter"|"cellsPerColumnLimitFilter"|"stripValueTransformer"|"applyLabelTransformer"|undefined} filter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + Object.defineProperty(RowFilter.prototype, "filter", { + get: $util.oneOfGetter($oneOfFields = ["chain", "interleave", "condition", "sink", "passAllFilter", "blockAllFilter", "rowKeyRegexFilter", "rowSampleFilter", "familyNameRegexFilter", "columnQualifierRegexFilter", "columnRangeFilter", "timestampRangeFilter", "valueRegexFilter", "valueRangeFilter", "cellsPerRowOffsetFilter", "cellsPerRowLimitFilter", "cellsPerColumnLimitFilter", "stripValueTransformer", "applyLabelTransformer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RowFilter instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {google.bigtable.v2.IRowFilter=} [properties] Properties to set + * @returns {google.bigtable.v2.RowFilter} RowFilter instance + */ + RowFilter.create = function create(properties) { + return new RowFilter(properties); + }; + + /** + * Encodes the specified RowFilter message. Does not implicitly {@link google.bigtable.v2.RowFilter.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {google.bigtable.v2.IRowFilter} message RowFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) + $root.google.bigtable.v2.RowFilter.Chain.encode(message.chain, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.interleave != null && Object.hasOwnProperty.call(message, "interleave")) + $root.google.bigtable.v2.RowFilter.Interleave.encode(message.interleave, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.bigtable.v2.RowFilter.Condition.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rowKeyRegexFilter != null && Object.hasOwnProperty.call(message, "rowKeyRegexFilter")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.rowKeyRegexFilter); + if (message.familyNameRegexFilter != null && Object.hasOwnProperty.call(message, "familyNameRegexFilter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.familyNameRegexFilter); + if (message.columnQualifierRegexFilter != null && Object.hasOwnProperty.call(message, "columnQualifierRegexFilter")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.columnQualifierRegexFilter); + if (message.columnRangeFilter != null && Object.hasOwnProperty.call(message, "columnRangeFilter")) + $root.google.bigtable.v2.ColumnRange.encode(message.columnRangeFilter, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timestampRangeFilter != null && Object.hasOwnProperty.call(message, "timestampRangeFilter")) + $root.google.bigtable.v2.TimestampRange.encode(message.timestampRangeFilter, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.valueRegexFilter != null && Object.hasOwnProperty.call(message, "valueRegexFilter")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.valueRegexFilter); + if (message.cellsPerRowOffsetFilter != null && Object.hasOwnProperty.call(message, "cellsPerRowOffsetFilter")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.cellsPerRowOffsetFilter); + if (message.cellsPerRowLimitFilter != null && Object.hasOwnProperty.call(message, "cellsPerRowLimitFilter")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.cellsPerRowLimitFilter); + if (message.cellsPerColumnLimitFilter != null && Object.hasOwnProperty.call(message, "cellsPerColumnLimitFilter")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.cellsPerColumnLimitFilter); + if (message.stripValueTransformer != null && Object.hasOwnProperty.call(message, "stripValueTransformer")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.stripValueTransformer); + if (message.rowSampleFilter != null && Object.hasOwnProperty.call(message, "rowSampleFilter")) + writer.uint32(/* id 14, wireType 1 =*/113).double(message.rowSampleFilter); + if (message.valueRangeFilter != null && Object.hasOwnProperty.call(message, "valueRangeFilter")) + $root.google.bigtable.v2.ValueRange.encode(message.valueRangeFilter, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.sink != null && Object.hasOwnProperty.call(message, "sink")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.sink); + if (message.passAllFilter != null && Object.hasOwnProperty.call(message, "passAllFilter")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.passAllFilter); + if (message.blockAllFilter != null && Object.hasOwnProperty.call(message, "blockAllFilter")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.blockAllFilter); + if (message.applyLabelTransformer != null && Object.hasOwnProperty.call(message, "applyLabelTransformer")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.applyLabelTransformer); + return writer; + }; + + /** + * Encodes the specified RowFilter message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {google.bigtable.v2.IRowFilter} message RowFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowFilter message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RowFilter} RowFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowFilter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RowFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chain = $root.google.bigtable.v2.RowFilter.Chain.decode(reader, reader.uint32()); + break; + } + case 2: { + message.interleave = $root.google.bigtable.v2.RowFilter.Interleave.decode(reader, reader.uint32()); + break; + } + case 3: { + message.condition = $root.google.bigtable.v2.RowFilter.Condition.decode(reader, reader.uint32()); + break; + } + case 16: { + message.sink = reader.bool(); + break; + } + case 17: { + message.passAllFilter = reader.bool(); + break; + } + case 18: { + message.blockAllFilter = reader.bool(); + break; + } + case 4: { + message.rowKeyRegexFilter = reader.bytes(); + break; + } + case 14: { + message.rowSampleFilter = reader.double(); + break; + } + case 5: { + message.familyNameRegexFilter = reader.string(); + break; + } + case 6: { + message.columnQualifierRegexFilter = reader.bytes(); + break; + } + case 7: { + message.columnRangeFilter = $root.google.bigtable.v2.ColumnRange.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timestampRangeFilter = $root.google.bigtable.v2.TimestampRange.decode(reader, reader.uint32()); + break; + } + case 9: { + message.valueRegexFilter = reader.bytes(); + break; + } + case 15: { + message.valueRangeFilter = $root.google.bigtable.v2.ValueRange.decode(reader, reader.uint32()); + break; + } + case 10: { + message.cellsPerRowOffsetFilter = reader.int32(); + break; + } + case 11: { + message.cellsPerRowLimitFilter = reader.int32(); + break; + } + case 12: { + message.cellsPerColumnLimitFilter = reader.int32(); + break; + } + case 13: { + message.stripValueTransformer = reader.bool(); + break; + } + case 19: { + message.applyLabelTransformer = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RowFilter} RowFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowFilter message. + * @function verify + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.chain != null && message.hasOwnProperty("chain")) { + properties.filter = 1; + { + var error = $root.google.bigtable.v2.RowFilter.Chain.verify(message.chain); + if (error) + return "chain." + error; + } + } + if (message.interleave != null && message.hasOwnProperty("interleave")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + { + var error = $root.google.bigtable.v2.RowFilter.Interleave.verify(message.interleave); + if (error) + return "interleave." + error; + } + } + if (message.condition != null && message.hasOwnProperty("condition")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + { + var error = $root.google.bigtable.v2.RowFilter.Condition.verify(message.condition); + if (error) + return "condition." + error; + } + } + if (message.sink != null && message.hasOwnProperty("sink")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (typeof message.sink !== "boolean") + return "sink: boolean expected"; + } + if (message.passAllFilter != null && message.hasOwnProperty("passAllFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (typeof message.passAllFilter !== "boolean") + return "passAllFilter: boolean expected"; + } + if (message.blockAllFilter != null && message.hasOwnProperty("blockAllFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (typeof message.blockAllFilter !== "boolean") + return "blockAllFilter: boolean expected"; + } + if (message.rowKeyRegexFilter != null && message.hasOwnProperty("rowKeyRegexFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!(message.rowKeyRegexFilter && typeof message.rowKeyRegexFilter.length === "number" || $util.isString(message.rowKeyRegexFilter))) + return "rowKeyRegexFilter: buffer expected"; + } + if (message.rowSampleFilter != null && message.hasOwnProperty("rowSampleFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (typeof message.rowSampleFilter !== "number") + return "rowSampleFilter: number expected"; + } + if (message.familyNameRegexFilter != null && message.hasOwnProperty("familyNameRegexFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!$util.isString(message.familyNameRegexFilter)) + return "familyNameRegexFilter: string expected"; + } + if (message.columnQualifierRegexFilter != null && message.hasOwnProperty("columnQualifierRegexFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!(message.columnQualifierRegexFilter && typeof message.columnQualifierRegexFilter.length === "number" || $util.isString(message.columnQualifierRegexFilter))) + return "columnQualifierRegexFilter: buffer expected"; + } + if (message.columnRangeFilter != null && message.hasOwnProperty("columnRangeFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + { + var error = $root.google.bigtable.v2.ColumnRange.verify(message.columnRangeFilter); + if (error) + return "columnRangeFilter." + error; + } + } + if (message.timestampRangeFilter != null && message.hasOwnProperty("timestampRangeFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + { + var error = $root.google.bigtable.v2.TimestampRange.verify(message.timestampRangeFilter); + if (error) + return "timestampRangeFilter." + error; + } + } + if (message.valueRegexFilter != null && message.hasOwnProperty("valueRegexFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!(message.valueRegexFilter && typeof message.valueRegexFilter.length === "number" || $util.isString(message.valueRegexFilter))) + return "valueRegexFilter: buffer expected"; + } + if (message.valueRangeFilter != null && message.hasOwnProperty("valueRangeFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + { + var error = $root.google.bigtable.v2.ValueRange.verify(message.valueRangeFilter); + if (error) + return "valueRangeFilter." + error; + } + } + if (message.cellsPerRowOffsetFilter != null && message.hasOwnProperty("cellsPerRowOffsetFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!$util.isInteger(message.cellsPerRowOffsetFilter)) + return "cellsPerRowOffsetFilter: integer expected"; + } + if (message.cellsPerRowLimitFilter != null && message.hasOwnProperty("cellsPerRowLimitFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!$util.isInteger(message.cellsPerRowLimitFilter)) + return "cellsPerRowLimitFilter: integer expected"; + } + if (message.cellsPerColumnLimitFilter != null && message.hasOwnProperty("cellsPerColumnLimitFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!$util.isInteger(message.cellsPerColumnLimitFilter)) + return "cellsPerColumnLimitFilter: integer expected"; + } + if (message.stripValueTransformer != null && message.hasOwnProperty("stripValueTransformer")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (typeof message.stripValueTransformer !== "boolean") + return "stripValueTransformer: boolean expected"; + } + if (message.applyLabelTransformer != null && message.hasOwnProperty("applyLabelTransformer")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!$util.isString(message.applyLabelTransformer)) + return "applyLabelTransformer: string expected"; + } + return null; + }; + + /** + * Creates a RowFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RowFilter} RowFilter + */ + RowFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RowFilter) + return object; + var message = new $root.google.bigtable.v2.RowFilter(); + if (object.chain != null) { + if (typeof object.chain !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.chain: object expected"); + message.chain = $root.google.bigtable.v2.RowFilter.Chain.fromObject(object.chain); + } + if (object.interleave != null) { + if (typeof object.interleave !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.interleave: object expected"); + message.interleave = $root.google.bigtable.v2.RowFilter.Interleave.fromObject(object.interleave); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.condition: object expected"); + message.condition = $root.google.bigtable.v2.RowFilter.Condition.fromObject(object.condition); + } + if (object.sink != null) + message.sink = Boolean(object.sink); + if (object.passAllFilter != null) + message.passAllFilter = Boolean(object.passAllFilter); + if (object.blockAllFilter != null) + message.blockAllFilter = Boolean(object.blockAllFilter); + if (object.rowKeyRegexFilter != null) + if (typeof object.rowKeyRegexFilter === "string") + $util.base64.decode(object.rowKeyRegexFilter, message.rowKeyRegexFilter = $util.newBuffer($util.base64.length(object.rowKeyRegexFilter)), 0); + else if (object.rowKeyRegexFilter.length >= 0) + message.rowKeyRegexFilter = object.rowKeyRegexFilter; + if (object.rowSampleFilter != null) + message.rowSampleFilter = Number(object.rowSampleFilter); + if (object.familyNameRegexFilter != null) + message.familyNameRegexFilter = String(object.familyNameRegexFilter); + if (object.columnQualifierRegexFilter != null) + if (typeof object.columnQualifierRegexFilter === "string") + $util.base64.decode(object.columnQualifierRegexFilter, message.columnQualifierRegexFilter = $util.newBuffer($util.base64.length(object.columnQualifierRegexFilter)), 0); + else if (object.columnQualifierRegexFilter.length >= 0) + message.columnQualifierRegexFilter = object.columnQualifierRegexFilter; + if (object.columnRangeFilter != null) { + if (typeof object.columnRangeFilter !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.columnRangeFilter: object expected"); + message.columnRangeFilter = $root.google.bigtable.v2.ColumnRange.fromObject(object.columnRangeFilter); + } + if (object.timestampRangeFilter != null) { + if (typeof object.timestampRangeFilter !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.timestampRangeFilter: object expected"); + message.timestampRangeFilter = $root.google.bigtable.v2.TimestampRange.fromObject(object.timestampRangeFilter); + } + if (object.valueRegexFilter != null) + if (typeof object.valueRegexFilter === "string") + $util.base64.decode(object.valueRegexFilter, message.valueRegexFilter = $util.newBuffer($util.base64.length(object.valueRegexFilter)), 0); + else if (object.valueRegexFilter.length >= 0) + message.valueRegexFilter = object.valueRegexFilter; + if (object.valueRangeFilter != null) { + if (typeof object.valueRangeFilter !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.valueRangeFilter: object expected"); + message.valueRangeFilter = $root.google.bigtable.v2.ValueRange.fromObject(object.valueRangeFilter); + } + if (object.cellsPerRowOffsetFilter != null) + message.cellsPerRowOffsetFilter = object.cellsPerRowOffsetFilter | 0; + if (object.cellsPerRowLimitFilter != null) + message.cellsPerRowLimitFilter = object.cellsPerRowLimitFilter | 0; + if (object.cellsPerColumnLimitFilter != null) + message.cellsPerColumnLimitFilter = object.cellsPerColumnLimitFilter | 0; + if (object.stripValueTransformer != null) + message.stripValueTransformer = Boolean(object.stripValueTransformer); + if (object.applyLabelTransformer != null) + message.applyLabelTransformer = String(object.applyLabelTransformer); + return message; + }; + + /** + * Creates a plain object from a RowFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {google.bigtable.v2.RowFilter} message RowFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.chain != null && message.hasOwnProperty("chain")) { + object.chain = $root.google.bigtable.v2.RowFilter.Chain.toObject(message.chain, options); + if (options.oneofs) + object.filter = "chain"; + } + if (message.interleave != null && message.hasOwnProperty("interleave")) { + object.interleave = $root.google.bigtable.v2.RowFilter.Interleave.toObject(message.interleave, options); + if (options.oneofs) + object.filter = "interleave"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + object.condition = $root.google.bigtable.v2.RowFilter.Condition.toObject(message.condition, options); + if (options.oneofs) + object.filter = "condition"; + } + if (message.rowKeyRegexFilter != null && message.hasOwnProperty("rowKeyRegexFilter")) { + object.rowKeyRegexFilter = options.bytes === String ? $util.base64.encode(message.rowKeyRegexFilter, 0, message.rowKeyRegexFilter.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKeyRegexFilter) : message.rowKeyRegexFilter; + if (options.oneofs) + object.filter = "rowKeyRegexFilter"; + } + if (message.familyNameRegexFilter != null && message.hasOwnProperty("familyNameRegexFilter")) { + object.familyNameRegexFilter = message.familyNameRegexFilter; + if (options.oneofs) + object.filter = "familyNameRegexFilter"; + } + if (message.columnQualifierRegexFilter != null && message.hasOwnProperty("columnQualifierRegexFilter")) { + object.columnQualifierRegexFilter = options.bytes === String ? $util.base64.encode(message.columnQualifierRegexFilter, 0, message.columnQualifierRegexFilter.length) : options.bytes === Array ? Array.prototype.slice.call(message.columnQualifierRegexFilter) : message.columnQualifierRegexFilter; + if (options.oneofs) + object.filter = "columnQualifierRegexFilter"; + } + if (message.columnRangeFilter != null && message.hasOwnProperty("columnRangeFilter")) { + object.columnRangeFilter = $root.google.bigtable.v2.ColumnRange.toObject(message.columnRangeFilter, options); + if (options.oneofs) + object.filter = "columnRangeFilter"; + } + if (message.timestampRangeFilter != null && message.hasOwnProperty("timestampRangeFilter")) { + object.timestampRangeFilter = $root.google.bigtable.v2.TimestampRange.toObject(message.timestampRangeFilter, options); + if (options.oneofs) + object.filter = "timestampRangeFilter"; + } + if (message.valueRegexFilter != null && message.hasOwnProperty("valueRegexFilter")) { + object.valueRegexFilter = options.bytes === String ? $util.base64.encode(message.valueRegexFilter, 0, message.valueRegexFilter.length) : options.bytes === Array ? Array.prototype.slice.call(message.valueRegexFilter) : message.valueRegexFilter; + if (options.oneofs) + object.filter = "valueRegexFilter"; + } + if (message.cellsPerRowOffsetFilter != null && message.hasOwnProperty("cellsPerRowOffsetFilter")) { + object.cellsPerRowOffsetFilter = message.cellsPerRowOffsetFilter; + if (options.oneofs) + object.filter = "cellsPerRowOffsetFilter"; + } + if (message.cellsPerRowLimitFilter != null && message.hasOwnProperty("cellsPerRowLimitFilter")) { + object.cellsPerRowLimitFilter = message.cellsPerRowLimitFilter; + if (options.oneofs) + object.filter = "cellsPerRowLimitFilter"; + } + if (message.cellsPerColumnLimitFilter != null && message.hasOwnProperty("cellsPerColumnLimitFilter")) { + object.cellsPerColumnLimitFilter = message.cellsPerColumnLimitFilter; + if (options.oneofs) + object.filter = "cellsPerColumnLimitFilter"; + } + if (message.stripValueTransformer != null && message.hasOwnProperty("stripValueTransformer")) { + object.stripValueTransformer = message.stripValueTransformer; + if (options.oneofs) + object.filter = "stripValueTransformer"; + } + if (message.rowSampleFilter != null && message.hasOwnProperty("rowSampleFilter")) { + object.rowSampleFilter = options.json && !isFinite(message.rowSampleFilter) ? String(message.rowSampleFilter) : message.rowSampleFilter; + if (options.oneofs) + object.filter = "rowSampleFilter"; + } + if (message.valueRangeFilter != null && message.hasOwnProperty("valueRangeFilter")) { + object.valueRangeFilter = $root.google.bigtable.v2.ValueRange.toObject(message.valueRangeFilter, options); + if (options.oneofs) + object.filter = "valueRangeFilter"; + } + if (message.sink != null && message.hasOwnProperty("sink")) { + object.sink = message.sink; + if (options.oneofs) + object.filter = "sink"; + } + if (message.passAllFilter != null && message.hasOwnProperty("passAllFilter")) { + object.passAllFilter = message.passAllFilter; + if (options.oneofs) + object.filter = "passAllFilter"; + } + if (message.blockAllFilter != null && message.hasOwnProperty("blockAllFilter")) { + object.blockAllFilter = message.blockAllFilter; + if (options.oneofs) + object.filter = "blockAllFilter"; + } + if (message.applyLabelTransformer != null && message.hasOwnProperty("applyLabelTransformer")) { + object.applyLabelTransformer = message.applyLabelTransformer; + if (options.oneofs) + object.filter = "applyLabelTransformer"; + } + return object; + }; + + /** + * Converts this RowFilter to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RowFilter + * @instance + * @returns {Object.} JSON object + */ + RowFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowFilter + * @function getTypeUrl + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RowFilter"; + }; + + RowFilter.Chain = (function() { + + /** + * Properties of a Chain. + * @memberof google.bigtable.v2.RowFilter + * @interface IChain + * @property {Array.|null} [filters] Chain filters + */ + + /** + * Constructs a new Chain. + * @memberof google.bigtable.v2.RowFilter + * @classdesc Represents a Chain. + * @implements IChain + * @constructor + * @param {google.bigtable.v2.RowFilter.IChain=} [properties] Properties to set + */ + function Chain(properties) { + this.filters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chain filters. + * @member {Array.} filters + * @memberof google.bigtable.v2.RowFilter.Chain + * @instance + */ + Chain.prototype.filters = $util.emptyArray; + + /** + * Creates a new Chain instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {google.bigtable.v2.RowFilter.IChain=} [properties] Properties to set + * @returns {google.bigtable.v2.RowFilter.Chain} Chain instance + */ + Chain.create = function create(properties) { + return new Chain(properties); + }; + + /** + * Encodes the specified Chain message. Does not implicitly {@link google.bigtable.v2.RowFilter.Chain.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {google.bigtable.v2.RowFilter.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filters != null && message.filters.length) + for (var i = 0; i < message.filters.length; ++i) + $root.google.bigtable.v2.RowFilter.encode(message.filters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Chain message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.Chain.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {google.bigtable.v2.RowFilter.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chain message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RowFilter.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RowFilter.Chain(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.filters && message.filters.length)) + message.filters = []; + message.filters.push($root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RowFilter.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chain message. + * @function verify + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filters != null && message.hasOwnProperty("filters")) { + if (!Array.isArray(message.filters)) + return "filters: array expected"; + for (var i = 0; i < message.filters.length; ++i) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.filters[i]); + if (error) + return "filters." + error; + } + } + return null; + }; + + /** + * Creates a Chain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RowFilter.Chain} Chain + */ + Chain.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RowFilter.Chain) + return object; + var message = new $root.google.bigtable.v2.RowFilter.Chain(); + if (object.filters) { + if (!Array.isArray(object.filters)) + throw TypeError(".google.bigtable.v2.RowFilter.Chain.filters: array expected"); + message.filters = []; + for (var i = 0; i < object.filters.length; ++i) { + if (typeof object.filters[i] !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.Chain.filters: object expected"); + message.filters[i] = $root.google.bigtable.v2.RowFilter.fromObject(object.filters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Chain message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {google.bigtable.v2.RowFilter.Chain} message Chain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.filters = []; + if (message.filters && message.filters.length) { + object.filters = []; + for (var j = 0; j < message.filters.length; ++j) + object.filters[j] = $root.google.bigtable.v2.RowFilter.toObject(message.filters[j], options); + } + return object; + }; + + /** + * Converts this Chain to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RowFilter.Chain + * @instance + * @returns {Object.} JSON object + */ + Chain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Chain + * @function getTypeUrl + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Chain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RowFilter.Chain"; + }; + + return Chain; + })(); + + RowFilter.Interleave = (function() { + + /** + * Properties of an Interleave. + * @memberof google.bigtable.v2.RowFilter + * @interface IInterleave + * @property {Array.|null} [filters] Interleave filters + */ + + /** + * Constructs a new Interleave. + * @memberof google.bigtable.v2.RowFilter + * @classdesc Represents an Interleave. + * @implements IInterleave + * @constructor + * @param {google.bigtable.v2.RowFilter.IInterleave=} [properties] Properties to set + */ + function Interleave(properties) { + this.filters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Interleave filters. + * @member {Array.} filters + * @memberof google.bigtable.v2.RowFilter.Interleave + * @instance + */ + Interleave.prototype.filters = $util.emptyArray; + + /** + * Creates a new Interleave instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {google.bigtable.v2.RowFilter.IInterleave=} [properties] Properties to set + * @returns {google.bigtable.v2.RowFilter.Interleave} Interleave instance + */ + Interleave.create = function create(properties) { + return new Interleave(properties); + }; + + /** + * Encodes the specified Interleave message. Does not implicitly {@link google.bigtable.v2.RowFilter.Interleave.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {google.bigtable.v2.RowFilter.IInterleave} message Interleave message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interleave.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filters != null && message.filters.length) + for (var i = 0; i < message.filters.length; ++i) + $root.google.bigtable.v2.RowFilter.encode(message.filters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Interleave message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.Interleave.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {google.bigtable.v2.RowFilter.IInterleave} message Interleave message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interleave.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Interleave message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RowFilter.Interleave} Interleave + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interleave.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RowFilter.Interleave(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.filters && message.filters.length)) + message.filters = []; + message.filters.push($root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Interleave message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RowFilter.Interleave} Interleave + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interleave.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Interleave message. + * @function verify + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Interleave.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filters != null && message.hasOwnProperty("filters")) { + if (!Array.isArray(message.filters)) + return "filters: array expected"; + for (var i = 0; i < message.filters.length; ++i) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.filters[i]); + if (error) + return "filters." + error; + } + } + return null; + }; + + /** + * Creates an Interleave message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RowFilter.Interleave} Interleave + */ + Interleave.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RowFilter.Interleave) + return object; + var message = new $root.google.bigtable.v2.RowFilter.Interleave(); + if (object.filters) { + if (!Array.isArray(object.filters)) + throw TypeError(".google.bigtable.v2.RowFilter.Interleave.filters: array expected"); + message.filters = []; + for (var i = 0; i < object.filters.length; ++i) { + if (typeof object.filters[i] !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.Interleave.filters: object expected"); + message.filters[i] = $root.google.bigtable.v2.RowFilter.fromObject(object.filters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Interleave message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {google.bigtable.v2.RowFilter.Interleave} message Interleave + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Interleave.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.filters = []; + if (message.filters && message.filters.length) { + object.filters = []; + for (var j = 0; j < message.filters.length; ++j) + object.filters[j] = $root.google.bigtable.v2.RowFilter.toObject(message.filters[j], options); + } + return object; + }; + + /** + * Converts this Interleave to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RowFilter.Interleave + * @instance + * @returns {Object.} JSON object + */ + Interleave.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Interleave + * @function getTypeUrl + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Interleave.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RowFilter.Interleave"; + }; + + return Interleave; + })(); + + RowFilter.Condition = (function() { + + /** + * Properties of a Condition. + * @memberof google.bigtable.v2.RowFilter + * @interface ICondition + * @property {google.bigtable.v2.IRowFilter|null} [predicateFilter] Condition predicateFilter + * @property {google.bigtable.v2.IRowFilter|null} [trueFilter] Condition trueFilter + * @property {google.bigtable.v2.IRowFilter|null} [falseFilter] Condition falseFilter + */ + + /** + * Constructs a new Condition. + * @memberof google.bigtable.v2.RowFilter + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.bigtable.v2.RowFilter.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Condition predicateFilter. + * @member {google.bigtable.v2.IRowFilter|null|undefined} predicateFilter + * @memberof google.bigtable.v2.RowFilter.Condition + * @instance + */ + Condition.prototype.predicateFilter = null; + + /** + * Condition trueFilter. + * @member {google.bigtable.v2.IRowFilter|null|undefined} trueFilter + * @memberof google.bigtable.v2.RowFilter.Condition + * @instance + */ + Condition.prototype.trueFilter = null; + + /** + * Condition falseFilter. + * @member {google.bigtable.v2.IRowFilter|null|undefined} falseFilter + * @memberof google.bigtable.v2.RowFilter.Condition + * @instance + */ + Condition.prototype.falseFilter = null; + + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {google.bigtable.v2.RowFilter.ICondition=} [properties] Properties to set + * @returns {google.bigtable.v2.RowFilter.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.bigtable.v2.RowFilter.Condition.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {google.bigtable.v2.RowFilter.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.predicateFilter != null && Object.hasOwnProperty.call(message, "predicateFilter")) + $root.google.bigtable.v2.RowFilter.encode(message.predicateFilter, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.trueFilter != null && Object.hasOwnProperty.call(message, "trueFilter")) + $root.google.bigtable.v2.RowFilter.encode(message.trueFilter, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.falseFilter != null && Object.hasOwnProperty.call(message, "falseFilter")) + $root.google.bigtable.v2.RowFilter.encode(message.falseFilter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {google.bigtable.v2.RowFilter.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RowFilter.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RowFilter.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.predicateFilter = $root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32()); + break; + } + case 2: { + message.trueFilter = $root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32()); + break; + } + case 3: { + message.falseFilter = $root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RowFilter.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Condition message. + * @function verify + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.predicateFilter != null && message.hasOwnProperty("predicateFilter")) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.predicateFilter); + if (error) + return "predicateFilter." + error; + } + if (message.trueFilter != null && message.hasOwnProperty("trueFilter")) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.trueFilter); + if (error) + return "trueFilter." + error; + } + if (message.falseFilter != null && message.hasOwnProperty("falseFilter")) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.falseFilter); + if (error) + return "falseFilter." + error; + } + return null; + }; + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RowFilter.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RowFilter.Condition) + return object; + var message = new $root.google.bigtable.v2.RowFilter.Condition(); + if (object.predicateFilter != null) { + if (typeof object.predicateFilter !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.Condition.predicateFilter: object expected"); + message.predicateFilter = $root.google.bigtable.v2.RowFilter.fromObject(object.predicateFilter); + } + if (object.trueFilter != null) { + if (typeof object.trueFilter !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.Condition.trueFilter: object expected"); + message.trueFilter = $root.google.bigtable.v2.RowFilter.fromObject(object.trueFilter); + } + if (object.falseFilter != null) { + if (typeof object.falseFilter !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.Condition.falseFilter: object expected"); + message.falseFilter = $root.google.bigtable.v2.RowFilter.fromObject(object.falseFilter); + } + return message; + }; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {google.bigtable.v2.RowFilter.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.predicateFilter = null; + object.trueFilter = null; + object.falseFilter = null; + } + if (message.predicateFilter != null && message.hasOwnProperty("predicateFilter")) + object.predicateFilter = $root.google.bigtable.v2.RowFilter.toObject(message.predicateFilter, options); + if (message.trueFilter != null && message.hasOwnProperty("trueFilter")) + object.trueFilter = $root.google.bigtable.v2.RowFilter.toObject(message.trueFilter, options); + if (message.falseFilter != null && message.hasOwnProperty("falseFilter")) + object.falseFilter = $root.google.bigtable.v2.RowFilter.toObject(message.falseFilter, options); + return object; + }; + + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RowFilter.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Condition + * @function getTypeUrl + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RowFilter.Condition"; + }; + + return Condition; + })(); + + return RowFilter; + })(); + + v2.Mutation = (function() { + + /** + * Properties of a Mutation. + * @memberof google.bigtable.v2 + * @interface IMutation + * @property {google.bigtable.v2.Mutation.ISetCell|null} [setCell] Mutation setCell + * @property {google.bigtable.v2.Mutation.IAddToCell|null} [addToCell] Mutation addToCell + * @property {google.bigtable.v2.Mutation.IMergeToCell|null} [mergeToCell] Mutation mergeToCell + * @property {google.bigtable.v2.Mutation.IDeleteFromColumn|null} [deleteFromColumn] Mutation deleteFromColumn + * @property {google.bigtable.v2.Mutation.IDeleteFromFamily|null} [deleteFromFamily] Mutation deleteFromFamily + * @property {google.bigtable.v2.Mutation.IDeleteFromRow|null} [deleteFromRow] Mutation deleteFromRow + */ + + /** + * Constructs a new Mutation. + * @memberof google.bigtable.v2 + * @classdesc Represents a Mutation. + * @implements IMutation + * @constructor + * @param {google.bigtable.v2.IMutation=} [properties] Properties to set + */ + function Mutation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Mutation setCell. + * @member {google.bigtable.v2.Mutation.ISetCell|null|undefined} setCell + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Mutation.prototype.setCell = null; + + /** + * Mutation addToCell. + * @member {google.bigtable.v2.Mutation.IAddToCell|null|undefined} addToCell + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Mutation.prototype.addToCell = null; + + /** + * Mutation mergeToCell. + * @member {google.bigtable.v2.Mutation.IMergeToCell|null|undefined} mergeToCell + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Mutation.prototype.mergeToCell = null; + + /** + * Mutation deleteFromColumn. + * @member {google.bigtable.v2.Mutation.IDeleteFromColumn|null|undefined} deleteFromColumn + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Mutation.prototype.deleteFromColumn = null; + + /** + * Mutation deleteFromFamily. + * @member {google.bigtable.v2.Mutation.IDeleteFromFamily|null|undefined} deleteFromFamily + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Mutation.prototype.deleteFromFamily = null; + + /** + * Mutation deleteFromRow. + * @member {google.bigtable.v2.Mutation.IDeleteFromRow|null|undefined} deleteFromRow + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Mutation.prototype.deleteFromRow = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Mutation mutation. + * @member {"setCell"|"addToCell"|"mergeToCell"|"deleteFromColumn"|"deleteFromFamily"|"deleteFromRow"|undefined} mutation + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Object.defineProperty(Mutation.prototype, "mutation", { + get: $util.oneOfGetter($oneOfFields = ["setCell", "addToCell", "mergeToCell", "deleteFromColumn", "deleteFromFamily", "deleteFromRow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Mutation instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation + * @static + * @param {google.bigtable.v2.IMutation=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation} Mutation instance + */ + Mutation.create = function create(properties) { + return new Mutation(properties); + }; + + /** + * Encodes the specified Mutation message. Does not implicitly {@link google.bigtable.v2.Mutation.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation + * @static + * @param {google.bigtable.v2.IMutation} message Mutation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mutation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.setCell != null && Object.hasOwnProperty.call(message, "setCell")) + $root.google.bigtable.v2.Mutation.SetCell.encode(message.setCell, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleteFromColumn != null && Object.hasOwnProperty.call(message, "deleteFromColumn")) + $root.google.bigtable.v2.Mutation.DeleteFromColumn.encode(message.deleteFromColumn, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deleteFromFamily != null && Object.hasOwnProperty.call(message, "deleteFromFamily")) + $root.google.bigtable.v2.Mutation.DeleteFromFamily.encode(message.deleteFromFamily, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.deleteFromRow != null && Object.hasOwnProperty.call(message, "deleteFromRow")) + $root.google.bigtable.v2.Mutation.DeleteFromRow.encode(message.deleteFromRow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.addToCell != null && Object.hasOwnProperty.call(message, "addToCell")) + $root.google.bigtable.v2.Mutation.AddToCell.encode(message.addToCell, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.mergeToCell != null && Object.hasOwnProperty.call(message, "mergeToCell")) + $root.google.bigtable.v2.Mutation.MergeToCell.encode(message.mergeToCell, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation + * @static + * @param {google.bigtable.v2.IMutation} message Mutation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mutation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Mutation message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation} Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mutation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.setCell = $root.google.bigtable.v2.Mutation.SetCell.decode(reader, reader.uint32()); + break; + } + case 5: { + message.addToCell = $root.google.bigtable.v2.Mutation.AddToCell.decode(reader, reader.uint32()); + break; + } + case 6: { + message.mergeToCell = $root.google.bigtable.v2.Mutation.MergeToCell.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deleteFromColumn = $root.google.bigtable.v2.Mutation.DeleteFromColumn.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deleteFromFamily = $root.google.bigtable.v2.Mutation.DeleteFromFamily.decode(reader, reader.uint32()); + break; + } + case 4: { + message.deleteFromRow = $root.google.bigtable.v2.Mutation.DeleteFromRow.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Mutation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation} Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mutation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Mutation message. + * @function verify + * @memberof google.bigtable.v2.Mutation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Mutation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.setCell != null && message.hasOwnProperty("setCell")) { + properties.mutation = 1; + { + var error = $root.google.bigtable.v2.Mutation.SetCell.verify(message.setCell); + if (error) + return "setCell." + error; + } + } + if (message.addToCell != null && message.hasOwnProperty("addToCell")) { + if (properties.mutation === 1) + return "mutation: multiple values"; + properties.mutation = 1; + { + var error = $root.google.bigtable.v2.Mutation.AddToCell.verify(message.addToCell); + if (error) + return "addToCell." + error; + } + } + if (message.mergeToCell != null && message.hasOwnProperty("mergeToCell")) { + if (properties.mutation === 1) + return "mutation: multiple values"; + properties.mutation = 1; + { + var error = $root.google.bigtable.v2.Mutation.MergeToCell.verify(message.mergeToCell); + if (error) + return "mergeToCell." + error; + } + } + if (message.deleteFromColumn != null && message.hasOwnProperty("deleteFromColumn")) { + if (properties.mutation === 1) + return "mutation: multiple values"; + properties.mutation = 1; + { + var error = $root.google.bigtable.v2.Mutation.DeleteFromColumn.verify(message.deleteFromColumn); + if (error) + return "deleteFromColumn." + error; + } + } + if (message.deleteFromFamily != null && message.hasOwnProperty("deleteFromFamily")) { + if (properties.mutation === 1) + return "mutation: multiple values"; + properties.mutation = 1; + { + var error = $root.google.bigtable.v2.Mutation.DeleteFromFamily.verify(message.deleteFromFamily); + if (error) + return "deleteFromFamily." + error; + } + } + if (message.deleteFromRow != null && message.hasOwnProperty("deleteFromRow")) { + if (properties.mutation === 1) + return "mutation: multiple values"; + properties.mutation = 1; + { + var error = $root.google.bigtable.v2.Mutation.DeleteFromRow.verify(message.deleteFromRow); + if (error) + return "deleteFromRow." + error; + } + } + return null; + }; + + /** + * Creates a Mutation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation} Mutation + */ + Mutation.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation) + return object; + var message = new $root.google.bigtable.v2.Mutation(); + if (object.setCell != null) { + if (typeof object.setCell !== "object") + throw TypeError(".google.bigtable.v2.Mutation.setCell: object expected"); + message.setCell = $root.google.bigtable.v2.Mutation.SetCell.fromObject(object.setCell); + } + if (object.addToCell != null) { + if (typeof object.addToCell !== "object") + throw TypeError(".google.bigtable.v2.Mutation.addToCell: object expected"); + message.addToCell = $root.google.bigtable.v2.Mutation.AddToCell.fromObject(object.addToCell); + } + if (object.mergeToCell != null) { + if (typeof object.mergeToCell !== "object") + throw TypeError(".google.bigtable.v2.Mutation.mergeToCell: object expected"); + message.mergeToCell = $root.google.bigtable.v2.Mutation.MergeToCell.fromObject(object.mergeToCell); + } + if (object.deleteFromColumn != null) { + if (typeof object.deleteFromColumn !== "object") + throw TypeError(".google.bigtable.v2.Mutation.deleteFromColumn: object expected"); + message.deleteFromColumn = $root.google.bigtable.v2.Mutation.DeleteFromColumn.fromObject(object.deleteFromColumn); + } + if (object.deleteFromFamily != null) { + if (typeof object.deleteFromFamily !== "object") + throw TypeError(".google.bigtable.v2.Mutation.deleteFromFamily: object expected"); + message.deleteFromFamily = $root.google.bigtable.v2.Mutation.DeleteFromFamily.fromObject(object.deleteFromFamily); + } + if (object.deleteFromRow != null) { + if (typeof object.deleteFromRow !== "object") + throw TypeError(".google.bigtable.v2.Mutation.deleteFromRow: object expected"); + message.deleteFromRow = $root.google.bigtable.v2.Mutation.DeleteFromRow.fromObject(object.deleteFromRow); + } + return message; + }; + + /** + * Creates a plain object from a Mutation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation + * @static + * @param {google.bigtable.v2.Mutation} message Mutation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Mutation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.setCell != null && message.hasOwnProperty("setCell")) { + object.setCell = $root.google.bigtable.v2.Mutation.SetCell.toObject(message.setCell, options); + if (options.oneofs) + object.mutation = "setCell"; + } + if (message.deleteFromColumn != null && message.hasOwnProperty("deleteFromColumn")) { + object.deleteFromColumn = $root.google.bigtable.v2.Mutation.DeleteFromColumn.toObject(message.deleteFromColumn, options); + if (options.oneofs) + object.mutation = "deleteFromColumn"; + } + if (message.deleteFromFamily != null && message.hasOwnProperty("deleteFromFamily")) { + object.deleteFromFamily = $root.google.bigtable.v2.Mutation.DeleteFromFamily.toObject(message.deleteFromFamily, options); + if (options.oneofs) + object.mutation = "deleteFromFamily"; + } + if (message.deleteFromRow != null && message.hasOwnProperty("deleteFromRow")) { + object.deleteFromRow = $root.google.bigtable.v2.Mutation.DeleteFromRow.toObject(message.deleteFromRow, options); + if (options.oneofs) + object.mutation = "deleteFromRow"; + } + if (message.addToCell != null && message.hasOwnProperty("addToCell")) { + object.addToCell = $root.google.bigtable.v2.Mutation.AddToCell.toObject(message.addToCell, options); + if (options.oneofs) + object.mutation = "addToCell"; + } + if (message.mergeToCell != null && message.hasOwnProperty("mergeToCell")) { + object.mergeToCell = $root.google.bigtable.v2.Mutation.MergeToCell.toObject(message.mergeToCell, options); + if (options.oneofs) + object.mutation = "mergeToCell"; + } + return object; + }; + + /** + * Converts this Mutation to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation + * @instance + * @returns {Object.} JSON object + */ + Mutation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Mutation + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Mutation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation"; + }; + + Mutation.SetCell = (function() { + + /** + * Properties of a SetCell. + * @memberof google.bigtable.v2.Mutation + * @interface ISetCell + * @property {string|null} [familyName] SetCell familyName + * @property {Uint8Array|null} [columnQualifier] SetCell columnQualifier + * @property {number|Long|null} [timestampMicros] SetCell timestampMicros + * @property {Uint8Array|null} [value] SetCell value + */ + + /** + * Constructs a new SetCell. + * @memberof google.bigtable.v2.Mutation + * @classdesc Represents a SetCell. + * @implements ISetCell + * @constructor + * @param {google.bigtable.v2.Mutation.ISetCell=} [properties] Properties to set + */ + function SetCell(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetCell familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.Mutation.SetCell + * @instance + */ + SetCell.prototype.familyName = ""; + + /** + * SetCell columnQualifier. + * @member {Uint8Array} columnQualifier + * @memberof google.bigtable.v2.Mutation.SetCell + * @instance + */ + SetCell.prototype.columnQualifier = $util.newBuffer([]); + + /** + * SetCell timestampMicros. + * @member {number|Long} timestampMicros + * @memberof google.bigtable.v2.Mutation.SetCell + * @instance + */ + SetCell.prototype.timestampMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SetCell value. + * @member {Uint8Array} value + * @memberof google.bigtable.v2.Mutation.SetCell + * @instance + */ + SetCell.prototype.value = $util.newBuffer([]); + + /** + * Creates a new SetCell instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {google.bigtable.v2.Mutation.ISetCell=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation.SetCell} SetCell instance + */ + SetCell.create = function create(properties) { + return new SetCell(properties); + }; + + /** + * Encodes the specified SetCell message. Does not implicitly {@link google.bigtable.v2.Mutation.SetCell.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {google.bigtable.v2.Mutation.ISetCell} message SetCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetCell.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + if (message.columnQualifier != null && Object.hasOwnProperty.call(message, "columnQualifier")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.columnQualifier); + if (message.timestampMicros != null && Object.hasOwnProperty.call(message, "timestampMicros")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.timestampMicros); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified SetCell message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.SetCell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {google.bigtable.v2.Mutation.ISetCell} message SetCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetCell.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetCell message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation.SetCell} SetCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetCell.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation.SetCell(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + case 2: { + message.columnQualifier = reader.bytes(); + break; + } + case 3: { + message.timestampMicros = reader.int64(); + break; + } + case 4: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetCell message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation.SetCell} SetCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetCell.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetCell message. + * @function verify + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetCell.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + if (!(message.columnQualifier && typeof message.columnQualifier.length === "number" || $util.isString(message.columnQualifier))) + return "columnQualifier: buffer expected"; + if (message.timestampMicros != null && message.hasOwnProperty("timestampMicros")) + if (!$util.isInteger(message.timestampMicros) && !(message.timestampMicros && $util.isInteger(message.timestampMicros.low) && $util.isInteger(message.timestampMicros.high))) + return "timestampMicros: integer|Long expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a SetCell message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation.SetCell} SetCell + */ + SetCell.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation.SetCell) + return object; + var message = new $root.google.bigtable.v2.Mutation.SetCell(); + if (object.familyName != null) + message.familyName = String(object.familyName); + if (object.columnQualifier != null) + if (typeof object.columnQualifier === "string") + $util.base64.decode(object.columnQualifier, message.columnQualifier = $util.newBuffer($util.base64.length(object.columnQualifier)), 0); + else if (object.columnQualifier.length >= 0) + message.columnQualifier = object.columnQualifier; + if (object.timestampMicros != null) + if ($util.Long) + (message.timestampMicros = $util.Long.fromValue(object.timestampMicros)).unsigned = false; + else if (typeof object.timestampMicros === "string") + message.timestampMicros = parseInt(object.timestampMicros, 10); + else if (typeof object.timestampMicros === "number") + message.timestampMicros = object.timestampMicros; + else if (typeof object.timestampMicros === "object") + message.timestampMicros = new $util.LongBits(object.timestampMicros.low >>> 0, object.timestampMicros.high >>> 0).toNumber(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a SetCell message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {google.bigtable.v2.Mutation.SetCell} message SetCell + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetCell.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.familyName = ""; + if (options.bytes === String) + object.columnQualifier = ""; + else { + object.columnQualifier = []; + if (options.bytes !== Array) + object.columnQualifier = $util.newBuffer(object.columnQualifier); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestampMicros = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + object.columnQualifier = options.bytes === String ? $util.base64.encode(message.columnQualifier, 0, message.columnQualifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.columnQualifier) : message.columnQualifier; + if (message.timestampMicros != null && message.hasOwnProperty("timestampMicros")) + if (typeof message.timestampMicros === "number") + object.timestampMicros = options.longs === String ? String(message.timestampMicros) : message.timestampMicros; + else + object.timestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.timestampMicros) : options.longs === Number ? new $util.LongBits(message.timestampMicros.low >>> 0, message.timestampMicros.high >>> 0).toNumber() : message.timestampMicros; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this SetCell to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation.SetCell + * @instance + * @returns {Object.} JSON object + */ + SetCell.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetCell + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetCell.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation.SetCell"; + }; + + return SetCell; + })(); + + Mutation.AddToCell = (function() { + + /** + * Properties of an AddToCell. + * @memberof google.bigtable.v2.Mutation + * @interface IAddToCell + * @property {string|null} [familyName] AddToCell familyName + * @property {google.bigtable.v2.IValue|null} [columnQualifier] AddToCell columnQualifier + * @property {google.bigtable.v2.IValue|null} [timestamp] AddToCell timestamp + * @property {google.bigtable.v2.IValue|null} [input] AddToCell input + */ + + /** + * Constructs a new AddToCell. + * @memberof google.bigtable.v2.Mutation + * @classdesc Represents an AddToCell. + * @implements IAddToCell + * @constructor + * @param {google.bigtable.v2.Mutation.IAddToCell=} [properties] Properties to set + */ + function AddToCell(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddToCell familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.Mutation.AddToCell + * @instance + */ + AddToCell.prototype.familyName = ""; + + /** + * AddToCell columnQualifier. + * @member {google.bigtable.v2.IValue|null|undefined} columnQualifier + * @memberof google.bigtable.v2.Mutation.AddToCell + * @instance + */ + AddToCell.prototype.columnQualifier = null; + + /** + * AddToCell timestamp. + * @member {google.bigtable.v2.IValue|null|undefined} timestamp + * @memberof google.bigtable.v2.Mutation.AddToCell + * @instance + */ + AddToCell.prototype.timestamp = null; + + /** + * AddToCell input. + * @member {google.bigtable.v2.IValue|null|undefined} input + * @memberof google.bigtable.v2.Mutation.AddToCell + * @instance + */ + AddToCell.prototype.input = null; + + /** + * Creates a new AddToCell instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {google.bigtable.v2.Mutation.IAddToCell=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation.AddToCell} AddToCell instance + */ + AddToCell.create = function create(properties) { + return new AddToCell(properties); + }; + + /** + * Encodes the specified AddToCell message. Does not implicitly {@link google.bigtable.v2.Mutation.AddToCell.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {google.bigtable.v2.Mutation.IAddToCell} message AddToCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddToCell.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + if (message.columnQualifier != null && Object.hasOwnProperty.call(message, "columnQualifier")) + $root.google.bigtable.v2.Value.encode(message.columnQualifier, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.bigtable.v2.Value.encode(message.timestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.bigtable.v2.Value.encode(message.input, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddToCell message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.AddToCell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {google.bigtable.v2.Mutation.IAddToCell} message AddToCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddToCell.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddToCell message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation.AddToCell} AddToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddToCell.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation.AddToCell(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + case 2: { + message.columnQualifier = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + } + case 3: { + message.timestamp = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + } + case 4: { + message.input = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddToCell message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation.AddToCell} AddToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddToCell.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddToCell message. + * @function verify + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddToCell.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) { + var error = $root.google.bigtable.v2.Value.verify(message.columnQualifier); + if (error) + return "columnQualifier." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.bigtable.v2.Value.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.bigtable.v2.Value.verify(message.input); + if (error) + return "input." + error; + } + return null; + }; + + /** + * Creates an AddToCell message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation.AddToCell} AddToCell + */ + AddToCell.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation.AddToCell) + return object; + var message = new $root.google.bigtable.v2.Mutation.AddToCell(); + if (object.familyName != null) + message.familyName = String(object.familyName); + if (object.columnQualifier != null) { + if (typeof object.columnQualifier !== "object") + throw TypeError(".google.bigtable.v2.Mutation.AddToCell.columnQualifier: object expected"); + message.columnQualifier = $root.google.bigtable.v2.Value.fromObject(object.columnQualifier); + } + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".google.bigtable.v2.Mutation.AddToCell.timestamp: object expected"); + message.timestamp = $root.google.bigtable.v2.Value.fromObject(object.timestamp); + } + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.bigtable.v2.Mutation.AddToCell.input: object expected"); + message.input = $root.google.bigtable.v2.Value.fromObject(object.input); + } + return message; + }; + + /** + * Creates a plain object from an AddToCell message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {google.bigtable.v2.Mutation.AddToCell} message AddToCell + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddToCell.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.familyName = ""; + object.columnQualifier = null; + object.timestamp = null; + object.input = null; + } + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + object.columnQualifier = $root.google.bigtable.v2.Value.toObject(message.columnQualifier, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.bigtable.v2.Value.toObject(message.timestamp, options); + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.bigtable.v2.Value.toObject(message.input, options); + return object; + }; + + /** + * Converts this AddToCell to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation.AddToCell + * @instance + * @returns {Object.} JSON object + */ + AddToCell.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddToCell + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddToCell.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation.AddToCell"; + }; + + return AddToCell; + })(); + + Mutation.MergeToCell = (function() { + + /** + * Properties of a MergeToCell. + * @memberof google.bigtable.v2.Mutation + * @interface IMergeToCell + * @property {string|null} [familyName] MergeToCell familyName + * @property {google.bigtable.v2.IValue|null} [columnQualifier] MergeToCell columnQualifier + * @property {google.bigtable.v2.IValue|null} [timestamp] MergeToCell timestamp + * @property {google.bigtable.v2.IValue|null} [input] MergeToCell input + */ + + /** + * Constructs a new MergeToCell. + * @memberof google.bigtable.v2.Mutation + * @classdesc Represents a MergeToCell. + * @implements IMergeToCell + * @constructor + * @param {google.bigtable.v2.Mutation.IMergeToCell=} [properties] Properties to set + */ + function MergeToCell(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MergeToCell familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @instance + */ + MergeToCell.prototype.familyName = ""; + + /** + * MergeToCell columnQualifier. + * @member {google.bigtable.v2.IValue|null|undefined} columnQualifier + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @instance + */ + MergeToCell.prototype.columnQualifier = null; + + /** + * MergeToCell timestamp. + * @member {google.bigtable.v2.IValue|null|undefined} timestamp + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @instance + */ + MergeToCell.prototype.timestamp = null; + + /** + * MergeToCell input. + * @member {google.bigtable.v2.IValue|null|undefined} input + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @instance + */ + MergeToCell.prototype.input = null; + + /** + * Creates a new MergeToCell instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {google.bigtable.v2.Mutation.IMergeToCell=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation.MergeToCell} MergeToCell instance + */ + MergeToCell.create = function create(properties) { + return new MergeToCell(properties); + }; + + /** + * Encodes the specified MergeToCell message. Does not implicitly {@link google.bigtable.v2.Mutation.MergeToCell.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {google.bigtable.v2.Mutation.IMergeToCell} message MergeToCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergeToCell.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + if (message.columnQualifier != null && Object.hasOwnProperty.call(message, "columnQualifier")) + $root.google.bigtable.v2.Value.encode(message.columnQualifier, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.bigtable.v2.Value.encode(message.timestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.bigtable.v2.Value.encode(message.input, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MergeToCell message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.MergeToCell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {google.bigtable.v2.Mutation.IMergeToCell} message MergeToCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergeToCell.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MergeToCell message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation.MergeToCell} MergeToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergeToCell.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation.MergeToCell(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + case 2: { + message.columnQualifier = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + } + case 3: { + message.timestamp = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + } + case 4: { + message.input = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MergeToCell message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation.MergeToCell} MergeToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergeToCell.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MergeToCell message. + * @function verify + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MergeToCell.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) { + var error = $root.google.bigtable.v2.Value.verify(message.columnQualifier); + if (error) + return "columnQualifier." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.bigtable.v2.Value.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.bigtable.v2.Value.verify(message.input); + if (error) + return "input." + error; + } + return null; + }; + + /** + * Creates a MergeToCell message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation.MergeToCell} MergeToCell + */ + MergeToCell.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation.MergeToCell) + return object; + var message = new $root.google.bigtable.v2.Mutation.MergeToCell(); + if (object.familyName != null) + message.familyName = String(object.familyName); + if (object.columnQualifier != null) { + if (typeof object.columnQualifier !== "object") + throw TypeError(".google.bigtable.v2.Mutation.MergeToCell.columnQualifier: object expected"); + message.columnQualifier = $root.google.bigtable.v2.Value.fromObject(object.columnQualifier); + } + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".google.bigtable.v2.Mutation.MergeToCell.timestamp: object expected"); + message.timestamp = $root.google.bigtable.v2.Value.fromObject(object.timestamp); + } + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.bigtable.v2.Mutation.MergeToCell.input: object expected"); + message.input = $root.google.bigtable.v2.Value.fromObject(object.input); + } + return message; + }; + + /** + * Creates a plain object from a MergeToCell message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {google.bigtable.v2.Mutation.MergeToCell} message MergeToCell + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MergeToCell.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.familyName = ""; + object.columnQualifier = null; + object.timestamp = null; + object.input = null; + } + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + object.columnQualifier = $root.google.bigtable.v2.Value.toObject(message.columnQualifier, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.bigtable.v2.Value.toObject(message.timestamp, options); + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.bigtable.v2.Value.toObject(message.input, options); + return object; + }; + + /** + * Converts this MergeToCell to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @instance + * @returns {Object.} JSON object + */ + MergeToCell.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MergeToCell + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MergeToCell.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation.MergeToCell"; + }; + + return MergeToCell; + })(); + + Mutation.DeleteFromColumn = (function() { + + /** + * Properties of a DeleteFromColumn. + * @memberof google.bigtable.v2.Mutation + * @interface IDeleteFromColumn + * @property {string|null} [familyName] DeleteFromColumn familyName + * @property {Uint8Array|null} [columnQualifier] DeleteFromColumn columnQualifier + * @property {google.bigtable.v2.ITimestampRange|null} [timeRange] DeleteFromColumn timeRange + */ + + /** + * Constructs a new DeleteFromColumn. + * @memberof google.bigtable.v2.Mutation + * @classdesc Represents a DeleteFromColumn. + * @implements IDeleteFromColumn + * @constructor + * @param {google.bigtable.v2.Mutation.IDeleteFromColumn=} [properties] Properties to set + */ + function DeleteFromColumn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFromColumn familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @instance + */ + DeleteFromColumn.prototype.familyName = ""; + + /** + * DeleteFromColumn columnQualifier. + * @member {Uint8Array} columnQualifier + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @instance + */ + DeleteFromColumn.prototype.columnQualifier = $util.newBuffer([]); + + /** + * DeleteFromColumn timeRange. + * @member {google.bigtable.v2.ITimestampRange|null|undefined} timeRange + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @instance + */ + DeleteFromColumn.prototype.timeRange = null; + + /** + * Creates a new DeleteFromColumn instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromColumn=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation.DeleteFromColumn} DeleteFromColumn instance + */ + DeleteFromColumn.create = function create(properties) { + return new DeleteFromColumn(properties); + }; + + /** + * Encodes the specified DeleteFromColumn message. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromColumn.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromColumn} message DeleteFromColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFromColumn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + if (message.columnQualifier != null && Object.hasOwnProperty.call(message, "columnQualifier")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.columnQualifier); + if (message.timeRange != null && Object.hasOwnProperty.call(message, "timeRange")) + $root.google.bigtable.v2.TimestampRange.encode(message.timeRange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteFromColumn message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromColumn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromColumn} message DeleteFromColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFromColumn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFromColumn message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation.DeleteFromColumn} DeleteFromColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFromColumn.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation.DeleteFromColumn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + case 2: { + message.columnQualifier = reader.bytes(); + break; + } + case 3: { + message.timeRange = $root.google.bigtable.v2.TimestampRange.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFromColumn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation.DeleteFromColumn} DeleteFromColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFromColumn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFromColumn message. + * @function verify + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFromColumn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + if (!(message.columnQualifier && typeof message.columnQualifier.length === "number" || $util.isString(message.columnQualifier))) + return "columnQualifier: buffer expected"; + if (message.timeRange != null && message.hasOwnProperty("timeRange")) { + var error = $root.google.bigtable.v2.TimestampRange.verify(message.timeRange); + if (error) + return "timeRange." + error; + } + return null; + }; + + /** + * Creates a DeleteFromColumn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation.DeleteFromColumn} DeleteFromColumn + */ + DeleteFromColumn.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation.DeleteFromColumn) + return object; + var message = new $root.google.bigtable.v2.Mutation.DeleteFromColumn(); + if (object.familyName != null) + message.familyName = String(object.familyName); + if (object.columnQualifier != null) + if (typeof object.columnQualifier === "string") + $util.base64.decode(object.columnQualifier, message.columnQualifier = $util.newBuffer($util.base64.length(object.columnQualifier)), 0); + else if (object.columnQualifier.length >= 0) + message.columnQualifier = object.columnQualifier; + if (object.timeRange != null) { + if (typeof object.timeRange !== "object") + throw TypeError(".google.bigtable.v2.Mutation.DeleteFromColumn.timeRange: object expected"); + message.timeRange = $root.google.bigtable.v2.TimestampRange.fromObject(object.timeRange); + } + return message; + }; + + /** + * Creates a plain object from a DeleteFromColumn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {google.bigtable.v2.Mutation.DeleteFromColumn} message DeleteFromColumn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFromColumn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.familyName = ""; + if (options.bytes === String) + object.columnQualifier = ""; + else { + object.columnQualifier = []; + if (options.bytes !== Array) + object.columnQualifier = $util.newBuffer(object.columnQualifier); + } + object.timeRange = null; + } + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + object.columnQualifier = options.bytes === String ? $util.base64.encode(message.columnQualifier, 0, message.columnQualifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.columnQualifier) : message.columnQualifier; + if (message.timeRange != null && message.hasOwnProperty("timeRange")) + object.timeRange = $root.google.bigtable.v2.TimestampRange.toObject(message.timeRange, options); + return object; + }; + + /** + * Converts this DeleteFromColumn to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @instance + * @returns {Object.} JSON object + */ + DeleteFromColumn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFromColumn + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFromColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation.DeleteFromColumn"; + }; + + return DeleteFromColumn; + })(); + + Mutation.DeleteFromFamily = (function() { + + /** + * Properties of a DeleteFromFamily. + * @memberof google.bigtable.v2.Mutation + * @interface IDeleteFromFamily + * @property {string|null} [familyName] DeleteFromFamily familyName + */ + + /** + * Constructs a new DeleteFromFamily. + * @memberof google.bigtable.v2.Mutation + * @classdesc Represents a DeleteFromFamily. + * @implements IDeleteFromFamily + * @constructor + * @param {google.bigtable.v2.Mutation.IDeleteFromFamily=} [properties] Properties to set + */ + function DeleteFromFamily(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFromFamily familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @instance + */ + DeleteFromFamily.prototype.familyName = ""; + + /** + * Creates a new DeleteFromFamily instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromFamily=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation.DeleteFromFamily} DeleteFromFamily instance + */ + DeleteFromFamily.create = function create(properties) { + return new DeleteFromFamily(properties); + }; + + /** + * Encodes the specified DeleteFromFamily message. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromFamily.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromFamily} message DeleteFromFamily message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFromFamily.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + return writer; + }; + + /** + * Encodes the specified DeleteFromFamily message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromFamily.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromFamily} message DeleteFromFamily message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFromFamily.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFromFamily message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation.DeleteFromFamily} DeleteFromFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFromFamily.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation.DeleteFromFamily(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFromFamily message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation.DeleteFromFamily} DeleteFromFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFromFamily.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFromFamily message. + * @function verify + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFromFamily.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + return null; + }; + + /** + * Creates a DeleteFromFamily message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation.DeleteFromFamily} DeleteFromFamily + */ + DeleteFromFamily.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation.DeleteFromFamily) + return object; + var message = new $root.google.bigtable.v2.Mutation.DeleteFromFamily(); + if (object.familyName != null) + message.familyName = String(object.familyName); + return message; + }; + + /** + * Creates a plain object from a DeleteFromFamily message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {google.bigtable.v2.Mutation.DeleteFromFamily} message DeleteFromFamily + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFromFamily.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.familyName = ""; + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + return object; + }; + + /** + * Converts this DeleteFromFamily to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @instance + * @returns {Object.} JSON object + */ + DeleteFromFamily.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFromFamily + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFromFamily.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation.DeleteFromFamily"; + }; + + return DeleteFromFamily; + })(); + + Mutation.DeleteFromRow = (function() { + + /** + * Properties of a DeleteFromRow. + * @memberof google.bigtable.v2.Mutation + * @interface IDeleteFromRow + */ + + /** + * Constructs a new DeleteFromRow. + * @memberof google.bigtable.v2.Mutation + * @classdesc Represents a DeleteFromRow. + * @implements IDeleteFromRow + * @constructor + * @param {google.bigtable.v2.Mutation.IDeleteFromRow=} [properties] Properties to set + */ + function DeleteFromRow(properties) { + if (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 DeleteFromRow instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromRow=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation.DeleteFromRow} DeleteFromRow instance + */ + DeleteFromRow.create = function create(properties) { + return new DeleteFromRow(properties); + }; + + /** + * Encodes the specified DeleteFromRow message. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromRow.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromRow} message DeleteFromRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFromRow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteFromRow message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromRow} message DeleteFromRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFromRow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFromRow message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation.DeleteFromRow} DeleteFromRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFromRow.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation.DeleteFromRow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFromRow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation.DeleteFromRow} DeleteFromRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFromRow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFromRow message. + * @function verify + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFromRow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteFromRow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation.DeleteFromRow} DeleteFromRow + */ + DeleteFromRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation.DeleteFromRow) + return object; + return new $root.google.bigtable.v2.Mutation.DeleteFromRow(); + }; + + /** + * Creates a plain object from a DeleteFromRow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {google.bigtable.v2.Mutation.DeleteFromRow} message DeleteFromRow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFromRow.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteFromRow to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @instance + * @returns {Object.} JSON object + */ + DeleteFromRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFromRow + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFromRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation.DeleteFromRow"; + }; + + return DeleteFromRow; + })(); + + return Mutation; + })(); + + v2.ReadModifyWriteRule = (function() { + + /** + * Properties of a ReadModifyWriteRule. + * @memberof google.bigtable.v2 + * @interface IReadModifyWriteRule + * @property {string|null} [familyName] ReadModifyWriteRule familyName + * @property {Uint8Array|null} [columnQualifier] ReadModifyWriteRule columnQualifier + * @property {Uint8Array|null} [appendValue] ReadModifyWriteRule appendValue + * @property {number|Long|null} [incrementAmount] ReadModifyWriteRule incrementAmount + */ + + /** + * Constructs a new ReadModifyWriteRule. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadModifyWriteRule. + * @implements IReadModifyWriteRule + * @constructor + * @param {google.bigtable.v2.IReadModifyWriteRule=} [properties] Properties to set + */ + function ReadModifyWriteRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadModifyWriteRule familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @instance + */ + ReadModifyWriteRule.prototype.familyName = ""; + + /** + * ReadModifyWriteRule columnQualifier. + * @member {Uint8Array} columnQualifier + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @instance + */ + ReadModifyWriteRule.prototype.columnQualifier = $util.newBuffer([]); + + /** + * ReadModifyWriteRule appendValue. + * @member {Uint8Array|null|undefined} appendValue + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @instance + */ + ReadModifyWriteRule.prototype.appendValue = null; + + /** + * ReadModifyWriteRule incrementAmount. + * @member {number|Long|null|undefined} incrementAmount + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @instance + */ + ReadModifyWriteRule.prototype.incrementAmount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadModifyWriteRule rule. + * @member {"appendValue"|"incrementAmount"|undefined} rule + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @instance + */ + Object.defineProperty(ReadModifyWriteRule.prototype, "rule", { + get: $util.oneOfGetter($oneOfFields = ["appendValue", "incrementAmount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadModifyWriteRule instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {google.bigtable.v2.IReadModifyWriteRule=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadModifyWriteRule} ReadModifyWriteRule instance + */ + ReadModifyWriteRule.create = function create(properties) { + return new ReadModifyWriteRule(properties); + }; + + /** + * Encodes the specified ReadModifyWriteRule message. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRule.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {google.bigtable.v2.IReadModifyWriteRule} message ReadModifyWriteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + if (message.columnQualifier != null && Object.hasOwnProperty.call(message, "columnQualifier")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.columnQualifier); + if (message.appendValue != null && Object.hasOwnProperty.call(message, "appendValue")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.appendValue); + if (message.incrementAmount != null && Object.hasOwnProperty.call(message, "incrementAmount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.incrementAmount); + return writer; + }; + + /** + * Encodes the specified ReadModifyWriteRule message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {google.bigtable.v2.IReadModifyWriteRule} message ReadModifyWriteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadModifyWriteRule message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadModifyWriteRule} ReadModifyWriteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadModifyWriteRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + case 2: { + message.columnQualifier = reader.bytes(); + break; + } + case 3: { + message.appendValue = reader.bytes(); + break; + } + case 4: { + message.incrementAmount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadModifyWriteRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadModifyWriteRule} ReadModifyWriteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadModifyWriteRule message. + * @function verify + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadModifyWriteRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + if (!(message.columnQualifier && typeof message.columnQualifier.length === "number" || $util.isString(message.columnQualifier))) + return "columnQualifier: buffer expected"; + if (message.appendValue != null && message.hasOwnProperty("appendValue")) { + properties.rule = 1; + if (!(message.appendValue && typeof message.appendValue.length === "number" || $util.isString(message.appendValue))) + return "appendValue: buffer expected"; + } + if (message.incrementAmount != null && message.hasOwnProperty("incrementAmount")) { + if (properties.rule === 1) + return "rule: multiple values"; + properties.rule = 1; + if (!$util.isInteger(message.incrementAmount) && !(message.incrementAmount && $util.isInteger(message.incrementAmount.low) && $util.isInteger(message.incrementAmount.high))) + return "incrementAmount: integer|Long expected"; + } + return null; + }; + + /** + * Creates a ReadModifyWriteRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadModifyWriteRule} ReadModifyWriteRule + */ + ReadModifyWriteRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadModifyWriteRule) + return object; + var message = new $root.google.bigtable.v2.ReadModifyWriteRule(); + if (object.familyName != null) + message.familyName = String(object.familyName); + if (object.columnQualifier != null) + if (typeof object.columnQualifier === "string") + $util.base64.decode(object.columnQualifier, message.columnQualifier = $util.newBuffer($util.base64.length(object.columnQualifier)), 0); + else if (object.columnQualifier.length >= 0) + message.columnQualifier = object.columnQualifier; + if (object.appendValue != null) + if (typeof object.appendValue === "string") + $util.base64.decode(object.appendValue, message.appendValue = $util.newBuffer($util.base64.length(object.appendValue)), 0); + else if (object.appendValue.length >= 0) + message.appendValue = object.appendValue; + if (object.incrementAmount != null) + if ($util.Long) + (message.incrementAmount = $util.Long.fromValue(object.incrementAmount)).unsigned = false; + else if (typeof object.incrementAmount === "string") + message.incrementAmount = parseInt(object.incrementAmount, 10); + else if (typeof object.incrementAmount === "number") + message.incrementAmount = object.incrementAmount; + else if (typeof object.incrementAmount === "object") + message.incrementAmount = new $util.LongBits(object.incrementAmount.low >>> 0, object.incrementAmount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ReadModifyWriteRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {google.bigtable.v2.ReadModifyWriteRule} message ReadModifyWriteRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadModifyWriteRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.familyName = ""; + if (options.bytes === String) + object.columnQualifier = ""; + else { + object.columnQualifier = []; + if (options.bytes !== Array) + object.columnQualifier = $util.newBuffer(object.columnQualifier); + } + } + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + object.columnQualifier = options.bytes === String ? $util.base64.encode(message.columnQualifier, 0, message.columnQualifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.columnQualifier) : message.columnQualifier; + if (message.appendValue != null && message.hasOwnProperty("appendValue")) { + object.appendValue = options.bytes === String ? $util.base64.encode(message.appendValue, 0, message.appendValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.appendValue) : message.appendValue; + if (options.oneofs) + object.rule = "appendValue"; + } + if (message.incrementAmount != null && message.hasOwnProperty("incrementAmount")) { + if (typeof message.incrementAmount === "number") + object.incrementAmount = options.longs === String ? String(message.incrementAmount) : message.incrementAmount; + else + object.incrementAmount = options.longs === String ? $util.Long.prototype.toString.call(message.incrementAmount) : options.longs === Number ? new $util.LongBits(message.incrementAmount.low >>> 0, message.incrementAmount.high >>> 0).toNumber() : message.incrementAmount; + if (options.oneofs) + object.rule = "incrementAmount"; + } + return object; + }; + + /** + * Converts this ReadModifyWriteRule to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @instance + * @returns {Object.} JSON object + */ + ReadModifyWriteRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadModifyWriteRule + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadModifyWriteRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadModifyWriteRule"; + }; + + return ReadModifyWriteRule; + })(); + + v2.StreamPartition = (function() { + + /** + * Properties of a StreamPartition. + * @memberof google.bigtable.v2 + * @interface IStreamPartition + * @property {google.bigtable.v2.IRowRange|null} [rowRange] StreamPartition rowRange + */ + + /** + * Constructs a new StreamPartition. + * @memberof google.bigtable.v2 + * @classdesc Represents a StreamPartition. + * @implements IStreamPartition + * @constructor + * @param {google.bigtable.v2.IStreamPartition=} [properties] Properties to set + */ + function StreamPartition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamPartition rowRange. + * @member {google.bigtable.v2.IRowRange|null|undefined} rowRange + * @memberof google.bigtable.v2.StreamPartition + * @instance + */ + StreamPartition.prototype.rowRange = null; + + /** + * Creates a new StreamPartition instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {google.bigtable.v2.IStreamPartition=} [properties] Properties to set + * @returns {google.bigtable.v2.StreamPartition} StreamPartition instance + */ + StreamPartition.create = function create(properties) { + return new StreamPartition(properties); + }; + + /** + * Encodes the specified StreamPartition message. Does not implicitly {@link google.bigtable.v2.StreamPartition.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {google.bigtable.v2.IStreamPartition} message StreamPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamPartition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowRange != null && Object.hasOwnProperty.call(message, "rowRange")) + $root.google.bigtable.v2.RowRange.encode(message.rowRange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamPartition message, length delimited. Does not implicitly {@link google.bigtable.v2.StreamPartition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {google.bigtable.v2.IStreamPartition} message StreamPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamPartition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamPartition message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.StreamPartition} StreamPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamPartition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.StreamPartition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowRange = $root.google.bigtable.v2.RowRange.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamPartition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.StreamPartition} StreamPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamPartition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamPartition message. + * @function verify + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamPartition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowRange != null && message.hasOwnProperty("rowRange")) { + var error = $root.google.bigtable.v2.RowRange.verify(message.rowRange); + if (error) + return "rowRange." + error; + } + return null; + }; + + /** + * Creates a StreamPartition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.StreamPartition} StreamPartition + */ + StreamPartition.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.StreamPartition) + return object; + var message = new $root.google.bigtable.v2.StreamPartition(); + if (object.rowRange != null) { + if (typeof object.rowRange !== "object") + throw TypeError(".google.bigtable.v2.StreamPartition.rowRange: object expected"); + message.rowRange = $root.google.bigtable.v2.RowRange.fromObject(object.rowRange); + } + return message; + }; + + /** + * Creates a plain object from a StreamPartition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {google.bigtable.v2.StreamPartition} message StreamPartition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamPartition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.rowRange = null; + if (message.rowRange != null && message.hasOwnProperty("rowRange")) + object.rowRange = $root.google.bigtable.v2.RowRange.toObject(message.rowRange, options); + return object; + }; + + /** + * Converts this StreamPartition to JSON. + * @function toJSON + * @memberof google.bigtable.v2.StreamPartition + * @instance + * @returns {Object.} JSON object + */ + StreamPartition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamPartition + * @function getTypeUrl + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamPartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.StreamPartition"; + }; + + return StreamPartition; + })(); + + v2.StreamContinuationTokens = (function() { + + /** + * Properties of a StreamContinuationTokens. + * @memberof google.bigtable.v2 + * @interface IStreamContinuationTokens + * @property {Array.|null} [tokens] StreamContinuationTokens tokens + */ + + /** + * Constructs a new StreamContinuationTokens. + * @memberof google.bigtable.v2 + * @classdesc Represents a StreamContinuationTokens. + * @implements IStreamContinuationTokens + * @constructor + * @param {google.bigtable.v2.IStreamContinuationTokens=} [properties] Properties to set + */ + function StreamContinuationTokens(properties) { + this.tokens = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamContinuationTokens tokens. + * @member {Array.} tokens + * @memberof google.bigtable.v2.StreamContinuationTokens + * @instance + */ + StreamContinuationTokens.prototype.tokens = $util.emptyArray; + + /** + * Creates a new StreamContinuationTokens instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {google.bigtable.v2.IStreamContinuationTokens=} [properties] Properties to set + * @returns {google.bigtable.v2.StreamContinuationTokens} StreamContinuationTokens instance + */ + StreamContinuationTokens.create = function create(properties) { + return new StreamContinuationTokens(properties); + }; + + /** + * Encodes the specified StreamContinuationTokens message. Does not implicitly {@link google.bigtable.v2.StreamContinuationTokens.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {google.bigtable.v2.IStreamContinuationTokens} message StreamContinuationTokens message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamContinuationTokens.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokens != null && message.tokens.length) + for (var i = 0; i < message.tokens.length; ++i) + $root.google.bigtable.v2.StreamContinuationToken.encode(message.tokens[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamContinuationTokens message, length delimited. Does not implicitly {@link google.bigtable.v2.StreamContinuationTokens.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {google.bigtable.v2.IStreamContinuationTokens} message StreamContinuationTokens message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamContinuationTokens.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamContinuationTokens message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.StreamContinuationTokens} StreamContinuationTokens + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamContinuationTokens.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.StreamContinuationTokens(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tokens && message.tokens.length)) + message.tokens = []; + message.tokens.push($root.google.bigtable.v2.StreamContinuationToken.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamContinuationTokens message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.StreamContinuationTokens} StreamContinuationTokens + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamContinuationTokens.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamContinuationTokens message. + * @function verify + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamContinuationTokens.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokens != null && message.hasOwnProperty("tokens")) { + if (!Array.isArray(message.tokens)) + return "tokens: array expected"; + for (var i = 0; i < message.tokens.length; ++i) { + var error = $root.google.bigtable.v2.StreamContinuationToken.verify(message.tokens[i]); + if (error) + return "tokens." + error; + } + } + return null; + }; + + /** + * Creates a StreamContinuationTokens message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.StreamContinuationTokens} StreamContinuationTokens + */ + StreamContinuationTokens.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.StreamContinuationTokens) + return object; + var message = new $root.google.bigtable.v2.StreamContinuationTokens(); + if (object.tokens) { + if (!Array.isArray(object.tokens)) + throw TypeError(".google.bigtable.v2.StreamContinuationTokens.tokens: array expected"); + message.tokens = []; + for (var i = 0; i < object.tokens.length; ++i) { + if (typeof object.tokens[i] !== "object") + throw TypeError(".google.bigtable.v2.StreamContinuationTokens.tokens: object expected"); + message.tokens[i] = $root.google.bigtable.v2.StreamContinuationToken.fromObject(object.tokens[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StreamContinuationTokens message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {google.bigtable.v2.StreamContinuationTokens} message StreamContinuationTokens + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamContinuationTokens.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokens = []; + if (message.tokens && message.tokens.length) { + object.tokens = []; + for (var j = 0; j < message.tokens.length; ++j) + object.tokens[j] = $root.google.bigtable.v2.StreamContinuationToken.toObject(message.tokens[j], options); + } + return object; + }; + + /** + * Converts this StreamContinuationTokens to JSON. + * @function toJSON + * @memberof google.bigtable.v2.StreamContinuationTokens + * @instance + * @returns {Object.} JSON object + */ + StreamContinuationTokens.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamContinuationTokens + * @function getTypeUrl + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamContinuationTokens.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.StreamContinuationTokens"; + }; + + return StreamContinuationTokens; + })(); + + v2.StreamContinuationToken = (function() { + + /** + * Properties of a StreamContinuationToken. + * @memberof google.bigtable.v2 + * @interface IStreamContinuationToken + * @property {google.bigtable.v2.IStreamPartition|null} [partition] StreamContinuationToken partition + * @property {string|null} [token] StreamContinuationToken token + */ + + /** + * Constructs a new StreamContinuationToken. + * @memberof google.bigtable.v2 + * @classdesc Represents a StreamContinuationToken. + * @implements IStreamContinuationToken + * @constructor + * @param {google.bigtable.v2.IStreamContinuationToken=} [properties] Properties to set + */ + function StreamContinuationToken(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamContinuationToken partition. + * @member {google.bigtable.v2.IStreamPartition|null|undefined} partition + * @memberof google.bigtable.v2.StreamContinuationToken + * @instance + */ + StreamContinuationToken.prototype.partition = null; + + /** + * StreamContinuationToken token. + * @member {string} token + * @memberof google.bigtable.v2.StreamContinuationToken + * @instance + */ + StreamContinuationToken.prototype.token = ""; + + /** + * Creates a new StreamContinuationToken instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {google.bigtable.v2.IStreamContinuationToken=} [properties] Properties to set + * @returns {google.bigtable.v2.StreamContinuationToken} StreamContinuationToken instance + */ + StreamContinuationToken.create = function create(properties) { + return new StreamContinuationToken(properties); + }; + + /** + * Encodes the specified StreamContinuationToken message. Does not implicitly {@link google.bigtable.v2.StreamContinuationToken.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {google.bigtable.v2.IStreamContinuationToken} message StreamContinuationToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamContinuationToken.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) + $root.google.bigtable.v2.StreamPartition.encode(message.partition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.token); + return writer; + }; + + /** + * Encodes the specified StreamContinuationToken message, length delimited. Does not implicitly {@link google.bigtable.v2.StreamContinuationToken.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {google.bigtable.v2.IStreamContinuationToken} message StreamContinuationToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamContinuationToken.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamContinuationToken message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.StreamContinuationToken} StreamContinuationToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamContinuationToken.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.StreamContinuationToken(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partition = $root.google.bigtable.v2.StreamPartition.decode(reader, reader.uint32()); + break; + } + case 2: { + message.token = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamContinuationToken message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.StreamContinuationToken} StreamContinuationToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamContinuationToken.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamContinuationToken message. + * @function verify + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamContinuationToken.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partition != null && message.hasOwnProperty("partition")) { + var error = $root.google.bigtable.v2.StreamPartition.verify(message.partition); + if (error) + return "partition." + error; + } + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + return null; + }; + + /** + * Creates a StreamContinuationToken message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.StreamContinuationToken} StreamContinuationToken + */ + StreamContinuationToken.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.StreamContinuationToken) + return object; + var message = new $root.google.bigtable.v2.StreamContinuationToken(); + if (object.partition != null) { + if (typeof object.partition !== "object") + throw TypeError(".google.bigtable.v2.StreamContinuationToken.partition: object expected"); + message.partition = $root.google.bigtable.v2.StreamPartition.fromObject(object.partition); + } + if (object.token != null) + message.token = String(object.token); + return message; + }; + + /** + * Creates a plain object from a StreamContinuationToken message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {google.bigtable.v2.StreamContinuationToken} message StreamContinuationToken + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamContinuationToken.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.partition = null; + object.token = ""; + } + if (message.partition != null && message.hasOwnProperty("partition")) + object.partition = $root.google.bigtable.v2.StreamPartition.toObject(message.partition, options); + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + return object; + }; + + /** + * Converts this StreamContinuationToken to JSON. + * @function toJSON + * @memberof google.bigtable.v2.StreamContinuationToken + * @instance + * @returns {Object.} JSON object + */ + StreamContinuationToken.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamContinuationToken + * @function getTypeUrl + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamContinuationToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.StreamContinuationToken"; + }; + + return StreamContinuationToken; + })(); + + v2.ProtoFormat = (function() { + + /** + * Properties of a ProtoFormat. + * @memberof google.bigtable.v2 + * @interface IProtoFormat + */ + + /** + * Constructs a new ProtoFormat. + * @memberof google.bigtable.v2 + * @classdesc Represents a ProtoFormat. + * @implements IProtoFormat + * @constructor + * @param {google.bigtable.v2.IProtoFormat=} [properties] Properties to set + */ + function ProtoFormat(properties) { + if (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 ProtoFormat instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {google.bigtable.v2.IProtoFormat=} [properties] Properties to set + * @returns {google.bigtable.v2.ProtoFormat} ProtoFormat instance + */ + ProtoFormat.create = function create(properties) { + return new ProtoFormat(properties); + }; + + /** + * Encodes the specified ProtoFormat message. Does not implicitly {@link google.bigtable.v2.ProtoFormat.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {google.bigtable.v2.IProtoFormat} message ProtoFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoFormat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ProtoFormat message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoFormat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {google.bigtable.v2.IProtoFormat} message ProtoFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoFormat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoFormat message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ProtoFormat} ProtoFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoFormat.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ProtoFormat(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoFormat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ProtoFormat} ProtoFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoFormat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoFormat message. + * @function verify + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoFormat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ProtoFormat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ProtoFormat} ProtoFormat + */ + ProtoFormat.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ProtoFormat) + return object; + return new $root.google.bigtable.v2.ProtoFormat(); + }; + + /** + * Creates a plain object from a ProtoFormat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {google.bigtable.v2.ProtoFormat} message ProtoFormat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoFormat.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ProtoFormat to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ProtoFormat + * @instance + * @returns {Object.} JSON object + */ + ProtoFormat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProtoFormat + * @function getTypeUrl + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoFormat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ProtoFormat"; + }; + + return ProtoFormat; + })(); + + v2.ColumnMetadata = (function() { + + /** + * Properties of a ColumnMetadata. + * @memberof google.bigtable.v2 + * @interface IColumnMetadata + * @property {string|null} [name] ColumnMetadata name + * @property {google.bigtable.v2.IType|null} [type] ColumnMetadata type + */ + + /** + * Constructs a new ColumnMetadata. + * @memberof google.bigtable.v2 + * @classdesc Represents a ColumnMetadata. + * @implements IColumnMetadata + * @constructor + * @param {google.bigtable.v2.IColumnMetadata=} [properties] Properties to set + */ + function ColumnMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnMetadata name. + * @member {string} name + * @memberof google.bigtable.v2.ColumnMetadata + * @instance + */ + ColumnMetadata.prototype.name = ""; + + /** + * ColumnMetadata type. + * @member {google.bigtable.v2.IType|null|undefined} type + * @memberof google.bigtable.v2.ColumnMetadata + * @instance + */ + ColumnMetadata.prototype.type = null; + + /** + * Creates a new ColumnMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {google.bigtable.v2.IColumnMetadata=} [properties] Properties to set + * @returns {google.bigtable.v2.ColumnMetadata} ColumnMetadata instance + */ + ColumnMetadata.create = function create(properties) { + return new ColumnMetadata(properties); + }; + + /** + * Encodes the specified ColumnMetadata message. Does not implicitly {@link google.bigtable.v2.ColumnMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {google.bigtable.v2.IColumnMetadata} message ColumnMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.bigtable.v2.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ColumnMetadata message, length delimited. Does not implicitly {@link google.bigtable.v2.ColumnMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {google.bigtable.v2.IColumnMetadata} message ColumnMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ColumnMetadata} ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ColumnMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ColumnMetadata} ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnMetadata message. + * @function verify + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnMetadata.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.type != null && message.hasOwnProperty("type")) { + var error = $root.google.bigtable.v2.Type.verify(message.type); + if (error) + return "type." + error; + } + return null; + }; + + /** + * Creates a ColumnMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ColumnMetadata} ColumnMetadata + */ + ColumnMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ColumnMetadata) + return object; + var message = new $root.google.bigtable.v2.ColumnMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.bigtable.v2.ColumnMetadata.type: object expected"); + message.type = $root.google.bigtable.v2.Type.fromObject(object.type); + } + return message; + }; + + /** + * Creates a plain object from a ColumnMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {google.bigtable.v2.ColumnMetadata} message ColumnMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.bigtable.v2.Type.toObject(message.type, options); + return object; + }; + + /** + * Converts this ColumnMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ColumnMetadata + * @instance + * @returns {Object.} JSON object + */ + ColumnMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnMetadata + * @function getTypeUrl + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ColumnMetadata"; + }; + + return ColumnMetadata; + })(); + + v2.ProtoSchema = (function() { + + /** + * Properties of a ProtoSchema. + * @memberof google.bigtable.v2 + * @interface IProtoSchema + * @property {Array.|null} [columns] ProtoSchema columns + */ + + /** + * Constructs a new ProtoSchema. + * @memberof google.bigtable.v2 + * @classdesc Represents a ProtoSchema. + * @implements IProtoSchema + * @constructor + * @param {google.bigtable.v2.IProtoSchema=} [properties] Properties to set + */ + function ProtoSchema(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtoSchema columns. + * @member {Array.} columns + * @memberof google.bigtable.v2.ProtoSchema + * @instance + */ + ProtoSchema.prototype.columns = $util.emptyArray; + + /** + * Creates a new ProtoSchema instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {google.bigtable.v2.IProtoSchema=} [properties] Properties to set + * @returns {google.bigtable.v2.ProtoSchema} ProtoSchema instance + */ + ProtoSchema.create = function create(properties) { + return new ProtoSchema(properties); + }; + + /** + * Encodes the specified ProtoSchema message. Does not implicitly {@link google.bigtable.v2.ProtoSchema.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {google.bigtable.v2.IProtoSchema} message ProtoSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.bigtable.v2.ColumnMetadata.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProtoSchema message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {google.bigtable.v2.IProtoSchema} message ProtoSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ProtoSchema} ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoSchema.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ProtoSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.bigtable.v2.ColumnMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ProtoSchema} ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoSchema message. + * @function verify + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.bigtable.v2.ColumnMetadata.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + return null; + }; + + /** + * Creates a ProtoSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ProtoSchema} ProtoSchema + */ + ProtoSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ProtoSchema) + return object; + var message = new $root.google.bigtable.v2.ProtoSchema(); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.bigtable.v2.ProtoSchema.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".google.bigtable.v2.ProtoSchema.columns: object expected"); + message.columns[i] = $root.google.bigtable.v2.ColumnMetadata.fromObject(object.columns[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProtoSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {google.bigtable.v2.ProtoSchema} message ProtoSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.bigtable.v2.ColumnMetadata.toObject(message.columns[j], options); + } + return object; + }; + + /** + * Converts this ProtoSchema to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ProtoSchema + * @instance + * @returns {Object.} JSON object + */ + ProtoSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProtoSchema + * @function getTypeUrl + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ProtoSchema"; + }; + + return ProtoSchema; + })(); + + v2.ResultSetMetadata = (function() { + + /** + * Properties of a ResultSetMetadata. + * @memberof google.bigtable.v2 + * @interface IResultSetMetadata + * @property {google.bigtable.v2.IProtoSchema|null} [protoSchema] ResultSetMetadata protoSchema + */ + + /** + * Constructs a new ResultSetMetadata. + * @memberof google.bigtable.v2 + * @classdesc Represents a ResultSetMetadata. + * @implements IResultSetMetadata + * @constructor + * @param {google.bigtable.v2.IResultSetMetadata=} [properties] Properties to set + */ + function ResultSetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultSetMetadata protoSchema. + * @member {google.bigtable.v2.IProtoSchema|null|undefined} protoSchema + * @memberof google.bigtable.v2.ResultSetMetadata + * @instance + */ + ResultSetMetadata.prototype.protoSchema = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResultSetMetadata schema. + * @member {"protoSchema"|undefined} schema + * @memberof google.bigtable.v2.ResultSetMetadata + * @instance + */ + Object.defineProperty(ResultSetMetadata.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["protoSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResultSetMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {google.bigtable.v2.IResultSetMetadata=} [properties] Properties to set + * @returns {google.bigtable.v2.ResultSetMetadata} ResultSetMetadata instance + */ + ResultSetMetadata.create = function create(properties) { + return new ResultSetMetadata(properties); + }; + + /** + * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.bigtable.v2.ResultSetMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {google.bigtable.v2.IResultSetMetadata} message ResultSetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protoSchema != null && Object.hasOwnProperty.call(message, "protoSchema")) + $root.google.bigtable.v2.ProtoSchema.encode(message.protoSchema, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.bigtable.v2.ResultSetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {google.bigtable.v2.IResultSetMetadata} message ResultSetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ResultSetMetadata} ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ResultSetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.protoSchema = $root.google.bigtable.v2.ProtoSchema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ResultSetMetadata} ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultSetMetadata message. + * @function verify + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultSetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.protoSchema != null && message.hasOwnProperty("protoSchema")) { + properties.schema = 1; + { + var error = $root.google.bigtable.v2.ProtoSchema.verify(message.protoSchema); + if (error) + return "protoSchema." + error; + } + } + return null; + }; + + /** + * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ResultSetMetadata} ResultSetMetadata + */ + ResultSetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ResultSetMetadata) + return object; + var message = new $root.google.bigtable.v2.ResultSetMetadata(); + if (object.protoSchema != null) { + if (typeof object.protoSchema !== "object") + throw TypeError(".google.bigtable.v2.ResultSetMetadata.protoSchema: object expected"); + message.protoSchema = $root.google.bigtable.v2.ProtoSchema.fromObject(object.protoSchema); + } + return message; + }; + + /** + * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {google.bigtable.v2.ResultSetMetadata} message ResultSetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultSetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.protoSchema != null && message.hasOwnProperty("protoSchema")) { + object.protoSchema = $root.google.bigtable.v2.ProtoSchema.toObject(message.protoSchema, options); + if (options.oneofs) + object.schema = "protoSchema"; + } + return object; + }; + + /** + * Converts this ResultSetMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ResultSetMetadata + * @instance + * @returns {Object.} JSON object + */ + ResultSetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultSetMetadata + * @function getTypeUrl + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultSetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ResultSetMetadata"; + }; + + return ResultSetMetadata; + })(); + + v2.ProtoRows = (function() { + + /** + * Properties of a ProtoRows. + * @memberof google.bigtable.v2 + * @interface IProtoRows + * @property {Array.|null} [values] ProtoRows values + */ + + /** + * Constructs a new ProtoRows. + * @memberof google.bigtable.v2 + * @classdesc Represents a ProtoRows. + * @implements IProtoRows + * @constructor + * @param {google.bigtable.v2.IProtoRows=} [properties] Properties to set + */ + function ProtoRows(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtoRows values. + * @member {Array.} values + * @memberof google.bigtable.v2.ProtoRows + * @instance + */ + ProtoRows.prototype.values = $util.emptyArray; + + /** + * Creates a new ProtoRows instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {google.bigtable.v2.IProtoRows=} [properties] Properties to set + * @returns {google.bigtable.v2.ProtoRows} ProtoRows instance + */ + ProtoRows.create = function create(properties) { + return new ProtoRows(properties); + }; + + /** + * Encodes the specified ProtoRows message. Does not implicitly {@link google.bigtable.v2.ProtoRows.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {google.bigtable.v2.IProtoRows} message ProtoRows message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoRows.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.bigtable.v2.Value.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProtoRows message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoRows.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {google.bigtable.v2.IProtoRows} message ProtoRows message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoRows.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoRows message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ProtoRows} ProtoRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoRows.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ProtoRows(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.bigtable.v2.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoRows message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ProtoRows} ProtoRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoRows.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoRows message. + * @function verify + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoRows.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.bigtable.v2.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ProtoRows message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ProtoRows} ProtoRows + */ + ProtoRows.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ProtoRows) + return object; + var message = new $root.google.bigtable.v2.ProtoRows(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.bigtable.v2.ProtoRows.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.bigtable.v2.ProtoRows.values: object expected"); + message.values[i] = $root.google.bigtable.v2.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProtoRows message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {google.bigtable.v2.ProtoRows} message ProtoRows + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoRows.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.bigtable.v2.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ProtoRows to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ProtoRows + * @instance + * @returns {Object.} JSON object + */ + ProtoRows.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProtoRows + * @function getTypeUrl + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoRows.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ProtoRows"; + }; + + return ProtoRows; + })(); + + v2.ProtoRowsBatch = (function() { + + /** + * Properties of a ProtoRowsBatch. + * @memberof google.bigtable.v2 + * @interface IProtoRowsBatch + * @property {Uint8Array|null} [batchData] ProtoRowsBatch batchData + */ + + /** + * Constructs a new ProtoRowsBatch. + * @memberof google.bigtable.v2 + * @classdesc Represents a ProtoRowsBatch. + * @implements IProtoRowsBatch + * @constructor + * @param {google.bigtable.v2.IProtoRowsBatch=} [properties] Properties to set + */ + function ProtoRowsBatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtoRowsBatch batchData. + * @member {Uint8Array} batchData + * @memberof google.bigtable.v2.ProtoRowsBatch + * @instance + */ + ProtoRowsBatch.prototype.batchData = $util.newBuffer([]); + + /** + * Creates a new ProtoRowsBatch instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {google.bigtable.v2.IProtoRowsBatch=} [properties] Properties to set + * @returns {google.bigtable.v2.ProtoRowsBatch} ProtoRowsBatch instance + */ + ProtoRowsBatch.create = function create(properties) { + return new ProtoRowsBatch(properties); + }; + + /** + * Encodes the specified ProtoRowsBatch message. Does not implicitly {@link google.bigtable.v2.ProtoRowsBatch.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {google.bigtable.v2.IProtoRowsBatch} message ProtoRowsBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoRowsBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.batchData != null && Object.hasOwnProperty.call(message, "batchData")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.batchData); + return writer; + }; + + /** + * Encodes the specified ProtoRowsBatch message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoRowsBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {google.bigtable.v2.IProtoRowsBatch} message ProtoRowsBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoRowsBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoRowsBatch message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ProtoRowsBatch} ProtoRowsBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoRowsBatch.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ProtoRowsBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.batchData = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoRowsBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ProtoRowsBatch} ProtoRowsBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoRowsBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoRowsBatch message. + * @function verify + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoRowsBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.batchData != null && message.hasOwnProperty("batchData")) + if (!(message.batchData && typeof message.batchData.length === "number" || $util.isString(message.batchData))) + return "batchData: buffer expected"; + return null; + }; + + /** + * Creates a ProtoRowsBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ProtoRowsBatch} ProtoRowsBatch + */ + ProtoRowsBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ProtoRowsBatch) + return object; + var message = new $root.google.bigtable.v2.ProtoRowsBatch(); + if (object.batchData != null) + if (typeof object.batchData === "string") + $util.base64.decode(object.batchData, message.batchData = $util.newBuffer($util.base64.length(object.batchData)), 0); + else if (object.batchData.length >= 0) + message.batchData = object.batchData; + return message; + }; + + /** + * Creates a plain object from a ProtoRowsBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {google.bigtable.v2.ProtoRowsBatch} message ProtoRowsBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoRowsBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.batchData = ""; + else { + object.batchData = []; + if (options.bytes !== Array) + object.batchData = $util.newBuffer(object.batchData); + } + if (message.batchData != null && message.hasOwnProperty("batchData")) + object.batchData = options.bytes === String ? $util.base64.encode(message.batchData, 0, message.batchData.length) : options.bytes === Array ? Array.prototype.slice.call(message.batchData) : message.batchData; + return object; + }; + + /** + * Converts this ProtoRowsBatch to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ProtoRowsBatch + * @instance + * @returns {Object.} JSON object + */ + ProtoRowsBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProtoRowsBatch + * @function getTypeUrl + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoRowsBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ProtoRowsBatch"; + }; + + return ProtoRowsBatch; + })(); + + v2.PartialResultSet = (function() { + + /** + * Properties of a PartialResultSet. + * @memberof google.bigtable.v2 + * @interface IPartialResultSet + * @property {google.bigtable.v2.IProtoRowsBatch|null} [protoRowsBatch] PartialResultSet protoRowsBatch + * @property {number|null} [batchChecksum] PartialResultSet batchChecksum + * @property {Uint8Array|null} [resumeToken] PartialResultSet resumeToken + * @property {boolean|null} [reset] PartialResultSet reset + * @property {number|null} [estimatedBatchSize] PartialResultSet estimatedBatchSize + */ + + /** + * Constructs a new PartialResultSet. + * @memberof google.bigtable.v2 + * @classdesc Represents a PartialResultSet. + * @implements IPartialResultSet + * @constructor + * @param {google.bigtable.v2.IPartialResultSet=} [properties] Properties to set + */ + function PartialResultSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartialResultSet protoRowsBatch. + * @member {google.bigtable.v2.IProtoRowsBatch|null|undefined} protoRowsBatch + * @memberof google.bigtable.v2.PartialResultSet + * @instance + */ + PartialResultSet.prototype.protoRowsBatch = null; + + /** + * PartialResultSet batchChecksum. + * @member {number|null|undefined} batchChecksum + * @memberof google.bigtable.v2.PartialResultSet + * @instance + */ + PartialResultSet.prototype.batchChecksum = null; + + /** + * PartialResultSet resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.bigtable.v2.PartialResultSet + * @instance + */ + PartialResultSet.prototype.resumeToken = $util.newBuffer([]); + + /** + * PartialResultSet reset. + * @member {boolean} reset + * @memberof google.bigtable.v2.PartialResultSet + * @instance + */ + PartialResultSet.prototype.reset = false; + + /** + * PartialResultSet estimatedBatchSize. + * @member {number} estimatedBatchSize + * @memberof google.bigtable.v2.PartialResultSet + * @instance + */ + PartialResultSet.prototype.estimatedBatchSize = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PartialResultSet partialRows. + * @member {"protoRowsBatch"|undefined} partialRows + * @memberof google.bigtable.v2.PartialResultSet + * @instance + */ + Object.defineProperty(PartialResultSet.prototype, "partialRows", { + get: $util.oneOfGetter($oneOfFields = ["protoRowsBatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PartialResultSet.prototype, "_batchChecksum", { + get: $util.oneOfGetter($oneOfFields = ["batchChecksum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PartialResultSet instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {google.bigtable.v2.IPartialResultSet=} [properties] Properties to set + * @returns {google.bigtable.v2.PartialResultSet} PartialResultSet instance + */ + PartialResultSet.create = function create(properties) { + return new PartialResultSet(properties); + }; + + /** + * Encodes the specified PartialResultSet message. Does not implicitly {@link google.bigtable.v2.PartialResultSet.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {google.bigtable.v2.IPartialResultSet} message PartialResultSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialResultSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protoRowsBatch != null && Object.hasOwnProperty.call(message, "protoRowsBatch")) + $root.google.bigtable.v2.ProtoRowsBatch.encode(message.protoRowsBatch, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.estimatedBatchSize != null && Object.hasOwnProperty.call(message, "estimatedBatchSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.estimatedBatchSize); + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.resumeToken); + if (message.batchChecksum != null && Object.hasOwnProperty.call(message, "batchChecksum")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.batchChecksum); + if (message.reset != null && Object.hasOwnProperty.call(message, "reset")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.reset); + return writer; + }; + + /** + * Encodes the specified PartialResultSet message, length delimited. Does not implicitly {@link google.bigtable.v2.PartialResultSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {google.bigtable.v2.IPartialResultSet} message PartialResultSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialResultSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.PartialResultSet} PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialResultSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.PartialResultSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.protoRowsBatch = $root.google.bigtable.v2.ProtoRowsBatch.decode(reader, reader.uint32()); + break; + } + case 6: { + message.batchChecksum = reader.uint32(); + break; + } + case 5: { + message.resumeToken = reader.bytes(); + break; + } + case 7: { + message.reset = reader.bool(); + break; + } + case 4: { + message.estimatedBatchSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.PartialResultSet} PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialResultSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartialResultSet message. + * @function verify + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartialResultSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.protoRowsBatch != null && message.hasOwnProperty("protoRowsBatch")) { + properties.partialRows = 1; + { + var error = $root.google.bigtable.v2.ProtoRowsBatch.verify(message.protoRowsBatch); + if (error) + return "protoRowsBatch." + error; + } + } + if (message.batchChecksum != null && message.hasOwnProperty("batchChecksum")) { + properties._batchChecksum = 1; + if (!$util.isInteger(message.batchChecksum)) + return "batchChecksum: integer expected"; + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.reset != null && message.hasOwnProperty("reset")) + if (typeof message.reset !== "boolean") + return "reset: boolean expected"; + if (message.estimatedBatchSize != null && message.hasOwnProperty("estimatedBatchSize")) + if (!$util.isInteger(message.estimatedBatchSize)) + return "estimatedBatchSize: integer expected"; + return null; + }; + + /** + * Creates a PartialResultSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.PartialResultSet} PartialResultSet + */ + PartialResultSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.PartialResultSet) + return object; + var message = new $root.google.bigtable.v2.PartialResultSet(); + if (object.protoRowsBatch != null) { + if (typeof object.protoRowsBatch !== "object") + throw TypeError(".google.bigtable.v2.PartialResultSet.protoRowsBatch: object expected"); + message.protoRowsBatch = $root.google.bigtable.v2.ProtoRowsBatch.fromObject(object.protoRowsBatch); + } + if (object.batchChecksum != null) + message.batchChecksum = object.batchChecksum >>> 0; + if (object.resumeToken != null) + if (typeof object.resumeToken === "string") + $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); + else if (object.resumeToken.length >= 0) + message.resumeToken = object.resumeToken; + if (object.reset != null) + message.reset = Boolean(object.reset); + if (object.estimatedBatchSize != null) + message.estimatedBatchSize = object.estimatedBatchSize | 0; + return message; + }; + + /** + * Creates a plain object from a PartialResultSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {google.bigtable.v2.PartialResultSet} message PartialResultSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartialResultSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.estimatedBatchSize = 0; + if (options.bytes === String) + object.resumeToken = ""; + else { + object.resumeToken = []; + if (options.bytes !== Array) + object.resumeToken = $util.newBuffer(object.resumeToken); + } + object.reset = false; + } + if (message.protoRowsBatch != null && message.hasOwnProperty("protoRowsBatch")) { + object.protoRowsBatch = $root.google.bigtable.v2.ProtoRowsBatch.toObject(message.protoRowsBatch, options); + if (options.oneofs) + object.partialRows = "protoRowsBatch"; + } + if (message.estimatedBatchSize != null && message.hasOwnProperty("estimatedBatchSize")) + object.estimatedBatchSize = message.estimatedBatchSize; + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; + if (message.batchChecksum != null && message.hasOwnProperty("batchChecksum")) { + object.batchChecksum = message.batchChecksum; + if (options.oneofs) + object._batchChecksum = "batchChecksum"; + } + if (message.reset != null && message.hasOwnProperty("reset")) + object.reset = message.reset; + return object; + }; + + /** + * Converts this PartialResultSet to JSON. + * @function toJSON + * @memberof google.bigtable.v2.PartialResultSet + * @instance + * @returns {Object.} JSON object + */ + PartialResultSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartialResultSet + * @function getTypeUrl + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartialResultSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.PartialResultSet"; + }; + + return PartialResultSet; + })(); + + v2.Idempotency = (function() { + + /** + * Properties of an Idempotency. + * @memberof google.bigtable.v2 + * @interface IIdempotency + * @property {Uint8Array|null} [token] Idempotency token + * @property {google.protobuf.ITimestamp|null} [startTime] Idempotency startTime + */ + + /** + * Constructs a new Idempotency. + * @memberof google.bigtable.v2 + * @classdesc Represents an Idempotency. + * @implements IIdempotency + * @constructor + * @param {google.bigtable.v2.IIdempotency=} [properties] Properties to set + */ + function Idempotency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Idempotency token. + * @member {Uint8Array} token + * @memberof google.bigtable.v2.Idempotency + * @instance + */ + Idempotency.prototype.token = $util.newBuffer([]); + + /** + * Idempotency startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.v2.Idempotency + * @instance + */ + Idempotency.prototype.startTime = null; + + /** + * Creates a new Idempotency instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {google.bigtable.v2.IIdempotency=} [properties] Properties to set + * @returns {google.bigtable.v2.Idempotency} Idempotency instance + */ + Idempotency.create = function create(properties) { + return new Idempotency(properties); + }; + + /** + * Encodes the specified Idempotency message. Does not implicitly {@link google.bigtable.v2.Idempotency.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {google.bigtable.v2.IIdempotency} message Idempotency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Idempotency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.token); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Idempotency message, length delimited. Does not implicitly {@link google.bigtable.v2.Idempotency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {google.bigtable.v2.IIdempotency} message Idempotency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Idempotency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Idempotency message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Idempotency} Idempotency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Idempotency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Idempotency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.token = reader.bytes(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Idempotency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Idempotency} Idempotency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Idempotency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Idempotency message. + * @function verify + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Idempotency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!(message.token && typeof message.token.length === "number" || $util.isString(message.token))) + return "token: buffer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates an Idempotency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Idempotency} Idempotency + */ + Idempotency.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Idempotency) + return object; + var message = new $root.google.bigtable.v2.Idempotency(); + if (object.token != null) + if (typeof object.token === "string") + $util.base64.decode(object.token, message.token = $util.newBuffer($util.base64.length(object.token)), 0); + else if (object.token.length >= 0) + message.token = object.token; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.v2.Idempotency.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from an Idempotency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {google.bigtable.v2.Idempotency} message Idempotency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Idempotency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.token = ""; + else { + object.token = []; + if (options.bytes !== Array) + object.token = $util.newBuffer(object.token); + } + object.startTime = null; + } + if (message.token != null && message.hasOwnProperty("token")) + object.token = options.bytes === String ? $util.base64.encode(message.token, 0, message.token.length) : options.bytes === Array ? Array.prototype.slice.call(message.token) : message.token; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this Idempotency to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Idempotency + * @instance + * @returns {Object.} JSON object + */ + Idempotency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Idempotency + * @function getTypeUrl + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Idempotency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Idempotency"; + }; + + return Idempotency; + })(); + + v2.Type = (function() { + + /** + * Properties of a Type. + * @memberof google.bigtable.v2 + * @interface IType + * @property {google.bigtable.v2.Type.IBytes|null} [bytesType] Type bytesType + * @property {google.bigtable.v2.Type.IString|null} [stringType] Type stringType + * @property {google.bigtable.v2.Type.IInt64|null} [int64Type] Type int64Type + * @property {google.bigtable.v2.Type.IFloat32|null} [float32Type] Type float32Type + * @property {google.bigtable.v2.Type.IFloat64|null} [float64Type] Type float64Type + * @property {google.bigtable.v2.Type.IBool|null} [boolType] Type boolType + * @property {google.bigtable.v2.Type.ITimestamp|null} [timestampType] Type timestampType + * @property {google.bigtable.v2.Type.IDate|null} [dateType] Type dateType + * @property {google.bigtable.v2.Type.IAggregate|null} [aggregateType] Type aggregateType + * @property {google.bigtable.v2.Type.IStruct|null} [structType] Type structType + * @property {google.bigtable.v2.Type.IArray|null} [arrayType] Type arrayType + * @property {google.bigtable.v2.Type.IMap|null} [mapType] Type mapType + * @property {google.bigtable.v2.Type.IProto|null} [protoType] Type protoType + * @property {google.bigtable.v2.Type.IEnum|null} [enumType] Type enumType + */ + + /** + * Constructs a new Type. + * @memberof google.bigtable.v2 + * @classdesc Represents a Type. + * @implements IType + * @constructor + * @param {google.bigtable.v2.IType=} [properties] Properties to set + */ + function Type(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Type bytesType. + * @member {google.bigtable.v2.Type.IBytes|null|undefined} bytesType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.bytesType = null; + + /** + * Type stringType. + * @member {google.bigtable.v2.Type.IString|null|undefined} stringType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.stringType = null; + + /** + * Type int64Type. + * @member {google.bigtable.v2.Type.IInt64|null|undefined} int64Type + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.int64Type = null; + + /** + * Type float32Type. + * @member {google.bigtable.v2.Type.IFloat32|null|undefined} float32Type + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.float32Type = null; + + /** + * Type float64Type. + * @member {google.bigtable.v2.Type.IFloat64|null|undefined} float64Type + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.float64Type = null; + + /** + * Type boolType. + * @member {google.bigtable.v2.Type.IBool|null|undefined} boolType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.boolType = null; + + /** + * Type timestampType. + * @member {google.bigtable.v2.Type.ITimestamp|null|undefined} timestampType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.timestampType = null; + + /** + * Type dateType. + * @member {google.bigtable.v2.Type.IDate|null|undefined} dateType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.dateType = null; + + /** + * Type aggregateType. + * @member {google.bigtable.v2.Type.IAggregate|null|undefined} aggregateType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.aggregateType = null; + + /** + * Type structType. + * @member {google.bigtable.v2.Type.IStruct|null|undefined} structType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.structType = null; + + /** + * Type arrayType. + * @member {google.bigtable.v2.Type.IArray|null|undefined} arrayType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.arrayType = null; + + /** + * Type mapType. + * @member {google.bigtable.v2.Type.IMap|null|undefined} mapType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.mapType = null; + + /** + * Type protoType. + * @member {google.bigtable.v2.Type.IProto|null|undefined} protoType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.protoType = null; + + /** + * Type enumType. + * @member {google.bigtable.v2.Type.IEnum|null|undefined} enumType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.enumType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Type kind. + * @member {"bytesType"|"stringType"|"int64Type"|"float32Type"|"float64Type"|"boolType"|"timestampType"|"dateType"|"aggregateType"|"structType"|"arrayType"|"mapType"|"protoType"|"enumType"|undefined} kind + * @memberof google.bigtable.v2.Type + * @instance + */ + Object.defineProperty(Type.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["bytesType", "stringType", "int64Type", "float32Type", "float64Type", "boolType", "timestampType", "dateType", "aggregateType", "structType", "arrayType", "mapType", "protoType", "enumType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Type instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type + * @static + * @param {google.bigtable.v2.IType=} [properties] Properties to set + * @returns {google.bigtable.v2.Type} Type instance + */ + Type.create = function create(properties) { + return new Type(properties); + }; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.bigtable.v2.Type.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type + * @static + * @param {google.bigtable.v2.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesType != null && Object.hasOwnProperty.call(message, "bytesType")) + $root.google.bigtable.v2.Type.Bytes.encode(message.bytesType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stringType != null && Object.hasOwnProperty.call(message, "stringType")) + $root.google.bigtable.v2.Type.String.encode(message.stringType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.arrayType != null && Object.hasOwnProperty.call(message, "arrayType")) + $root.google.bigtable.v2.Type.Array.encode(message.arrayType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mapType != null && Object.hasOwnProperty.call(message, "mapType")) + $root.google.bigtable.v2.Type.Map.encode(message.mapType, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.int64Type != null && Object.hasOwnProperty.call(message, "int64Type")) + $root.google.bigtable.v2.Type.Int64.encode(message.int64Type, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.aggregateType != null && Object.hasOwnProperty.call(message, "aggregateType")) + $root.google.bigtable.v2.Type.Aggregate.encode(message.aggregateType, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) + $root.google.bigtable.v2.Type.Struct.encode(message.structType, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.boolType != null && Object.hasOwnProperty.call(message, "boolType")) + $root.google.bigtable.v2.Type.Bool.encode(message.boolType, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.float64Type != null && Object.hasOwnProperty.call(message, "float64Type")) + $root.google.bigtable.v2.Type.Float64.encode(message.float64Type, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.timestampType != null && Object.hasOwnProperty.call(message, "timestampType")) + $root.google.bigtable.v2.Type.Timestamp.encode(message.timestampType, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.dateType != null && Object.hasOwnProperty.call(message, "dateType")) + $root.google.bigtable.v2.Type.Date.encode(message.dateType, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.float32Type != null && Object.hasOwnProperty.call(message, "float32Type")) + $root.google.bigtable.v2.Type.Float32.encode(message.float32Type, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.protoType != null && Object.hasOwnProperty.call(message, "protoType")) + $root.google.bigtable.v2.Type.Proto.encode(message.protoType, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + $root.google.bigtable.v2.Type.Enum.encode(message.enumType, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type + * @static + * @param {google.bigtable.v2.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Type message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bytesType = $root.google.bigtable.v2.Type.Bytes.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stringType = $root.google.bigtable.v2.Type.String.decode(reader, reader.uint32()); + break; + } + case 5: { + message.int64Type = $root.google.bigtable.v2.Type.Int64.decode(reader, reader.uint32()); + break; + } + case 12: { + message.float32Type = $root.google.bigtable.v2.Type.Float32.decode(reader, reader.uint32()); + break; + } + case 9: { + message.float64Type = $root.google.bigtable.v2.Type.Float64.decode(reader, reader.uint32()); + break; + } + case 8: { + message.boolType = $root.google.bigtable.v2.Type.Bool.decode(reader, reader.uint32()); + break; + } + case 10: { + message.timestampType = $root.google.bigtable.v2.Type.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.dateType = $root.google.bigtable.v2.Type.Date.decode(reader, reader.uint32()); + break; + } + case 6: { + message.aggregateType = $root.google.bigtable.v2.Type.Aggregate.decode(reader, reader.uint32()); + break; + } + case 7: { + message.structType = $root.google.bigtable.v2.Type.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.arrayType = $root.google.bigtable.v2.Type.Array.decode(reader, reader.uint32()); + break; + } + case 4: { + message.mapType = $root.google.bigtable.v2.Type.Map.decode(reader, reader.uint32()); + break; + } + case 13: { + message.protoType = $root.google.bigtable.v2.Type.Proto.decode(reader, reader.uint32()); + break; + } + case 14: { + message.enumType = $root.google.bigtable.v2.Type.Enum.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Type message. + * @function verify + * @memberof google.bigtable.v2.Type + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Type.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) { + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Bytes.verify(message.bytesType); + if (error) + return "bytesType." + error; + } + } + if (message.stringType != null && message.hasOwnProperty("stringType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.String.verify(message.stringType); + if (error) + return "stringType." + error; + } + } + if (message.int64Type != null && message.hasOwnProperty("int64Type")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Int64.verify(message.int64Type); + if (error) + return "int64Type." + error; + } + } + if (message.float32Type != null && message.hasOwnProperty("float32Type")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Float32.verify(message.float32Type); + if (error) + return "float32Type." + error; + } + } + if (message.float64Type != null && message.hasOwnProperty("float64Type")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Float64.verify(message.float64Type); + if (error) + return "float64Type." + error; + } + } + if (message.boolType != null && message.hasOwnProperty("boolType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Bool.verify(message.boolType); + if (error) + return "boolType." + error; + } + } + if (message.timestampType != null && message.hasOwnProperty("timestampType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Timestamp.verify(message.timestampType); + if (error) + return "timestampType." + error; + } + } + if (message.dateType != null && message.hasOwnProperty("dateType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Date.verify(message.dateType); + if (error) + return "dateType." + error; + } + } + if (message.aggregateType != null && message.hasOwnProperty("aggregateType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Aggregate.verify(message.aggregateType); + if (error) + return "aggregateType." + error; + } + } + if (message.structType != null && message.hasOwnProperty("structType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Struct.verify(message.structType); + if (error) + return "structType." + error; + } + } + if (message.arrayType != null && message.hasOwnProperty("arrayType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Array.verify(message.arrayType); + if (error) + return "arrayType." + error; + } + } + if (message.mapType != null && message.hasOwnProperty("mapType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Map.verify(message.mapType); + if (error) + return "mapType." + error; + } + } + if (message.protoType != null && message.hasOwnProperty("protoType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Proto.verify(message.protoType); + if (error) + return "protoType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Enum.verify(message.enumType); + if (error) + return "enumType." + error; + } + } + return null; + }; + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type} Type + */ + Type.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type) + return object; + var message = new $root.google.bigtable.v2.Type(); + if (object.bytesType != null) { + if (typeof object.bytesType !== "object") + throw TypeError(".google.bigtable.v2.Type.bytesType: object expected"); + message.bytesType = $root.google.bigtable.v2.Type.Bytes.fromObject(object.bytesType); + } + if (object.stringType != null) { + if (typeof object.stringType !== "object") + throw TypeError(".google.bigtable.v2.Type.stringType: object expected"); + message.stringType = $root.google.bigtable.v2.Type.String.fromObject(object.stringType); + } + if (object.int64Type != null) { + if (typeof object.int64Type !== "object") + throw TypeError(".google.bigtable.v2.Type.int64Type: object expected"); + message.int64Type = $root.google.bigtable.v2.Type.Int64.fromObject(object.int64Type); + } + if (object.float32Type != null) { + if (typeof object.float32Type !== "object") + throw TypeError(".google.bigtable.v2.Type.float32Type: object expected"); + message.float32Type = $root.google.bigtable.v2.Type.Float32.fromObject(object.float32Type); + } + if (object.float64Type != null) { + if (typeof object.float64Type !== "object") + throw TypeError(".google.bigtable.v2.Type.float64Type: object expected"); + message.float64Type = $root.google.bigtable.v2.Type.Float64.fromObject(object.float64Type); + } + if (object.boolType != null) { + if (typeof object.boolType !== "object") + throw TypeError(".google.bigtable.v2.Type.boolType: object expected"); + message.boolType = $root.google.bigtable.v2.Type.Bool.fromObject(object.boolType); + } + if (object.timestampType != null) { + if (typeof object.timestampType !== "object") + throw TypeError(".google.bigtable.v2.Type.timestampType: object expected"); + message.timestampType = $root.google.bigtable.v2.Type.Timestamp.fromObject(object.timestampType); + } + if (object.dateType != null) { + if (typeof object.dateType !== "object") + throw TypeError(".google.bigtable.v2.Type.dateType: object expected"); + message.dateType = $root.google.bigtable.v2.Type.Date.fromObject(object.dateType); + } + if (object.aggregateType != null) { + if (typeof object.aggregateType !== "object") + throw TypeError(".google.bigtable.v2.Type.aggregateType: object expected"); + message.aggregateType = $root.google.bigtable.v2.Type.Aggregate.fromObject(object.aggregateType); + } + if (object.structType != null) { + if (typeof object.structType !== "object") + throw TypeError(".google.bigtable.v2.Type.structType: object expected"); + message.structType = $root.google.bigtable.v2.Type.Struct.fromObject(object.structType); + } + if (object.arrayType != null) { + if (typeof object.arrayType !== "object") + throw TypeError(".google.bigtable.v2.Type.arrayType: object expected"); + message.arrayType = $root.google.bigtable.v2.Type.Array.fromObject(object.arrayType); + } + if (object.mapType != null) { + if (typeof object.mapType !== "object") + throw TypeError(".google.bigtable.v2.Type.mapType: object expected"); + message.mapType = $root.google.bigtable.v2.Type.Map.fromObject(object.mapType); + } + if (object.protoType != null) { + if (typeof object.protoType !== "object") + throw TypeError(".google.bigtable.v2.Type.protoType: object expected"); + message.protoType = $root.google.bigtable.v2.Type.Proto.fromObject(object.protoType); + } + if (object.enumType != null) { + if (typeof object.enumType !== "object") + throw TypeError(".google.bigtable.v2.Type.enumType: object expected"); + message.enumType = $root.google.bigtable.v2.Type.Enum.fromObject(object.enumType); + } + return message; + }; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type + * @static + * @param {google.bigtable.v2.Type} message Type + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Type.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) { + object.bytesType = $root.google.bigtable.v2.Type.Bytes.toObject(message.bytesType, options); + if (options.oneofs) + object.kind = "bytesType"; + } + if (message.stringType != null && message.hasOwnProperty("stringType")) { + object.stringType = $root.google.bigtable.v2.Type.String.toObject(message.stringType, options); + if (options.oneofs) + object.kind = "stringType"; + } + if (message.arrayType != null && message.hasOwnProperty("arrayType")) { + object.arrayType = $root.google.bigtable.v2.Type.Array.toObject(message.arrayType, options); + if (options.oneofs) + object.kind = "arrayType"; + } + if (message.mapType != null && message.hasOwnProperty("mapType")) { + object.mapType = $root.google.bigtable.v2.Type.Map.toObject(message.mapType, options); + if (options.oneofs) + object.kind = "mapType"; + } + if (message.int64Type != null && message.hasOwnProperty("int64Type")) { + object.int64Type = $root.google.bigtable.v2.Type.Int64.toObject(message.int64Type, options); + if (options.oneofs) + object.kind = "int64Type"; + } + if (message.aggregateType != null && message.hasOwnProperty("aggregateType")) { + object.aggregateType = $root.google.bigtable.v2.Type.Aggregate.toObject(message.aggregateType, options); + if (options.oneofs) + object.kind = "aggregateType"; + } + if (message.structType != null && message.hasOwnProperty("structType")) { + object.structType = $root.google.bigtable.v2.Type.Struct.toObject(message.structType, options); + if (options.oneofs) + object.kind = "structType"; + } + if (message.boolType != null && message.hasOwnProperty("boolType")) { + object.boolType = $root.google.bigtable.v2.Type.Bool.toObject(message.boolType, options); + if (options.oneofs) + object.kind = "boolType"; + } + if (message.float64Type != null && message.hasOwnProperty("float64Type")) { + object.float64Type = $root.google.bigtable.v2.Type.Float64.toObject(message.float64Type, options); + if (options.oneofs) + object.kind = "float64Type"; + } + if (message.timestampType != null && message.hasOwnProperty("timestampType")) { + object.timestampType = $root.google.bigtable.v2.Type.Timestamp.toObject(message.timestampType, options); + if (options.oneofs) + object.kind = "timestampType"; + } + if (message.dateType != null && message.hasOwnProperty("dateType")) { + object.dateType = $root.google.bigtable.v2.Type.Date.toObject(message.dateType, options); + if (options.oneofs) + object.kind = "dateType"; + } + if (message.float32Type != null && message.hasOwnProperty("float32Type")) { + object.float32Type = $root.google.bigtable.v2.Type.Float32.toObject(message.float32Type, options); + if (options.oneofs) + object.kind = "float32Type"; + } + if (message.protoType != null && message.hasOwnProperty("protoType")) { + object.protoType = $root.google.bigtable.v2.Type.Proto.toObject(message.protoType, options); + if (options.oneofs) + object.kind = "protoType"; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + object.enumType = $root.google.bigtable.v2.Type.Enum.toObject(message.enumType, options); + if (options.oneofs) + object.kind = "enumType"; + } + return object; + }; + + /** + * Converts this Type to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type + * @instance + * @returns {Object.} JSON object + */ + Type.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Type + * @function getTypeUrl + * @memberof google.bigtable.v2.Type + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Type.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type"; + }; + + Type.Bytes = (function() { + + /** + * Properties of a Bytes. + * @memberof google.bigtable.v2.Type + * @interface IBytes + * @property {google.bigtable.v2.Type.Bytes.IEncoding|null} [encoding] Bytes encoding + */ + + /** + * Constructs a new Bytes. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Bytes. + * @implements IBytes + * @constructor + * @param {google.bigtable.v2.Type.IBytes=} [properties] Properties to set + */ + function Bytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bytes encoding. + * @member {google.bigtable.v2.Type.Bytes.IEncoding|null|undefined} encoding + * @memberof google.bigtable.v2.Type.Bytes + * @instance + */ + Bytes.prototype.encoding = null; + + /** + * Creates a new Bytes instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {google.bigtable.v2.Type.IBytes=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Bytes} Bytes instance + */ + Bytes.create = function create(properties) { + return new Bytes(properties); + }; + + /** + * Encodes the specified Bytes message. Does not implicitly {@link google.bigtable.v2.Type.Bytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {google.bigtable.v2.Type.IBytes} message Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.v2.Type.Bytes.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Bytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {google.bigtable.v2.Type.IBytes} message Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Bytes} Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Bytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.v2.Type.Bytes.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Bytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Bytes} Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bytes message. + * @function verify + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.v2.Type.Bytes.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a Bytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Bytes} Bytes + */ + Bytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Bytes) + return object; + var message = new $root.google.bigtable.v2.Type.Bytes(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.v2.Type.Bytes.encoding: object expected"); + message.encoding = $root.google.bigtable.v2.Type.Bytes.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a Bytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {google.bigtable.v2.Type.Bytes} message Bytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.v2.Type.Bytes.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Bytes to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Bytes + * @instance + * @returns {Object.} JSON object + */ + Bytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bytes + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Bytes"; + }; + + Bytes.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.v2.Type.Bytes + * @interface IEncoding + * @property {google.bigtable.v2.Type.Bytes.Encoding.IRaw|null} [raw] Encoding raw + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.v2.Type.Bytes + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.v2.Type.Bytes.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding raw. + * @member {google.bigtable.v2.Type.Bytes.Encoding.IRaw|null|undefined} raw + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @instance + */ + Encoding.prototype.raw = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"raw"|undefined} encoding + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["raw"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.v2.Type.Bytes.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Bytes.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.v2.Type.Bytes.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.raw != null && Object.hasOwnProperty.call(message, "raw")) + $root.google.bigtable.v2.Type.Bytes.Encoding.Raw.encode(message.raw, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.v2.Type.Bytes.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Bytes.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Bytes.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.raw = $root.google.bigtable.v2.Type.Bytes.Encoding.Raw.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Bytes.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.raw != null && message.hasOwnProperty("raw")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Bytes.Encoding.Raw.verify(message.raw); + if (error) + return "raw." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Bytes.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Bytes.Encoding) + return object; + var message = new $root.google.bigtable.v2.Type.Bytes.Encoding(); + if (object.raw != null) { + if (typeof object.raw !== "object") + throw TypeError(".google.bigtable.v2.Type.Bytes.Encoding.raw: object expected"); + message.raw = $root.google.bigtable.v2.Type.Bytes.Encoding.Raw.fromObject(object.raw); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.v2.Type.Bytes.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.raw != null && message.hasOwnProperty("raw")) { + object.raw = $root.google.bigtable.v2.Type.Bytes.Encoding.Raw.toObject(message.raw, options); + if (options.oneofs) + object.encoding = "raw"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Bytes.Encoding"; + }; + + Encoding.Raw = (function() { + + /** + * Properties of a Raw. + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @interface IRaw + * @property {boolean|null} [escapeNulls] Raw escapeNulls + */ + + /** + * Constructs a new Raw. + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @classdesc Represents a Raw. + * @implements IRaw + * @constructor + * @param {google.bigtable.v2.Type.Bytes.Encoding.IRaw=} [properties] Properties to set + */ + function Raw(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Raw escapeNulls. + * @member {boolean} escapeNulls + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @instance + */ + Raw.prototype.escapeNulls = false; + + /** + * Creates a new Raw instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.v2.Type.Bytes.Encoding.IRaw=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Bytes.Encoding.Raw} Raw instance + */ + Raw.create = function create(properties) { + return new Raw(properties); + }; + + /** + * Encodes the specified Raw message. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.v2.Type.Bytes.Encoding.IRaw} message Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Raw.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.escapeNulls != null && Object.hasOwnProperty.call(message, "escapeNulls")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.escapeNulls); + return writer; + }; + + /** + * Encodes the specified Raw message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.v2.Type.Bytes.Encoding.IRaw} message Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Raw.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Raw message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Bytes.Encoding.Raw} Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Raw.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Bytes.Encoding.Raw(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.escapeNulls = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Raw message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Bytes.Encoding.Raw} Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Raw.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Raw message. + * @function verify + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Raw.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.escapeNulls != null && message.hasOwnProperty("escapeNulls")) + if (typeof message.escapeNulls !== "boolean") + return "escapeNulls: boolean expected"; + return null; + }; + + /** + * Creates a Raw message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Bytes.Encoding.Raw} Raw + */ + Raw.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Bytes.Encoding.Raw) + return object; + var message = new $root.google.bigtable.v2.Type.Bytes.Encoding.Raw(); + if (object.escapeNulls != null) + message.escapeNulls = Boolean(object.escapeNulls); + return message; + }; + + /** + * Creates a plain object from a Raw message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.v2.Type.Bytes.Encoding.Raw} message Raw + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Raw.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.escapeNulls = false; + if (message.escapeNulls != null && message.hasOwnProperty("escapeNulls")) + object.escapeNulls = message.escapeNulls; + return object; + }; + + /** + * Converts this Raw to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @instance + * @returns {Object.} JSON object + */ + Raw.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Raw + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Raw.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Bytes.Encoding.Raw"; + }; + + return Raw; + })(); + + return Encoding; + })(); + + return Bytes; + })(); + + Type.String = (function() { + + /** + * Properties of a String. + * @memberof google.bigtable.v2.Type + * @interface IString + * @property {google.bigtable.v2.Type.String.IEncoding|null} [encoding] String encoding + */ + + /** + * Constructs a new String. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a String. + * @implements IString + * @constructor + * @param {google.bigtable.v2.Type.IString=} [properties] Properties to set + */ + function String(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * String encoding. + * @member {google.bigtable.v2.Type.String.IEncoding|null|undefined} encoding + * @memberof google.bigtable.v2.Type.String + * @instance + */ + String.prototype.encoding = null; + + /** + * Creates a new String instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.String + * @static + * @param {google.bigtable.v2.Type.IString=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.String} String instance + */ + String.create = function create(properties) { + return new String(properties); + }; + + /** + * Encodes the specified String message. Does not implicitly {@link google.bigtable.v2.Type.String.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.String + * @static + * @param {google.bigtable.v2.Type.IString} message String message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + String.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.v2.Type.String.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified String message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.String + * @static + * @param {google.bigtable.v2.Type.IString} message String message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + String.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a String message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.String + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.String} String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + String.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.String(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.v2.Type.String.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a String message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.String + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.String} String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + String.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a String message. + * @function verify + * @memberof google.bigtable.v2.Type.String + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + String.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.v2.Type.String.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a String message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.String + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.String} String + */ + String.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.String) + return object; + var message = new $root.google.bigtable.v2.Type.String(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.v2.Type.String.encoding: object expected"); + message.encoding = $root.google.bigtable.v2.Type.String.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a String message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.String + * @static + * @param {google.bigtable.v2.Type.String} message String + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + String.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.v2.Type.String.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this String to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.String + * @instance + * @returns {Object.} JSON object + */ + String.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for String + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.String + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + String.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.String"; + }; + + String.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.v2.Type.String + * @interface IEncoding + * @property {google.bigtable.v2.Type.String.Encoding.IUtf8Raw|null} [utf8Raw] Encoding utf8Raw + * @property {google.bigtable.v2.Type.String.Encoding.IUtf8Bytes|null} [utf8Bytes] Encoding utf8Bytes + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.v2.Type.String + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.v2.Type.String.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding utf8Raw. + * @member {google.bigtable.v2.Type.String.Encoding.IUtf8Raw|null|undefined} utf8Raw + * @memberof google.bigtable.v2.Type.String.Encoding + * @instance + */ + Encoding.prototype.utf8Raw = null; + + /** + * Encoding utf8Bytes. + * @member {google.bigtable.v2.Type.String.Encoding.IUtf8Bytes|null|undefined} utf8Bytes + * @memberof google.bigtable.v2.Type.String.Encoding + * @instance + */ + Encoding.prototype.utf8Bytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"utf8Raw"|"utf8Bytes"|undefined} encoding + * @memberof google.bigtable.v2.Type.String.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["utf8Raw", "utf8Bytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {google.bigtable.v2.Type.String.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.String.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {google.bigtable.v2.Type.String.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.utf8Raw != null && Object.hasOwnProperty.call(message, "utf8Raw")) + $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw.encode(message.utf8Raw, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.utf8Bytes != null && Object.hasOwnProperty.call(message, "utf8Bytes")) + $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.encode(message.utf8Bytes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {google.bigtable.v2.Type.String.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.String.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.String.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.utf8Raw = $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw.decode(reader, reader.uint32()); + break; + } + case 2: { + message.utf8Bytes = $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.String.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.utf8Raw != null && message.hasOwnProperty("utf8Raw")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw.verify(message.utf8Raw); + if (error) + return "utf8Raw." + error; + } + } + if (message.utf8Bytes != null && message.hasOwnProperty("utf8Bytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.verify(message.utf8Bytes); + if (error) + return "utf8Bytes." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.String.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.String.Encoding) + return object; + var message = new $root.google.bigtable.v2.Type.String.Encoding(); + if (object.utf8Raw != null) { + if (typeof object.utf8Raw !== "object") + throw TypeError(".google.bigtable.v2.Type.String.Encoding.utf8Raw: object expected"); + message.utf8Raw = $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw.fromObject(object.utf8Raw); + } + if (object.utf8Bytes != null) { + if (typeof object.utf8Bytes !== "object") + throw TypeError(".google.bigtable.v2.Type.String.Encoding.utf8Bytes: object expected"); + message.utf8Bytes = $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.fromObject(object.utf8Bytes); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {google.bigtable.v2.Type.String.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.utf8Raw != null && message.hasOwnProperty("utf8Raw")) { + object.utf8Raw = $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw.toObject(message.utf8Raw, options); + if (options.oneofs) + object.encoding = "utf8Raw"; + } + if (message.utf8Bytes != null && message.hasOwnProperty("utf8Bytes")) { + object.utf8Bytes = $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.toObject(message.utf8Bytes, options); + if (options.oneofs) + object.encoding = "utf8Bytes"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.String.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.String.Encoding"; + }; + + Encoding.Utf8Raw = (function() { + + /** + * Properties of an Utf8Raw. + * @memberof google.bigtable.v2.Type.String.Encoding + * @interface IUtf8Raw + */ + + /** + * Constructs a new Utf8Raw. + * @memberof google.bigtable.v2.Type.String.Encoding + * @classdesc Represents an Utf8Raw. + * @implements IUtf8Raw + * @constructor + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Raw=} [properties] Properties to set + */ + function Utf8Raw(properties) { + if (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 Utf8Raw instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Raw=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Raw} Utf8Raw instance + */ + Utf8Raw.create = function create(properties) { + return new Utf8Raw(properties); + }; + + /** + * Encodes the specified Utf8Raw message. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Raw} message Utf8Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Raw.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Utf8Raw message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Raw} message Utf8Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Raw.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Raw} Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Raw.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Raw} Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Raw.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Utf8Raw message. + * @function verify + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Utf8Raw.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Utf8Raw message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Raw} Utf8Raw + */ + Utf8Raw.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw) + return object; + return new $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw(); + }; + + /** + * Creates a plain object from an Utf8Raw message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.v2.Type.String.Encoding.Utf8Raw} message Utf8Raw + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Utf8Raw.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Utf8Raw to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @instance + * @returns {Object.} JSON object + */ + Utf8Raw.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Utf8Raw + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Utf8Raw.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.String.Encoding.Utf8Raw"; + }; + + return Utf8Raw; + })(); + + Encoding.Utf8Bytes = (function() { + + /** + * Properties of an Utf8Bytes. + * @memberof google.bigtable.v2.Type.String.Encoding + * @interface IUtf8Bytes + * @property {string|null} [nullEscapeChar] Utf8Bytes nullEscapeChar + */ + + /** + * Constructs a new Utf8Bytes. + * @memberof google.bigtable.v2.Type.String.Encoding + * @classdesc Represents an Utf8Bytes. + * @implements IUtf8Bytes + * @constructor + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Bytes=} [properties] Properties to set + */ + function Utf8Bytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Utf8Bytes nullEscapeChar. + * @member {string} nullEscapeChar + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @instance + */ + Utf8Bytes.prototype.nullEscapeChar = ""; + + /** + * Creates a new Utf8Bytes instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Bytes=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes instance + */ + Utf8Bytes.create = function create(properties) { + return new Utf8Bytes(properties); + }; + + /** + * Encodes the specified Utf8Bytes message. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Bytes} message Utf8Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Bytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullEscapeChar != null && Object.hasOwnProperty.call(message, "nullEscapeChar")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nullEscapeChar); + return writer; + }; + + /** + * Encodes the specified Utf8Bytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Bytes} message Utf8Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Bytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Bytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nullEscapeChar = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Bytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Utf8Bytes message. + * @function verify + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Utf8Bytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nullEscapeChar != null && message.hasOwnProperty("nullEscapeChar")) + if (!$util.isString(message.nullEscapeChar)) + return "nullEscapeChar: string expected"; + return null; + }; + + /** + * Creates an Utf8Bytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes + */ + Utf8Bytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) + return object; + var message = new $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes(); + if (object.nullEscapeChar != null) + message.nullEscapeChar = String(object.nullEscapeChar); + return message; + }; + + /** + * Creates a plain object from an Utf8Bytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.v2.Type.String.Encoding.Utf8Bytes} message Utf8Bytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Utf8Bytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.nullEscapeChar = ""; + if (message.nullEscapeChar != null && message.hasOwnProperty("nullEscapeChar")) + object.nullEscapeChar = message.nullEscapeChar; + return object; + }; + + /** + * Converts this Utf8Bytes to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @instance + * @returns {Object.} JSON object + */ + Utf8Bytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Utf8Bytes + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Utf8Bytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.String.Encoding.Utf8Bytes"; + }; + + return Utf8Bytes; + })(); + + return Encoding; + })(); + + return String; + })(); + + Type.Int64 = (function() { + + /** + * Properties of an Int64. + * @memberof google.bigtable.v2.Type + * @interface IInt64 + * @property {google.bigtable.v2.Type.Int64.IEncoding|null} [encoding] Int64 encoding + */ + + /** + * Constructs a new Int64. + * @memberof google.bigtable.v2.Type + * @classdesc Represents an Int64. + * @implements IInt64 + * @constructor + * @param {google.bigtable.v2.Type.IInt64=} [properties] Properties to set + */ + function Int64(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64 encoding. + * @member {google.bigtable.v2.Type.Int64.IEncoding|null|undefined} encoding + * @memberof google.bigtable.v2.Type.Int64 + * @instance + */ + Int64.prototype.encoding = null; + + /** + * Creates a new Int64 instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {google.bigtable.v2.Type.IInt64=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Int64} Int64 instance + */ + Int64.create = function create(properties) { + return new Int64(properties); + }; + + /** + * Encodes the specified Int64 message. Does not implicitly {@link google.bigtable.v2.Type.Int64.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {google.bigtable.v2.Type.IInt64} message Int64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.v2.Type.Int64.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Int64 message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {google.bigtable.v2.Type.IInt64} message Int64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64 message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Int64} Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Int64(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.v2.Type.Int64.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Int64} Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64 message. + * @function verify + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.v2.Type.Int64.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates an Int64 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Int64} Int64 + */ + Int64.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Int64) + return object; + var message = new $root.google.bigtable.v2.Type.Int64(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.v2.Type.Int64.encoding: object expected"); + message.encoding = $root.google.bigtable.v2.Type.Int64.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from an Int64 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {google.bigtable.v2.Type.Int64} message Int64 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.v2.Type.Int64.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Int64 to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Int64 + * @instance + * @returns {Object.} JSON object + */ + Int64.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64 + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Int64"; + }; + + Int64.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.v2.Type.Int64 + * @interface IEncoding + * @property {google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes|null} [bigEndianBytes] Encoding bigEndianBytes + * @property {google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes|null} [orderedCodeBytes] Encoding orderedCodeBytes + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.v2.Type.Int64 + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.v2.Type.Int64.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding bigEndianBytes. + * @member {google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes|null|undefined} bigEndianBytes + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @instance + */ + Encoding.prototype.bigEndianBytes = null; + + /** + * Encoding orderedCodeBytes. + * @member {google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes|null|undefined} orderedCodeBytes + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @instance + */ + Encoding.prototype.orderedCodeBytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"bigEndianBytes"|"orderedCodeBytes"|undefined} encoding + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["bigEndianBytes", "orderedCodeBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.v2.Type.Int64.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Int64.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.v2.Type.Int64.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigEndianBytes != null && Object.hasOwnProperty.call(message, "bigEndianBytes")) + $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.encode(message.bigEndianBytes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.orderedCodeBytes != null && Object.hasOwnProperty.call(message, "orderedCodeBytes")) + $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.encode(message.orderedCodeBytes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.v2.Type.Int64.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Int64.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Int64.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bigEndianBytes = $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.decode(reader, reader.uint32()); + break; + } + case 2: { + message.orderedCodeBytes = $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Int64.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bigEndianBytes != null && message.hasOwnProperty("bigEndianBytes")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.verify(message.bigEndianBytes); + if (error) + return "bigEndianBytes." + error; + } + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.verify(message.orderedCodeBytes); + if (error) + return "orderedCodeBytes." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Int64.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Int64.Encoding) + return object; + var message = new $root.google.bigtable.v2.Type.Int64.Encoding(); + if (object.bigEndianBytes != null) { + if (typeof object.bigEndianBytes !== "object") + throw TypeError(".google.bigtable.v2.Type.Int64.Encoding.bigEndianBytes: object expected"); + message.bigEndianBytes = $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.fromObject(object.bigEndianBytes); + } + if (object.orderedCodeBytes != null) { + if (typeof object.orderedCodeBytes !== "object") + throw TypeError(".google.bigtable.v2.Type.Int64.Encoding.orderedCodeBytes: object expected"); + message.orderedCodeBytes = $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.fromObject(object.orderedCodeBytes); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bigEndianBytes != null && message.hasOwnProperty("bigEndianBytes")) { + object.bigEndianBytes = $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.toObject(message.bigEndianBytes, options); + if (options.oneofs) + object.encoding = "bigEndianBytes"; + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + object.orderedCodeBytes = $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.toObject(message.orderedCodeBytes, options); + if (options.oneofs) + object.encoding = "orderedCodeBytes"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Int64.Encoding"; + }; + + Encoding.BigEndianBytes = (function() { + + /** + * Properties of a BigEndianBytes. + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @interface IBigEndianBytes + * @property {google.bigtable.v2.Type.IBytes|null} [bytesType] BigEndianBytes bytesType + */ + + /** + * Constructs a new BigEndianBytes. + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @classdesc Represents a BigEndianBytes. + * @implements IBigEndianBytes + * @constructor + * @param {google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes=} [properties] Properties to set + */ + function BigEndianBytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigEndianBytes bytesType. + * @member {google.bigtable.v2.Type.IBytes|null|undefined} bytesType + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @instance + */ + BigEndianBytes.prototype.bytesType = null; + + /** + * Creates a new BigEndianBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes instance + */ + BigEndianBytes.create = function create(properties) { + return new BigEndianBytes(properties); + }; + + /** + * Encodes the specified BigEndianBytes message. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes} message BigEndianBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigEndianBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesType != null && Object.hasOwnProperty.call(message, "bytesType")) + $root.google.bigtable.v2.Type.Bytes.encode(message.bytesType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BigEndianBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes} message BigEndianBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigEndianBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigEndianBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bytesType = $root.google.bigtable.v2.Type.Bytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigEndianBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigEndianBytes message. + * @function verify + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigEndianBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) { + var error = $root.google.bigtable.v2.Type.Bytes.verify(message.bytesType); + if (error) + return "bytesType." + error; + } + return null; + }; + + /** + * Creates a BigEndianBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes + */ + BigEndianBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) + return object; + var message = new $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes(); + if (object.bytesType != null) { + if (typeof object.bytesType !== "object") + throw TypeError(".google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.bytesType: object expected"); + message.bytesType = $root.google.bigtable.v2.Type.Bytes.fromObject(object.bytesType); + } + return message; + }; + + /** + * Creates a plain object from a BigEndianBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes} message BigEndianBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigEndianBytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.bytesType = null; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) + object.bytesType = $root.google.bigtable.v2.Type.Bytes.toObject(message.bytesType, options); + return object; + }; + + /** + * Converts this BigEndianBytes to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @instance + * @returns {Object.} JSON object + */ + BigEndianBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigEndianBytes + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigEndianBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes"; + }; + + return BigEndianBytes; + })(); + + Encoding.OrderedCodeBytes = (function() { + + /** + * Properties of an OrderedCodeBytes. + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @interface IOrderedCodeBytes + */ + + /** + * Constructs a new OrderedCodeBytes. + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @classdesc Represents an OrderedCodeBytes. + * @implements IOrderedCodeBytes + * @constructor + * @param {google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes=} [properties] Properties to set + */ + function OrderedCodeBytes(properties) { + if (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 OrderedCodeBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes instance + */ + OrderedCodeBytes.create = function create(properties) { + return new OrderedCodeBytes(properties); + }; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrderedCodeBytes message. + * @function verify + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrderedCodeBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes + */ + OrderedCodeBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) + return object; + return new $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes(); + }; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes} message OrderedCodeBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrderedCodeBytes.toObject = function toObject() { + return {}; + }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @instance + * @returns {Object.} JSON object + */ + OrderedCodeBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrderedCodeBytes + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrderedCodeBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes"; + }; + + return OrderedCodeBytes; + })(); + + return Encoding; + })(); + + return Int64; + })(); + + Type.Bool = (function() { + + /** + * Properties of a Bool. + * @memberof google.bigtable.v2.Type + * @interface IBool + */ + + /** + * Constructs a new Bool. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Bool. + * @implements IBool + * @constructor + * @param {google.bigtable.v2.Type.IBool=} [properties] Properties to set + */ + function Bool(properties) { + if (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 Bool instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {google.bigtable.v2.Type.IBool=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Bool} Bool instance + */ + Bool.create = function create(properties) { + return new Bool(properties); + }; + + /** + * Encodes the specified Bool message. Does not implicitly {@link google.bigtable.v2.Type.Bool.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {google.bigtable.v2.Type.IBool} message Bool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Bool message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {google.bigtable.v2.Type.IBool} message Bool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bool message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Bool} Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Bool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Bool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Bool} Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bool message. + * @function verify + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Bool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Bool} Bool + */ + Bool.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Bool) + return object; + return new $root.google.bigtable.v2.Type.Bool(); + }; + + /** + * Creates a plain object from a Bool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {google.bigtable.v2.Type.Bool} message Bool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bool.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Bool to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Bool + * @instance + * @returns {Object.} JSON object + */ + Bool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bool + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Bool"; + }; + + return Bool; + })(); + + Type.Float32 = (function() { + + /** + * Properties of a Float32. + * @memberof google.bigtable.v2.Type + * @interface IFloat32 + */ + + /** + * Constructs a new Float32. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Float32. + * @implements IFloat32 + * @constructor + * @param {google.bigtable.v2.Type.IFloat32=} [properties] Properties to set + */ + function Float32(properties) { + if (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 Float32 instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {google.bigtable.v2.Type.IFloat32=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Float32} Float32 instance + */ + Float32.create = function create(properties) { + return new Float32(properties); + }; + + /** + * Encodes the specified Float32 message. Does not implicitly {@link google.bigtable.v2.Type.Float32.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {google.bigtable.v2.Type.IFloat32} message Float32 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float32.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Float32 message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Float32.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {google.bigtable.v2.Type.IFloat32} message Float32 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float32.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Float32 message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Float32} Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float32.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Float32(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Float32 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Float32} Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float32.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Float32 message. + * @function verify + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Float32.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Float32 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Float32} Float32 + */ + Float32.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Float32) + return object; + return new $root.google.bigtable.v2.Type.Float32(); + }; + + /** + * Creates a plain object from a Float32 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {google.bigtable.v2.Type.Float32} message Float32 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Float32.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Float32 to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Float32 + * @instance + * @returns {Object.} JSON object + */ + Float32.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Float32 + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Float32.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Float32"; + }; + + return Float32; + })(); + + Type.Float64 = (function() { + + /** + * Properties of a Float64. + * @memberof google.bigtable.v2.Type + * @interface IFloat64 + */ + + /** + * Constructs a new Float64. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Float64. + * @implements IFloat64 + * @constructor + * @param {google.bigtable.v2.Type.IFloat64=} [properties] Properties to set + */ + function Float64(properties) { + if (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 Float64 instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {google.bigtable.v2.Type.IFloat64=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Float64} Float64 instance + */ + Float64.create = function create(properties) { + return new Float64(properties); + }; + + /** + * Encodes the specified Float64 message. Does not implicitly {@link google.bigtable.v2.Type.Float64.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {google.bigtable.v2.Type.IFloat64} message Float64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float64.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Float64 message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Float64.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {google.bigtable.v2.Type.IFloat64} message Float64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float64.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Float64 message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Float64} Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float64.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Float64(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Float64 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Float64} Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float64.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Float64 message. + * @function verify + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Float64.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Float64 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Float64} Float64 + */ + Float64.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Float64) + return object; + return new $root.google.bigtable.v2.Type.Float64(); + }; + + /** + * Creates a plain object from a Float64 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {google.bigtable.v2.Type.Float64} message Float64 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Float64.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Float64 to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Float64 + * @instance + * @returns {Object.} JSON object + */ + Float64.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Float64 + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Float64.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Float64"; + }; + + return Float64; + })(); + + Type.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.bigtable.v2.Type + * @interface ITimestamp + * @property {google.bigtable.v2.Type.Timestamp.IEncoding|null} [encoding] Timestamp encoding + */ + + /** + * Constructs a new Timestamp. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.bigtable.v2.Type.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 encoding. + * @member {google.bigtable.v2.Type.Timestamp.IEncoding|null|undefined} encoding + * @memberof google.bigtable.v2.Type.Timestamp + * @instance + */ + Timestamp.prototype.encoding = null; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Timestamp + * @static + * @param {google.bigtable.v2.Type.ITimestamp=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.bigtable.v2.Type.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Timestamp + * @static + * @param {google.bigtable.v2.Type.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.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.v2.Type.Timestamp.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Timestamp + * @static + * @param {google.bigtable.v2.Type.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.bigtable.v2.Type.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.v2.Type.Timestamp.Encoding.decode(reader, reader.uint32()); + 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.bigtable.v2.Type.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.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.bigtable.v2.Type.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.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.v2.Type.Timestamp.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Timestamp) + return object; + var message = new $root.google.bigtable.v2.Type.Timestamp(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.v2.Type.Timestamp.encoding: object expected"); + message.encoding = $root.google.bigtable.v2.Type.Timestamp.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Timestamp + * @static + * @param {google.bigtable.v2.Type.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) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.v2.Type.Timestamp.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Timestamp"; + }; + + Timestamp.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.v2.Type.Timestamp + * @interface IEncoding + * @property {google.bigtable.v2.Type.Int64.IEncoding|null} [unixMicrosInt64] Encoding unixMicrosInt64 + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.v2.Type.Timestamp + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.v2.Type.Timestamp.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding unixMicrosInt64. + * @member {google.bigtable.v2.Type.Int64.IEncoding|null|undefined} unixMicrosInt64 + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @instance + */ + Encoding.prototype.unixMicrosInt64 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"unixMicrosInt64"|undefined} encoding + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["unixMicrosInt64"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.v2.Type.Timestamp.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Timestamp.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.v2.Type.Timestamp.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unixMicrosInt64 != null && Object.hasOwnProperty.call(message, "unixMicrosInt64")) + $root.google.bigtable.v2.Type.Int64.Encoding.encode(message.unixMicrosInt64, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.v2.Type.Timestamp.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Timestamp.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Timestamp.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.unixMicrosInt64 = $root.google.bigtable.v2.Type.Int64.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Timestamp.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.unixMicrosInt64 != null && message.hasOwnProperty("unixMicrosInt64")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Int64.Encoding.verify(message.unixMicrosInt64); + if (error) + return "unixMicrosInt64." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Timestamp.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Timestamp.Encoding) + return object; + var message = new $root.google.bigtable.v2.Type.Timestamp.Encoding(); + if (object.unixMicrosInt64 != null) { + if (typeof object.unixMicrosInt64 !== "object") + throw TypeError(".google.bigtable.v2.Type.Timestamp.Encoding.unixMicrosInt64: object expected"); + message.unixMicrosInt64 = $root.google.bigtable.v2.Type.Int64.Encoding.fromObject(object.unixMicrosInt64); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.v2.Type.Timestamp.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.unixMicrosInt64 != null && message.hasOwnProperty("unixMicrosInt64")) { + object.unixMicrosInt64 = $root.google.bigtable.v2.Type.Int64.Encoding.toObject(message.unixMicrosInt64, options); + if (options.oneofs) + object.encoding = "unixMicrosInt64"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Timestamp.Encoding"; + }; + + return Encoding; + })(); + + return Timestamp; + })(); + + Type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.bigtable.v2.Type + * @interface IDate + */ + + /** + * Constructs a new Date. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.bigtable.v2.Type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {google.bigtable.v2.Type.IDate=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.bigtable.v2.Type.Date.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {google.bigtable.v2.Type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {google.bigtable.v2.Type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Date) + return object; + return new $root.google.bigtable.v2.Type.Date(); + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {google.bigtable.v2.Type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Date"; + }; + + return Date; + })(); + + Type.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.bigtable.v2.Type + * @interface IStruct + * @property {Array.|null} [fields] Struct fields + * @property {google.bigtable.v2.Type.Struct.IEncoding|null} [encoding] Struct encoding + */ + + /** + * Constructs a new Struct. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.bigtable.v2.Type.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Array.} fields + * @memberof google.bigtable.v2.Type.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyArray; + + /** + * Struct encoding. + * @member {google.bigtable.v2.Type.Struct.IEncoding|null|undefined} encoding + * @memberof google.bigtable.v2.Type.Struct + * @instance + */ + Struct.prototype.encoding = null; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {google.bigtable.v2.Type.IStruct=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.bigtable.v2.Type.Struct.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {google.bigtable.v2.Type.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.bigtable.v2.Type.Struct.Field.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.v2.Type.Struct.Encoding.encode(message.encoding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {google.bigtable.v2.Type.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Struct(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.bigtable.v2.Type.Struct.Field.decode(reader, reader.uint32())); + break; + } + case 2: { + message.encoding = $root.google.bigtable.v2.Type.Struct.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.bigtable.v2.Type.Struct.Field.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.v2.Type.Struct.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Struct) + return object; + var message = new $root.google.bigtable.v2.Type.Struct(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.bigtable.v2.Type.Struct.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.bigtable.v2.Type.Struct.fields: object expected"); + message.fields[i] = $root.google.bigtable.v2.Type.Struct.Field.fromObject(object.fields[i]); + } + } + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.v2.Type.Struct.encoding: object expected"); + message.encoding = $root.google.bigtable.v2.Type.Struct.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {google.bigtable.v2.Type.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) + object.encoding = null; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.bigtable.v2.Type.Struct.Field.toObject(message.fields[j], options); + } + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.v2.Type.Struct.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Struct"; + }; + + Struct.Field = (function() { + + /** + * Properties of a Field. + * @memberof google.bigtable.v2.Type.Struct + * @interface IField + * @property {string|null} [fieldName] Field fieldName + * @property {google.bigtable.v2.IType|null} [type] Field type + */ + + /** + * Constructs a new Field. + * @memberof google.bigtable.v2.Type.Struct + * @classdesc Represents a Field. + * @implements IField + * @constructor + * @param {google.bigtable.v2.Type.Struct.IField=} [properties] Properties to set + */ + function Field(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Field fieldName. + * @member {string} fieldName + * @memberof google.bigtable.v2.Type.Struct.Field + * @instance + */ + Field.prototype.fieldName = ""; + + /** + * Field type. + * @member {google.bigtable.v2.IType|null|undefined} type + * @memberof google.bigtable.v2.Type.Struct.Field + * @instance + */ + Field.prototype.type = null; + + /** + * Creates a new Field instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {google.bigtable.v2.Type.Struct.IField=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Struct.Field} Field instance + */ + Field.create = function create(properties) { + return new Field(properties); + }; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Field.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {google.bigtable.v2.Type.Struct.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.bigtable.v2.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Field.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {google.bigtable.v2.Type.Struct.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Field message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Struct.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Struct.Field(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 2: { + message.type = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Struct.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Field message. + * @function verify + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Field.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.bigtable.v2.Type.verify(message.type); + if (error) + return "type." + error; + } + return null; + }; + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Struct.Field} Field + */ + Field.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Struct.Field) + return object; + var message = new $root.google.bigtable.v2.Type.Struct.Field(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.bigtable.v2.Type.Struct.Field.type: object expected"); + message.type = $root.google.bigtable.v2.Type.fromObject(object.type); + } + return message; + }; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {google.bigtable.v2.Type.Struct.Field} message Field + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Field.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldName = ""; + object.type = null; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.bigtable.v2.Type.toObject(message.type, options); + return object; + }; + + /** + * Converts this Field to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Struct.Field + * @instance + * @returns {Object.} JSON object + */ + Field.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Field + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Struct.Field"; + }; + + return Field; + })(); + + Struct.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.v2.Type.Struct + * @interface IEncoding + * @property {google.bigtable.v2.Type.Struct.Encoding.ISingleton|null} [singleton] Encoding singleton + * @property {google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes|null} [delimitedBytes] Encoding delimitedBytes + * @property {google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes|null} [orderedCodeBytes] Encoding orderedCodeBytes + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.v2.Type.Struct + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.v2.Type.Struct.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding singleton. + * @member {google.bigtable.v2.Type.Struct.Encoding.ISingleton|null|undefined} singleton + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @instance + */ + Encoding.prototype.singleton = null; + + /** + * Encoding delimitedBytes. + * @member {google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes|null|undefined} delimitedBytes + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @instance + */ + Encoding.prototype.delimitedBytes = null; + + /** + * Encoding orderedCodeBytes. + * @member {google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes|null|undefined} orderedCodeBytes + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @instance + */ + Encoding.prototype.orderedCodeBytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"singleton"|"delimitedBytes"|"orderedCodeBytes"|undefined} encoding + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["singleton", "delimitedBytes", "orderedCodeBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.v2.Type.Struct.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Struct.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.v2.Type.Struct.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.singleton != null && Object.hasOwnProperty.call(message, "singleton")) + $root.google.bigtable.v2.Type.Struct.Encoding.Singleton.encode(message.singleton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.delimitedBytes != null && Object.hasOwnProperty.call(message, "delimitedBytes")) + $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.encode(message.delimitedBytes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.orderedCodeBytes != null && Object.hasOwnProperty.call(message, "orderedCodeBytes")) + $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.encode(message.orderedCodeBytes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.v2.Type.Struct.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Struct.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Struct.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.singleton = $root.google.bigtable.v2.Type.Struct.Encoding.Singleton.decode(reader, reader.uint32()); + break; + } + case 2: { + message.delimitedBytes = $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.decode(reader, reader.uint32()); + break; + } + case 3: { + message.orderedCodeBytes = $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Struct.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.singleton != null && message.hasOwnProperty("singleton")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Struct.Encoding.Singleton.verify(message.singleton); + if (error) + return "singleton." + error; + } + } + if (message.delimitedBytes != null && message.hasOwnProperty("delimitedBytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.verify(message.delimitedBytes); + if (error) + return "delimitedBytes." + error; + } + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.verify(message.orderedCodeBytes); + if (error) + return "orderedCodeBytes." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Struct.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Struct.Encoding) + return object; + var message = new $root.google.bigtable.v2.Type.Struct.Encoding(); + if (object.singleton != null) { + if (typeof object.singleton !== "object") + throw TypeError(".google.bigtable.v2.Type.Struct.Encoding.singleton: object expected"); + message.singleton = $root.google.bigtable.v2.Type.Struct.Encoding.Singleton.fromObject(object.singleton); + } + if (object.delimitedBytes != null) { + if (typeof object.delimitedBytes !== "object") + throw TypeError(".google.bigtable.v2.Type.Struct.Encoding.delimitedBytes: object expected"); + message.delimitedBytes = $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.fromObject(object.delimitedBytes); + } + if (object.orderedCodeBytes != null) { + if (typeof object.orderedCodeBytes !== "object") + throw TypeError(".google.bigtable.v2.Type.Struct.Encoding.orderedCodeBytes: object expected"); + message.orderedCodeBytes = $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.fromObject(object.orderedCodeBytes); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.singleton != null && message.hasOwnProperty("singleton")) { + object.singleton = $root.google.bigtable.v2.Type.Struct.Encoding.Singleton.toObject(message.singleton, options); + if (options.oneofs) + object.encoding = "singleton"; + } + if (message.delimitedBytes != null && message.hasOwnProperty("delimitedBytes")) { + object.delimitedBytes = $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.toObject(message.delimitedBytes, options); + if (options.oneofs) + object.encoding = "delimitedBytes"; + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + object.orderedCodeBytes = $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.toObject(message.orderedCodeBytes, options); + if (options.oneofs) + object.encoding = "orderedCodeBytes"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Struct.Encoding"; + }; + + Encoding.Singleton = (function() { + + /** + * Properties of a Singleton. + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @interface ISingleton + */ + + /** + * Constructs a new Singleton. + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @classdesc Represents a Singleton. + * @implements ISingleton + * @constructor + * @param {google.bigtable.v2.Type.Struct.Encoding.ISingleton=} [properties] Properties to set + */ + function Singleton(properties) { + if (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 Singleton instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.ISingleton=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Struct.Encoding.Singleton} Singleton instance + */ + Singleton.create = function create(properties) { + return new Singleton(properties); + }; + + /** + * Encodes the specified Singleton message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.ISingleton} message Singleton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Singleton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Singleton message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.ISingleton} message Singleton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Singleton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Singleton message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Struct.Encoding.Singleton} Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Singleton.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Struct.Encoding.Singleton(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Singleton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Struct.Encoding.Singleton} Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Singleton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Singleton message. + * @function verify + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Singleton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Singleton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Struct.Encoding.Singleton} Singleton + */ + Singleton.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Struct.Encoding.Singleton) + return object; + return new $root.google.bigtable.v2.Type.Struct.Encoding.Singleton(); + }; + + /** + * Creates a plain object from a Singleton message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.Singleton} message Singleton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Singleton.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Singleton to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @instance + * @returns {Object.} JSON object + */ + Singleton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Singleton + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Singleton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Struct.Encoding.Singleton"; + }; + + return Singleton; + })(); + + Encoding.DelimitedBytes = (function() { + + /** + * Properties of a DelimitedBytes. + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @interface IDelimitedBytes + * @property {Uint8Array|null} [delimiter] DelimitedBytes delimiter + */ + + /** + * Constructs a new DelimitedBytes. + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @classdesc Represents a DelimitedBytes. + * @implements IDelimitedBytes + * @constructor + * @param {google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes=} [properties] Properties to set + */ + function DelimitedBytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DelimitedBytes delimiter. + * @member {Uint8Array} delimiter + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @instance + */ + DelimitedBytes.prototype.delimiter = $util.newBuffer([]); + + /** + * Creates a new DelimitedBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes instance + */ + DelimitedBytes.create = function create(properties) { + return new DelimitedBytes(properties); + }; + + /** + * Encodes the specified DelimitedBytes message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes} message DelimitedBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelimitedBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.delimiter); + return writer; + }; + + /** + * Encodes the specified DelimitedBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes} message DelimitedBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelimitedBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelimitedBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.delimiter = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelimitedBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DelimitedBytes message. + * @function verify + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DelimitedBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + if (!(message.delimiter && typeof message.delimiter.length === "number" || $util.isString(message.delimiter))) + return "delimiter: buffer expected"; + return null; + }; + + /** + * Creates a DelimitedBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes + */ + DelimitedBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) + return object; + var message = new $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes(); + if (object.delimiter != null) + if (typeof object.delimiter === "string") + $util.base64.decode(object.delimiter, message.delimiter = $util.newBuffer($util.base64.length(object.delimiter)), 0); + else if (object.delimiter.length >= 0) + message.delimiter = object.delimiter; + return message; + }; + + /** + * Creates a plain object from a DelimitedBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes} message DelimitedBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DelimitedBytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.delimiter = ""; + else { + object.delimiter = []; + if (options.bytes !== Array) + object.delimiter = $util.newBuffer(object.delimiter); + } + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + object.delimiter = options.bytes === String ? $util.base64.encode(message.delimiter, 0, message.delimiter.length) : options.bytes === Array ? Array.prototype.slice.call(message.delimiter) : message.delimiter; + return object; + }; + + /** + * Converts this DelimitedBytes to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @instance + * @returns {Object.} JSON object + */ + DelimitedBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DelimitedBytes + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DelimitedBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes"; + }; + + return DelimitedBytes; + })(); + + Encoding.OrderedCodeBytes = (function() { + + /** + * Properties of an OrderedCodeBytes. + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @interface IOrderedCodeBytes + */ + + /** + * Constructs a new OrderedCodeBytes. + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @classdesc Represents an OrderedCodeBytes. + * @implements IOrderedCodeBytes + * @constructor + * @param {google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes=} [properties] Properties to set + */ + function OrderedCodeBytes(properties) { + if (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 OrderedCodeBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes instance + */ + OrderedCodeBytes.create = function create(properties) { + return new OrderedCodeBytes(properties); + }; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrderedCodeBytes message. + * @function verify + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrderedCodeBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes + */ + OrderedCodeBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) + return object; + return new $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes(); + }; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes} message OrderedCodeBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrderedCodeBytes.toObject = function toObject() { + return {}; + }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @instance + * @returns {Object.} JSON object + */ + OrderedCodeBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrderedCodeBytes + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrderedCodeBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes"; + }; + + return OrderedCodeBytes; + })(); + + return Encoding; + })(); + + return Struct; + })(); + + Type.Proto = (function() { + + /** + * Properties of a Proto. + * @memberof google.bigtable.v2.Type + * @interface IProto + * @property {string|null} [schemaBundleId] Proto schemaBundleId + * @property {string|null} [messageName] Proto messageName + */ + + /** + * Constructs a new Proto. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Proto. + * @implements IProto + * @constructor + * @param {google.bigtable.v2.Type.IProto=} [properties] Properties to set + */ + function Proto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proto schemaBundleId. + * @member {string} schemaBundleId + * @memberof google.bigtable.v2.Type.Proto + * @instance + */ + Proto.prototype.schemaBundleId = ""; + + /** + * Proto messageName. + * @member {string} messageName + * @memberof google.bigtable.v2.Type.Proto + * @instance + */ + Proto.prototype.messageName = ""; + + /** + * Creates a new Proto instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {google.bigtable.v2.Type.IProto=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Proto} Proto instance + */ + Proto.create = function create(properties) { + return new Proto(properties); + }; + + /** + * Encodes the specified Proto message. Does not implicitly {@link google.bigtable.v2.Type.Proto.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {google.bigtable.v2.Type.IProto} message Proto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schemaBundleId); + if (message.messageName != null && Object.hasOwnProperty.call(message, "messageName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.messageName); + return writer; + }; + + /** + * Encodes the specified Proto message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Proto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {google.bigtable.v2.Type.IProto} message Proto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proto message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Proto} Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Proto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schemaBundleId = reader.string(); + break; + } + case 2: { + message.messageName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Proto} Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proto message. + * @function verify + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + if (!$util.isString(message.schemaBundleId)) + return "schemaBundleId: string expected"; + if (message.messageName != null && message.hasOwnProperty("messageName")) + if (!$util.isString(message.messageName)) + return "messageName: string expected"; + return null; + }; + + /** + * Creates a Proto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Proto} Proto + */ + Proto.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Proto) + return object; + var message = new $root.google.bigtable.v2.Type.Proto(); + if (object.schemaBundleId != null) + message.schemaBundleId = String(object.schemaBundleId); + if (object.messageName != null) + message.messageName = String(object.messageName); + return message; + }; + + /** + * Creates a plain object from a Proto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {google.bigtable.v2.Type.Proto} message Proto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schemaBundleId = ""; + object.messageName = ""; + } + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + object.schemaBundleId = message.schemaBundleId; + if (message.messageName != null && message.hasOwnProperty("messageName")) + object.messageName = message.messageName; + return object; + }; + + /** + * Converts this Proto to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Proto + * @instance + * @returns {Object.} JSON object + */ + Proto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Proto + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Proto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Proto"; + }; + + return Proto; + })(); + + Type.Enum = (function() { + + /** + * Properties of an Enum. + * @memberof google.bigtable.v2.Type + * @interface IEnum + * @property {string|null} [schemaBundleId] Enum schemaBundleId + * @property {string|null} [enumName] Enum enumName + */ + + /** + * Constructs a new Enum. + * @memberof google.bigtable.v2.Type + * @classdesc Represents an Enum. + * @implements IEnum + * @constructor + * @param {google.bigtable.v2.Type.IEnum=} [properties] Properties to set + */ + function Enum(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Enum schemaBundleId. + * @member {string} schemaBundleId + * @memberof google.bigtable.v2.Type.Enum + * @instance + */ + Enum.prototype.schemaBundleId = ""; + + /** + * Enum enumName. + * @member {string} enumName + * @memberof google.bigtable.v2.Type.Enum + * @instance + */ + Enum.prototype.enumName = ""; + + /** + * Creates a new Enum instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {google.bigtable.v2.Type.IEnum=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Enum} Enum instance + */ + Enum.create = function create(properties) { + return new Enum(properties); + }; + + /** + * Encodes the specified Enum message. Does not implicitly {@link google.bigtable.v2.Type.Enum.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {google.bigtable.v2.Type.IEnum} message Enum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Enum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schemaBundleId); + if (message.enumName != null && Object.hasOwnProperty.call(message, "enumName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.enumName); + return writer; + }; + + /** + * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Enum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {google.bigtable.v2.Type.IEnum} message Enum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Enum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Enum message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Enum} Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Enum.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Enum(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schemaBundleId = reader.string(); + break; + } + case 2: { + message.enumName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Enum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Enum} Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Enum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Enum message. + * @function verify + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Enum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + if (!$util.isString(message.schemaBundleId)) + return "schemaBundleId: string expected"; + if (message.enumName != null && message.hasOwnProperty("enumName")) + if (!$util.isString(message.enumName)) + return "enumName: string expected"; + return null; + }; + + /** + * Creates an Enum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Enum} Enum + */ + Enum.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Enum) + return object; + var message = new $root.google.bigtable.v2.Type.Enum(); + if (object.schemaBundleId != null) + message.schemaBundleId = String(object.schemaBundleId); + if (object.enumName != null) + message.enumName = String(object.enumName); + return message; + }; + + /** + * Creates a plain object from an Enum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {google.bigtable.v2.Type.Enum} message Enum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Enum.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schemaBundleId = ""; + object.enumName = ""; + } + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + object.schemaBundleId = message.schemaBundleId; + if (message.enumName != null && message.hasOwnProperty("enumName")) + object.enumName = message.enumName; + return object; + }; + + /** + * Converts this Enum to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Enum + * @instance + * @returns {Object.} JSON object + */ + Enum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Enum + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Enum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Enum"; + }; + + return Enum; + })(); + + Type.Array = (function() { + + /** + * Properties of an Array. + * @memberof google.bigtable.v2.Type + * @interface IArray + * @property {google.bigtable.v2.IType|null} [elementType] Array elementType + */ + + /** + * Constructs a new Array. + * @memberof google.bigtable.v2.Type + * @classdesc Represents an Array. + * @implements IArray + * @constructor + * @param {google.bigtable.v2.Type.IArray=} [properties] Properties to set + */ + function Array(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Array elementType. + * @member {google.bigtable.v2.IType|null|undefined} elementType + * @memberof google.bigtable.v2.Type.Array + * @instance + */ + Array.prototype.elementType = null; + + /** + * Creates a new Array instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {google.bigtable.v2.Type.IArray=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Array} Array instance + */ + Array.create = function create(properties) { + return new Array(properties); + }; + + /** + * Encodes the specified Array message. Does not implicitly {@link google.bigtable.v2.Type.Array.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {google.bigtable.v2.Type.IArray} message Array message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Array.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.elementType != null && Object.hasOwnProperty.call(message, "elementType")) + $root.google.bigtable.v2.Type.encode(message.elementType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Array message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Array.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {google.bigtable.v2.Type.IArray} message Array message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Array.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Array message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Array} Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Array.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Array(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.elementType = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Array message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Array} Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Array.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Array message. + * @function verify + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Array.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.elementType != null && message.hasOwnProperty("elementType")) { + var error = $root.google.bigtable.v2.Type.verify(message.elementType); + if (error) + return "elementType." + error; + } + return null; + }; + + /** + * Creates an Array message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Array} Array + */ + Array.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Array) + return object; + var message = new $root.google.bigtable.v2.Type.Array(); + if (object.elementType != null) { + if (typeof object.elementType !== "object") + throw TypeError(".google.bigtable.v2.Type.Array.elementType: object expected"); + message.elementType = $root.google.bigtable.v2.Type.fromObject(object.elementType); + } + return message; + }; + + /** + * Creates a plain object from an Array message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {google.bigtable.v2.Type.Array} message Array + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Array.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.elementType = null; + if (message.elementType != null && message.hasOwnProperty("elementType")) + object.elementType = $root.google.bigtable.v2.Type.toObject(message.elementType, options); + return object; + }; + + /** + * Converts this Array to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Array + * @instance + * @returns {Object.} JSON object + */ + Array.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Array + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Array.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Array"; + }; + + return Array; + })(); + + Type.Map = (function() { + + /** + * Properties of a Map. + * @memberof google.bigtable.v2.Type + * @interface IMap + * @property {google.bigtable.v2.IType|null} [keyType] Map keyType + * @property {google.bigtable.v2.IType|null} [valueType] Map valueType + */ + + /** + * Constructs a new Map. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Map. + * @implements IMap + * @constructor + * @param {google.bigtable.v2.Type.IMap=} [properties] Properties to set + */ + function Map(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Map keyType. + * @member {google.bigtable.v2.IType|null|undefined} keyType + * @memberof google.bigtable.v2.Type.Map + * @instance + */ + Map.prototype.keyType = null; + + /** + * Map valueType. + * @member {google.bigtable.v2.IType|null|undefined} valueType + * @memberof google.bigtable.v2.Type.Map + * @instance + */ + Map.prototype.valueType = null; + + /** + * Creates a new Map instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {google.bigtable.v2.Type.IMap=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Map} Map instance + */ + Map.create = function create(properties) { + return new Map(properties); + }; + + /** + * Encodes the specified Map message. Does not implicitly {@link google.bigtable.v2.Type.Map.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {google.bigtable.v2.Type.IMap} message Map message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Map.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyType != null && Object.hasOwnProperty.call(message, "keyType")) + $root.google.bigtable.v2.Type.encode(message.keyType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + $root.google.bigtable.v2.Type.encode(message.valueType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Map message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Map.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {google.bigtable.v2.Type.IMap} message Map message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Map.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Map message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Map} Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Map.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Map(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyType = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + case 2: { + message.valueType = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Map message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Map} Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Map.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Map message. + * @function verify + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Map.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyType != null && message.hasOwnProperty("keyType")) { + var error = $root.google.bigtable.v2.Type.verify(message.keyType); + if (error) + return "keyType." + error; + } + if (message.valueType != null && message.hasOwnProperty("valueType")) { + var error = $root.google.bigtable.v2.Type.verify(message.valueType); + if (error) + return "valueType." + error; + } + return null; + }; + + /** + * Creates a Map message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Map} Map + */ + Map.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Map) + return object; + var message = new $root.google.bigtable.v2.Type.Map(); + if (object.keyType != null) { + if (typeof object.keyType !== "object") + throw TypeError(".google.bigtable.v2.Type.Map.keyType: object expected"); + message.keyType = $root.google.bigtable.v2.Type.fromObject(object.keyType); + } + if (object.valueType != null) { + if (typeof object.valueType !== "object") + throw TypeError(".google.bigtable.v2.Type.Map.valueType: object expected"); + message.valueType = $root.google.bigtable.v2.Type.fromObject(object.valueType); + } + return message; + }; + + /** + * Creates a plain object from a Map message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {google.bigtable.v2.Type.Map} message Map + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Map.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyType = null; + object.valueType = null; + } + if (message.keyType != null && message.hasOwnProperty("keyType")) + object.keyType = $root.google.bigtable.v2.Type.toObject(message.keyType, options); + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = $root.google.bigtable.v2.Type.toObject(message.valueType, options); + return object; + }; + + /** + * Converts this Map to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Map + * @instance + * @returns {Object.} JSON object + */ + Map.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Map + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Map.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Map"; + }; + + return Map; + })(); + + Type.Aggregate = (function() { + + /** + * Properties of an Aggregate. + * @memberof google.bigtable.v2.Type + * @interface IAggregate + * @property {google.bigtable.v2.IType|null} [inputType] Aggregate inputType + * @property {google.bigtable.v2.IType|null} [stateType] Aggregate stateType + * @property {google.bigtable.v2.Type.Aggregate.ISum|null} [sum] Aggregate sum + * @property {google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null} [hllppUniqueCount] Aggregate hllppUniqueCount + * @property {google.bigtable.v2.Type.Aggregate.IMax|null} [max] Aggregate max + * @property {google.bigtable.v2.Type.Aggregate.IMin|null} [min] Aggregate min + */ + + /** + * Constructs a new Aggregate. + * @memberof google.bigtable.v2.Type + * @classdesc Represents an Aggregate. + * @implements IAggregate + * @constructor + * @param {google.bigtable.v2.Type.IAggregate=} [properties] Properties to set + */ + function Aggregate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Aggregate inputType. + * @member {google.bigtable.v2.IType|null|undefined} inputType + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.inputType = null; + + /** + * Aggregate stateType. + * @member {google.bigtable.v2.IType|null|undefined} stateType + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.stateType = null; + + /** + * Aggregate sum. + * @member {google.bigtable.v2.Type.Aggregate.ISum|null|undefined} sum + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.sum = null; + + /** + * Aggregate hllppUniqueCount. + * @member {google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null|undefined} hllppUniqueCount + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.hllppUniqueCount = null; + + /** + * Aggregate max. + * @member {google.bigtable.v2.Type.Aggregate.IMax|null|undefined} max + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.max = null; + + /** + * Aggregate min. + * @member {google.bigtable.v2.Type.Aggregate.IMin|null|undefined} min + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.min = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Aggregate aggregator. + * @member {"sum"|"hllppUniqueCount"|"max"|"min"|undefined} aggregator + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Object.defineProperty(Aggregate.prototype, "aggregator", { + get: $util.oneOfGetter($oneOfFields = ["sum", "hllppUniqueCount", "max", "min"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Aggregate instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {google.bigtable.v2.Type.IAggregate=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Aggregate} Aggregate instance + */ + Aggregate.create = function create(properties) { + return new Aggregate(properties); + }; + + /** + * Encodes the specified Aggregate message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {google.bigtable.v2.Type.IAggregate} message Aggregate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + $root.google.bigtable.v2.Type.encode(message.inputType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateType != null && Object.hasOwnProperty.call(message, "stateType")) + $root.google.bigtable.v2.Type.encode(message.stateType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + $root.google.bigtable.v2.Type.Aggregate.Sum.encode(message.sum, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hllppUniqueCount != null && Object.hasOwnProperty.call(message, "hllppUniqueCount")) + $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.encode(message.hllppUniqueCount, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + $root.google.bigtable.v2.Type.Aggregate.Max.encode(message.max, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + $root.google.bigtable.v2.Type.Aggregate.Min.encode(message.min, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Aggregate message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {google.bigtable.v2.Type.IAggregate} message Aggregate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Aggregate message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Aggregate} Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Aggregate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputType = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stateType = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + case 4: { + message.sum = $root.google.bigtable.v2.Type.Aggregate.Sum.decode(reader, reader.uint32()); + break; + } + case 5: { + message.hllppUniqueCount = $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.decode(reader, reader.uint32()); + break; + } + case 6: { + message.max = $root.google.bigtable.v2.Type.Aggregate.Max.decode(reader, reader.uint32()); + break; + } + case 7: { + message.min = $root.google.bigtable.v2.Type.Aggregate.Min.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Aggregate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Aggregate} Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Aggregate message. + * @function verify + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Aggregate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inputType != null && message.hasOwnProperty("inputType")) { + var error = $root.google.bigtable.v2.Type.verify(message.inputType); + if (error) + return "inputType." + error; + } + if (message.stateType != null && message.hasOwnProperty("stateType")) { + var error = $root.google.bigtable.v2.Type.verify(message.stateType); + if (error) + return "stateType." + error; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + properties.aggregator = 1; + { + var error = $root.google.bigtable.v2.Type.Aggregate.Sum.verify(message.sum); + if (error) + return "sum." + error; + } + } + if (message.hllppUniqueCount != null && message.hasOwnProperty("hllppUniqueCount")) { + if (properties.aggregator === 1) + return "aggregator: multiple values"; + properties.aggregator = 1; + { + var error = $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify(message.hllppUniqueCount); + if (error) + return "hllppUniqueCount." + error; + } + } + if (message.max != null && message.hasOwnProperty("max")) { + if (properties.aggregator === 1) + return "aggregator: multiple values"; + properties.aggregator = 1; + { + var error = $root.google.bigtable.v2.Type.Aggregate.Max.verify(message.max); + if (error) + return "max." + error; + } + } + if (message.min != null && message.hasOwnProperty("min")) { + if (properties.aggregator === 1) + return "aggregator: multiple values"; + properties.aggregator = 1; + { + var error = $root.google.bigtable.v2.Type.Aggregate.Min.verify(message.min); + if (error) + return "min." + error; + } + } + return null; + }; + + /** + * Creates an Aggregate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Aggregate} Aggregate + */ + Aggregate.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Aggregate) + return object; + var message = new $root.google.bigtable.v2.Type.Aggregate(); + if (object.inputType != null) { + if (typeof object.inputType !== "object") + throw TypeError(".google.bigtable.v2.Type.Aggregate.inputType: object expected"); + message.inputType = $root.google.bigtable.v2.Type.fromObject(object.inputType); + } + if (object.stateType != null) { + if (typeof object.stateType !== "object") + throw TypeError(".google.bigtable.v2.Type.Aggregate.stateType: object expected"); + message.stateType = $root.google.bigtable.v2.Type.fromObject(object.stateType); + } + if (object.sum != null) { + if (typeof object.sum !== "object") + throw TypeError(".google.bigtable.v2.Type.Aggregate.sum: object expected"); + message.sum = $root.google.bigtable.v2.Type.Aggregate.Sum.fromObject(object.sum); + } + if (object.hllppUniqueCount != null) { + if (typeof object.hllppUniqueCount !== "object") + throw TypeError(".google.bigtable.v2.Type.Aggregate.hllppUniqueCount: object expected"); + message.hllppUniqueCount = $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.fromObject(object.hllppUniqueCount); + } + if (object.max != null) { + if (typeof object.max !== "object") + throw TypeError(".google.bigtable.v2.Type.Aggregate.max: object expected"); + message.max = $root.google.bigtable.v2.Type.Aggregate.Max.fromObject(object.max); + } + if (object.min != null) { + if (typeof object.min !== "object") + throw TypeError(".google.bigtable.v2.Type.Aggregate.min: object expected"); + message.min = $root.google.bigtable.v2.Type.Aggregate.Min.fromObject(object.min); + } + return message; + }; + + /** + * Creates a plain object from an Aggregate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {google.bigtable.v2.Type.Aggregate} message Aggregate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Aggregate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputType = null; + object.stateType = null; + } + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = $root.google.bigtable.v2.Type.toObject(message.inputType, options); + if (message.stateType != null && message.hasOwnProperty("stateType")) + object.stateType = $root.google.bigtable.v2.Type.toObject(message.stateType, options); + if (message.sum != null && message.hasOwnProperty("sum")) { + object.sum = $root.google.bigtable.v2.Type.Aggregate.Sum.toObject(message.sum, options); + if (options.oneofs) + object.aggregator = "sum"; + } + if (message.hllppUniqueCount != null && message.hasOwnProperty("hllppUniqueCount")) { + object.hllppUniqueCount = $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.toObject(message.hllppUniqueCount, options); + if (options.oneofs) + object.aggregator = "hllppUniqueCount"; + } + if (message.max != null && message.hasOwnProperty("max")) { + object.max = $root.google.bigtable.v2.Type.Aggregate.Max.toObject(message.max, options); + if (options.oneofs) + object.aggregator = "max"; + } + if (message.min != null && message.hasOwnProperty("min")) { + object.min = $root.google.bigtable.v2.Type.Aggregate.Min.toObject(message.min, options); + if (options.oneofs) + object.aggregator = "min"; + } + return object; + }; + + /** + * Converts this Aggregate to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + * @returns {Object.} JSON object + */ + Aggregate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Aggregate + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Aggregate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Aggregate"; + }; + + Aggregate.Sum = (function() { + + /** + * Properties of a Sum. + * @memberof google.bigtable.v2.Type.Aggregate + * @interface ISum + */ + + /** + * Constructs a new Sum. + * @memberof google.bigtable.v2.Type.Aggregate + * @classdesc Represents a Sum. + * @implements ISum + * @constructor + * @param {google.bigtable.v2.Type.Aggregate.ISum=} [properties] Properties to set + */ + function Sum(properties) { + if (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 Sum instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.v2.Type.Aggregate.ISum=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Aggregate.Sum} Sum instance + */ + Sum.create = function create(properties) { + return new Sum(properties); + }; + + /** + * Encodes the specified Sum message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Sum.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.v2.Type.Aggregate.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Sum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.v2.Type.Aggregate.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sum message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Aggregate.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Aggregate.Sum(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Aggregate.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sum message. + * @function verify + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Aggregate.Sum} Sum + */ + Sum.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Aggregate.Sum) + return object; + return new $root.google.bigtable.v2.Type.Aggregate.Sum(); + }; + + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.v2.Type.Aggregate.Sum} message Sum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sum.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Sum to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @instance + * @returns {Object.} JSON object + */ + Sum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Sum + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Aggregate.Sum"; + }; + + return Sum; + })(); + + Aggregate.Max = (function() { + + /** + * Properties of a Max. + * @memberof google.bigtable.v2.Type.Aggregate + * @interface IMax + */ + + /** + * Constructs a new Max. + * @memberof google.bigtable.v2.Type.Aggregate + * @classdesc Represents a Max. + * @implements IMax + * @constructor + * @param {google.bigtable.v2.Type.Aggregate.IMax=} [properties] Properties to set + */ + function Max(properties) { + if (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 Max instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.v2.Type.Aggregate.IMax=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Aggregate.Max} Max instance + */ + Max.create = function create(properties) { + return new Max(properties); + }; + + /** + * Encodes the specified Max message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Max.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.v2.Type.Aggregate.IMax} message Max message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Max.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Max message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Max.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.v2.Type.Aggregate.IMax} message Max message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Max.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Max message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Aggregate.Max} Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Max.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Aggregate.Max(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Max message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Aggregate.Max} Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Max.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Max message. + * @function verify + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Max.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Max message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Aggregate.Max} Max + */ + Max.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Aggregate.Max) + return object; + return new $root.google.bigtable.v2.Type.Aggregate.Max(); + }; + + /** + * Creates a plain object from a Max message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.v2.Type.Aggregate.Max} message Max + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Max.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Max to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @instance + * @returns {Object.} JSON object + */ + Max.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Max + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Max.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Aggregate.Max"; + }; + + return Max; + })(); + + Aggregate.Min = (function() { + + /** + * Properties of a Min. + * @memberof google.bigtable.v2.Type.Aggregate + * @interface IMin + */ + + /** + * Constructs a new Min. + * @memberof google.bigtable.v2.Type.Aggregate + * @classdesc Represents a Min. + * @implements IMin + * @constructor + * @param {google.bigtable.v2.Type.Aggregate.IMin=} [properties] Properties to set + */ + function Min(properties) { + if (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 Min instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.v2.Type.Aggregate.IMin=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Aggregate.Min} Min instance + */ + Min.create = function create(properties) { + return new Min(properties); + }; + + /** + * Encodes the specified Min message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Min.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.v2.Type.Aggregate.IMin} message Min message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Min.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Min message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Min.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.v2.Type.Aggregate.IMin} message Min message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Min.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Min message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Aggregate.Min} Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Min.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Aggregate.Min(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Min message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Aggregate.Min} Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Min.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Min message. + * @function verify + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Min.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Min message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Aggregate.Min} Min + */ + Min.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Aggregate.Min) + return object; + return new $root.google.bigtable.v2.Type.Aggregate.Min(); + }; + + /** + * Creates a plain object from a Min message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.v2.Type.Aggregate.Min} message Min + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Min.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Min to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @instance + * @returns {Object.} JSON object + */ + Min.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Min + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Min.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Aggregate.Min"; + }; + + return Min; + })(); + + Aggregate.HyperLogLogPlusPlusUniqueCount = (function() { + + /** + * Properties of a HyperLogLogPlusPlusUniqueCount. + * @memberof google.bigtable.v2.Type.Aggregate + * @interface IHyperLogLogPlusPlusUniqueCount + */ + + /** + * Constructs a new HyperLogLogPlusPlusUniqueCount. + * @memberof google.bigtable.v2.Type.Aggregate + * @classdesc Represents a HyperLogLogPlusPlusUniqueCount. + * @implements IHyperLogLogPlusPlusUniqueCount + * @constructor + * @param {google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount=} [properties] Properties to set + */ + function HyperLogLogPlusPlusUniqueCount(properties) { + if (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 HyperLogLogPlusPlusUniqueCount instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount instance + */ + HyperLogLogPlusPlusUniqueCount.create = function create(properties) { + return new HyperLogLogPlusPlusUniqueCount(properties); + }; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount} message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HyperLogLogPlusPlusUniqueCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount} message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HyperLogLogPlusPlusUniqueCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HyperLogLogPlusPlusUniqueCount.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HyperLogLogPlusPlusUniqueCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HyperLogLogPlusPlusUniqueCount message. + * @function verify + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HyperLogLogPlusPlusUniqueCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a HyperLogLogPlusPlusUniqueCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount + */ + HyperLogLogPlusPlusUniqueCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + return object; + return new $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount(); + }; + + /** + * Creates a plain object from a HyperLogLogPlusPlusUniqueCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} message HyperLogLogPlusPlusUniqueCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HyperLogLogPlusPlusUniqueCount.toObject = function toObject() { + return {}; + }; + + /** + * Converts this HyperLogLogPlusPlusUniqueCount to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @instance + * @returns {Object.} JSON object + */ + HyperLogLogPlusPlusUniqueCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HyperLogLogPlusPlusUniqueCount + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HyperLogLogPlusPlusUniqueCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount"; + }; + + return HyperLogLogPlusPlusUniqueCount; + })(); + + return Aggregate; + })(); + + return Type; + })(); + + v2.ReadIterationStats = (function() { + + /** + * Properties of a ReadIterationStats. + * @memberof google.bigtable.v2 + * @interface IReadIterationStats + * @property {number|Long|null} [rowsSeenCount] ReadIterationStats rowsSeenCount + * @property {number|Long|null} [rowsReturnedCount] ReadIterationStats rowsReturnedCount + * @property {number|Long|null} [cellsSeenCount] ReadIterationStats cellsSeenCount + * @property {number|Long|null} [cellsReturnedCount] ReadIterationStats cellsReturnedCount + */ + + /** + * Constructs a new ReadIterationStats. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadIterationStats. + * @implements IReadIterationStats + * @constructor + * @param {google.bigtable.v2.IReadIterationStats=} [properties] Properties to set + */ + function ReadIterationStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadIterationStats rowsSeenCount. + * @member {number|Long} rowsSeenCount + * @memberof google.bigtable.v2.ReadIterationStats + * @instance + */ + ReadIterationStats.prototype.rowsSeenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadIterationStats rowsReturnedCount. + * @member {number|Long} rowsReturnedCount + * @memberof google.bigtable.v2.ReadIterationStats + * @instance + */ + ReadIterationStats.prototype.rowsReturnedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadIterationStats cellsSeenCount. + * @member {number|Long} cellsSeenCount + * @memberof google.bigtable.v2.ReadIterationStats + * @instance + */ + ReadIterationStats.prototype.cellsSeenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadIterationStats cellsReturnedCount. + * @member {number|Long} cellsReturnedCount + * @memberof google.bigtable.v2.ReadIterationStats + * @instance + */ + ReadIterationStats.prototype.cellsReturnedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ReadIterationStats instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {google.bigtable.v2.IReadIterationStats=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadIterationStats} ReadIterationStats instance + */ + ReadIterationStats.create = function create(properties) { + return new ReadIterationStats(properties); + }; + + /** + * Encodes the specified ReadIterationStats message. Does not implicitly {@link google.bigtable.v2.ReadIterationStats.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {google.bigtable.v2.IReadIterationStats} message ReadIterationStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadIterationStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowsSeenCount != null && Object.hasOwnProperty.call(message, "rowsSeenCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.rowsSeenCount); + if (message.rowsReturnedCount != null && Object.hasOwnProperty.call(message, "rowsReturnedCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowsReturnedCount); + if (message.cellsSeenCount != null && Object.hasOwnProperty.call(message, "cellsSeenCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.cellsSeenCount); + if (message.cellsReturnedCount != null && Object.hasOwnProperty.call(message, "cellsReturnedCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.cellsReturnedCount); + return writer; + }; + + /** + * Encodes the specified ReadIterationStats message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadIterationStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {google.bigtable.v2.IReadIterationStats} message ReadIterationStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadIterationStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadIterationStats message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadIterationStats} ReadIterationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadIterationStats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadIterationStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowsSeenCount = reader.int64(); + break; + } + case 2: { + message.rowsReturnedCount = reader.int64(); + break; + } + case 3: { + message.cellsSeenCount = reader.int64(); + break; + } + case 4: { + message.cellsReturnedCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadIterationStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadIterationStats} ReadIterationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadIterationStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadIterationStats message. + * @function verify + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadIterationStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowsSeenCount != null && message.hasOwnProperty("rowsSeenCount")) + if (!$util.isInteger(message.rowsSeenCount) && !(message.rowsSeenCount && $util.isInteger(message.rowsSeenCount.low) && $util.isInteger(message.rowsSeenCount.high))) + return "rowsSeenCount: integer|Long expected"; + if (message.rowsReturnedCount != null && message.hasOwnProperty("rowsReturnedCount")) + if (!$util.isInteger(message.rowsReturnedCount) && !(message.rowsReturnedCount && $util.isInteger(message.rowsReturnedCount.low) && $util.isInteger(message.rowsReturnedCount.high))) + return "rowsReturnedCount: integer|Long expected"; + if (message.cellsSeenCount != null && message.hasOwnProperty("cellsSeenCount")) + if (!$util.isInteger(message.cellsSeenCount) && !(message.cellsSeenCount && $util.isInteger(message.cellsSeenCount.low) && $util.isInteger(message.cellsSeenCount.high))) + return "cellsSeenCount: integer|Long expected"; + if (message.cellsReturnedCount != null && message.hasOwnProperty("cellsReturnedCount")) + if (!$util.isInteger(message.cellsReturnedCount) && !(message.cellsReturnedCount && $util.isInteger(message.cellsReturnedCount.low) && $util.isInteger(message.cellsReturnedCount.high))) + return "cellsReturnedCount: integer|Long expected"; + return null; + }; + + /** + * Creates a ReadIterationStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadIterationStats} ReadIterationStats + */ + ReadIterationStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadIterationStats) + return object; + var message = new $root.google.bigtable.v2.ReadIterationStats(); + if (object.rowsSeenCount != null) + if ($util.Long) + (message.rowsSeenCount = $util.Long.fromValue(object.rowsSeenCount)).unsigned = false; + else if (typeof object.rowsSeenCount === "string") + message.rowsSeenCount = parseInt(object.rowsSeenCount, 10); + else if (typeof object.rowsSeenCount === "number") + message.rowsSeenCount = object.rowsSeenCount; + else if (typeof object.rowsSeenCount === "object") + message.rowsSeenCount = new $util.LongBits(object.rowsSeenCount.low >>> 0, object.rowsSeenCount.high >>> 0).toNumber(); + if (object.rowsReturnedCount != null) + if ($util.Long) + (message.rowsReturnedCount = $util.Long.fromValue(object.rowsReturnedCount)).unsigned = false; + else if (typeof object.rowsReturnedCount === "string") + message.rowsReturnedCount = parseInt(object.rowsReturnedCount, 10); + else if (typeof object.rowsReturnedCount === "number") + message.rowsReturnedCount = object.rowsReturnedCount; + else if (typeof object.rowsReturnedCount === "object") + message.rowsReturnedCount = new $util.LongBits(object.rowsReturnedCount.low >>> 0, object.rowsReturnedCount.high >>> 0).toNumber(); + if (object.cellsSeenCount != null) + if ($util.Long) + (message.cellsSeenCount = $util.Long.fromValue(object.cellsSeenCount)).unsigned = false; + else if (typeof object.cellsSeenCount === "string") + message.cellsSeenCount = parseInt(object.cellsSeenCount, 10); + else if (typeof object.cellsSeenCount === "number") + message.cellsSeenCount = object.cellsSeenCount; + else if (typeof object.cellsSeenCount === "object") + message.cellsSeenCount = new $util.LongBits(object.cellsSeenCount.low >>> 0, object.cellsSeenCount.high >>> 0).toNumber(); + if (object.cellsReturnedCount != null) + if ($util.Long) + (message.cellsReturnedCount = $util.Long.fromValue(object.cellsReturnedCount)).unsigned = false; + else if (typeof object.cellsReturnedCount === "string") + message.cellsReturnedCount = parseInt(object.cellsReturnedCount, 10); + else if (typeof object.cellsReturnedCount === "number") + message.cellsReturnedCount = object.cellsReturnedCount; + else if (typeof object.cellsReturnedCount === "object") + message.cellsReturnedCount = new $util.LongBits(object.cellsReturnedCount.low >>> 0, object.cellsReturnedCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ReadIterationStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {google.bigtable.v2.ReadIterationStats} message ReadIterationStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadIterationStats.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.rowsSeenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowsSeenCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowsReturnedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowsReturnedCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.cellsSeenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.cellsSeenCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.cellsReturnedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.cellsReturnedCount = options.longs === String ? "0" : 0; + } + if (message.rowsSeenCount != null && message.hasOwnProperty("rowsSeenCount")) + if (typeof message.rowsSeenCount === "number") + object.rowsSeenCount = options.longs === String ? String(message.rowsSeenCount) : message.rowsSeenCount; + else + object.rowsSeenCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowsSeenCount) : options.longs === Number ? new $util.LongBits(message.rowsSeenCount.low >>> 0, message.rowsSeenCount.high >>> 0).toNumber() : message.rowsSeenCount; + if (message.rowsReturnedCount != null && message.hasOwnProperty("rowsReturnedCount")) + if (typeof message.rowsReturnedCount === "number") + object.rowsReturnedCount = options.longs === String ? String(message.rowsReturnedCount) : message.rowsReturnedCount; + else + object.rowsReturnedCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowsReturnedCount) : options.longs === Number ? new $util.LongBits(message.rowsReturnedCount.low >>> 0, message.rowsReturnedCount.high >>> 0).toNumber() : message.rowsReturnedCount; + if (message.cellsSeenCount != null && message.hasOwnProperty("cellsSeenCount")) + if (typeof message.cellsSeenCount === "number") + object.cellsSeenCount = options.longs === String ? String(message.cellsSeenCount) : message.cellsSeenCount; + else + object.cellsSeenCount = options.longs === String ? $util.Long.prototype.toString.call(message.cellsSeenCount) : options.longs === Number ? new $util.LongBits(message.cellsSeenCount.low >>> 0, message.cellsSeenCount.high >>> 0).toNumber() : message.cellsSeenCount; + if (message.cellsReturnedCount != null && message.hasOwnProperty("cellsReturnedCount")) + if (typeof message.cellsReturnedCount === "number") + object.cellsReturnedCount = options.longs === String ? String(message.cellsReturnedCount) : message.cellsReturnedCount; + else + object.cellsReturnedCount = options.longs === String ? $util.Long.prototype.toString.call(message.cellsReturnedCount) : options.longs === Number ? new $util.LongBits(message.cellsReturnedCount.low >>> 0, message.cellsReturnedCount.high >>> 0).toNumber() : message.cellsReturnedCount; + return object; + }; + + /** + * Converts this ReadIterationStats to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadIterationStats + * @instance + * @returns {Object.} JSON object + */ + ReadIterationStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadIterationStats + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadIterationStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadIterationStats"; + }; + + return ReadIterationStats; + })(); + + v2.RequestLatencyStats = (function() { + + /** + * Properties of a RequestLatencyStats. + * @memberof google.bigtable.v2 + * @interface IRequestLatencyStats + * @property {google.protobuf.IDuration|null} [frontendServerLatency] RequestLatencyStats frontendServerLatency + */ + + /** + * Constructs a new RequestLatencyStats. + * @memberof google.bigtable.v2 + * @classdesc Represents a RequestLatencyStats. + * @implements IRequestLatencyStats + * @constructor + * @param {google.bigtable.v2.IRequestLatencyStats=} [properties] Properties to set + */ + function RequestLatencyStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestLatencyStats frontendServerLatency. + * @member {google.protobuf.IDuration|null|undefined} frontendServerLatency + * @memberof google.bigtable.v2.RequestLatencyStats + * @instance + */ + RequestLatencyStats.prototype.frontendServerLatency = null; + + /** + * Creates a new RequestLatencyStats instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {google.bigtable.v2.IRequestLatencyStats=} [properties] Properties to set + * @returns {google.bigtable.v2.RequestLatencyStats} RequestLatencyStats instance + */ + RequestLatencyStats.create = function create(properties) { + return new RequestLatencyStats(properties); + }; + + /** + * Encodes the specified RequestLatencyStats message. Does not implicitly {@link google.bigtable.v2.RequestLatencyStats.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {google.bigtable.v2.IRequestLatencyStats} message RequestLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestLatencyStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frontendServerLatency != null && Object.hasOwnProperty.call(message, "frontendServerLatency")) + $root.google.protobuf.Duration.encode(message.frontendServerLatency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestLatencyStats message, length delimited. Does not implicitly {@link google.bigtable.v2.RequestLatencyStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {google.bigtable.v2.IRequestLatencyStats} message RequestLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestLatencyStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestLatencyStats message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RequestLatencyStats} RequestLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestLatencyStats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RequestLatencyStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.frontendServerLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestLatencyStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RequestLatencyStats} RequestLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestLatencyStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestLatencyStats message. + * @function verify + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestLatencyStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frontendServerLatency != null && message.hasOwnProperty("frontendServerLatency")) { + var error = $root.google.protobuf.Duration.verify(message.frontendServerLatency); + if (error) + return "frontendServerLatency." + error; + } + return null; + }; + + /** + * Creates a RequestLatencyStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RequestLatencyStats} RequestLatencyStats + */ + RequestLatencyStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RequestLatencyStats) + return object; + var message = new $root.google.bigtable.v2.RequestLatencyStats(); + if (object.frontendServerLatency != null) { + if (typeof object.frontendServerLatency !== "object") + throw TypeError(".google.bigtable.v2.RequestLatencyStats.frontendServerLatency: object expected"); + message.frontendServerLatency = $root.google.protobuf.Duration.fromObject(object.frontendServerLatency); + } + return message; + }; + + /** + * Creates a plain object from a RequestLatencyStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {google.bigtable.v2.RequestLatencyStats} message RequestLatencyStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestLatencyStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.frontendServerLatency = null; + if (message.frontendServerLatency != null && message.hasOwnProperty("frontendServerLatency")) + object.frontendServerLatency = $root.google.protobuf.Duration.toObject(message.frontendServerLatency, options); + return object; + }; + + /** + * Converts this RequestLatencyStats to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RequestLatencyStats + * @instance + * @returns {Object.} JSON object + */ + RequestLatencyStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestLatencyStats + * @function getTypeUrl + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestLatencyStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RequestLatencyStats"; + }; + + return RequestLatencyStats; + })(); + + v2.FullReadStatsView = (function() { + + /** + * Properties of a FullReadStatsView. + * @memberof google.bigtable.v2 + * @interface IFullReadStatsView + * @property {google.bigtable.v2.IReadIterationStats|null} [readIterationStats] FullReadStatsView readIterationStats + * @property {google.bigtable.v2.IRequestLatencyStats|null} [requestLatencyStats] FullReadStatsView requestLatencyStats + */ + + /** + * Constructs a new FullReadStatsView. + * @memberof google.bigtable.v2 + * @classdesc Represents a FullReadStatsView. + * @implements IFullReadStatsView + * @constructor + * @param {google.bigtable.v2.IFullReadStatsView=} [properties] Properties to set + */ + function FullReadStatsView(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FullReadStatsView readIterationStats. + * @member {google.bigtable.v2.IReadIterationStats|null|undefined} readIterationStats + * @memberof google.bigtable.v2.FullReadStatsView + * @instance + */ + FullReadStatsView.prototype.readIterationStats = null; + + /** + * FullReadStatsView requestLatencyStats. + * @member {google.bigtable.v2.IRequestLatencyStats|null|undefined} requestLatencyStats + * @memberof google.bigtable.v2.FullReadStatsView + * @instance + */ + FullReadStatsView.prototype.requestLatencyStats = null; + + /** + * Creates a new FullReadStatsView instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {google.bigtable.v2.IFullReadStatsView=} [properties] Properties to set + * @returns {google.bigtable.v2.FullReadStatsView} FullReadStatsView instance + */ + FullReadStatsView.create = function create(properties) { + return new FullReadStatsView(properties); + }; + + /** + * Encodes the specified FullReadStatsView message. Does not implicitly {@link google.bigtable.v2.FullReadStatsView.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {google.bigtable.v2.IFullReadStatsView} message FullReadStatsView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FullReadStatsView.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readIterationStats != null && Object.hasOwnProperty.call(message, "readIterationStats")) + $root.google.bigtable.v2.ReadIterationStats.encode(message.readIterationStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestLatencyStats != null && Object.hasOwnProperty.call(message, "requestLatencyStats")) + $root.google.bigtable.v2.RequestLatencyStats.encode(message.requestLatencyStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FullReadStatsView message, length delimited. Does not implicitly {@link google.bigtable.v2.FullReadStatsView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {google.bigtable.v2.IFullReadStatsView} message FullReadStatsView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FullReadStatsView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FullReadStatsView message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.FullReadStatsView} FullReadStatsView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FullReadStatsView.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.FullReadStatsView(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.readIterationStats = $root.google.bigtable.v2.ReadIterationStats.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestLatencyStats = $root.google.bigtable.v2.RequestLatencyStats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FullReadStatsView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.FullReadStatsView} FullReadStatsView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FullReadStatsView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FullReadStatsView message. + * @function verify + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FullReadStatsView.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readIterationStats != null && message.hasOwnProperty("readIterationStats")) { + var error = $root.google.bigtable.v2.ReadIterationStats.verify(message.readIterationStats); + if (error) + return "readIterationStats." + error; + } + if (message.requestLatencyStats != null && message.hasOwnProperty("requestLatencyStats")) { + var error = $root.google.bigtable.v2.RequestLatencyStats.verify(message.requestLatencyStats); + if (error) + return "requestLatencyStats." + error; + } + return null; + }; + + /** + * Creates a FullReadStatsView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.FullReadStatsView} FullReadStatsView + */ + FullReadStatsView.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.FullReadStatsView) + return object; + var message = new $root.google.bigtable.v2.FullReadStatsView(); + if (object.readIterationStats != null) { + if (typeof object.readIterationStats !== "object") + throw TypeError(".google.bigtable.v2.FullReadStatsView.readIterationStats: object expected"); + message.readIterationStats = $root.google.bigtable.v2.ReadIterationStats.fromObject(object.readIterationStats); + } + if (object.requestLatencyStats != null) { + if (typeof object.requestLatencyStats !== "object") + throw TypeError(".google.bigtable.v2.FullReadStatsView.requestLatencyStats: object expected"); + message.requestLatencyStats = $root.google.bigtable.v2.RequestLatencyStats.fromObject(object.requestLatencyStats); + } + return message; + }; + + /** + * Creates a plain object from a FullReadStatsView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {google.bigtable.v2.FullReadStatsView} message FullReadStatsView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FullReadStatsView.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readIterationStats = null; + object.requestLatencyStats = null; + } + if (message.readIterationStats != null && message.hasOwnProperty("readIterationStats")) + object.readIterationStats = $root.google.bigtable.v2.ReadIterationStats.toObject(message.readIterationStats, options); + if (message.requestLatencyStats != null && message.hasOwnProperty("requestLatencyStats")) + object.requestLatencyStats = $root.google.bigtable.v2.RequestLatencyStats.toObject(message.requestLatencyStats, options); + return object; + }; + + /** + * Converts this FullReadStatsView to JSON. + * @function toJSON + * @memberof google.bigtable.v2.FullReadStatsView + * @instance + * @returns {Object.} JSON object + */ + FullReadStatsView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FullReadStatsView + * @function getTypeUrl + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FullReadStatsView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.FullReadStatsView"; + }; + + return FullReadStatsView; + })(); + + v2.RequestStats = (function() { + + /** + * Properties of a RequestStats. + * @memberof google.bigtable.v2 + * @interface IRequestStats + * @property {google.bigtable.v2.IFullReadStatsView|null} [fullReadStatsView] RequestStats fullReadStatsView + */ + + /** + * Constructs a new RequestStats. + * @memberof google.bigtable.v2 + * @classdesc Represents a RequestStats. + * @implements IRequestStats + * @constructor + * @param {google.bigtable.v2.IRequestStats=} [properties] Properties to set + */ + function RequestStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestStats fullReadStatsView. + * @member {google.bigtable.v2.IFullReadStatsView|null|undefined} fullReadStatsView + * @memberof google.bigtable.v2.RequestStats + * @instance + */ + RequestStats.prototype.fullReadStatsView = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RequestStats statsView. + * @member {"fullReadStatsView"|undefined} statsView + * @memberof google.bigtable.v2.RequestStats + * @instance + */ + Object.defineProperty(RequestStats.prototype, "statsView", { + get: $util.oneOfGetter($oneOfFields = ["fullReadStatsView"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RequestStats instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {google.bigtable.v2.IRequestStats=} [properties] Properties to set + * @returns {google.bigtable.v2.RequestStats} RequestStats instance + */ + RequestStats.create = function create(properties) { + return new RequestStats(properties); + }; + + /** + * Encodes the specified RequestStats message. Does not implicitly {@link google.bigtable.v2.RequestStats.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {google.bigtable.v2.IRequestStats} message RequestStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullReadStatsView != null && Object.hasOwnProperty.call(message, "fullReadStatsView")) + $root.google.bigtable.v2.FullReadStatsView.encode(message.fullReadStatsView, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestStats message, length delimited. Does not implicitly {@link google.bigtable.v2.RequestStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {google.bigtable.v2.IRequestStats} message RequestStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestStats message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RequestStats} RequestStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestStats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RequestStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fullReadStatsView = $root.google.bigtable.v2.FullReadStatsView.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RequestStats} RequestStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestStats message. + * @function verify + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fullReadStatsView != null && message.hasOwnProperty("fullReadStatsView")) { + properties.statsView = 1; + { + var error = $root.google.bigtable.v2.FullReadStatsView.verify(message.fullReadStatsView); + if (error) + return "fullReadStatsView." + error; + } + } + return null; + }; + + /** + * Creates a RequestStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RequestStats} RequestStats + */ + RequestStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RequestStats) + return object; + var message = new $root.google.bigtable.v2.RequestStats(); + if (object.fullReadStatsView != null) { + if (typeof object.fullReadStatsView !== "object") + throw TypeError(".google.bigtable.v2.RequestStats.fullReadStatsView: object expected"); + message.fullReadStatsView = $root.google.bigtable.v2.FullReadStatsView.fromObject(object.fullReadStatsView); + } + return message; + }; + + /** + * Creates a plain object from a RequestStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {google.bigtable.v2.RequestStats} message RequestStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.fullReadStatsView != null && message.hasOwnProperty("fullReadStatsView")) { + object.fullReadStatsView = $root.google.bigtable.v2.FullReadStatsView.toObject(message.fullReadStatsView, options); + if (options.oneofs) + object.statsView = "fullReadStatsView"; + } + return object; + }; + + /** + * Converts this RequestStats to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RequestStats + * @instance + * @returns {Object.} JSON object + */ + RequestStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestStats + * @function getTypeUrl + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RequestStats"; + }; + + return RequestStats; + })(); + + v2.FeatureFlags = (function() { + + /** + * Properties of a FeatureFlags. + * @memberof google.bigtable.v2 + * @interface IFeatureFlags + * @property {boolean|null} [reverseScans] FeatureFlags reverseScans + * @property {boolean|null} [mutateRowsRateLimit] FeatureFlags mutateRowsRateLimit + * @property {boolean|null} [mutateRowsRateLimit2] FeatureFlags mutateRowsRateLimit2 + * @property {boolean|null} [lastScannedRowResponses] FeatureFlags lastScannedRowResponses + * @property {boolean|null} [routingCookie] FeatureFlags routingCookie + * @property {boolean|null} [retryInfo] FeatureFlags retryInfo + * @property {boolean|null} [clientSideMetricsEnabled] FeatureFlags clientSideMetricsEnabled + * @property {boolean|null} [trafficDirectorEnabled] FeatureFlags trafficDirectorEnabled + * @property {boolean|null} [directAccessRequested] FeatureFlags directAccessRequested + * @property {boolean|null} [peerInfo] FeatureFlags peerInfo + */ + + /** + * Constructs a new FeatureFlags. + * @memberof google.bigtable.v2 + * @classdesc Represents a FeatureFlags. + * @implements IFeatureFlags + * @constructor + * @param {google.bigtable.v2.IFeatureFlags=} [properties] Properties to set + */ + function FeatureFlags(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureFlags reverseScans. + * @member {boolean} reverseScans + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.reverseScans = false; + + /** + * FeatureFlags mutateRowsRateLimit. + * @member {boolean} mutateRowsRateLimit + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.mutateRowsRateLimit = false; + + /** + * FeatureFlags mutateRowsRateLimit2. + * @member {boolean} mutateRowsRateLimit2 + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.mutateRowsRateLimit2 = false; + + /** + * FeatureFlags lastScannedRowResponses. + * @member {boolean} lastScannedRowResponses + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.lastScannedRowResponses = false; + + /** + * FeatureFlags routingCookie. + * @member {boolean} routingCookie + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.routingCookie = false; + + /** + * FeatureFlags retryInfo. + * @member {boolean} retryInfo + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.retryInfo = false; + + /** + * FeatureFlags clientSideMetricsEnabled. + * @member {boolean} clientSideMetricsEnabled + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.clientSideMetricsEnabled = false; + + /** + * FeatureFlags trafficDirectorEnabled. + * @member {boolean} trafficDirectorEnabled + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.trafficDirectorEnabled = false; + + /** + * FeatureFlags directAccessRequested. + * @member {boolean} directAccessRequested + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.directAccessRequested = false; + + /** + * FeatureFlags peerInfo. + * @member {boolean} peerInfo + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.peerInfo = false; + + /** + * Creates a new FeatureFlags instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {google.bigtable.v2.IFeatureFlags=} [properties] Properties to set + * @returns {google.bigtable.v2.FeatureFlags} FeatureFlags instance + */ + FeatureFlags.create = function create(properties) { + return new FeatureFlags(properties); + }; + + /** + * Encodes the specified FeatureFlags message. Does not implicitly {@link google.bigtable.v2.FeatureFlags.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {google.bigtable.v2.IFeatureFlags} message FeatureFlags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureFlags.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reverseScans != null && Object.hasOwnProperty.call(message, "reverseScans")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.reverseScans); + if (message.mutateRowsRateLimit != null && Object.hasOwnProperty.call(message, "mutateRowsRateLimit")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.mutateRowsRateLimit); + if (message.lastScannedRowResponses != null && Object.hasOwnProperty.call(message, "lastScannedRowResponses")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.lastScannedRowResponses); + if (message.mutateRowsRateLimit2 != null && Object.hasOwnProperty.call(message, "mutateRowsRateLimit2")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.mutateRowsRateLimit2); + if (message.routingCookie != null && Object.hasOwnProperty.call(message, "routingCookie")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.routingCookie); + if (message.retryInfo != null && Object.hasOwnProperty.call(message, "retryInfo")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.retryInfo); + if (message.clientSideMetricsEnabled != null && Object.hasOwnProperty.call(message, "clientSideMetricsEnabled")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.clientSideMetricsEnabled); + if (message.trafficDirectorEnabled != null && Object.hasOwnProperty.call(message, "trafficDirectorEnabled")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.trafficDirectorEnabled); + if (message.directAccessRequested != null && Object.hasOwnProperty.call(message, "directAccessRequested")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.directAccessRequested); + if (message.peerInfo != null && Object.hasOwnProperty.call(message, "peerInfo")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.peerInfo); + return writer; + }; + + /** + * Encodes the specified FeatureFlags message, length delimited. Does not implicitly {@link google.bigtable.v2.FeatureFlags.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {google.bigtable.v2.IFeatureFlags} message FeatureFlags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureFlags.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureFlags message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.FeatureFlags} FeatureFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureFlags.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.FeatureFlags(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.reverseScans = reader.bool(); + break; + } + case 3: { + message.mutateRowsRateLimit = reader.bool(); + break; + } + case 5: { + message.mutateRowsRateLimit2 = reader.bool(); + break; + } + case 4: { + message.lastScannedRowResponses = reader.bool(); + break; + } + case 6: { + message.routingCookie = reader.bool(); + break; + } + case 7: { + message.retryInfo = reader.bool(); + break; + } + case 8: { + message.clientSideMetricsEnabled = reader.bool(); + break; + } + case 9: { + message.trafficDirectorEnabled = reader.bool(); + break; + } + case 10: { + message.directAccessRequested = reader.bool(); + break; + } + case 11: { + message.peerInfo = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureFlags message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.FeatureFlags} FeatureFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureFlags.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureFlags message. + * @function verify + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureFlags.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reverseScans != null && message.hasOwnProperty("reverseScans")) + if (typeof message.reverseScans !== "boolean") + return "reverseScans: boolean expected"; + if (message.mutateRowsRateLimit != null && message.hasOwnProperty("mutateRowsRateLimit")) + if (typeof message.mutateRowsRateLimit !== "boolean") + return "mutateRowsRateLimit: boolean expected"; + if (message.mutateRowsRateLimit2 != null && message.hasOwnProperty("mutateRowsRateLimit2")) + if (typeof message.mutateRowsRateLimit2 !== "boolean") + return "mutateRowsRateLimit2: boolean expected"; + if (message.lastScannedRowResponses != null && message.hasOwnProperty("lastScannedRowResponses")) + if (typeof message.lastScannedRowResponses !== "boolean") + return "lastScannedRowResponses: boolean expected"; + if (message.routingCookie != null && message.hasOwnProperty("routingCookie")) + if (typeof message.routingCookie !== "boolean") + return "routingCookie: boolean expected"; + if (message.retryInfo != null && message.hasOwnProperty("retryInfo")) + if (typeof message.retryInfo !== "boolean") + return "retryInfo: boolean expected"; + if (message.clientSideMetricsEnabled != null && message.hasOwnProperty("clientSideMetricsEnabled")) + if (typeof message.clientSideMetricsEnabled !== "boolean") + return "clientSideMetricsEnabled: boolean expected"; + if (message.trafficDirectorEnabled != null && message.hasOwnProperty("trafficDirectorEnabled")) + if (typeof message.trafficDirectorEnabled !== "boolean") + return "trafficDirectorEnabled: boolean expected"; + if (message.directAccessRequested != null && message.hasOwnProperty("directAccessRequested")) + if (typeof message.directAccessRequested !== "boolean") + return "directAccessRequested: boolean expected"; + if (message.peerInfo != null && message.hasOwnProperty("peerInfo")) + if (typeof message.peerInfo !== "boolean") + return "peerInfo: boolean expected"; + return null; + }; + + /** + * Creates a FeatureFlags message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.FeatureFlags} FeatureFlags + */ + FeatureFlags.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.FeatureFlags) + return object; + var message = new $root.google.bigtable.v2.FeatureFlags(); + if (object.reverseScans != null) + message.reverseScans = Boolean(object.reverseScans); + if (object.mutateRowsRateLimit != null) + message.mutateRowsRateLimit = Boolean(object.mutateRowsRateLimit); + if (object.mutateRowsRateLimit2 != null) + message.mutateRowsRateLimit2 = Boolean(object.mutateRowsRateLimit2); + if (object.lastScannedRowResponses != null) + message.lastScannedRowResponses = Boolean(object.lastScannedRowResponses); + if (object.routingCookie != null) + message.routingCookie = Boolean(object.routingCookie); + if (object.retryInfo != null) + message.retryInfo = Boolean(object.retryInfo); + if (object.clientSideMetricsEnabled != null) + message.clientSideMetricsEnabled = Boolean(object.clientSideMetricsEnabled); + if (object.trafficDirectorEnabled != null) + message.trafficDirectorEnabled = Boolean(object.trafficDirectorEnabled); + if (object.directAccessRequested != null) + message.directAccessRequested = Boolean(object.directAccessRequested); + if (object.peerInfo != null) + message.peerInfo = Boolean(object.peerInfo); + return message; + }; + + /** + * Creates a plain object from a FeatureFlags message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {google.bigtable.v2.FeatureFlags} message FeatureFlags + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureFlags.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.reverseScans = false; + object.mutateRowsRateLimit = false; + object.lastScannedRowResponses = false; + object.mutateRowsRateLimit2 = false; + object.routingCookie = false; + object.retryInfo = false; + object.clientSideMetricsEnabled = false; + object.trafficDirectorEnabled = false; + object.directAccessRequested = false; + object.peerInfo = false; + } + if (message.reverseScans != null && message.hasOwnProperty("reverseScans")) + object.reverseScans = message.reverseScans; + if (message.mutateRowsRateLimit != null && message.hasOwnProperty("mutateRowsRateLimit")) + object.mutateRowsRateLimit = message.mutateRowsRateLimit; + if (message.lastScannedRowResponses != null && message.hasOwnProperty("lastScannedRowResponses")) + object.lastScannedRowResponses = message.lastScannedRowResponses; + if (message.mutateRowsRateLimit2 != null && message.hasOwnProperty("mutateRowsRateLimit2")) + object.mutateRowsRateLimit2 = message.mutateRowsRateLimit2; + if (message.routingCookie != null && message.hasOwnProperty("routingCookie")) + object.routingCookie = message.routingCookie; + if (message.retryInfo != null && message.hasOwnProperty("retryInfo")) + object.retryInfo = message.retryInfo; + if (message.clientSideMetricsEnabled != null && message.hasOwnProperty("clientSideMetricsEnabled")) + object.clientSideMetricsEnabled = message.clientSideMetricsEnabled; + if (message.trafficDirectorEnabled != null && message.hasOwnProperty("trafficDirectorEnabled")) + object.trafficDirectorEnabled = message.trafficDirectorEnabled; + if (message.directAccessRequested != null && message.hasOwnProperty("directAccessRequested")) + object.directAccessRequested = message.directAccessRequested; + if (message.peerInfo != null && message.hasOwnProperty("peerInfo")) + object.peerInfo = message.peerInfo; + return object; + }; + + /** + * Converts this FeatureFlags to JSON. + * @function toJSON + * @memberof google.bigtable.v2.FeatureFlags + * @instance + * @returns {Object.} JSON object + */ + FeatureFlags.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureFlags + * @function getTypeUrl + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureFlags.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.FeatureFlags"; + }; + + return FeatureFlags; + })(); + + v2.PeerInfo = (function() { + + /** + * Properties of a PeerInfo. + * @memberof google.bigtable.v2 + * @interface IPeerInfo + * @property {number|Long|null} [googleFrontendId] PeerInfo googleFrontendId + * @property {number|Long|null} [applicationFrontendId] PeerInfo applicationFrontendId + * @property {string|null} [applicationFrontendZone] PeerInfo applicationFrontendZone + * @property {string|null} [applicationFrontendSubzone] PeerInfo applicationFrontendSubzone + * @property {google.bigtable.v2.PeerInfo.TransportType|null} [transportType] PeerInfo transportType + */ + + /** + * Constructs a new PeerInfo. + * @memberof google.bigtable.v2 + * @classdesc Represents a PeerInfo. + * @implements IPeerInfo + * @constructor + * @param {google.bigtable.v2.IPeerInfo=} [properties] Properties to set + */ + function PeerInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PeerInfo googleFrontendId. + * @member {number|Long} googleFrontendId + * @memberof google.bigtable.v2.PeerInfo + * @instance + */ + PeerInfo.prototype.googleFrontendId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PeerInfo applicationFrontendId. + * @member {number|Long} applicationFrontendId + * @memberof google.bigtable.v2.PeerInfo + * @instance + */ + PeerInfo.prototype.applicationFrontendId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PeerInfo applicationFrontendZone. + * @member {string} applicationFrontendZone + * @memberof google.bigtable.v2.PeerInfo + * @instance + */ + PeerInfo.prototype.applicationFrontendZone = ""; + + /** + * PeerInfo applicationFrontendSubzone. + * @member {string} applicationFrontendSubzone + * @memberof google.bigtable.v2.PeerInfo + * @instance + */ + PeerInfo.prototype.applicationFrontendSubzone = ""; + + /** + * PeerInfo transportType. + * @member {google.bigtable.v2.PeerInfo.TransportType} transportType + * @memberof google.bigtable.v2.PeerInfo + * @instance + */ + PeerInfo.prototype.transportType = 0; + + /** + * Creates a new PeerInfo instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {google.bigtable.v2.IPeerInfo=} [properties] Properties to set + * @returns {google.bigtable.v2.PeerInfo} PeerInfo instance + */ + PeerInfo.create = function create(properties) { + return new PeerInfo(properties); + }; + + /** + * Encodes the specified PeerInfo message. Does not implicitly {@link google.bigtable.v2.PeerInfo.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {google.bigtable.v2.IPeerInfo} message PeerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeerInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.googleFrontendId != null && Object.hasOwnProperty.call(message, "googleFrontendId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.googleFrontendId); + if (message.applicationFrontendId != null && Object.hasOwnProperty.call(message, "applicationFrontendId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.applicationFrontendId); + if (message.applicationFrontendZone != null && Object.hasOwnProperty.call(message, "applicationFrontendZone")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.applicationFrontendZone); + if (message.applicationFrontendSubzone != null && Object.hasOwnProperty.call(message, "applicationFrontendSubzone")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.applicationFrontendSubzone); + if (message.transportType != null && Object.hasOwnProperty.call(message, "transportType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.transportType); + return writer; + }; + + /** + * Encodes the specified PeerInfo message, length delimited. Does not implicitly {@link google.bigtable.v2.PeerInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {google.bigtable.v2.IPeerInfo} message PeerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeerInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PeerInfo message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.PeerInfo} PeerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeerInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.PeerInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.googleFrontendId = reader.int64(); + break; + } + case 2: { + message.applicationFrontendId = reader.int64(); + break; + } + case 3: { + message.applicationFrontendZone = reader.string(); + break; + } + case 4: { + message.applicationFrontendSubzone = reader.string(); + break; + } + case 5: { + message.transportType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PeerInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.PeerInfo} PeerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeerInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PeerInfo message. + * @function verify + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PeerInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.googleFrontendId != null && message.hasOwnProperty("googleFrontendId")) + if (!$util.isInteger(message.googleFrontendId) && !(message.googleFrontendId && $util.isInteger(message.googleFrontendId.low) && $util.isInteger(message.googleFrontendId.high))) + return "googleFrontendId: integer|Long expected"; + if (message.applicationFrontendId != null && message.hasOwnProperty("applicationFrontendId")) + if (!$util.isInteger(message.applicationFrontendId) && !(message.applicationFrontendId && $util.isInteger(message.applicationFrontendId.low) && $util.isInteger(message.applicationFrontendId.high))) + return "applicationFrontendId: integer|Long expected"; + if (message.applicationFrontendZone != null && message.hasOwnProperty("applicationFrontendZone")) + if (!$util.isString(message.applicationFrontendZone)) + return "applicationFrontendZone: string expected"; + if (message.applicationFrontendSubzone != null && message.hasOwnProperty("applicationFrontendSubzone")) + if (!$util.isString(message.applicationFrontendSubzone)) + return "applicationFrontendSubzone: string expected"; + if (message.transportType != null && message.hasOwnProperty("transportType")) + switch (message.transportType) { + default: + return "transportType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + return null; + }; + + /** + * Creates a PeerInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.PeerInfo} PeerInfo + */ + PeerInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.PeerInfo) + return object; + var message = new $root.google.bigtable.v2.PeerInfo(); + if (object.googleFrontendId != null) + if ($util.Long) + (message.googleFrontendId = $util.Long.fromValue(object.googleFrontendId)).unsigned = false; + else if (typeof object.googleFrontendId === "string") + message.googleFrontendId = parseInt(object.googleFrontendId, 10); + else if (typeof object.googleFrontendId === "number") + message.googleFrontendId = object.googleFrontendId; + else if (typeof object.googleFrontendId === "object") + message.googleFrontendId = new $util.LongBits(object.googleFrontendId.low >>> 0, object.googleFrontendId.high >>> 0).toNumber(); + if (object.applicationFrontendId != null) + if ($util.Long) + (message.applicationFrontendId = $util.Long.fromValue(object.applicationFrontendId)).unsigned = false; + else if (typeof object.applicationFrontendId === "string") + message.applicationFrontendId = parseInt(object.applicationFrontendId, 10); + else if (typeof object.applicationFrontendId === "number") + message.applicationFrontendId = object.applicationFrontendId; + else if (typeof object.applicationFrontendId === "object") + message.applicationFrontendId = new $util.LongBits(object.applicationFrontendId.low >>> 0, object.applicationFrontendId.high >>> 0).toNumber(); + if (object.applicationFrontendZone != null) + message.applicationFrontendZone = String(object.applicationFrontendZone); + if (object.applicationFrontendSubzone != null) + message.applicationFrontendSubzone = String(object.applicationFrontendSubzone); + switch (object.transportType) { + default: + if (typeof object.transportType === "number") { + message.transportType = object.transportType; + break; + } + break; + case "TRANSPORT_TYPE_UNKNOWN": + case 0: + message.transportType = 0; + break; + case "TRANSPORT_TYPE_EXTERNAL": + case 1: + message.transportType = 1; + break; + case "TRANSPORT_TYPE_CLOUD_PATH": + case 2: + message.transportType = 2; + break; + case "TRANSPORT_TYPE_DIRECT_ACCESS": + case 3: + message.transportType = 3; + break; + case "TRANSPORT_TYPE_SESSION_UNKNOWN": + case 4: + message.transportType = 4; + break; + case "TRANSPORT_TYPE_SESSION_EXTERNAL": + case 5: + message.transportType = 5; + break; + case "TRANSPORT_TYPE_SESSION_CLOUD_PATH": + case 6: + message.transportType = 6; + break; + case "TRANSPORT_TYPE_SESSION_DIRECT_ACCESS": + case 7: + message.transportType = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from a PeerInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {google.bigtable.v2.PeerInfo} message PeerInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PeerInfo.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.googleFrontendId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.googleFrontendId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.applicationFrontendId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.applicationFrontendId = options.longs === String ? "0" : 0; + object.applicationFrontendZone = ""; + object.applicationFrontendSubzone = ""; + object.transportType = options.enums === String ? "TRANSPORT_TYPE_UNKNOWN" : 0; + } + if (message.googleFrontendId != null && message.hasOwnProperty("googleFrontendId")) + if (typeof message.googleFrontendId === "number") + object.googleFrontendId = options.longs === String ? String(message.googleFrontendId) : message.googleFrontendId; + else + object.googleFrontendId = options.longs === String ? $util.Long.prototype.toString.call(message.googleFrontendId) : options.longs === Number ? new $util.LongBits(message.googleFrontendId.low >>> 0, message.googleFrontendId.high >>> 0).toNumber() : message.googleFrontendId; + if (message.applicationFrontendId != null && message.hasOwnProperty("applicationFrontendId")) + if (typeof message.applicationFrontendId === "number") + object.applicationFrontendId = options.longs === String ? String(message.applicationFrontendId) : message.applicationFrontendId; + else + object.applicationFrontendId = options.longs === String ? $util.Long.prototype.toString.call(message.applicationFrontendId) : options.longs === Number ? new $util.LongBits(message.applicationFrontendId.low >>> 0, message.applicationFrontendId.high >>> 0).toNumber() : message.applicationFrontendId; + if (message.applicationFrontendZone != null && message.hasOwnProperty("applicationFrontendZone")) + object.applicationFrontendZone = message.applicationFrontendZone; + if (message.applicationFrontendSubzone != null && message.hasOwnProperty("applicationFrontendSubzone")) + object.applicationFrontendSubzone = message.applicationFrontendSubzone; + if (message.transportType != null && message.hasOwnProperty("transportType")) + object.transportType = options.enums === String ? $root.google.bigtable.v2.PeerInfo.TransportType[message.transportType] === undefined ? message.transportType : $root.google.bigtable.v2.PeerInfo.TransportType[message.transportType] : message.transportType; + return object; + }; + + /** + * Converts this PeerInfo to JSON. + * @function toJSON + * @memberof google.bigtable.v2.PeerInfo + * @instance + * @returns {Object.} JSON object + */ + PeerInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PeerInfo + * @function getTypeUrl + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PeerInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.PeerInfo"; + }; + + /** + * TransportType enum. + * @name google.bigtable.v2.PeerInfo.TransportType + * @enum {number} + * @property {number} TRANSPORT_TYPE_UNKNOWN=0 TRANSPORT_TYPE_UNKNOWN value + * @property {number} TRANSPORT_TYPE_EXTERNAL=1 TRANSPORT_TYPE_EXTERNAL value + * @property {number} TRANSPORT_TYPE_CLOUD_PATH=2 TRANSPORT_TYPE_CLOUD_PATH value + * @property {number} TRANSPORT_TYPE_DIRECT_ACCESS=3 TRANSPORT_TYPE_DIRECT_ACCESS value + * @property {number} TRANSPORT_TYPE_SESSION_UNKNOWN=4 TRANSPORT_TYPE_SESSION_UNKNOWN value + * @property {number} TRANSPORT_TYPE_SESSION_EXTERNAL=5 TRANSPORT_TYPE_SESSION_EXTERNAL value + * @property {number} TRANSPORT_TYPE_SESSION_CLOUD_PATH=6 TRANSPORT_TYPE_SESSION_CLOUD_PATH value + * @property {number} TRANSPORT_TYPE_SESSION_DIRECT_ACCESS=7 TRANSPORT_TYPE_SESSION_DIRECT_ACCESS value + */ + PeerInfo.TransportType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSPORT_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TRANSPORT_TYPE_EXTERNAL"] = 1; + values[valuesById[2] = "TRANSPORT_TYPE_CLOUD_PATH"] = 2; + values[valuesById[3] = "TRANSPORT_TYPE_DIRECT_ACCESS"] = 3; + values[valuesById[4] = "TRANSPORT_TYPE_SESSION_UNKNOWN"] = 4; + values[valuesById[5] = "TRANSPORT_TYPE_SESSION_EXTERNAL"] = 5; + values[valuesById[6] = "TRANSPORT_TYPE_SESSION_CLOUD_PATH"] = 6; + values[valuesById[7] = "TRANSPORT_TYPE_SESSION_DIRECT_ACCESS"] = 7; + return values; + })(); + + return PeerInfo; + })(); + + v2.ResponseParams = (function() { + + /** + * Properties of a ResponseParams. + * @memberof google.bigtable.v2 + * @interface IResponseParams + * @property {string|null} [zoneId] ResponseParams zoneId + * @property {string|null} [clusterId] ResponseParams clusterId + * @property {number|Long|null} [afeId] ResponseParams afeId + */ + + /** + * Constructs a new ResponseParams. + * @memberof google.bigtable.v2 + * @classdesc Represents a ResponseParams. + * @implements IResponseParams + * @constructor + * @param {google.bigtable.v2.IResponseParams=} [properties] Properties to set + */ + function ResponseParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseParams zoneId. + * @member {string|null|undefined} zoneId + * @memberof google.bigtable.v2.ResponseParams + * @instance + */ + ResponseParams.prototype.zoneId = null; + + /** + * ResponseParams clusterId. + * @member {string|null|undefined} clusterId + * @memberof google.bigtable.v2.ResponseParams + * @instance + */ + ResponseParams.prototype.clusterId = null; + + /** + * ResponseParams afeId. + * @member {number|Long|null|undefined} afeId + * @memberof google.bigtable.v2.ResponseParams + * @instance + */ + ResponseParams.prototype.afeId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ResponseParams.prototype, "_zoneId", { + get: $util.oneOfGetter($oneOfFields = ["zoneId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ResponseParams.prototype, "_clusterId", { + get: $util.oneOfGetter($oneOfFields = ["clusterId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ResponseParams.prototype, "_afeId", { + get: $util.oneOfGetter($oneOfFields = ["afeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResponseParams instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {google.bigtable.v2.IResponseParams=} [properties] Properties to set + * @returns {google.bigtable.v2.ResponseParams} ResponseParams instance + */ + ResponseParams.create = function create(properties) { + return new ResponseParams(properties); + }; + + /** + * Encodes the specified ResponseParams message. Does not implicitly {@link google.bigtable.v2.ResponseParams.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {google.bigtable.v2.IResponseParams} message ResponseParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.afeId != null && Object.hasOwnProperty.call(message, "afeId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.afeId); + return writer; + }; + + /** + * Encodes the specified ResponseParams message, length delimited. Does not implicitly {@link google.bigtable.v2.ResponseParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {google.bigtable.v2.IResponseParams} message ResponseParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseParams message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ResponseParams} ResponseParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseParams.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ResponseParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.zoneId = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.afeId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ResponseParams} ResponseParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseParams message. + * @function verify + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) { + properties._zoneId = 1; + if (!$util.isString(message.zoneId)) + return "zoneId: string expected"; + } + if (message.clusterId != null && message.hasOwnProperty("clusterId")) { + properties._clusterId = 1; + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + } + if (message.afeId != null && message.hasOwnProperty("afeId")) { + properties._afeId = 1; + if (!$util.isInteger(message.afeId) && !(message.afeId && $util.isInteger(message.afeId.low) && $util.isInteger(message.afeId.high))) + return "afeId: integer|Long expected"; + } + return null; + }; + + /** + * Creates a ResponseParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ResponseParams} ResponseParams + */ + ResponseParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ResponseParams) + return object; + var message = new $root.google.bigtable.v2.ResponseParams(); + if (object.zoneId != null) + message.zoneId = String(object.zoneId); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.afeId != null) + if ($util.Long) + (message.afeId = $util.Long.fromValue(object.afeId)).unsigned = false; + else if (typeof object.afeId === "string") + message.afeId = parseInt(object.afeId, 10); + else if (typeof object.afeId === "number") + message.afeId = object.afeId; + else if (typeof object.afeId === "object") + message.afeId = new $util.LongBits(object.afeId.low >>> 0, object.afeId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ResponseParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {google.bigtable.v2.ResponseParams} message ResponseParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) { + object.zoneId = message.zoneId; + if (options.oneofs) + object._zoneId = "zoneId"; + } + if (message.clusterId != null && message.hasOwnProperty("clusterId")) { + object.clusterId = message.clusterId; + if (options.oneofs) + object._clusterId = "clusterId"; + } + if (message.afeId != null && message.hasOwnProperty("afeId")) { + if (typeof message.afeId === "number") + object.afeId = options.longs === String ? String(message.afeId) : message.afeId; + else + object.afeId = options.longs === String ? $util.Long.prototype.toString.call(message.afeId) : options.longs === Number ? new $util.LongBits(message.afeId.low >>> 0, message.afeId.high >>> 0).toNumber() : message.afeId; + if (options.oneofs) + object._afeId = "afeId"; + } + return object; + }; + + /** + * Converts this ResponseParams to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ResponseParams + * @instance + * @returns {Object.} JSON object + */ + ResponseParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResponseParams + * @function getTypeUrl + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResponseParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ResponseParams"; + }; + + return ResponseParams; + })(); + + return v2; + })(); + + return bigtable; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + 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|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) { + object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.common = null; + object.experimentalFeatures = null; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + this.renamedServices = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * 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 = []; + this.style = []; + if (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 = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + 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); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + 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; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.RoutingRule = (function() { + + /** + * Properties of a RoutingRule. + * @memberof google.api + * @interface IRoutingRule + * @property {Array.|null} [routingParameters] RoutingRule routingParameters + */ + + /** + * Constructs a new RoutingRule. + * @memberof google.api + * @classdesc Represents a RoutingRule. + * @implements IRoutingRule + * @constructor + * @param {google.api.IRoutingRule=} [properties] Properties to set + */ + function RoutingRule(properties) { + this.routingParameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingRule routingParameters. + * @member {Array.} routingParameters + * @memberof google.api.RoutingRule + * @instance + */ + RoutingRule.prototype.routingParameters = $util.emptyArray; + + /** + * Creates a new RoutingRule instance using the specified properties. + * @function create + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule=} [properties] Properties to set + * @returns {google.api.RoutingRule} RoutingRule instance + */ + RoutingRule.create = function create(properties) { + return new RoutingRule(properties); + }; + + /** + * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @function encode + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routingParameters != null && message.routingParameters.length) + for (var i = 0; i < message.routingParameters.length; ++i) + $root.google.api.RoutingParameter.encode(message.routingParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.RoutingRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RoutingRule} RoutingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.routingParameters && message.routingParameters.length)) + message.routingParameters = []; + message.routingParameters.push($root.google.api.RoutingParameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RoutingRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RoutingRule} RoutingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingRule message. + * @function verify + * @memberof google.api.RoutingRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) { + if (!Array.isArray(message.routingParameters)) + return "routingParameters: array expected"; + for (var i = 0; i < message.routingParameters.length; ++i) { + var error = $root.google.api.RoutingParameter.verify(message.routingParameters[i]); + if (error) + return "routingParameters." + error; + } + } + return null; + }; + + /** + * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RoutingRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.RoutingRule} RoutingRule + */ + RoutingRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RoutingRule) + return object; + var message = new $root.google.api.RoutingRule(); + if (object.routingParameters) { + if (!Array.isArray(object.routingParameters)) + throw TypeError(".google.api.RoutingRule.routingParameters: array expected"); + message.routingParameters = []; + for (var i = 0; i < object.routingParameters.length; ++i) { + if (typeof object.routingParameters[i] !== "object") + throw TypeError(".google.api.RoutingRule.routingParameters: object expected"); + message.routingParameters[i] = $root.google.api.RoutingParameter.fromObject(object.routingParameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RoutingRule + * @static + * @param {google.api.RoutingRule} message RoutingRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.routingParameters = []; + if (message.routingParameters && message.routingParameters.length) { + object.routingParameters = []; + for (var j = 0; j < message.routingParameters.length; ++j) + object.routingParameters[j] = $root.google.api.RoutingParameter.toObject(message.routingParameters[j], options); + } + return object; + }; + + /** + * Converts this RoutingRule to JSON. + * @function toJSON + * @memberof google.api.RoutingRule + * @instance + * @returns {Object.} JSON object + */ + RoutingRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingRule + * @function getTypeUrl + * @memberof google.api.RoutingRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RoutingRule"; + }; + + return RoutingRule; + })(); + + api.RoutingParameter = (function() { + + /** + * Properties of a RoutingParameter. + * @memberof google.api + * @interface IRoutingParameter + * @property {string|null} [field] RoutingParameter field + * @property {string|null} [pathTemplate] RoutingParameter pathTemplate + */ + + /** + * Constructs a new RoutingParameter. + * @memberof google.api + * @classdesc Represents a RoutingParameter. + * @implements IRoutingParameter + * @constructor + * @param {google.api.IRoutingParameter=} [properties] Properties to set + */ + function RoutingParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingParameter field. + * @member {string} field + * @memberof google.api.RoutingParameter + * @instance + */ + RoutingParameter.prototype.field = ""; + + /** + * RoutingParameter pathTemplate. + * @member {string} pathTemplate + * @memberof google.api.RoutingParameter + * @instance + */ + RoutingParameter.prototype.pathTemplate = ""; + + /** + * Creates a new RoutingParameter instance using the specified properties. + * @function create + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter=} [properties] Properties to set + * @returns {google.api.RoutingParameter} RoutingParameter instance + */ + RoutingParameter.create = function create(properties) { + return new RoutingParameter(properties); + }; + + /** + * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @function encode + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pathTemplate); + return writer; + }; + + /** + * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer. + * @function decode + * @memberof google.api.RoutingParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RoutingParameter} RoutingParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingParameter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.pathTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RoutingParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RoutingParameter} RoutingParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingParameter message. + * @function verify + * @memberof google.api.RoutingParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + if (!$util.isString(message.pathTemplate)) + return "pathTemplate: string expected"; + return null; + }; + + /** + * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RoutingParameter + * @static + * @param {Object.} object Plain object + * @returns {google.api.RoutingParameter} RoutingParameter + */ + RoutingParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RoutingParameter) + return object; + var message = new $root.google.api.RoutingParameter(); + if (object.field != null) + message.field = String(object.field); + if (object.pathTemplate != null) + message.pathTemplate = String(object.pathTemplate); + return message; + }; + + /** + * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.RoutingParameter} message RoutingParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.pathTemplate = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + object.pathTemplate = message.pathTemplate; + return object; + }; + + /** + * Converts this RoutingParameter to JSON. + * @function toJSON + * @memberof google.api.RoutingParameter + * @instance + * @returns {Object.} JSON object + */ + RoutingParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingParameter + * @function getTypeUrl + * @memberof google.api.RoutingParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RoutingParameter"; + }; + + return RoutingParameter; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + 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} [optionDependency] FileDescriptorProto optionDependency + * @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 + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * 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.optionDependency = []; + 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 optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $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 = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); + 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, error) { + 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(); + if (tag === error) + break; + 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 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + 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.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] 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"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + 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.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } + 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); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + 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 = []; + object.optionDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + 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; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } + 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); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + 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 + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility + */ + + /** + * 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; + + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + case 11: { + message.visibility = reader.int32(); + 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"; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + 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; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + 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); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * 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 = []; + this.declaration = []; + if (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; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * 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.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + 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; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + 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.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + 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 + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility + */ + + /** + * 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; + + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + case 6: { + message.visibility = reader.int32(); + 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"; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + 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; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + 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); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + 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} [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 {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @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 deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + 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 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 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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.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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + 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.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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + 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] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + 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.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @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 deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + 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} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + 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 unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = 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 debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + 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) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + 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) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + 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.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + 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.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object.featureSupport = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); + 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]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + 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); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSupport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; + return object; + }; + + /** + * Converts this FeatureSupport to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + * @returns {Object.} JSON object + */ + FeatureSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSupport + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; + }; + + return FeatureSupport; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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 (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + 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 {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @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 deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } + 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; + object.features = null; + object.debugRedact = false; + object.featureSupport = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); + 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); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @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 + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * 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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * 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"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + 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.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + 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); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + 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 {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.api.IRoutingRule|null} [".google.api.routing"] MethodOptions .google.api.routing + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.api.routing. + * @member {google.api.IRoutingRule|null|undefined} .google.api.routing + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.routing"] = null; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + if (message[".google.api.routing"] != null && Object.hasOwnProperty.call(message, ".google.api.routing")) + $root.google.api.RoutingRule.encode(message[".google.api.routing"], writer.uint32(/* id 72295729, wireType 2 =*/578365834).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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 72295729: { + message[".google.api.routing"] = $root.google.api.RoutingRule.decode(reader, reader.uint32()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) { + var error = $root.google.api.RoutingRule.verify(message[".google.api.routing"]); + if (error) + return ".google.api.routing." + error; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + 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) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.api.routing"] != null) { + if (typeof object[".google.api.routing"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.routing: object expected"); + message[".google.api.routing"] = $root.google.api.RoutingRule.fromObject(object[".google.api.routing"]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + object[".google.api.routing"] = 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] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) + object[".google.api.routing"] = $root.google.api.RoutingRule.toObject(message[".google.api.routing"], 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); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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 >= 0) + 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); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (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 VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.fixedFeatures = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); + if (error) + return "fixedFeatures." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; + } + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * 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 + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * 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; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + 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, error) { + 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(); + if (tag === error) + break; + 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; + } + case 5: { + message.semantic = 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"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * 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; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * 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; + object.semantic = options.enums === String ? "NONE" : 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; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @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 IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @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 {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.updateMask = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/handwritten/bigtable/protos/protos.json b/handwritten/bigtable/protos/protos.json new file mode 100644 index 00000000000..7eacb803c58 --- /dev/null +++ b/handwritten/bigtable/protos/protos.json @@ -0,0 +1,10191 @@ +{ + "nested": { + "google": { + "nested": { + "bigtable": { + "nested": { + "admin": { + "nested": { + "v2": { + "options": { + "csharp_namespace": "Google.Cloud.Bigtable.Admin.V2", + "go_package": "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb", + "java_multiple_files": true, + "java_outer_classname": "TypesProto", + "java_package": "com.google.bigtable.admin.v2", + "php_namespace": "Google\\Cloud\\Bigtable\\Admin\\V2", + "ruby_package": "Google::Cloud::Bigtable::Admin::V2", + "(google.api.resource_definition).type": "cloudkms.googleapis.com/CryptoKeyVersion", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" + }, + "nested": { + "BigtableInstanceAdmin": { + "options": { + "(google.api.default_host)": "bigtableadmin.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigtable.admin,https://www.googleapis.com/auth/bigtable.admin.cluster,https://www.googleapis.com/auth/bigtable.admin.instance,https://www.googleapis.com/auth/cloud-bigtable.admin,https://www.googleapis.com/auth/cloud-bigtable.admin.cluster,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/instances", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,instance_id,instance,clusters", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "CreateInstanceMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/instances", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,instance_id,instance,clusters" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "CreateInstanceMetadata" + } + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateInstance": { + "requestType": "Instance", + "responseType": "Instance", + "options": { + "(google.api.http).put": "/v2/{name=projects/*/instances/*}", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v2/{name=projects/*/instances/*}", + "body": "*" + } + } + ] + }, + "PartialUpdateInstance": { + "requestType": "PartialUpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{instance.name=projects/*/instances/*}", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "instance,update_mask", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "UpdateInstanceMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{instance.name=projects/*/instances/*}", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "instance,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "UpdateInstanceMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCluster": { + "requestType": "CreateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/clusters", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "parent,cluster_id,cluster", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "CreateClusterMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/clusters", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "parent,cluster_id,cluster" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "CreateClusterMetadata" + } + } + ] + }, + "GetCluster": { + "requestType": "GetClusterRequest", + "responseType": "Cluster", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/clusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListClusters": { + "requestType": "ListClustersRequest", + "responseType": "ListClustersResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*}/clusters", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*}/clusters" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateCluster": { + "requestType": "Cluster", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).put": "/v2/{name=projects/*/instances/*/clusters/*}", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "UpdateClusterMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v2/{name=projects/*/instances/*/clusters/*}", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "UpdateClusterMetadata" + } + } + ] + }, + "PartialUpdateCluster": { + "requestType": "PartialUpdateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{cluster.name=projects/*/instances/*/clusters/*}", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "cluster,update_mask", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "PartialUpdateClusterMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{cluster.name=projects/*/instances/*/clusters/*}", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "cluster,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "PartialUpdateClusterMetadata" + } + } + ] + }, + "DeleteCluster": { + "requestType": "DeleteClusterRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/clusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAppProfile": { + "requestType": "CreateAppProfileRequest", + "responseType": "AppProfile", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/appProfiles", + "(google.api.http).body": "app_profile", + "(google.api.method_signature)": "parent,app_profile_id,app_profile" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/appProfiles", + "body": "app_profile" + } + }, + { + "(google.api.method_signature)": "parent,app_profile_id,app_profile" + } + ] + }, + "GetAppProfile": { + "requestType": "GetAppProfileRequest", + "responseType": "AppProfile", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/appProfiles/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/appProfiles/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAppProfiles": { + "requestType": "ListAppProfilesRequest", + "responseType": "ListAppProfilesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*}/appProfiles", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*}/appProfiles" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateAppProfile": { + "requestType": "UpdateAppProfileRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{app_profile.name=projects/*/instances/*/appProfiles/*}", + "(google.api.http).body": "app_profile", + "(google.api.method_signature)": "app_profile,update_mask", + "(google.longrunning.operation_info).response_type": "AppProfile", + "(google.longrunning.operation_info).metadata_type": "UpdateAppProfileMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{app_profile.name=projects/*/instances/*/appProfiles/*}", + "body": "app_profile" + } + }, + { + "(google.api.method_signature)": "app_profile,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AppProfile", + "metadata_type": "UpdateAppProfileMetadata" + } + } + ] + }, + "DeleteAppProfile": { + "requestType": "DeleteAppProfileRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/appProfiles/*}", + "(google.api.method_signature)": "name,ignore_warnings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/appProfiles/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.api.method_signature)": "name,ignore_warnings" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/instances/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{resource=projects/*/instances/*/logicalViews/*}:getIamPolicy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/instances/*}:getIamPolicy", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{resource=projects/*/instances/*/materializedViews/*}:getIamPolicy", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/logicalViews/*}:getIamPolicy", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/instances/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{resource=projects/*/instances/*/logicalViews/*}:setIamPolicy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/instances/*}:setIamPolicy", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{resource=projects/*/instances/*/materializedViews/*}:setIamPolicy", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/logicalViews/*}:setIamPolicy", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/instances/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{resource=projects/*/instances/*/logicalViews/*}:testIamPermissions", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/instances/*}:testIamPermissions", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{resource=projects/*/instances/*/materializedViews/*}:testIamPermissions", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/logicalViews/*}:testIamPermissions", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "ListHotTablets": { + "requestType": "ListHotTabletsRequest", + "responseType": "ListHotTabletsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*/clusters/*}/hotTablets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*/clusters/*}/hotTablets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateLogicalView": { + "requestType": "CreateLogicalViewRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/logicalViews", + "(google.api.http).body": "logical_view", + "(google.api.method_signature)": "parent,logical_view,logical_view_id", + "(google.longrunning.operation_info).response_type": "LogicalView", + "(google.longrunning.operation_info).metadata_type": "CreateLogicalViewMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/logicalViews", + "body": "logical_view" + } + }, + { + "(google.api.method_signature)": "parent,logical_view,logical_view_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "LogicalView", + "metadata_type": "CreateLogicalViewMetadata" + } + } + ] + }, + "GetLogicalView": { + "requestType": "GetLogicalViewRequest", + "responseType": "LogicalView", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/logicalViews/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/logicalViews/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListLogicalViews": { + "requestType": "ListLogicalViewsRequest", + "responseType": "ListLogicalViewsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*}/logicalViews", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*}/logicalViews" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateLogicalView": { + "requestType": "UpdateLogicalViewRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{logical_view.name=projects/*/instances/*/logicalViews/*}", + "(google.api.http).body": "logical_view", + "(google.api.method_signature)": "logical_view,update_mask", + "(google.longrunning.operation_info).response_type": "LogicalView", + "(google.longrunning.operation_info).metadata_type": "UpdateLogicalViewMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{logical_view.name=projects/*/instances/*/logicalViews/*}", + "body": "logical_view" + } + }, + { + "(google.api.method_signature)": "logical_view,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "LogicalView", + "metadata_type": "UpdateLogicalViewMetadata" + } + } + ] + }, + "DeleteLogicalView": { + "requestType": "DeleteLogicalViewRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/logicalViews/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/logicalViews/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateMaterializedView": { + "requestType": "CreateMaterializedViewRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/materializedViews", + "(google.api.http).body": "materialized_view", + "(google.api.method_signature)": "parent,materialized_view,materialized_view_id", + "(google.longrunning.operation_info).response_type": "MaterializedView", + "(google.longrunning.operation_info).metadata_type": "CreateMaterializedViewMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/materializedViews", + "body": "materialized_view" + } + }, + { + "(google.api.method_signature)": "parent,materialized_view,materialized_view_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MaterializedView", + "metadata_type": "CreateMaterializedViewMetadata" + } + } + ] + }, + "GetMaterializedView": { + "requestType": "GetMaterializedViewRequest", + "responseType": "MaterializedView", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/materializedViews/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/materializedViews/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListMaterializedViews": { + "requestType": "ListMaterializedViewsRequest", + "responseType": "ListMaterializedViewsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*}/materializedViews", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*}/materializedViews" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateMaterializedView": { + "requestType": "UpdateMaterializedViewRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{materialized_view.name=projects/*/instances/*/materializedViews/*}", + "(google.api.http).body": "materialized_view", + "(google.api.method_signature)": "materialized_view,update_mask", + "(google.longrunning.operation_info).response_type": "MaterializedView", + "(google.longrunning.operation_info).metadata_type": "UpdateMaterializedViewMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{materialized_view.name=projects/*/instances/*/materializedViews/*}", + "body": "materialized_view" + } + }, + { + "(google.api.method_signature)": "materialized_view,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MaterializedView", + "metadata_type": "UpdateMaterializedViewMetadata" + } + } + ] + }, + "DeleteMaterializedView": { + "requestType": "DeleteMaterializedViewRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/materializedViews/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/materializedViews/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusters": { + "keyType": "string", + "type": "Cluster", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "failedLocations": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "PartialUpdateInstanceRequest": { + "fields": { + "instance": { + "type": "Instance", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + } + } + }, + "CreateClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + } + } + }, + "ListClustersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "pageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListClustersResponse": { + "fields": { + "clusters": { + "rule": "repeated", + "type": "Cluster", + "id": 1 + }, + "failedLocations": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "DeleteClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + } + } + }, + "CreateInstanceMetadata": { + "fields": { + "originalRequest": { + "type": "CreateInstanceRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "UpdateInstanceMetadata": { + "fields": { + "originalRequest": { + "type": "PartialUpdateInstanceRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "CreateClusterMetadata": { + "fields": { + "originalRequest": { + "type": "CreateClusterRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "tables": { + "keyType": "string", + "type": "TableProgress", + "id": 4 + } + }, + "nested": { + "TableProgress": { + "fields": { + "estimatedSizeBytes": { + "type": "int64", + "id": 2 + }, + "estimatedCopiedBytes": { + "type": "int64", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "COPYING": 2, + "COMPLETED": 3, + "CANCELLED": 4 + } + } + } + } + } + }, + "UpdateClusterMetadata": { + "fields": { + "originalRequest": { + "type": "Cluster", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "PartialUpdateClusterMetadata": { + "fields": { + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "originalRequest": { + "type": "PartialUpdateClusterRequest", + "id": 3 + } + } + }, + "PartialUpdateClusterRequest": { + "fields": { + "cluster": { + "type": "Cluster", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateAppProfileRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "appProfileId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "appProfile": { + "type": "AppProfile", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 4 + } + } + }, + "GetAppProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AppProfile" + } + } + } + }, + "ListAppProfilesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListAppProfilesResponse": { + "fields": { + "appProfiles": { + "rule": "repeated", + "type": "AppProfile", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "failedLocations": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdateAppProfileRequest": { + "fields": { + "appProfile": { + "type": "AppProfile", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteAppProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AppProfile" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAppProfileMetadata": { + "fields": {} + }, + "ListHotTabletsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "ListHotTabletsResponse": { + "fields": { + "hotTablets": { + "rule": "repeated", + "type": "HotTablet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateLogicalViewRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "logicalViewId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "logicalView": { + "type": "LogicalView", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateLogicalViewMetadata": { + "fields": { + "originalRequest": { + "type": "CreateLogicalViewRequest", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "GetLogicalViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/LogicalView" + } + } + } + }, + "ListLogicalViewsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigtableadmin.googleapis.com/LogicalView" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListLogicalViewsResponse": { + "fields": { + "logicalViews": { + "rule": "repeated", + "type": "LogicalView", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateLogicalViewRequest": { + "fields": { + "logicalView": { + "type": "LogicalView", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateLogicalViewMetadata": { + "fields": { + "originalRequest": { + "type": "UpdateLogicalViewRequest", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "DeleteLogicalViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/LogicalView" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateMaterializedViewRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "materializedViewId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "materializedView": { + "type": "MaterializedView", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateMaterializedViewMetadata": { + "fields": { + "originalRequest": { + "type": "CreateMaterializedViewRequest", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "GetMaterializedViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/MaterializedView" + } + } + } + }, + "ListMaterializedViewsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigtableadmin.googleapis.com/MaterializedView" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListMaterializedViewsResponse": { + "fields": { + "materializedViews": { + "rule": "repeated", + "type": "MaterializedView", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateMaterializedViewRequest": { + "fields": { + "materializedView": { + "type": "MaterializedView", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateMaterializedViewMetadata": { + "fields": { + "originalRequest": { + "type": "UpdateMaterializedViewRequest", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "DeleteMaterializedViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/MaterializedView" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}", + "(google.api.resource).plural": "instances", + "(google.api.resource).singular": "instance" + }, + "oneofs": { + "_satisfiesPzs": { + "oneof": [ + "satisfiesPzs" + ] + }, + "_satisfiesPzi": { + "oneof": [ + "satisfiesPzi" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 4 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "tags": { + "keyType": "string", + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_NOT_KNOWN": 0, + "READY": 1, + "CREATING": 2 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "PRODUCTION": 1, + "DEVELOPMENT": 2 + } + } + } + }, + "AutoscalingTargets": { + "fields": { + "cpuUtilizationPercent": { + "type": "int32", + "id": 2 + }, + "storageUtilizationGibPerNode": { + "type": "int32", + "id": 3 + } + } + }, + "AutoscalingLimits": { + "fields": { + "minServeNodes": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxServeNodes": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Cluster": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/Cluster", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/clusters/{cluster}", + "(google.api.resource).plural": "clusters", + "(google.api.resource).singular": "cluster" + }, + "oneofs": { + "config": { + "oneof": [ + "clusterConfig" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "location": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serveNodes": { + "type": "int32", + "id": 4 + }, + "nodeScalingFactor": { + "type": "NodeScalingFactor", + "id": 9, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "clusterConfig": { + "type": "ClusterConfig", + "id": 7 + }, + "defaultStorageType": { + "type": "StorageType", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_NOT_KNOWN": 0, + "READY": 1, + "CREATING": 2, + "RESIZING": 3, + "DISABLED": 4 + } + }, + "NodeScalingFactor": { + "values": { + "NODE_SCALING_FACTOR_UNSPECIFIED": 0, + "NODE_SCALING_FACTOR_1X": 1, + "NODE_SCALING_FACTOR_2X": 2 + } + }, + "ClusterAutoscalingConfig": { + "fields": { + "autoscalingLimits": { + "type": "AutoscalingLimits", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "autoscalingTargets": { + "type": "AutoscalingTargets", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ClusterConfig": { + "fields": { + "clusterAutoscalingConfig": { + "type": "ClusterAutoscalingConfig", + "id": 1 + } + } + }, + "EncryptionConfig": { + "fields": { + "kmsKeyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + } + } + } + }, + "AppProfile": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/AppProfile", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/appProfiles/{app_profile}", + "(google.api.resource).plural": "appProfiles", + "(google.api.resource).singular": "appProfile" + }, + "oneofs": { + "routingPolicy": { + "oneof": [ + "multiClusterRoutingUseAny", + "singleClusterRouting" + ] + }, + "isolation": { + "oneof": [ + "priority", + "standardIsolation", + "dataBoostIsolationReadOnly" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "etag": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "multiClusterRoutingUseAny": { + "type": "MultiClusterRoutingUseAny", + "id": 5 + }, + "singleClusterRouting": { + "type": "SingleClusterRouting", + "id": 6 + }, + "priority": { + "type": "Priority", + "id": 7, + "options": { + "deprecated": true + } + }, + "standardIsolation": { + "type": "StandardIsolation", + "id": 11 + }, + "dataBoostIsolationReadOnly": { + "type": "DataBoostIsolationReadOnly", + "id": 10 + } + }, + "nested": { + "MultiClusterRoutingUseAny": { + "oneofs": { + "affinity": { + "oneof": [ + "rowAffinity" + ] + } + }, + "fields": { + "clusterIds": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "rowAffinity": { + "type": "RowAffinity", + "id": 3 + } + }, + "nested": { + "RowAffinity": { + "fields": {} + } + } + }, + "SingleClusterRouting": { + "fields": { + "clusterId": { + "type": "string", + "id": 1 + }, + "allowTransactionalWrites": { + "type": "bool", + "id": 2 + } + } + }, + "Priority": { + "values": { + "PRIORITY_UNSPECIFIED": 0, + "PRIORITY_LOW": 1, + "PRIORITY_MEDIUM": 2, + "PRIORITY_HIGH": 3 + } + }, + "StandardIsolation": { + "fields": { + "priority": { + "type": "Priority", + "id": 1 + } + } + }, + "DataBoostIsolationReadOnly": { + "oneofs": { + "_computeBillingOwner": { + "oneof": [ + "computeBillingOwner" + ] + } + }, + "fields": { + "computeBillingOwner": { + "type": "ComputeBillingOwner", + "id": 1, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "ComputeBillingOwner": { + "values": { + "COMPUTE_BILLING_OWNER_UNSPECIFIED": 0, + "HOST_PAYS": 1 + } + } + } + } + } + }, + "HotTablet": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/HotTablet", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}", + "(google.api.resource).plural": "hotTablets", + "(google.api.resource).singular": "hotTablet" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "tableName": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startKey": { + "type": "string", + "id": 5 + }, + "endKey": { + "type": "string", + "id": 6 + }, + "nodeCpuUsagePercent": { + "type": "float", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "LogicalView": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/LogicalView", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/logicalViews/{logical_view}", + "(google.api.resource).plural": "logicalViews", + "(google.api.resource).singular": "logicalView" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deletionProtection": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MaterializedView": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/MaterializedView", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/materializedViews/{materialized_view}", + "(google.api.resource).plural": "materializedViews", + "(google.api.resource).singular": "materializedView" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deletionProtection": { + "type": "bool", + "id": 6 + } + } + }, + "StorageType": { + "values": { + "STORAGE_TYPE_UNSPECIFIED": 0, + "SSD": 1, + "HDD": 2 + } + }, + "OperationProgress": { + "fields": { + "progressPercent": { + "type": "int32", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "BigtableTableAdmin": { + "options": { + "(google.api.default_host)": "bigtableadmin.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigtable.admin,https://www.googleapis.com/auth/bigtable.admin.table,https://www.googleapis.com/auth/cloud-bigtable.admin,https://www.googleapis.com/auth/cloud-bigtable.admin.table,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "CreateTable": { + "requestType": "CreateTableRequest", + "responseType": "Table", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/tables", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,table_id,table" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/tables", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,table_id,table" + } + ] + }, + "CreateTableFromSnapshot": { + "requestType": "CreateTableFromSnapshotRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,table_id,source_snapshot", + "(google.longrunning.operation_info).response_type": "Table", + "(google.longrunning.operation_info).metadata_type": "CreateTableFromSnapshotMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,table_id,source_snapshot" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Table", + "metadata_type": "CreateTableFromSnapshotMetadata" + } + } + ] + }, + "ListTables": { + "requestType": "ListTablesRequest", + "responseType": "ListTablesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*}/tables", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*}/tables" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTable": { + "requestType": "GetTableRequest", + "responseType": "Table", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/tables/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/tables/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateTable": { + "requestType": "UpdateTableRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{table.name=projects/*/instances/*/tables/*}", + "(google.api.http).body": "table", + "(google.api.method_signature)": "table,update_mask", + "(google.longrunning.operation_info).response_type": "Table", + "(google.longrunning.operation_info).metadata_type": "UpdateTableMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{table.name=projects/*/instances/*/tables/*}", + "body": "table" + } + }, + { + "(google.api.method_signature)": "table,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Table", + "metadata_type": "UpdateTableMetadata" + } + } + ] + }, + "DeleteTable": { + "requestType": "DeleteTableRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/tables/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/tables/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UndeleteTable": { + "requestType": "UndeleteTableRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*/tables/*}:undelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Table", + "(google.longrunning.operation_info).metadata_type": "UndeleteTableMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*/tables/*}:undelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Table", + "metadata_type": "UndeleteTableMetadata" + } + } + ] + }, + "CreateAuthorizedView": { + "requestType": "CreateAuthorizedViewRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews", + "(google.api.http).body": "authorized_view", + "(google.api.method_signature)": "parent,authorized_view,authorized_view_id", + "(google.longrunning.operation_info).response_type": "AuthorizedView", + "(google.longrunning.operation_info).metadata_type": "CreateAuthorizedViewMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews", + "body": "authorized_view" + } + }, + { + "(google.api.method_signature)": "parent,authorized_view,authorized_view_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AuthorizedView", + "metadata_type": "CreateAuthorizedViewMetadata" + } + } + ] + }, + "ListAuthorizedViews": { + "requestType": "ListAuthorizedViewsRequest", + "responseType": "ListAuthorizedViewsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAuthorizedView": { + "requestType": "GetAuthorizedViewRequest", + "responseType": "AuthorizedView", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateAuthorizedView": { + "requestType": "UpdateAuthorizedViewRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{authorized_view.name=projects/*/instances/*/tables/*/authorizedViews/*}", + "(google.api.http).body": "authorized_view", + "(google.api.method_signature)": "authorized_view,update_mask", + "(google.longrunning.operation_info).response_type": "AuthorizedView", + "(google.longrunning.operation_info).metadata_type": "UpdateAuthorizedViewMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{authorized_view.name=projects/*/instances/*/tables/*/authorizedViews/*}", + "body": "authorized_view" + } + }, + { + "(google.api.method_signature)": "authorized_view,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AuthorizedView", + "metadata_type": "UpdateAuthorizedViewMetadata" + } + } + ] + }, + "DeleteAuthorizedView": { + "requestType": "DeleteAuthorizedViewRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ModifyColumnFamilies": { + "requestType": "ModifyColumnFamiliesRequest", + "responseType": "Table", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*/tables/*}:modifyColumnFamilies", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,modifications" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*/tables/*}:modifyColumnFamilies", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,modifications" + } + ] + }, + "DropRowRange": { + "requestType": "DropRowRangeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*/tables/*}:dropRowRange", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*/tables/*}:dropRowRange", + "body": "*" + } + } + ] + }, + "GenerateConsistencyToken": { + "requestType": "GenerateConsistencyTokenRequest", + "responseType": "GenerateConsistencyTokenResponse", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CheckConsistency": { + "requestType": "CheckConsistencyRequest", + "responseType": "CheckConsistencyResponse", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*/tables/*}:checkConsistency", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,consistency_token" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*/tables/*}:checkConsistency", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,consistency_token" + } + ] + }, + "SnapshotTable": { + "requestType": "SnapshotTableRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*/tables/*}:snapshot", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,cluster,snapshot_id,description", + "(google.longrunning.operation_info).response_type": "Snapshot", + "(google.longrunning.operation_info).metadata_type": "SnapshotTableMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*/tables/*}:snapshot", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,cluster,snapshot_id,description" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Snapshot", + "metadata_type": "SnapshotTableMetadata" + } + } + ] + }, + "GetSnapshot": { + "requestType": "GetSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSnapshots": { + "requestType": "ListSnapshotsRequest", + "responseType": "ListSnapshotsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*/clusters/*}/snapshots", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*/clusters/*}/snapshots" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteSnapshot": { + "requestType": "DeleteSnapshotRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateBackup": { + "requestType": "CreateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*/clusters/*}/backups", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "parent,backup_id,backup", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "CreateBackupMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*/clusters/*}/backups", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "parent,backup_id,backup" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "CreateBackupMetadata" + } + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/clusters/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/clusters/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).patch": "/v2/{backup.name=projects/*/instances/*/clusters/*/backups/*}", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "backup,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{backup.name=projects/*/instances/*/clusters/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/clusters/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/clusters/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*/clusters/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*/clusters/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RestoreTable": { + "requestType": "RestoreTableRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/tables:restore", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Table", + "(google.longrunning.operation_info).metadata_type": "RestoreTableMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/tables:restore", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Table", + "metadata_type": "RestoreTableMetadata" + } + } + ] + }, + "CopyBackup": { + "requestType": "CopyBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*/clusters/*}/backups:copy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "CopyBackupMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*/clusters/*}/backups:copy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "CopyBackupMetadata" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/instances/*/tables/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:getIamPolicy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/instances/*/tables/*}:getIamPolicy", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:getIamPolicy", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/tables/*/authorizedViews/*}:getIamPolicy", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:getIamPolicy", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/instances/*/tables/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:setIamPolicy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/instances/*/tables/*}:setIamPolicy", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:setIamPolicy", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/tables/*/authorizedViews/*}:setIamPolicy", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:setIamPolicy", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/instances/*/tables/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:testIamPermissions", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/instances/*/tables/*}:testIamPermissions", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:testIamPermissions", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/tables/*/authorizedViews/*}:testIamPermissions", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:testIamPermissions", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "CreateSchemaBundle": { + "requestType": "CreateSchemaBundleRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*/tables/*}/schemaBundles", + "(google.api.http).body": "schema_bundle", + "(google.api.method_signature)": "parent,schema_bundle_id,schema_bundle", + "(google.longrunning.operation_info).response_type": "SchemaBundle", + "(google.longrunning.operation_info).metadata_type": "CreateSchemaBundleMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*/tables/*}/schemaBundles", + "body": "schema_bundle" + } + }, + { + "(google.api.method_signature)": "parent,schema_bundle_id,schema_bundle" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "SchemaBundle", + "metadata_type": "CreateSchemaBundleMetadata" + } + } + ] + }, + "UpdateSchemaBundle": { + "requestType": "UpdateSchemaBundleRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{schema_bundle.name=projects/*/instances/*/tables/*/schemaBundles/*}", + "(google.api.http).body": "schema_bundle", + "(google.api.method_signature)": "schema_bundle,update_mask", + "(google.longrunning.operation_info).response_type": "SchemaBundle", + "(google.longrunning.operation_info).metadata_type": "UpdateSchemaBundleMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{schema_bundle.name=projects/*/instances/*/tables/*/schemaBundles/*}", + "body": "schema_bundle" + } + }, + { + "(google.api.method_signature)": "schema_bundle,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "SchemaBundle", + "metadata_type": "UpdateSchemaBundleMetadata" + } + } + ] + }, + "GetSchemaBundle": { + "requestType": "GetSchemaBundleRequest", + "responseType": "SchemaBundle", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/tables/*/schemaBundles/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/tables/*/schemaBundles/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSchemaBundles": { + "requestType": "ListSchemaBundlesRequest", + "responseType": "ListSchemaBundlesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*/tables/*}/schemaBundles", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*/tables/*}/schemaBundles" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteSchemaBundle": { + "requestType": "DeleteSchemaBundleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/tables/*/schemaBundles/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/tables/*/schemaBundles/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "RestoreTableRequest": { + "oneofs": { + "source": { + "oneof": [ + "backup" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "tableId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Backup" + } + } + } + }, + "RestoreTableMetadata": { + "oneofs": { + "sourceInfo": { + "oneof": [ + "backupInfo" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "sourceType": { + "type": "RestoreSourceType", + "id": 2 + }, + "backupInfo": { + "type": "BackupInfo", + "id": 3 + }, + "optimizeTableOperationName": { + "type": "string", + "id": 4 + }, + "progress": { + "type": "OperationProgress", + "id": 5 + } + } + }, + "OptimizeRestoredTableMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "progress": { + "type": "OperationProgress", + "id": 2 + } + } + }, + "CreateTableRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "tableId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "table": { + "type": "Table", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "initialSplits": { + "rule": "repeated", + "type": "Split", + "id": 4 + } + }, + "nested": { + "Split": { + "fields": { + "key": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "CreateTableFromSnapshotRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "tableId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceSnapshot": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Snapshot" + } + } + } + }, + "DropRowRangeRequest": { + "oneofs": { + "target": { + "oneof": [ + "rowKeyPrefix", + "deleteAllDataFromTable" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "rowKeyPrefix": { + "type": "bytes", + "id": 2 + }, + "deleteAllDataFromTable": { + "type": "bool", + "id": 3 + } + } + }, + "ListTablesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "view": { + "type": "Table.View", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListTablesResponse": { + "fields": { + "tables": { + "rule": "repeated", + "type": "Table", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTableRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "view": { + "type": "Table.View", + "id": 2 + } + } + }, + "UpdateTableRequest": { + "fields": { + "table": { + "type": "Table", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateTableMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "DeleteTableRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + } + } + }, + "UndeleteTableRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + } + } + }, + "UndeleteTableMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "ModifyColumnFamiliesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "modifications": { + "rule": "repeated", + "type": "Modification", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Modification": { + "oneofs": { + "mod": { + "oneof": [ + "create", + "update", + "drop" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "create": { + "type": "ColumnFamily", + "id": 2 + }, + "update": { + "type": "ColumnFamily", + "id": 3 + }, + "drop": { + "type": "bool", + "id": 4 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "GenerateConsistencyTokenRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + } + } + }, + "GenerateConsistencyTokenResponse": { + "fields": { + "consistencyToken": { + "type": "string", + "id": 1 + } + } + }, + "CheckConsistencyRequest": { + "oneofs": { + "mode": { + "oneof": [ + "standardReadRemoteWrites", + "dataBoostReadLocalWrites" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "consistencyToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "standardReadRemoteWrites": { + "type": "StandardReadRemoteWrites", + "id": 3 + }, + "dataBoostReadLocalWrites": { + "type": "DataBoostReadLocalWrites", + "id": 4 + } + } + }, + "StandardReadRemoteWrites": { + "fields": {} + }, + "DataBoostReadLocalWrites": { + "fields": {} + }, + "CheckConsistencyResponse": { + "fields": { + "consistent": { + "type": "bool", + "id": 1 + } + } + }, + "SnapshotTableRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "cluster": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + }, + "snapshotId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + } + } + }, + "GetSnapshotRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Snapshot" + } + } + } + }, + "ListSnapshotsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSnapshotsResponse": { + "fields": { + "snapshots": { + "rule": "repeated", + "type": "Snapshot", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteSnapshotRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Snapshot" + } + } + } + }, + "SnapshotTableMetadata": { + "fields": { + "originalRequest": { + "type": "SnapshotTableRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "CreateTableFromSnapshotMetadata": { + "fields": { + "originalRequest": { + "type": "CreateTableFromSnapshotRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "CreateBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + }, + "backupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "Backup", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateBackupMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "sourceTable": { + "type": "string", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "UpdateBackupRequest": { + "fields": { + "backup": { + "type": "Backup", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Backup" + } + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Backup" + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CopyBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + }, + "backupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceBackup": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Backup" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CopyBackupMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Backup" + } + }, + "sourceBackupInfo": { + "type": "BackupInfo", + "id": 2 + }, + "progress": { + "type": "OperationProgress", + "id": 3 + } + } + }, + "CreateAuthorizedViewRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "authorizedViewId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authorizedView": { + "type": "AuthorizedView", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateAuthorizedViewMetadata": { + "fields": { + "originalRequest": { + "type": "CreateAuthorizedViewRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "ListAuthorizedViewsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "AuthorizedView.ResponseView", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAuthorizedViewsResponse": { + "fields": { + "authorizedViews": { + "rule": "repeated", + "type": "AuthorizedView", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAuthorizedViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "view": { + "type": "AuthorizedView.ResponseView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateAuthorizedViewRequest": { + "fields": { + "authorizedView": { + "type": "AuthorizedView", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateAuthorizedViewMetadata": { + "fields": { + "originalRequest": { + "type": "UpdateAuthorizedViewRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "DeleteAuthorizedViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateSchemaBundleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "schemaBundleId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "schemaBundle": { + "type": "SchemaBundle", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateSchemaBundleMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "UpdateSchemaBundleRequest": { + "fields": { + "schemaBundle": { + "type": "SchemaBundle", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateSchemaBundleMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "GetSchemaBundleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/SchemaBundle" + } + } + } + }, + "ListSchemaBundlesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigtableadmin.googleapis.com/SchemaBundle" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSchemaBundlesResponse": { + "fields": { + "schemaBundles": { + "rule": "repeated", + "type": "SchemaBundle", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteSchemaBundleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/SchemaBundle" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreInfo": { + "oneofs": { + "sourceInfo": { + "oneof": [ + "backupInfo" + ] + } + }, + "fields": { + "sourceType": { + "type": "RestoreSourceType", + "id": 1 + }, + "backupInfo": { + "type": "BackupInfo", + "id": 2 + } + } + }, + "ChangeStreamConfig": { + "fields": { + "retentionPeriod": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "Table": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/Table", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/tables/{table}" + }, + "oneofs": { + "automatedBackupConfig": { + "oneof": [ + "automatedBackupPolicy" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "clusterStates": { + "keyType": "string", + "type": "ClusterState", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "columnFamilies": { + "keyType": "string", + "type": "ColumnFamily", + "id": 3 + }, + "granularity": { + "type": "TimestampGranularity", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "restoreInfo": { + "type": "RestoreInfo", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "changeStreamConfig": { + "type": "ChangeStreamConfig", + "id": 8 + }, + "deletionProtection": { + "type": "bool", + "id": 9 + }, + "automatedBackupPolicy": { + "type": "AutomatedBackupPolicy", + "id": 13 + }, + "rowKeySchema": { + "type": "Type.Struct", + "id": 15 + } + }, + "nested": { + "ClusterState": { + "fields": { + "replicationState": { + "type": "ReplicationState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionInfo": { + "rule": "repeated", + "type": "EncryptionInfo", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ReplicationState": { + "values": { + "STATE_NOT_KNOWN": 0, + "INITIALIZING": 1, + "PLANNED_MAINTENANCE": 2, + "UNPLANNED_MAINTENANCE": 3, + "READY": 4, + "READY_OPTIMIZING": 5 + } + } + } + }, + "TimestampGranularity": { + "values": { + "TIMESTAMP_GRANULARITY_UNSPECIFIED": 0, + "MILLIS": 1 + } + }, + "View": { + "values": { + "VIEW_UNSPECIFIED": 0, + "NAME_ONLY": 1, + "SCHEMA_VIEW": 2, + "REPLICATION_VIEW": 3, + "ENCRYPTION_VIEW": 5, + "FULL": 4 + } + }, + "AutomatedBackupPolicy": { + "fields": { + "retentionPeriod": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "frequency": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "AuthorizedView": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/AuthorizedView", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}", + "(google.api.resource).plural": "authorizedViews", + "(google.api.resource).singular": "authorizedView" + }, + "oneofs": { + "authorizedView": { + "oneof": [ + "subsetView" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "subsetView": { + "type": "SubsetView", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + }, + "deletionProtection": { + "type": "bool", + "id": 4 + } + }, + "nested": { + "FamilySubsets": { + "fields": { + "qualifiers": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "qualifierPrefixes": { + "rule": "repeated", + "type": "bytes", + "id": 2 + } + } + }, + "SubsetView": { + "fields": { + "rowPrefixes": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "familySubsets": { + "keyType": "string", + "type": "FamilySubsets", + "id": 2 + } + } + }, + "ResponseView": { + "values": { + "RESPONSE_VIEW_UNSPECIFIED": 0, + "NAME_ONLY": 1, + "BASIC": 2, + "FULL": 3 + } + } + } + }, + "ColumnFamily": { + "fields": { + "gcRule": { + "type": "GcRule", + "id": 1 + }, + "valueType": { + "type": "Type", + "id": 3 + } + } + }, + "GcRule": { + "oneofs": { + "rule": { + "oneof": [ + "maxNumVersions", + "maxAge", + "intersection", + "union" + ] + } + }, + "fields": { + "maxNumVersions": { + "type": "int32", + "id": 1 + }, + "maxAge": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "intersection": { + "type": "Intersection", + "id": 3 + }, + "union": { + "type": "Union", + "id": 4 + } + }, + "nested": { + "Intersection": { + "fields": { + "rules": { + "rule": "repeated", + "type": "GcRule", + "id": 1 + } + } + }, + "Union": { + "fields": { + "rules": { + "rule": "repeated", + "type": "GcRule", + "id": 1 + } + } + } + } + }, + "EncryptionInfo": { + "fields": { + "encryptionType": { + "type": "EncryptionType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionStatus": { + "type": "google.rpc.Status", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + }, + "nested": { + "EncryptionType": { + "values": { + "ENCRYPTION_TYPE_UNSPECIFIED": 0, + "GOOGLE_DEFAULT_ENCRYPTION": 1, + "CUSTOMER_MANAGED_ENCRYPTION": 2 + } + } + } + }, + "Snapshot": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/Snapshot", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "sourceTable": { + "type": "Table", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSizeBytes": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 7 + } + }, + "nested": { + "State": { + "values": { + "STATE_NOT_KNOWN": 0, + "READY": 1, + "CREATING": 2 + } + } + } + }, + "Backup": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "sourceTable": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceBackup": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sizeBytes": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupType": { + "type": "BackupType", + "id": 11 + }, + "hotToStandardTime": { + "type": "google.protobuf.Timestamp", + "id": 12 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2 + } + }, + "BackupType": { + "values": { + "BACKUP_TYPE_UNSPECIFIED": 0, + "STANDARD": 1, + "HOT": 2 + } + } + } + }, + "BackupInfo": { + "fields": { + "backup": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceTable": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceBackup": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RestoreSourceType": { + "values": { + "RESTORE_SOURCE_TYPE_UNSPECIFIED": 0, + "BACKUP": 1 + } + }, + "ProtoSchema": { + "fields": { + "protoDescriptors": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SchemaBundle": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/SchemaBundle", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}", + "(google.api.resource).plural": "schemaBundles", + "(google.api.resource).singular": "schemaBundle" + }, + "oneofs": { + "type": { + "oneof": [ + "protoSchema" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "protoSchema": { + "type": "ProtoSchema", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Type": { + "oneofs": { + "kind": { + "oneof": [ + "bytesType", + "stringType", + "int64Type", + "float32Type", + "float64Type", + "boolType", + "timestampType", + "dateType", + "aggregateType", + "structType", + "arrayType", + "mapType", + "protoType", + "enumType" + ] + } + }, + "fields": { + "bytesType": { + "type": "Bytes", + "id": 1 + }, + "stringType": { + "type": "String", + "id": 2 + }, + "int64Type": { + "type": "Int64", + "id": 5 + }, + "float32Type": { + "type": "Float32", + "id": 12 + }, + "float64Type": { + "type": "Float64", + "id": 9 + }, + "boolType": { + "type": "Bool", + "id": 8 + }, + "timestampType": { + "type": "Timestamp", + "id": 10 + }, + "dateType": { + "type": "Date", + "id": 11 + }, + "aggregateType": { + "type": "Aggregate", + "id": 6 + }, + "structType": { + "type": "Struct", + "id": 7 + }, + "arrayType": { + "type": "Array", + "id": 3 + }, + "mapType": { + "type": "Map", + "id": 4 + }, + "protoType": { + "type": "Proto", + "id": 13 + }, + "enumType": { + "type": "Enum", + "id": 14 + } + }, + "nested": { + "Bytes": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "raw" + ] + } + }, + "fields": { + "raw": { + "type": "Raw", + "id": 1 + } + }, + "nested": { + "Raw": { + "fields": {} + } + } + } + } + }, + "String": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "utf8Raw", + "utf8Bytes" + ] + } + }, + "fields": { + "utf8Raw": { + "type": "Utf8Raw", + "id": 1, + "options": { + "deprecated": true + } + }, + "utf8Bytes": { + "type": "Utf8Bytes", + "id": 2 + } + }, + "nested": { + "Utf8Raw": { + "options": { + "deprecated": true + }, + "fields": {} + }, + "Utf8Bytes": { + "fields": {} + } + } + } + } + }, + "Int64": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "bigEndianBytes", + "orderedCodeBytes" + ] + } + }, + "fields": { + "bigEndianBytes": { + "type": "BigEndianBytes", + "id": 1 + }, + "orderedCodeBytes": { + "type": "OrderedCodeBytes", + "id": 2 + } + }, + "nested": { + "BigEndianBytes": { + "fields": { + "bytesType": { + "type": "Bytes", + "id": 1, + "options": { + "deprecated": true + } + } + } + }, + "OrderedCodeBytes": { + "fields": {} + } + } + } + } + }, + "Bool": { + "fields": {} + }, + "Float32": { + "fields": {} + }, + "Float64": { + "fields": {} + }, + "Timestamp": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "unixMicrosInt64" + ] + } + }, + "fields": { + "unixMicrosInt64": { + "type": "Int64.Encoding", + "id": 1 + } + } + } + } + }, + "Date": { + "fields": {} + }, + "Struct": { + "fields": { + "fields": { + "rule": "repeated", + "type": "Field", + "id": 1 + }, + "encoding": { + "type": "Encoding", + "id": 2 + } + }, + "nested": { + "Field": { + "fields": { + "fieldName": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + } + } + }, + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "singleton", + "delimitedBytes", + "orderedCodeBytes" + ] + } + }, + "fields": { + "singleton": { + "type": "Singleton", + "id": 1 + }, + "delimitedBytes": { + "type": "DelimitedBytes", + "id": 2 + }, + "orderedCodeBytes": { + "type": "OrderedCodeBytes", + "id": 3 + } + }, + "nested": { + "Singleton": { + "fields": {} + }, + "DelimitedBytes": { + "fields": { + "delimiter": { + "type": "bytes", + "id": 1 + } + } + }, + "OrderedCodeBytes": { + "fields": {} + } + } + } + } + }, + "Proto": { + "fields": { + "schemaBundleId": { + "type": "string", + "id": 1 + }, + "messageName": { + "type": "string", + "id": 2 + } + } + }, + "Enum": { + "fields": { + "schemaBundleId": { + "type": "string", + "id": 1 + }, + "enumName": { + "type": "string", + "id": 2 + } + } + }, + "Array": { + "fields": { + "elementType": { + "type": "Type", + "id": 1 + } + } + }, + "Map": { + "fields": { + "keyType": { + "type": "Type", + "id": 1 + }, + "valueType": { + "type": "Type", + "id": 2 + } + } + }, + "Aggregate": { + "oneofs": { + "aggregator": { + "oneof": [ + "sum", + "hllppUniqueCount", + "max", + "min" + ] + } + }, + "fields": { + "inputType": { + "type": "Type", + "id": 1 + }, + "stateType": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sum": { + "type": "Sum", + "id": 4 + }, + "hllppUniqueCount": { + "type": "HyperLogLogPlusPlusUniqueCount", + "id": 5 + }, + "max": { + "type": "Max", + "id": 6 + }, + "min": { + "type": "Min", + "id": 7 + } + }, + "nested": { + "Sum": { + "fields": {} + }, + "Max": { + "fields": {} + }, + "Min": { + "fields": {} + }, + "HyperLogLogPlusPlusUniqueCount": { + "fields": {} + } + } + } + } + } + } + } + } + }, + "v2": { + "options": { + "csharp_namespace": "Google.Cloud.Bigtable.V2", + "go_package": "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb", + "java_multiple_files": true, + "java_outer_classname": "ResponseParamsProto", + "java_package": "com.google.bigtable.v2", + "php_namespace": "Google\\Cloud\\Bigtable\\V2", + "ruby_package": "Google::Cloud::Bigtable::V2", + "(google.api.resource_definition).type": "bigtableadmin.googleapis.com/MaterializedView", + "(google.api.resource_definition).pattern": "projects/{project}/instances/{instance}/materializedViews/{materialized_view}" + }, + "nested": { + "Bigtable": { + "options": { + "(google.api.default_host)": "bigtable.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigtable.data,https://www.googleapis.com/auth/bigtable.data.readonly,https://www.googleapis.com/auth/cloud-bigtable.data,https://www.googleapis.com/auth/cloud-bigtable.data.readonly,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ReadRows": { + "requestType": "ReadRowsRequest", + "responseType": "ReadRowsResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:readRows", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{materialized_view_name=projects/*/instances/*/materializedViews/*}:readRows", + "(google.api.http).additional_bindings.body": "*", + "(google.api.routing).routing_parameters.field": "materialized_view_name", + "(google.api.routing).routing_parameters.path_template": "{name=projects/*/instances/*}/**", + "(google.api.method_signature)": "table_name,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:readRows", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readRows", + "body": "*" + }, + { + "post": "/v2/{materialized_view_name=projects/*/instances/*/materializedViews/*}:readRows", + "body": "*" + } + ] + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "table_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}" + }, + { + "field": "app_profile_id" + }, + { + "field": "authorized_view_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}/**" + }, + { + "field": "materialized_view_name", + "path_template": "{name=projects/*/instances/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "table_name" + }, + { + "(google.api.method_signature)": "table_name,app_profile_id" + } + ] + }, + "SampleRowKeys": { + "requestType": "SampleRowKeysRequest", + "responseType": "SampleRowKeysResponse", + "responseStream": true, + "options": { + "(google.api.http).get": "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys", + "(google.api.http).additional_bindings.get": "/v2/{materialized_view_name=projects/*/instances/*/materializedViews/*}:sampleRowKeys", + "(google.api.routing).routing_parameters.field": "materialized_view_name", + "(google.api.routing).routing_parameters.path_template": "{name=projects/*/instances/*}/**", + "(google.api.method_signature)": "table_name,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys", + "additional_bindings": [ + { + "get": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:sampleRowKeys" + }, + { + "get": "/v2/{materialized_view_name=projects/*/instances/*/materializedViews/*}:sampleRowKeys" + } + ] + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "table_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}" + }, + { + "field": "app_profile_id" + }, + { + "field": "authorized_view_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}/**" + }, + { + "field": "materialized_view_name", + "path_template": "{name=projects/*/instances/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "table_name" + }, + { + "(google.api.method_signature)": "table_name,app_profile_id" + } + ] + }, + "MutateRow": { + "requestType": "MutateRowRequest", + "responseType": "MutateRowResponse", + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRow", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRow", + "(google.api.http).additional_bindings.body": "*", + "(google.api.routing).routing_parameters.field": "authorized_view_name", + "(google.api.routing).routing_parameters.path_template": "{table_name=projects/*/instances/*/tables/*}/**", + "(google.api.method_signature)": "table_name,row_key,mutations,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRow", + "body": "*", + "additional_bindings": { + "post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRow", + "body": "*" + } + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "table_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}" + }, + { + "field": "app_profile_id" + }, + { + "field": "authorized_view_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "table_name,row_key,mutations" + }, + { + "(google.api.method_signature)": "table_name,row_key,mutations,app_profile_id" + } + ] + }, + "MutateRows": { + "requestType": "MutateRowsRequest", + "responseType": "MutateRowsResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRows", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRows", + "(google.api.http).additional_bindings.body": "*", + "(google.api.routing).routing_parameters.field": "authorized_view_name", + "(google.api.routing).routing_parameters.path_template": "{table_name=projects/*/instances/*/tables/*}/**", + "(google.api.method_signature)": "table_name,entries,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRows", + "body": "*", + "additional_bindings": { + "post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRows", + "body": "*" + } + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "table_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}" + }, + { + "field": "app_profile_id" + }, + { + "field": "authorized_view_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "table_name,entries" + }, + { + "(google.api.method_signature)": "table_name,entries,app_profile_id" + } + ] + }, + "CheckAndMutateRow": { + "requestType": "CheckAndMutateRowRequest", + "responseType": "CheckAndMutateRowResponse", + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:checkAndMutateRow", + "(google.api.http).additional_bindings.body": "*", + "(google.api.routing).routing_parameters.field": "authorized_view_name", + "(google.api.routing).routing_parameters.path_template": "{table_name=projects/*/instances/*/tables/*}/**", + "(google.api.method_signature)": "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow", + "body": "*", + "additional_bindings": { + "post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:checkAndMutateRow", + "body": "*" + } + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "table_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}" + }, + { + "field": "app_profile_id" + }, + { + "field": "authorized_view_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "table_name,row_key,predicate_filter,true_mutations,false_mutations" + }, + { + "(google.api.method_signature)": "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id" + } + ] + }, + "PingAndWarm": { + "requestType": "PingAndWarmRequest", + "responseType": "PingAndWarmResponse", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*}:ping", + "(google.api.http).body": "*", + "(google.api.routing).routing_parameters.field": "app_profile_id", + "(google.api.routing).routing_parameters.path_template": "{name=projects/*/instances/*}", + "(google.api.method_signature)": "name,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*}:ping", + "body": "*" + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "name", + "path_template": "{name=projects/*/instances/*}" + }, + { + "field": "app_profile_id" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.api.method_signature)": "name,app_profile_id" + } + ] + }, + "ReadModifyWriteRow": { + "requestType": "ReadModifyWriteRowRequest", + "responseType": "ReadModifyWriteRowResponse", + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readModifyWriteRow", + "(google.api.http).additional_bindings.body": "*", + "(google.api.routing).routing_parameters.field": "authorized_view_name", + "(google.api.routing).routing_parameters.path_template": "{table_name=projects/*/instances/*/tables/*}/**", + "(google.api.method_signature)": "table_name,row_key,rules,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow", + "body": "*", + "additional_bindings": { + "post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readModifyWriteRow", + "body": "*" + } + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "table_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}" + }, + { + "field": "app_profile_id" + }, + { + "field": "authorized_view_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "table_name,row_key,rules" + }, + { + "(google.api.method_signature)": "table_name,row_key,rules,app_profile_id" + } + ] + }, + "GenerateInitialChangeStreamPartitions": { + "requestType": "GenerateInitialChangeStreamPartitionsRequest", + "responseType": "GenerateInitialChangeStreamPartitionsResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:generateInitialChangeStreamPartitions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "table_name,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:generateInitialChangeStreamPartitions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "table_name" + }, + { + "(google.api.method_signature)": "table_name,app_profile_id" + } + ] + }, + "ReadChangeStream": { + "requestType": "ReadChangeStreamRequest", + "responseType": "ReadChangeStreamResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:readChangeStream", + "(google.api.http).body": "*", + "(google.api.method_signature)": "table_name,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:readChangeStream", + "body": "*" + } + }, + { + "(google.api.method_signature)": "table_name" + }, + { + "(google.api.method_signature)": "table_name,app_profile_id" + } + ] + }, + "PrepareQuery": { + "requestType": "PrepareQueryRequest", + "responseType": "PrepareQueryResponse", + "options": { + "(google.api.http).post": "/v2/{instance_name=projects/*/instances/*}:prepareQuery", + "(google.api.http).body": "*", + "(google.api.routing).routing_parameters.field": "app_profile_id", + "(google.api.routing).routing_parameters.path_template": "{name=projects/*/instances/*}", + "(google.api.method_signature)": "instance_name,query,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{instance_name=projects/*/instances/*}:prepareQuery", + "body": "*" + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "instance_name", + "path_template": "{name=projects/*/instances/*}" + }, + { + "field": "app_profile_id" + } + ] + } + }, + { + "(google.api.method_signature)": "instance_name,query" + }, + { + "(google.api.method_signature)": "instance_name,query,app_profile_id" + } + ] + }, + "ExecuteQuery": { + "requestType": "ExecuteQueryRequest", + "responseType": "ExecuteQueryResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v2/{instance_name=projects/*/instances/*}:executeQuery", + "(google.api.http).body": "*", + "(google.api.routing).routing_parameters.field": "app_profile_id", + "(google.api.routing).routing_parameters.path_template": "{name=projects/*/instances/*}", + "(google.api.method_signature)": "instance_name,query,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{instance_name=projects/*/instances/*}:executeQuery", + "body": "*" + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "instance_name", + "path_template": "{name=projects/*/instances/*}" + }, + { + "field": "app_profile_id" + } + ] + } + }, + { + "(google.api.method_signature)": "instance_name,query" + }, + { + "(google.api.method_signature)": "instance_name,query,app_profile_id" + } + ] + } + } + }, + "ReadRowsRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "authorizedViewName": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "materializedViewName": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/MaterializedView" + } + }, + "appProfileId": { + "type": "string", + "id": 5 + }, + "rows": { + "type": "RowSet", + "id": 2 + }, + "filter": { + "type": "RowFilter", + "id": 3 + }, + "rowsLimit": { + "type": "int64", + "id": 4 + }, + "requestStatsView": { + "type": "RequestStatsView", + "id": 6 + }, + "reversed": { + "type": "bool", + "id": 7 + } + }, + "nested": { + "RequestStatsView": { + "values": { + "REQUEST_STATS_VIEW_UNSPECIFIED": 0, + "REQUEST_STATS_NONE": 1, + "REQUEST_STATS_FULL": 2 + } + } + } + }, + "ReadRowsResponse": { + "fields": { + "chunks": { + "rule": "repeated", + "type": "CellChunk", + "id": 1 + }, + "lastScannedRowKey": { + "type": "bytes", + "id": 2 + }, + "requestStats": { + "type": "RequestStats", + "id": 3 + } + }, + "nested": { + "CellChunk": { + "oneofs": { + "rowStatus": { + "oneof": [ + "resetRow", + "commitRow" + ] + } + }, + "fields": { + "rowKey": { + "type": "bytes", + "id": 1 + }, + "familyName": { + "type": "google.protobuf.StringValue", + "id": 2 + }, + "qualifier": { + "type": "google.protobuf.BytesValue", + "id": 3 + }, + "timestampMicros": { + "type": "int64", + "id": 4 + }, + "labels": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "value": { + "type": "bytes", + "id": 6 + }, + "valueSize": { + "type": "int32", + "id": 7 + }, + "resetRow": { + "type": "bool", + "id": 8 + }, + "commitRow": { + "type": "bool", + "id": 9 + } + } + } + } + }, + "SampleRowKeysRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "authorizedViewName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "materializedViewName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/MaterializedView" + } + }, + "appProfileId": { + "type": "string", + "id": 2 + } + } + }, + "SampleRowKeysResponse": { + "fields": { + "rowKey": { + "type": "bytes", + "id": 1 + }, + "offsetBytes": { + "type": "int64", + "id": 2 + } + } + }, + "MutateRowRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "authorizedViewName": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "appProfileId": { + "type": "string", + "id": 4 + }, + "rowKey": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mutations": { + "rule": "repeated", + "type": "Mutation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "idempotency": { + "type": "Idempotency", + "id": 8 + } + } + }, + "MutateRowResponse": { + "fields": {} + }, + "MutateRowsRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "authorizedViewName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "appProfileId": { + "type": "string", + "id": 3 + }, + "entries": { + "rule": "repeated", + "type": "Entry", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Entry": { + "fields": { + "rowKey": { + "type": "bytes", + "id": 1 + }, + "mutations": { + "rule": "repeated", + "type": "Mutation", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "idempotency": { + "type": "Idempotency", + "id": 3 + } + } + } + } + }, + "MutateRowsResponse": { + "oneofs": { + "_rateLimitInfo": { + "oneof": [ + "rateLimitInfo" + ] + } + }, + "fields": { + "entries": { + "rule": "repeated", + "type": "Entry", + "id": 1 + }, + "rateLimitInfo": { + "type": "RateLimitInfo", + "id": 3, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Entry": { + "fields": { + "index": { + "type": "int64", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + } + } + } + } + }, + "RateLimitInfo": { + "fields": { + "period": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "factor": { + "type": "double", + "id": 2 + } + } + }, + "CheckAndMutateRowRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "authorizedViewName": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "appProfileId": { + "type": "string", + "id": 7 + }, + "rowKey": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "predicateFilter": { + "type": "RowFilter", + "id": 6 + }, + "trueMutations": { + "rule": "repeated", + "type": "Mutation", + "id": 4 + }, + "falseMutations": { + "rule": "repeated", + "type": "Mutation", + "id": 5 + } + } + }, + "CheckAndMutateRowResponse": { + "fields": { + "predicateMatched": { + "type": "bool", + "id": 1 + } + } + }, + "PingAndWarmRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "appProfileId": { + "type": "string", + "id": 2 + } + } + }, + "PingAndWarmResponse": { + "fields": {} + }, + "ReadModifyWriteRowRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "authorizedViewName": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "appProfileId": { + "type": "string", + "id": 4 + }, + "rowKey": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rules": { + "rule": "repeated", + "type": "ReadModifyWriteRule", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ReadModifyWriteRowResponse": { + "fields": { + "row": { + "type": "Row", + "id": 1 + } + } + }, + "GenerateInitialChangeStreamPartitionsRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "appProfileId": { + "type": "string", + "id": 2 + } + } + }, + "GenerateInitialChangeStreamPartitionsResponse": { + "fields": { + "partition": { + "type": "StreamPartition", + "id": 1 + } + } + }, + "ReadChangeStreamRequest": { + "oneofs": { + "startFrom": { + "oneof": [ + "startTime", + "continuationTokens" + ] + } + }, + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "appProfileId": { + "type": "string", + "id": 2 + }, + "partition": { + "type": "StreamPartition", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "continuationTokens": { + "type": "StreamContinuationTokens", + "id": 6 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "heartbeatDuration": { + "type": "google.protobuf.Duration", + "id": 7 + } + } + }, + "ReadChangeStreamResponse": { + "oneofs": { + "streamRecord": { + "oneof": [ + "dataChange", + "heartbeat", + "closeStream" + ] + } + }, + "fields": { + "dataChange": { + "type": "DataChange", + "id": 1 + }, + "heartbeat": { + "type": "Heartbeat", + "id": 2 + }, + "closeStream": { + "type": "CloseStream", + "id": 3 + } + }, + "nested": { + "MutationChunk": { + "fields": { + "chunkInfo": { + "type": "ChunkInfo", + "id": 1 + }, + "mutation": { + "type": "Mutation", + "id": 2 + } + }, + "nested": { + "ChunkInfo": { + "fields": { + "chunkedValueSize": { + "type": "int32", + "id": 1 + }, + "chunkedValueOffset": { + "type": "int32", + "id": 2 + }, + "lastChunk": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "DataChange": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "sourceClusterId": { + "type": "string", + "id": 2 + }, + "rowKey": { + "type": "bytes", + "id": 3 + }, + "commitTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "tiebreaker": { + "type": "int32", + "id": 5 + }, + "chunks": { + "rule": "repeated", + "type": "MutationChunk", + "id": 6 + }, + "done": { + "type": "bool", + "id": 8 + }, + "token": { + "type": "string", + "id": 9 + }, + "estimatedLowWatermark": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "USER": 1, + "GARBAGE_COLLECTION": 2, + "CONTINUATION": 3 + } + } + } + }, + "Heartbeat": { + "fields": { + "continuationToken": { + "type": "StreamContinuationToken", + "id": 1 + }, + "estimatedLowWatermark": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "CloseStream": { + "fields": { + "status": { + "type": "google.rpc.Status", + "id": 1 + }, + "continuationTokens": { + "rule": "repeated", + "type": "StreamContinuationToken", + "id": 2 + }, + "newPartitions": { + "rule": "repeated", + "type": "StreamPartition", + "id": 3 + } + } + } + } + }, + "ExecuteQueryRequest": { + "oneofs": { + "dataFormat": { + "oneof": [ + "protoFormat" + ] + } + }, + "fields": { + "instanceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "appProfileId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "query": { + "type": "string", + "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "REQUIRED" + } + }, + "preparedQuery": { + "type": "bytes", + "id": 9 + }, + "protoFormat": { + "type": "ProtoFormat", + "id": 4, + "options": { + "deprecated": true + } + }, + "resumeToken": { + "type": "bytes", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "params": { + "keyType": "string", + "type": "Value", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExecuteQueryResponse": { + "oneofs": { + "response": { + "oneof": [ + "metadata", + "results" + ] + } + }, + "fields": { + "metadata": { + "type": "ResultSetMetadata", + "id": 1 + }, + "results": { + "type": "PartialResultSet", + "id": 2 + } + } + }, + "PrepareQueryRequest": { + "oneofs": { + "dataFormat": { + "oneof": [ + "protoFormat" + ] + } + }, + "fields": { + "instanceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "appProfileId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "query": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "protoFormat": { + "type": "ProtoFormat", + "id": 4 + }, + "paramTypes": { + "keyType": "string", + "type": "Type", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PrepareQueryResponse": { + "fields": { + "metadata": { + "type": "ResultSetMetadata", + "id": 1 + }, + "preparedQuery": { + "type": "bytes", + "id": 2 + }, + "validUntil": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "Row": { + "fields": { + "key": { + "type": "bytes", + "id": 1 + }, + "families": { + "rule": "repeated", + "type": "Family", + "id": 2 + } + } + }, + "Family": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "columns": { + "rule": "repeated", + "type": "Column", + "id": 2 + } + } + }, + "Column": { + "fields": { + "qualifier": { + "type": "bytes", + "id": 1 + }, + "cells": { + "rule": "repeated", + "type": "Cell", + "id": 2 + } + } + }, + "Cell": { + "fields": { + "timestampMicros": { + "type": "int64", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + }, + "labels": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "rawValue", + "rawTimestampMicros", + "bytesValue", + "stringValue", + "intValue", + "boolValue", + "floatValue", + "timestampValue", + "dateValue", + "arrayValue" + ] + } + }, + "fields": { + "type": { + "type": "Type", + "id": 7 + }, + "rawValue": { + "type": "bytes", + "id": 8 + }, + "rawTimestampMicros": { + "type": "int64", + "id": 9 + }, + "bytesValue": { + "type": "bytes", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "intValue": { + "type": "int64", + "id": 6 + }, + "boolValue": { + "type": "bool", + "id": 10 + }, + "floatValue": { + "type": "double", + "id": 11 + }, + "timestampValue": { + "type": "google.protobuf.Timestamp", + "id": 12 + }, + "dateValue": { + "type": "google.type.Date", + "id": 13 + }, + "arrayValue": { + "type": "ArrayValue", + "id": 4 + } + } + }, + "ArrayValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "RowRange": { + "oneofs": { + "startKey": { + "oneof": [ + "startKeyClosed", + "startKeyOpen" + ] + }, + "endKey": { + "oneof": [ + "endKeyOpen", + "endKeyClosed" + ] + } + }, + "fields": { + "startKeyClosed": { + "type": "bytes", + "id": 1 + }, + "startKeyOpen": { + "type": "bytes", + "id": 2 + }, + "endKeyOpen": { + "type": "bytes", + "id": 3 + }, + "endKeyClosed": { + "type": "bytes", + "id": 4 + } + } + }, + "RowSet": { + "fields": { + "rowKeys": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "rowRanges": { + "rule": "repeated", + "type": "RowRange", + "id": 2 + } + } + }, + "ColumnRange": { + "oneofs": { + "startQualifier": { + "oneof": [ + "startQualifierClosed", + "startQualifierOpen" + ] + }, + "endQualifier": { + "oneof": [ + "endQualifierClosed", + "endQualifierOpen" + ] + } + }, + "fields": { + "familyName": { + "type": "string", + "id": 1 + }, + "startQualifierClosed": { + "type": "bytes", + "id": 2 + }, + "startQualifierOpen": { + "type": "bytes", + "id": 3 + }, + "endQualifierClosed": { + "type": "bytes", + "id": 4 + }, + "endQualifierOpen": { + "type": "bytes", + "id": 5 + } + } + }, + "TimestampRange": { + "fields": { + "startTimestampMicros": { + "type": "int64", + "id": 1 + }, + "endTimestampMicros": { + "type": "int64", + "id": 2 + } + } + }, + "ValueRange": { + "oneofs": { + "startValue": { + "oneof": [ + "startValueClosed", + "startValueOpen" + ] + }, + "endValue": { + "oneof": [ + "endValueClosed", + "endValueOpen" + ] + } + }, + "fields": { + "startValueClosed": { + "type": "bytes", + "id": 1 + }, + "startValueOpen": { + "type": "bytes", + "id": 2 + }, + "endValueClosed": { + "type": "bytes", + "id": 3 + }, + "endValueOpen": { + "type": "bytes", + "id": 4 + } + } + }, + "RowFilter": { + "oneofs": { + "filter": { + "oneof": [ + "chain", + "interleave", + "condition", + "sink", + "passAllFilter", + "blockAllFilter", + "rowKeyRegexFilter", + "rowSampleFilter", + "familyNameRegexFilter", + "columnQualifierRegexFilter", + "columnRangeFilter", + "timestampRangeFilter", + "valueRegexFilter", + "valueRangeFilter", + "cellsPerRowOffsetFilter", + "cellsPerRowLimitFilter", + "cellsPerColumnLimitFilter", + "stripValueTransformer", + "applyLabelTransformer" + ] + } + }, + "fields": { + "chain": { + "type": "Chain", + "id": 1 + }, + "interleave": { + "type": "Interleave", + "id": 2 + }, + "condition": { + "type": "Condition", + "id": 3 + }, + "sink": { + "type": "bool", + "id": 16 + }, + "passAllFilter": { + "type": "bool", + "id": 17 + }, + "blockAllFilter": { + "type": "bool", + "id": 18 + }, + "rowKeyRegexFilter": { + "type": "bytes", + "id": 4 + }, + "rowSampleFilter": { + "type": "double", + "id": 14 + }, + "familyNameRegexFilter": { + "type": "string", + "id": 5 + }, + "columnQualifierRegexFilter": { + "type": "bytes", + "id": 6 + }, + "columnRangeFilter": { + "type": "ColumnRange", + "id": 7 + }, + "timestampRangeFilter": { + "type": "TimestampRange", + "id": 8 + }, + "valueRegexFilter": { + "type": "bytes", + "id": 9 + }, + "valueRangeFilter": { + "type": "ValueRange", + "id": 15 + }, + "cellsPerRowOffsetFilter": { + "type": "int32", + "id": 10 + }, + "cellsPerRowLimitFilter": { + "type": "int32", + "id": 11 + }, + "cellsPerColumnLimitFilter": { + "type": "int32", + "id": 12 + }, + "stripValueTransformer": { + "type": "bool", + "id": 13 + }, + "applyLabelTransformer": { + "type": "string", + "id": 19 + } + }, + "nested": { + "Chain": { + "fields": { + "filters": { + "rule": "repeated", + "type": "RowFilter", + "id": 1 + } + } + }, + "Interleave": { + "fields": { + "filters": { + "rule": "repeated", + "type": "RowFilter", + "id": 1 + } + } + }, + "Condition": { + "fields": { + "predicateFilter": { + "type": "RowFilter", + "id": 1 + }, + "trueFilter": { + "type": "RowFilter", + "id": 2 + }, + "falseFilter": { + "type": "RowFilter", + "id": 3 + } + } + } + } + }, + "Mutation": { + "oneofs": { + "mutation": { + "oneof": [ + "setCell", + "addToCell", + "mergeToCell", + "deleteFromColumn", + "deleteFromFamily", + "deleteFromRow" + ] + } + }, + "fields": { + "setCell": { + "type": "SetCell", + "id": 1 + }, + "addToCell": { + "type": "AddToCell", + "id": 5 + }, + "mergeToCell": { + "type": "MergeToCell", + "id": 6 + }, + "deleteFromColumn": { + "type": "DeleteFromColumn", + "id": 2 + }, + "deleteFromFamily": { + "type": "DeleteFromFamily", + "id": 3 + }, + "deleteFromRow": { + "type": "DeleteFromRow", + "id": 4 + } + }, + "nested": { + "SetCell": { + "fields": { + "familyName": { + "type": "string", + "id": 1 + }, + "columnQualifier": { + "type": "bytes", + "id": 2 + }, + "timestampMicros": { + "type": "int64", + "id": 3 + }, + "value": { + "type": "bytes", + "id": 4 + } + } + }, + "AddToCell": { + "fields": { + "familyName": { + "type": "string", + "id": 1 + }, + "columnQualifier": { + "type": "Value", + "id": 2 + }, + "timestamp": { + "type": "Value", + "id": 3 + }, + "input": { + "type": "Value", + "id": 4 + } + } + }, + "MergeToCell": { + "fields": { + "familyName": { + "type": "string", + "id": 1 + }, + "columnQualifier": { + "type": "Value", + "id": 2 + }, + "timestamp": { + "type": "Value", + "id": 3 + }, + "input": { + "type": "Value", + "id": 4 + } + } + }, + "DeleteFromColumn": { + "fields": { + "familyName": { + "type": "string", + "id": 1 + }, + "columnQualifier": { + "type": "bytes", + "id": 2 + }, + "timeRange": { + "type": "TimestampRange", + "id": 3 + } + } + }, + "DeleteFromFamily": { + "fields": { + "familyName": { + "type": "string", + "id": 1 + } + } + }, + "DeleteFromRow": { + "fields": {} + } + } + }, + "ReadModifyWriteRule": { + "oneofs": { + "rule": { + "oneof": [ + "appendValue", + "incrementAmount" + ] + } + }, + "fields": { + "familyName": { + "type": "string", + "id": 1 + }, + "columnQualifier": { + "type": "bytes", + "id": 2 + }, + "appendValue": { + "type": "bytes", + "id": 3 + }, + "incrementAmount": { + "type": "int64", + "id": 4 + } + } + }, + "StreamPartition": { + "fields": { + "rowRange": { + "type": "RowRange", + "id": 1 + } + } + }, + "StreamContinuationTokens": { + "fields": { + "tokens": { + "rule": "repeated", + "type": "StreamContinuationToken", + "id": 1 + } + } + }, + "StreamContinuationToken": { + "fields": { + "partition": { + "type": "StreamPartition", + "id": 1 + }, + "token": { + "type": "string", + "id": 2 + } + } + }, + "ProtoFormat": { + "fields": {} + }, + "ColumnMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + } + } + }, + "ProtoSchema": { + "fields": { + "columns": { + "rule": "repeated", + "type": "ColumnMetadata", + "id": 1 + } + } + }, + "ResultSetMetadata": { + "oneofs": { + "schema": { + "oneof": [ + "protoSchema" + ] + } + }, + "fields": { + "protoSchema": { + "type": "ProtoSchema", + "id": 1 + } + } + }, + "ProtoRows": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 2 + } + } + }, + "ProtoRowsBatch": { + "fields": { + "batchData": { + "type": "bytes", + "id": 1 + } + } + }, + "PartialResultSet": { + "oneofs": { + "partialRows": { + "oneof": [ + "protoRowsBatch" + ] + }, + "_batchChecksum": { + "oneof": [ + "batchChecksum" + ] + } + }, + "fields": { + "protoRowsBatch": { + "type": "ProtoRowsBatch", + "id": 3 + }, + "batchChecksum": { + "type": "uint32", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "resumeToken": { + "type": "bytes", + "id": 5 + }, + "reset": { + "type": "bool", + "id": 7 + }, + "estimatedBatchSize": { + "type": "int32", + "id": 4 + } + } + }, + "Idempotency": { + "fields": { + "token": { + "type": "bytes", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Type": { + "oneofs": { + "kind": { + "oneof": [ + "bytesType", + "stringType", + "int64Type", + "float32Type", + "float64Type", + "boolType", + "timestampType", + "dateType", + "aggregateType", + "structType", + "arrayType", + "mapType", + "protoType", + "enumType" + ] + } + }, + "fields": { + "bytesType": { + "type": "Bytes", + "id": 1 + }, + "stringType": { + "type": "String", + "id": 2 + }, + "int64Type": { + "type": "Int64", + "id": 5 + }, + "float32Type": { + "type": "Float32", + "id": 12 + }, + "float64Type": { + "type": "Float64", + "id": 9 + }, + "boolType": { + "type": "Bool", + "id": 8 + }, + "timestampType": { + "type": "Timestamp", + "id": 10 + }, + "dateType": { + "type": "Date", + "id": 11 + }, + "aggregateType": { + "type": "Aggregate", + "id": 6 + }, + "structType": { + "type": "Struct", + "id": 7 + }, + "arrayType": { + "type": "Array", + "id": 3 + }, + "mapType": { + "type": "Map", + "id": 4 + }, + "protoType": { + "type": "Proto", + "id": 13 + }, + "enumType": { + "type": "Enum", + "id": 14 + } + }, + "nested": { + "Bytes": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "raw" + ] + } + }, + "fields": { + "raw": { + "type": "Raw", + "id": 1 + } + }, + "nested": { + "Raw": { + "fields": { + "escapeNulls": { + "type": "bool", + "id": 1 + } + } + } + } + } + } + }, + "String": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "utf8Raw", + "utf8Bytes" + ] + } + }, + "fields": { + "utf8Raw": { + "type": "Utf8Raw", + "id": 1, + "options": { + "deprecated": true + } + }, + "utf8Bytes": { + "type": "Utf8Bytes", + "id": 2 + } + }, + "nested": { + "Utf8Raw": { + "options": { + "deprecated": true + }, + "fields": {} + }, + "Utf8Bytes": { + "fields": { + "nullEscapeChar": { + "type": "string", + "id": 1 + } + } + } + } + } + } + }, + "Int64": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "bigEndianBytes", + "orderedCodeBytes" + ] + } + }, + "fields": { + "bigEndianBytes": { + "type": "BigEndianBytes", + "id": 1 + }, + "orderedCodeBytes": { + "type": "OrderedCodeBytes", + "id": 2 + } + }, + "nested": { + "BigEndianBytes": { + "fields": { + "bytesType": { + "type": "Bytes", + "id": 1, + "options": { + "deprecated": true + } + } + } + }, + "OrderedCodeBytes": { + "fields": {} + } + } + } + } + }, + "Bool": { + "fields": {} + }, + "Float32": { + "fields": {} + }, + "Float64": { + "fields": {} + }, + "Timestamp": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "unixMicrosInt64" + ] + } + }, + "fields": { + "unixMicrosInt64": { + "type": "Int64.Encoding", + "id": 1 + } + } + } + } + }, + "Date": { + "fields": {} + }, + "Struct": { + "fields": { + "fields": { + "rule": "repeated", + "type": "Field", + "id": 1 + }, + "encoding": { + "type": "Encoding", + "id": 2 + } + }, + "nested": { + "Field": { + "fields": { + "fieldName": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + } + } + }, + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "singleton", + "delimitedBytes", + "orderedCodeBytes" + ] + } + }, + "fields": { + "singleton": { + "type": "Singleton", + "id": 1 + }, + "delimitedBytes": { + "type": "DelimitedBytes", + "id": 2 + }, + "orderedCodeBytes": { + "type": "OrderedCodeBytes", + "id": 3 + } + }, + "nested": { + "Singleton": { + "fields": {} + }, + "DelimitedBytes": { + "fields": { + "delimiter": { + "type": "bytes", + "id": 1 + } + } + }, + "OrderedCodeBytes": { + "fields": {} + } + } + } + } + }, + "Proto": { + "fields": { + "schemaBundleId": { + "type": "string", + "id": 1 + }, + "messageName": { + "type": "string", + "id": 2 + } + } + }, + "Enum": { + "fields": { + "schemaBundleId": { + "type": "string", + "id": 1 + }, + "enumName": { + "type": "string", + "id": 2 + } + } + }, + "Array": { + "fields": { + "elementType": { + "type": "Type", + "id": 1 + } + } + }, + "Map": { + "fields": { + "keyType": { + "type": "Type", + "id": 1 + }, + "valueType": { + "type": "Type", + "id": 2 + } + } + }, + "Aggregate": { + "oneofs": { + "aggregator": { + "oneof": [ + "sum", + "hllppUniqueCount", + "max", + "min" + ] + } + }, + "fields": { + "inputType": { + "type": "Type", + "id": 1 + }, + "stateType": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sum": { + "type": "Sum", + "id": 4 + }, + "hllppUniqueCount": { + "type": "HyperLogLogPlusPlusUniqueCount", + "id": 5 + }, + "max": { + "type": "Max", + "id": 6 + }, + "min": { + "type": "Min", + "id": 7 + } + }, + "nested": { + "Sum": { + "fields": {} + }, + "Max": { + "fields": {} + }, + "Min": { + "fields": {} + }, + "HyperLogLogPlusPlusUniqueCount": { + "fields": {} + } + } + } + } + }, + "ReadIterationStats": { + "fields": { + "rowsSeenCount": { + "type": "int64", + "id": 1 + }, + "rowsReturnedCount": { + "type": "int64", + "id": 2 + }, + "cellsSeenCount": { + "type": "int64", + "id": 3 + }, + "cellsReturnedCount": { + "type": "int64", + "id": 4 + } + } + }, + "RequestLatencyStats": { + "fields": { + "frontendServerLatency": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "FullReadStatsView": { + "fields": { + "readIterationStats": { + "type": "ReadIterationStats", + "id": 1 + }, + "requestLatencyStats": { + "type": "RequestLatencyStats", + "id": 2 + } + } + }, + "RequestStats": { + "oneofs": { + "statsView": { + "oneof": [ + "fullReadStatsView" + ] + } + }, + "fields": { + "fullReadStatsView": { + "type": "FullReadStatsView", + "id": 1 + } + } + }, + "FeatureFlags": { + "fields": { + "reverseScans": { + "type": "bool", + "id": 1 + }, + "mutateRowsRateLimit": { + "type": "bool", + "id": 3 + }, + "mutateRowsRateLimit2": { + "type": "bool", + "id": 5 + }, + "lastScannedRowResponses": { + "type": "bool", + "id": 4 + }, + "routingCookie": { + "type": "bool", + "id": 6 + }, + "retryInfo": { + "type": "bool", + "id": 7 + }, + "clientSideMetricsEnabled": { + "type": "bool", + "id": 8 + }, + "trafficDirectorEnabled": { + "type": "bool", + "id": 9 + }, + "directAccessRequested": { + "type": "bool", + "id": 10 + }, + "peerInfo": { + "type": "bool", + "id": 11 + } + } + }, + "PeerInfo": { + "fields": { + "googleFrontendId": { + "type": "int64", + "id": 1 + }, + "applicationFrontendId": { + "type": "int64", + "id": 2 + }, + "applicationFrontendZone": { + "type": "string", + "id": 3 + }, + "applicationFrontendSubzone": { + "type": "string", + "id": 4 + }, + "transportType": { + "type": "TransportType", + "id": 5 + } + }, + "nested": { + "TransportType": { + "values": { + "TRANSPORT_TYPE_UNKNOWN": 0, + "TRANSPORT_TYPE_EXTERNAL": 1, + "TRANSPORT_TYPE_CLOUD_PATH": 2, + "TRANSPORT_TYPE_DIRECT_ACCESS": 3, + "TRANSPORT_TYPE_SESSION_UNKNOWN": 4, + "TRANSPORT_TYPE_SESSION_EXTERNAL": 5, + "TRANSPORT_TYPE_SESSION_CLOUD_PATH": 6, + "TRANSPORT_TYPE_SESSION_DIRECT_ACCESS": 7 + } + } + } + }, + "ResponseParams": { + "oneofs": { + "_zoneId": { + "oneof": [ + "zoneId" + ] + }, + "_clusterId": { + "oneof": [ + "clusterId" + ] + }, + "_afeId": { + "oneof": [ + "afeId" + ] + } + }, + "fields": { + "zoneId": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "afeId": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "RoutingProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI" + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "routing": { + "type": "google.api.RoutingRule", + "id": 72295729, + "extend": "google.protobuf.MethodOptions" + }, + "RoutingRule": { + "fields": { + "routingParameters": { + "rule": "repeated", + "type": "RoutingParameter", + "id": 2 + } + } + }, + "RoutingParameter": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "pathTemplate": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "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 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, + "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 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "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 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 + } + }, + "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": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "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 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + }, + "reserved": [ + [ + 4, + 4 + ], + "stream" + ] + }, + "MethodDescriptorProto": { + "edition": "proto2", + "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": { + "edition": "proto2", + "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 + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + "php_generic_services", + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "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 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "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 + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false, + "deprecated": true + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "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 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } + } + }, + "extensions": [ + [ + 1000, + 9994 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + }, + "reserved": [ + [ + 1, + 1 + ] + ] + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "overridableFeatures": { + "type": "FeatureSet", + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 + } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1", + "cc_enable_arenas": true + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/date;date", + "java_multiple_files": true, + "java_outer_classname": "DateProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP", + "cc_enable_arenas": true + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + }, + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/handwritten/bigtable/protos/test_proxy.proto b/handwritten/bigtable/protos/test_proxy.proto new file mode 100644 index 00000000000..f919dc476ee --- /dev/null +++ b/handwritten/bigtable/protos/test_proxy.proto @@ -0,0 +1,350 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigtable.testproxy; + +import "google/api/client.proto"; +import "google/bigtable/v2/bigtable.proto"; +import "google/bigtable/v2/data.proto"; +import "google/protobuf/duration.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/bigtable/testproxy/testproxypb;testproxypb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.bigtable.testproxy"; + +// A config flag that dictates how the optional features should be enabled +// during the client creation. The optional features customize how the client +// interacts with the server, and are defined in +// https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/feature_flags.proto +enum OptionalFeatureConfig { + OPTIONAL_FEATURE_CONFIG_DEFAULT = 0; + + OPTIONAL_FEATURE_CONFIG_ENABLE_ALL = 1; +} + +// Request to test proxy service to create a client object. +message CreateClientRequest { + message SecurityOptions { + // Access token to use for client credentials. If empty, the client will not + // use any call credentials. Certain implementations may require `use_ssl` + // to be set when using this. + string access_token = 1; + + // Whether to use SSL channel credentials when connecting to the data + // endpoint. + bool use_ssl = 2; + + // If using SSL channel credentials, override the SSL endpoint to match the + // host that is specified in the backend's certificate. Also sets the + // client's authority header value. + string ssl_endpoint_override = 3; + + // PEM encoding of the server root certificates. If not set, the default + // root certs will be used instead. The default can be overridden via the + // GRPC_DEFAULT_SSL_ROOTS_FILE_PATH env var. + string ssl_root_certs_pem = 4; + } + + // A unique ID associated with the client object to be created. + string client_id = 1; + + // The "host:port" address of the data API endpoint (i.e. the backend being + // proxied to). Example: 127.0.0.1:38543. If you want to connect to a local + // emulator via BIGTABLE_EMULATOR_HOST environment variable, you can use + // "emulator" instead of "host:port" for this field. + string data_target = 2; + + // The project for all calls on this client. + string project_id = 3; + + // The instance for all calls on this client. + string instance_id = 4; + + // Optional app profile for all calls on this client. + // Some client bindings allow specifying the app profile on a per-operation + // basis. We don't yet support this in the proxy API, but may in the future. + string app_profile_id = 5; + + // If provided, a custom timeout will be set for each API call conducted by + // the created client. Otherwise, the default timeout from the client library + // will be used. Note that the override applies to all the methods. + google.protobuf.Duration per_operation_timeout = 6; + + // Optional config that dictates how the optional features should be enabled + // during the client creation. Please check the enum type's docstring above. + OptionalFeatureConfig optional_feature_config = 7; + + // Options to allow connecting to backends with channel and/or call + // credentials. This is needed internally by Cloud Bigtable's own testing + // frameworks.It is not necessary to support these fields for client + // conformance testing. + // + // WARNING: this allows the proxy to connect to a real production + // CBT backend with the right options, however, the proxy itself is insecure + // so it is not recommended to use it with real credentials or outside testing + // contexts. + SecurityOptions security_options = 8; +} + +// Response from test proxy service for CreateClientRequest. +message CreateClientResponse {} + +// Request to test proxy service to close a client object. +message CloseClientRequest { + // The ID of the target client object. + string client_id = 1; +} + +// Response from test proxy service for CloseClientRequest. +message CloseClientResponse {} + +// Request to test proxy service to remove a client object. +message RemoveClientRequest { + // The ID of the target client object. + string client_id = 1; +} + +// Response from test proxy service for RemoveClientRequest. +message RemoveClientResponse {} + +// Request to test proxy service to read a row. +message ReadRowRequest { + // The ID of the target client object. + string client_id = 1; + + // The unique name of the table from which to read the row. + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 4; + + // The row key of the target row. + string row_key = 2; + + // The row filter to be applied to the target row. + google.bigtable.v2.RowFilter filter = 3; +} + +// Response from test proxy service for ReadRowRequest or +// ReadModifyWriteRowRequest. +message RowResult { + // The RPC status from the client binding. + google.rpc.Status status = 1; + + // The contents of a single row. + google.bigtable.v2.Row row = 2; +} + +// Request to test proxy service to read rows. +message ReadRowsRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.ReadRowsRequest request = 2; + + // The streaming read can be canceled before all items are seen. + // Has no effect if non-positive. + int32 cancel_after_rows = 3; +} + +// Response from test proxy service for ReadRowsRequest. +message RowsResult { + // The RPC status from the client binding. + google.rpc.Status status = 1; + + // The contents of rows. + repeated google.bigtable.v2.Row rows = 2; +} + +// Request to test proxy service to mutate a row. +message MutateRowRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.MutateRowRequest request = 2; +} + +// Response from test proxy service for MutateRowRequest. +message MutateRowResult { + // The RPC status from the client binding. + google.rpc.Status status = 1; +} + +// Request to test proxy service to mutate rows. +message MutateRowsRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.MutateRowsRequest request = 2; +} + +// Response from test proxy service for MutateRowsRequest. +message MutateRowsResult { + // The RPC status from the client binding, corresponding to the + // whole operation. + google.rpc.Status status = 1; + + // The results corresponding to the failed rows. + repeated google.bigtable.v2.MutateRowsResponse.Entry entries = 2; +} + +// Request to test proxy service to check and mutate a row. +message CheckAndMutateRowRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.CheckAndMutateRowRequest request = 2; +} + +// Response from test proxy service for CheckAndMutateRowRequest. +message CheckAndMutateRowResult { + // The RPC status from the client binding. + google.rpc.Status status = 1; + + // The raw response from the Bigtable server. + google.bigtable.v2.CheckAndMutateRowResponse result = 2; +} + +// Request to test proxy service to sample row keys. +message SampleRowKeysRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.SampleRowKeysRequest request = 2; +} + +// Response from test proxy service for SampleRowKeysRequest. +message SampleRowKeysResult { + // The RPC status from the client binding. + google.rpc.Status status = 1; + + // The raw responses from the Bigtable server. + repeated google.bigtable.v2.SampleRowKeysResponse samples = 2; +} + +// Request to test proxy service to read modify write a row. +message ReadModifyWriteRowRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.ReadModifyWriteRowRequest request = 2; +} + +// Request to test proxy service to execute a query. +message ExecuteQueryRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.ExecuteQueryRequest request = 2; +} + +// Response from test proxy service for ExecuteQueryRequest. +message ExecuteQueryResult { + // The RPC status from the client binding. + google.rpc.Status status = 1; + + // Name and type information for the query result. + ResultSetMetadata metadata = 4; + + // Encoded version of the ResultSet. Should not contain type information. + repeated SqlRow rows = 3; +} + +// Schema information for the query result. +message ResultSetMetadata { + // Column metadata for each column inthe query result. + repeated google.bigtable.v2.ColumnMetadata columns = 1; +} + +// Representation of a single row in the query result. +message SqlRow { + // Columnar values returned by the query. + repeated google.bigtable.v2.Value values = 1; +} + +// Note that all RPCs are unary, even when the equivalent client binding call +// may be streaming. This is an intentional simplification. +// +// Most methods have sync (default) and async variants. For async variants, +// the proxy is expected to perform the async operation, then wait for results +// before delivering them back to the driver client. +// +// Operations that may have interesting concurrency characteristics are +// represented explicitly in the API (see ReadRowsRequest.cancel_after_rows). +// We include such operations only when they can be meaningfully performed +// through client bindings. +// +// Users should generally avoid setting deadlines for requests to the Proxy +// because operations are not cancelable. If the deadline is set anyway, please +// understand that the underlying operation will continue to be executed even +// after the deadline expires. +service CloudBigtableV2TestProxy { + option (google.api.default_host) = + "bigtable-test-proxy-not-accessible.googleapis.com"; + + // Client management: + // + // Creates a client in the proxy. + // Each client has its own dedicated channel(s), and can be used concurrently + // and independently with other clients. + rpc CreateClient(CreateClientRequest) returns (CreateClientResponse) {} + + // Closes a client in the proxy, making it not accept new requests. + rpc CloseClient(CloseClientRequest) returns (CloseClientResponse) {} + + // Removes a client in the proxy, making it inaccessible. Client closing + // should be done by CloseClient() separately. + rpc RemoveClient(RemoveClientRequest) returns (RemoveClientResponse) {} + + // Bigtable operations: for each operation, you should use the synchronous or + // asynchronous variant of the client method based on the `use_async_method` + // setting of the client instance. For starters, you can choose to implement + // one variant, and return UNIMPLEMENTED status for the other. + // + // Reads a row with the client instance. + // The result row may not be present in the response. + // Callers should check for it (e.g. calling has_row() in C++). + rpc ReadRow(ReadRowRequest) returns (RowResult) {} + + // Reads rows with the client instance. + rpc ReadRows(ReadRowsRequest) returns (RowsResult) {} + + // Writes a row with the client instance. + rpc MutateRow(MutateRowRequest) returns (MutateRowResult) {} + + // Writes multiple rows with the client instance. + rpc BulkMutateRows(MutateRowsRequest) returns (MutateRowsResult) {} + + // Performs a check-and-mutate-row operation with the client instance. + rpc CheckAndMutateRow(CheckAndMutateRowRequest) + returns (CheckAndMutateRowResult) {} + + // Obtains a row key sampling with the client instance. + rpc SampleRowKeys(SampleRowKeysRequest) returns (SampleRowKeysResult) {} + + // Performs a read-modify-write operation with the client. + rpc ReadModifyWriteRow(ReadModifyWriteRowRequest) returns (RowResult) {} + + // Executes a BTQL query with the client. + rpc ExecuteQuery(ExecuteQueryRequest) returns (ExecuteQueryResult) {} +} \ No newline at end of file diff --git a/handwritten/bigtable/samples/README.md b/handwritten/bigtable/samples/README.md new file mode 100644 index 00000000000..39cdc1cf880 --- /dev/null +++ b/handwritten/bigtable/samples/README.md @@ -0,0 +1,1220 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Bigtable: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Bigtable_instance_admin.create_app_profile](#bigtable_instance_admin.create_app_profile) + * [Bigtable_instance_admin.create_cluster](#bigtable_instance_admin.create_cluster) + * [Bigtable_instance_admin.create_instance](#bigtable_instance_admin.create_instance) + * [Bigtable_instance_admin.create_logical_view](#bigtable_instance_admin.create_logical_view) + * [Bigtable_instance_admin.create_materialized_view](#bigtable_instance_admin.create_materialized_view) + * [Bigtable_instance_admin.delete_app_profile](#bigtable_instance_admin.delete_app_profile) + * [Bigtable_instance_admin.delete_cluster](#bigtable_instance_admin.delete_cluster) + * [Bigtable_instance_admin.delete_instance](#bigtable_instance_admin.delete_instance) + * [Bigtable_instance_admin.delete_logical_view](#bigtable_instance_admin.delete_logical_view) + * [Bigtable_instance_admin.delete_materialized_view](#bigtable_instance_admin.delete_materialized_view) + * [Bigtable_instance_admin.get_app_profile](#bigtable_instance_admin.get_app_profile) + * [Bigtable_instance_admin.get_cluster](#bigtable_instance_admin.get_cluster) + * [Bigtable_instance_admin.get_iam_policy](#bigtable_instance_admin.get_iam_policy) + * [Bigtable_instance_admin.get_instance](#bigtable_instance_admin.get_instance) + * [Bigtable_instance_admin.get_logical_view](#bigtable_instance_admin.get_logical_view) + * [Bigtable_instance_admin.get_materialized_view](#bigtable_instance_admin.get_materialized_view) + * [Bigtable_instance_admin.list_app_profiles](#bigtable_instance_admin.list_app_profiles) + * [Bigtable_instance_admin.list_clusters](#bigtable_instance_admin.list_clusters) + * [Bigtable_instance_admin.list_hot_tablets](#bigtable_instance_admin.list_hot_tablets) + * [Bigtable_instance_admin.list_instances](#bigtable_instance_admin.list_instances) + * [Bigtable_instance_admin.list_logical_views](#bigtable_instance_admin.list_logical_views) + * [Bigtable_instance_admin.list_materialized_views](#bigtable_instance_admin.list_materialized_views) + * [Bigtable_instance_admin.partial_update_cluster](#bigtable_instance_admin.partial_update_cluster) + * [Bigtable_instance_admin.partial_update_instance](#bigtable_instance_admin.partial_update_instance) + * [Bigtable_instance_admin.set_iam_policy](#bigtable_instance_admin.set_iam_policy) + * [Bigtable_instance_admin.test_iam_permissions](#bigtable_instance_admin.test_iam_permissions) + * [Bigtable_instance_admin.update_app_profile](#bigtable_instance_admin.update_app_profile) + * [Bigtable_instance_admin.update_cluster](#bigtable_instance_admin.update_cluster) + * [Bigtable_instance_admin.update_instance](#bigtable_instance_admin.update_instance) + * [Bigtable_instance_admin.update_logical_view](#bigtable_instance_admin.update_logical_view) + * [Bigtable_instance_admin.update_materialized_view](#bigtable_instance_admin.update_materialized_view) + * [Bigtable_table_admin.check_consistency](#bigtable_table_admin.check_consistency) + * [Bigtable_table_admin.copy_backup](#bigtable_table_admin.copy_backup) + * [Bigtable_table_admin.create_authorized_view](#bigtable_table_admin.create_authorized_view) + * [Bigtable_table_admin.create_backup](#bigtable_table_admin.create_backup) + * [Bigtable_table_admin.create_schema_bundle](#bigtable_table_admin.create_schema_bundle) + * [Bigtable_table_admin.create_table](#bigtable_table_admin.create_table) + * [Bigtable_table_admin.create_table_from_snapshot](#bigtable_table_admin.create_table_from_snapshot) + * [Bigtable_table_admin.delete_authorized_view](#bigtable_table_admin.delete_authorized_view) + * [Bigtable_table_admin.delete_backup](#bigtable_table_admin.delete_backup) + * [Bigtable_table_admin.delete_schema_bundle](#bigtable_table_admin.delete_schema_bundle) + * [Bigtable_table_admin.delete_snapshot](#bigtable_table_admin.delete_snapshot) + * [Bigtable_table_admin.delete_table](#bigtable_table_admin.delete_table) + * [Bigtable_table_admin.drop_row_range](#bigtable_table_admin.drop_row_range) + * [Bigtable_table_admin.generate_consistency_token](#bigtable_table_admin.generate_consistency_token) + * [Bigtable_table_admin.get_authorized_view](#bigtable_table_admin.get_authorized_view) + * [Bigtable_table_admin.get_backup](#bigtable_table_admin.get_backup) + * [Bigtable_table_admin.get_iam_policy](#bigtable_table_admin.get_iam_policy) + * [Bigtable_table_admin.get_schema_bundle](#bigtable_table_admin.get_schema_bundle) + * [Bigtable_table_admin.get_snapshot](#bigtable_table_admin.get_snapshot) + * [Bigtable_table_admin.get_table](#bigtable_table_admin.get_table) + * [Bigtable_table_admin.list_authorized_views](#bigtable_table_admin.list_authorized_views) + * [Bigtable_table_admin.list_backups](#bigtable_table_admin.list_backups) + * [Bigtable_table_admin.list_schema_bundles](#bigtable_table_admin.list_schema_bundles) + * [Bigtable_table_admin.list_snapshots](#bigtable_table_admin.list_snapshots) + * [Bigtable_table_admin.list_tables](#bigtable_table_admin.list_tables) + * [Bigtable_table_admin.modify_column_families](#bigtable_table_admin.modify_column_families) + * [Bigtable_table_admin.restore_table](#bigtable_table_admin.restore_table) + * [Bigtable_table_admin.set_iam_policy](#bigtable_table_admin.set_iam_policy) + * [Bigtable_table_admin.snapshot_table](#bigtable_table_admin.snapshot_table) + * [Bigtable_table_admin.test_iam_permissions](#bigtable_table_admin.test_iam_permissions) + * [Bigtable_table_admin.undelete_table](#bigtable_table_admin.undelete_table) + * [Bigtable_table_admin.update_authorized_view](#bigtable_table_admin.update_authorized_view) + * [Bigtable_table_admin.update_backup](#bigtable_table_admin.update_backup) + * [Bigtable_table_admin.update_schema_bundle](#bigtable_table_admin.update_schema_bundle) + * [Bigtable_table_admin.update_table](#bigtable_table_admin.update_table) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Bigtable_instance_admin.create_app_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_app_profile.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_app_profile.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_app_profile.js` + + +----- + + + + +### Bigtable_instance_admin.create_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_cluster.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_cluster.js` + + +----- + + + + +### Bigtable_instance_admin.create_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_instance.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_instance.js` + + +----- + + + + +### Bigtable_instance_admin.create_logical_view + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_logical_view.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_logical_view.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_logical_view.js` + + +----- + + + + +### Bigtable_instance_admin.create_materialized_view + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_materialized_view.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_materialized_view.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_materialized_view.js` + + +----- + + + + +### Bigtable_instance_admin.delete_app_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_app_profile.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_app_profile.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_app_profile.js` + + +----- + + + + +### Bigtable_instance_admin.delete_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_cluster.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_cluster.js` + + +----- + + + + +### Bigtable_instance_admin.delete_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_instance.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_instance.js` + + +----- + + + + +### Bigtable_instance_admin.delete_logical_view + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_logical_view.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_logical_view.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_logical_view.js` + + +----- + + + + +### Bigtable_instance_admin.delete_materialized_view + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_materialized_view.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_materialized_view.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_materialized_view.js` + + +----- + + + + +### Bigtable_instance_admin.get_app_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_app_profile.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_app_profile.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_app_profile.js` + + +----- + + + + +### Bigtable_instance_admin.get_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_cluster.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_cluster.js` + + +----- + + + + +### Bigtable_instance_admin.get_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_iam_policy.js` + + +----- + + + + +### Bigtable_instance_admin.get_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_instance.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_instance.js` + + +----- + + + + +### Bigtable_instance_admin.get_logical_view + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_logical_view.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_logical_view.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_logical_view.js` + + +----- + + + + +### Bigtable_instance_admin.get_materialized_view + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_materialized_view.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_materialized_view.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_materialized_view.js` + + +----- + + + + +### Bigtable_instance_admin.list_app_profiles + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_app_profiles.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_app_profiles.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_app_profiles.js` + + +----- + + + + +### Bigtable_instance_admin.list_clusters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_clusters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_clusters.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_clusters.js` + + +----- + + + + +### Bigtable_instance_admin.list_hot_tablets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_hot_tablets.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_hot_tablets.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_hot_tablets.js` + + +----- + + + + +### Bigtable_instance_admin.list_instances + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_instances.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_instances.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_instances.js` + + +----- + + + + +### Bigtable_instance_admin.list_logical_views + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_logical_views.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_logical_views.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_logical_views.js` + + +----- + + + + +### Bigtable_instance_admin.list_materialized_views + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_materialized_views.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_materialized_views.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_materialized_views.js` + + +----- + + + + +### Bigtable_instance_admin.partial_update_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.partial_update_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.partial_update_cluster.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.partial_update_cluster.js` + + +----- + + + + +### Bigtable_instance_admin.partial_update_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.partial_update_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.partial_update_instance.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.partial_update_instance.js` + + +----- + + + + +### Bigtable_instance_admin.set_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.set_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.set_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.set_iam_policy.js` + + +----- + + + + +### Bigtable_instance_admin.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.test_iam_permissions.js` + + +----- + + + + +### Bigtable_instance_admin.update_app_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_app_profile.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_app_profile.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_app_profile.js` + + +----- + + + + +### Bigtable_instance_admin.update_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_cluster.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_cluster.js` + + +----- + + + + +### Bigtable_instance_admin.update_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_instance.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_instance.js` + + +----- + + + + +### Bigtable_instance_admin.update_logical_view + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_logical_view.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_logical_view.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_logical_view.js` + + +----- + + + + +### Bigtable_instance_admin.update_materialized_view + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_materialized_view.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_materialized_view.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_materialized_view.js` + + +----- + + + + +### Bigtable_table_admin.check_consistency + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.check_consistency.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.check_consistency.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.check_consistency.js` + + +----- + + + + +### Bigtable_table_admin.copy_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.copy_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.copy_backup.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.copy_backup.js` + + +----- + + + + +### Bigtable_table_admin.create_authorized_view + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_authorized_view.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_authorized_view.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_authorized_view.js` + + +----- + + + + +### Bigtable_table_admin.create_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_backup.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_backup.js` + + +----- + + + + +### Bigtable_table_admin.create_schema_bundle + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_schema_bundle.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_schema_bundle.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_schema_bundle.js` + + +----- + + + + +### Bigtable_table_admin.create_table + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_table.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_table.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_table.js` + + +----- + + + + +### Bigtable_table_admin.create_table_from_snapshot + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_table_from_snapshot.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_table_from_snapshot.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_table_from_snapshot.js` + + +----- + + + + +### Bigtable_table_admin.delete_authorized_view + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_authorized_view.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_authorized_view.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_authorized_view.js` + + +----- + + + + +### Bigtable_table_admin.delete_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_backup.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_backup.js` + + +----- + + + + +### Bigtable_table_admin.delete_schema_bundle + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_schema_bundle.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_schema_bundle.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_schema_bundle.js` + + +----- + + + + +### Bigtable_table_admin.delete_snapshot + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_snapshot.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_snapshot.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_snapshot.js` + + +----- + + + + +### Bigtable_table_admin.delete_table + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_table.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_table.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_table.js` + + +----- + + + + +### Bigtable_table_admin.drop_row_range + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.drop_row_range.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.drop_row_range.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.drop_row_range.js` + + +----- + + + + +### Bigtable_table_admin.generate_consistency_token + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.generate_consistency_token.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.generate_consistency_token.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.generate_consistency_token.js` + + +----- + + + + +### Bigtable_table_admin.get_authorized_view + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_authorized_view.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_authorized_view.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_authorized_view.js` + + +----- + + + + +### Bigtable_table_admin.get_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_backup.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_backup.js` + + +----- + + + + +### Bigtable_table_admin.get_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_iam_policy.js` + + +----- + + + + +### Bigtable_table_admin.get_schema_bundle + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_schema_bundle.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_schema_bundle.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_schema_bundle.js` + + +----- + + + + +### Bigtable_table_admin.get_snapshot + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_snapshot.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_snapshot.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_snapshot.js` + + +----- + + + + +### Bigtable_table_admin.get_table + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_table.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_table.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_table.js` + + +----- + + + + +### Bigtable_table_admin.list_authorized_views + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_authorized_views.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_authorized_views.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_authorized_views.js` + + +----- + + + + +### Bigtable_table_admin.list_backups + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_backups.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_backups.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_backups.js` + + +----- + + + + +### Bigtable_table_admin.list_schema_bundles + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_schema_bundles.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_schema_bundles.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_schema_bundles.js` + + +----- + + + + +### Bigtable_table_admin.list_snapshots + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_snapshots.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_snapshots.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_snapshots.js` + + +----- + + + + +### Bigtable_table_admin.list_tables + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_tables.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_tables.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_tables.js` + + +----- + + + + +### Bigtable_table_admin.modify_column_families + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.modify_column_families.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.modify_column_families.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.modify_column_families.js` + + +----- + + + + +### Bigtable_table_admin.restore_table + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.restore_table.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.restore_table.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.restore_table.js` + + +----- + + + + +### Bigtable_table_admin.set_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.set_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.set_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.set_iam_policy.js` + + +----- + + + + +### Bigtable_table_admin.snapshot_table + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.snapshot_table.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.snapshot_table.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.snapshot_table.js` + + +----- + + + + +### Bigtable_table_admin.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.test_iam_permissions.js` + + +----- + + + + +### Bigtable_table_admin.undelete_table + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.undelete_table.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.undelete_table.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.undelete_table.js` + + +----- + + + + +### Bigtable_table_admin.update_authorized_view + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_authorized_view.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_authorized_view.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_authorized_view.js` + + +----- + + + + +### Bigtable_table_admin.update_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_backup.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_backup.js` + + +----- + + + + +### Bigtable_table_admin.update_schema_bundle + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_schema_bundle.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_schema_bundle.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_schema_bundle.js` + + +----- + + + + +### Bigtable_table_admin.update_table + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_table.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_table.js,samples/README.md) + +__Usage:__ + + +`node handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_table.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/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/bigtable diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_app_profile.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_app_profile.js new file mode 100644 index 00000000000..bc9255fbf4f --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_app_profile.js @@ -0,0 +1,79 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, appProfileId, appProfile) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the instance in which to create the new app + * profile. Values are of the form `projects/{project}/instances/{instance}`. + */ + // const parent = 'abc123' + /** + * Required. The ID to be used when referring to the new app profile within + * its instance, e.g., just `myprofile` rather than + * `projects/myproject/instances/myinstance/appProfiles/myprofile`. + */ + // const appProfileId = 'abc123' + /** + * Required. The app profile to be created. + * Fields marked `OutputOnly` will be ignored. + */ + // const appProfile = {} + /** + * If true, ignore safety checks when creating the app profile. + */ + // const ignoreWarnings = true + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callCreateAppProfile() { + // Construct request + const request = { + parent, + appProfileId, + appProfile, + }; + + // Run request + const response = await adminClient.createAppProfile(request); + console.log(response); + } + + callCreateAppProfile(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_cluster.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_cluster.js new file mode 100644 index 00000000000..549fd02c49d --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_cluster.js @@ -0,0 +1,76 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the instance in which to create the new + * cluster. Values are of the form `projects/{project}/instances/{instance}`. + */ + // const parent = 'abc123' + /** + * Required. The ID to be used when referring to the new cluster within its + * instance, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + */ + // const clusterId = 'abc123' + /** + * Required. The cluster to be created. + * Fields marked `OutputOnly` must be left blank. + */ + // const cluster = {} + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callCreateCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await adminClient.createCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCluster(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_instance.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_instance.js new file mode 100644 index 00000000000..6aec34b13a2 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_instance.js @@ -0,0 +1,84 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, instanceId, instance, clusters) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the project in which to create the new + * instance. Values are of the form `projects/{project}`. + */ + // const parent = 'abc123' + /** + * Required. The ID to be used when referring to the new instance within its + * project, e.g., just `myinstance` rather than + * `projects/myproject/instances/myinstance`. + */ + // const instanceId = 'abc123' + /** + * Required. The instance to create. + * Fields marked `OutputOnly` must be left blank. + */ + // const instance = {} + /** + * Required. The clusters to be created within the instance, mapped by desired + * cluster ID, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * Fields marked `OutputOnly` must be left blank. + */ + // const clusters = [1,2,3,4] + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callCreateInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + clusters, + }; + + // Run request + const [operation] = await adminClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstance(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_logical_view.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_logical_view.js new file mode 100644 index 00000000000..79bede2310c --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_logical_view.js @@ -0,0 +1,74 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, logicalViewId, logicalView) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateLogicalView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent instance where this logical view will be created. + * Format: `projects/{project}/instances/{instance}`. + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the logical view, which will become the final + * component of the logical view's resource name. + */ + // const logicalViewId = 'abc123' + /** + * Required. The logical view to create. + */ + // const logicalView = {} + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callCreateLogicalView() { + // Construct request + const request = { + parent, + logicalViewId, + logicalView, + }; + + // Run request + const [operation] = await adminClient.createLogicalView(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateLogicalView(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateLogicalView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_materialized_view.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_materialized_view.js new file mode 100644 index 00000000000..2be69c02d2c --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.create_materialized_view.js @@ -0,0 +1,74 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, materializedViewId, materializedView) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateMaterializedView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent instance where this materialized view will be created. + * Format: `projects/{project}/instances/{instance}`. + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the materialized view, which will become the + * final component of the materialized view's resource name. + */ + // const materializedViewId = 'abc123' + /** + * Required. The materialized view to create. + */ + // const materializedView = {} + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callCreateMaterializedView() { + // Construct request + const request = { + parent, + materializedViewId, + materializedView, + }; + + // Run request + const [operation] = await adminClient.createMaterializedView(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateMaterializedView(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateMaterializedView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_app_profile.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_app_profile.js new file mode 100644 index 00000000000..e90300666da --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_app_profile.js @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, ignoreWarnings) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the app profile to be deleted. Values are of + * the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + */ + // const name = 'abc123' + /** + * Required. If true, ignore safety checks when deleting the app profile. + */ + // const ignoreWarnings = true + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callDeleteAppProfile() { + // Construct request + const request = { + name, + ignoreWarnings, + }; + + // Run request + const response = await adminClient.deleteAppProfile(request); + console.log(response); + } + + callDeleteAppProfile(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_cluster.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_cluster.js new file mode 100644 index 00000000000..e4a050965ab --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_cluster.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the cluster to be deleted. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callDeleteCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteCluster(request); + console.log(response); + } + + callDeleteCluster(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_instance.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_instance.js new file mode 100644 index 00000000000..a959058bbab --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_instance.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the instance to be deleted. + * Values are of the form `projects/{project}/instances/{instance}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteInstance(request); + console.log(response); + } + + callDeleteInstance(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_logical_view.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_logical_view.js new file mode 100644 index 00000000000..66caf0af0e9 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_logical_view.js @@ -0,0 +1,70 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteLogicalView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the logical view to be deleted. + * Format: + * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + */ + // const name = 'abc123' + /** + * Optional. The current etag of the logical view. + * If an etag is provided and does not match the current etag of the + * logical view, deletion will be blocked and an ABORTED error will be + * returned. + */ + // const etag = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callDeleteLogicalView() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteLogicalView(request); + console.log(response); + } + + callDeleteLogicalView(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteLogicalView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_materialized_view.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_materialized_view.js new file mode 100644 index 00000000000..92585e1799f --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.delete_materialized_view.js @@ -0,0 +1,70 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteMaterializedView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the materialized view to be deleted. + * Format: + * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + */ + // const name = 'abc123' + /** + * Optional. The current etag of the materialized view. + * If an etag is provided and does not match the current etag of the + * materialized view, deletion will be blocked and an ABORTED error will be + * returned. + */ + // const etag = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callDeleteMaterializedView() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteMaterializedView(request); + console.log(response); + } + + callDeleteMaterializedView(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteMaterializedView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_app_profile.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_app_profile.js new file mode 100644 index 00000000000..0d5b0e36da9 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_app_profile.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the requested app profile. Values are of the + * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callGetAppProfile() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getAppProfile(request); + console.log(response); + } + + callGetAppProfile(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_cluster.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_cluster.js new file mode 100644 index 00000000000..5cae85263fc --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_cluster.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the requested cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callGetCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getCluster(request); + console.log(response); + } + + callGetCluster(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_iam_policy.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_iam_policy.js new file mode 100644 index 00000000000..b07f9e6f1ad --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await adminClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_instance.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_instance.js new file mode 100644 index 00000000000..d65a7bf3403 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_instance.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the requested instance. Values are of the form + * `projects/{project}/instances/{instance}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_logical_view.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_logical_view.js new file mode 100644 index 00000000000..ff81ad8b13c --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_logical_view.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetLogicalView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the requested logical view. Values are of the + * form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callGetLogicalView() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getLogicalView(request); + console.log(response); + } + + callGetLogicalView(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetLogicalView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_materialized_view.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_materialized_view.js new file mode 100644 index 00000000000..b1218f75812 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.get_materialized_view.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetMaterializedView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the requested materialized view. Values are of + * the form + * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callGetMaterializedView() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getMaterializedView(request); + console.log(response); + } + + callGetMaterializedView(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetMaterializedView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_app_profiles.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_app_profiles.js new file mode 100644 index 00000000000..e96d826a92c --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_app_profiles.js @@ -0,0 +1,81 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the instance for which a list of app profiles + * is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. + */ + // const parent = 'abc123' + /** + * Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + */ + // const pageSize = 1234 + /** + * The value of `next_page_token` returned by a previous call. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callListAppProfiles() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = adminClient.listAppProfilesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAppProfiles(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_clusters.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_clusters.js new file mode 100644 index 00000000000..e02d599eb7f --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_clusters.js @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the instance for which a list of clusters is + * requested. Values are of the form + * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list + * Clusters for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + */ + // const parent = 'abc123' + /** + * DEPRECATED: This field is unused and ignored. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callListClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await adminClient.listClusters(request); + console.log(response); + } + + callListClusters(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_hot_tablets.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_hot_tablets.js new file mode 100644 index 00000000000..e7939ce52bb --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_hot_tablets.js @@ -0,0 +1,92 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + */ + // const parent = 'abc123' + /** + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + */ + // const startTime = {} + /** + * The end time to list hot tablets. + */ + // const endTime = {} + /** + * Maximum number of results per page. + * A page_size that is empty or zero lets the server choose the number of + * items to return. A page_size which is strictly positive will return at most + * that many items. A negative page_size will cause an error. + * Following the first request, subsequent paginated calls do not need a + * page_size field. If a page_size is set in subsequent calls, it must match + * the page_size given in the first request. + */ + // const pageSize = 1234 + /** + * The value of `next_page_token` returned by a previous call. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callListHotTablets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = adminClient.listHotTabletsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListHotTablets(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_instances.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_instances.js new file mode 100644 index 00000000000..07bd0bdf69c --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_instances.js @@ -0,0 +1,66 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the project for which a list of instances is + * requested. Values are of the form `projects/{project}`. + */ + // const parent = 'abc123' + /** + * DEPRECATED: This field is unused and ignored. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await adminClient.listInstances(request); + console.log(response); + } + + callListInstances(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_logical_views.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_logical_views.js new file mode 100644 index 00000000000..18bfe07ddc4 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_logical_views.js @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListLogicalViews_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the instance for which the list of logical + * views is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of logical views to return. The service may + * return fewer than this value + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListLogicalViews` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListLogicalViews` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callListLogicalViews() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = adminClient.listLogicalViewsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListLogicalViews(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListLogicalViews_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_materialized_views.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_materialized_views.js new file mode 100644 index 00000000000..00f6d9fe5eb --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.list_materialized_views.js @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListMaterializedViews_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the instance for which the list of + * materialized views is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of materialized views to return. The service + * may return fewer than this value + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListMaterializedViews` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMaterializedViews` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callListMaterializedViews() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = adminClient.listMaterializedViewsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMaterializedViews(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListMaterializedViews_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.partial_update_cluster.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.partial_update_cluster.js new file mode 100644 index 00000000000..6b972329015 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.partial_update_cluster.js @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(cluster, updateMask) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Cluster which contains the partial updates to be applied, + * subject to the update_mask. + */ + // const cluster = {} + /** + * Required. The subset of Cluster fields which should be replaced. + */ + // const updateMask = {} + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callPartialUpdateCluster() { + // Construct request + const request = { + cluster, + updateMask, + }; + + // Run request + const [operation] = await adminClient.partialUpdateCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPartialUpdateCluster(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.partial_update_instance.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.partial_update_instance.js new file mode 100644 index 00000000000..34ba3ee7ba8 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.partial_update_instance.js @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(instance, updateMask) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Instance which will (partially) replace the current value. + */ + // const instance = {} + /** + * Required. The subset of Instance fields which should be replaced. + * Must be explicitly set. + */ + // const updateMask = {} + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callPartialUpdateInstance() { + // Construct request + const request = { + instance, + updateMask, + }; + + // Run request + const [operation] = await adminClient.partialUpdateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPartialUpdateInstance(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.set_iam_policy.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.set_iam_policy.js new file mode 100644 index 00000000000..3ceeb407373 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, policy) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await adminClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.test_iam_permissions.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.test_iam_permissions.js new file mode 100644 index 00000000000..1494635e91a --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, permissions) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = ['abc','def'] + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await adminClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_app_profile.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_app_profile.js new file mode 100644 index 00000000000..a87131d92a7 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_app_profile.js @@ -0,0 +1,72 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(appProfile, updateMask) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The app profile which will (partially) replace the current value. + */ + // const appProfile = {} + /** + * Required. The subset of app profile fields which should be replaced. + * If unset, all fields will be replaced. + */ + // const updateMask = {} + /** + * If true, ignore safety checks when updating the app profile. + */ + // const ignoreWarnings = true + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callUpdateAppProfile() { + // Construct request + const request = { + appProfile, + updateMask, + }; + + // Run request + const [operation] = await adminClient.updateAppProfile(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateAppProfile(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_cluster.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_cluster.js new file mode 100644 index 00000000000..76ab36f2e19 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_cluster.js @@ -0,0 +1,101 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(location, state, nodeScalingFactor, defaultStorageType, encryptionConfig) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The unique name of the cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. + */ + // const name = 'abc123' + /** + * Immutable. The location where this cluster's nodes and storage reside. For + * best performance, clients should be located as close as possible to this + * cluster. Currently only zones are supported, so values should be of the + * form `projects/{project}/locations/{zone}`. + */ + // const location = 'abc123' + /** + * Output only. The current state of the cluster. + */ + // const state = {} + /** + * The number of nodes in the cluster. If no value is set, + * Cloud Bigtable automatically allocates nodes based on your data footprint + * and optimized for 50% storage utilization. + */ + // const serveNodes = 1234 + /** + * Immutable. The node scaling factor of this cluster. + */ + // const nodeScalingFactor = {} + /** + * Configuration for this cluster. + */ + // const clusterConfig = {} + /** + * Immutable. The type of storage used by this cluster to serve its + * parent instance's tables, unless explicitly overridden. + */ + // const defaultStorageType = {} + /** + * Immutable. The encryption configuration for CMEK-protected clusters. + */ + // const encryptionConfig = {} + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callUpdateCluster() { + // Construct request + const request = { + location, + state, + nodeScalingFactor, + defaultStorageType, + encryptionConfig, + }; + + // Run request + const [operation] = await adminClient.updateCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCluster(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_instance.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_instance.js new file mode 100644 index 00000000000..ef207645418 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_instance.js @@ -0,0 +1,119 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(displayName, state, createTime, satisfiesPzs, satisfiesPzi, tags) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The unique name of the instance. Values are of the form + * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. + */ + // const name = 'abc123' + /** + * Required. The descriptive name for this instance as it appears in UIs. + * Can be changed at any time, but should be kept globally unique + * to avoid confusion. + */ + // const displayName = 'abc123' + /** + * Output only. The current state of the instance. + */ + // const state = {} + /** + * The type of the instance. Defaults to `PRODUCTION`. + */ + // const type = {} + /** + * Labels are a flexible and lightweight mechanism for organizing cloud + * resources into groups that reflect a customer's organizational needs and + * deployment strategies. They can be used to filter resources and aggregate + * metrics. + * * Label keys must be between 1 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. + * * Label values must be between 0 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. + * * No more than 64 labels can be associated with a given resource. + * * Keys and values must both be under 128 bytes. + */ + // const labels = [1,2,3,4] + /** + * Output only. A commit timestamp representing when this Instance was + * created. For instances created before this field was added (August 2021), + * this value is `seconds: 0, nanos: 1`. + */ + // const createTime = {} + /** + * Output only. Reserved for future use. + */ + // const satisfiesPzs = true + /** + * Output only. Reserved for future use. + */ + // const satisfiesPzi = true + /** + * Optional. Input only. Immutable. Tag keys/values directly bound to this + * resource. For example: + * - "123/environment": "production", + * - "123/costCenter": "marketing" + * Tags and Labels (above) are both used to bind metadata to resources, with + * different use-cases. See + * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an + * in-depth overview on the difference between tags and labels. + */ + // const tags = [1,2,3,4] + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callUpdateInstance() { + // Construct request + const request = { + displayName, + state, + createTime, + satisfiesPzs, + satisfiesPzi, + tags, + }; + + // Run request + const response = await adminClient.updateInstance(request); + console.log(response); + } + + callUpdateInstance(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_logical_view.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_logical_view.js new file mode 100644 index 00000000000..c65190ac59a --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_logical_view.js @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(logicalView) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateLogicalView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The logical view to update. + * The logical view's `name` field is used to identify the view to update. + * Format: + * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + */ + // const logicalView = {} + /** + * Optional. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callUpdateLogicalView() { + // Construct request + const request = { + logicalView, + }; + + // Run request + const [operation] = await adminClient.updateLogicalView(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateLogicalView(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateLogicalView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_materialized_view.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_materialized_view.js new file mode 100644 index 00000000000..d4454708473 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_instance_admin.update_materialized_view.js @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(materializedView) { + // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateMaterializedView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The materialized view to update. + * The materialized view's `name` field is used to identify the view to + * update. Format: + * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + */ + // const materializedView = {} + /** + * Optional. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Admin library + const {InstanceAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new InstanceAdminClient(); + + async function callUpdateMaterializedView() { + // Construct request + const request = { + materializedView, + }; + + // Run request + const [operation] = await adminClient.updateMaterializedView(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateMaterializedView(); + // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateMaterializedView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.check_consistency.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.check_consistency.js new file mode 100644 index 00000000000..8a502e96366 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.check_consistency.js @@ -0,0 +1,80 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, consistencyToken) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the Table for which to check replication + * consistency. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + */ + // const name = 'abc123' + /** + * Required. The token created using GenerateConsistencyToken for the Table. + */ + // const consistencyToken = 'abc123' + /** + * Checks that reads using an app profile with `StandardIsolation` can + * see all writes committed before the token was created, even if the + * read and write target different clusters. + */ + // const standardReadRemoteWrites = {} + /** + * Checks that reads using an app profile with `DataBoostIsolationReadOnly` + * can see all writes committed before the token was created, but only if + * the read and write target the same cluster. + */ + // const dataBoostReadLocalWrites = {} + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callCheckConsistency() { + // Construct request + const request = { + name, + consistencyToken, + }; + + // Run request + const response = await adminClient.checkConsistency(request); + console.log(response); + } + + callCheckConsistency(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.copy_backup.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.copy_backup.js new file mode 100644 index 00000000000..bfe94f6c923 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.copy_backup.js @@ -0,0 +1,94 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, backupId, sourceBackup, expireTime) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the destination cluster that will contain the backup + * copy. The cluster must already exist. Values are of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + */ + // const parent = 'abc123' + /** + * Required. The id of the new backup. The `backup_id` along with `parent` + * are combined as {parent}/backups/{backup_id} to create the full backup + * name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex _a-zA-Z0-9 -_.a-zA-Z0-9 *. + */ + // const backupId = 'abc123' + /** + * Required. The source backup to be copied from. + * The source backup needs to be in READY state for it to be copied. + * Copying a copied backup is not allowed. + * Once CopyBackup is in progress, the source backup cannot be deleted or + * cleaned up on expiration until CopyBackup is finished. + * Values are of the form: + * `projects//instances//clusters//backups/`. + */ + // const sourceBackup = 'abc123' + /** + * Required. Required. The expiration time of the copied backup with + * microsecond granularity that must be at least 6 hours and at most 30 days + * from the time the request is received. Once the `expire_time` has + * passed, Cloud Bigtable will delete the backup and free the resources used + * by the backup. + */ + // const expireTime = {} + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callCopyBackup() { + // Construct request + const request = { + parent, + backupId, + sourceBackup, + expireTime, + }; + + // Run request + const [operation] = await adminClient.copyBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCopyBackup(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_authorized_view.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_authorized_view.js new file mode 100644 index 00000000000..240f7c8708c --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_authorized_view.js @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, authorizedViewId, authorizedView) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateAuthorizedView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. This is the name of the table the AuthorizedView belongs to. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + */ + // const parent = 'abc123' + /** + * Required. The id of the AuthorizedView to create. This AuthorizedView must + * not already exist. The `authorized_view_id` appended to `parent` forms the + * full AuthorizedView name of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`. + */ + // const authorizedViewId = 'abc123' + /** + * Required. The AuthorizedView to create. + */ + // const authorizedView = {} + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callCreateAuthorizedView() { + // Construct request + const request = { + parent, + authorizedViewId, + authorizedView, + }; + + // Run request + const [operation] = await adminClient.createAuthorizedView(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateAuthorizedView(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateAuthorizedView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_backup.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_backup.js new file mode 100644 index 00000000000..de54aec6cfe --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_backup.js @@ -0,0 +1,79 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, backupId, backup) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. This must be one of the clusters in the instance in which this + * table is located. The backup will be stored in this cluster. Values are + * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + */ + // const parent = 'abc123' + /** + * Required. The id of the backup to be created. The `backup_id` along with + * the parent `parent` are combined as {parent}/backups/{backup_id} to create + * the full backup name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex _a-zA-Z0-9 -_.a-zA-Z0-9 *. + */ + // const backupId = 'abc123' + /** + * Required. The backup to create. + */ + // const backup = {} + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callCreateBackup() { + // Construct request + const request = { + parent, + backupId, + backup, + }; + + // Run request + const [operation] = await adminClient.createBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackup(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_schema_bundle.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_schema_bundle.js new file mode 100644 index 00000000000..5f38fb6c033 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_schema_bundle.js @@ -0,0 +1,75 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, schemaBundleId, schemaBundle) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateSchemaBundle_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this schema bundle will be created. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + */ + // const parent = 'abc123' + /** + * Required. The unique ID to use for the schema bundle, which will become the + * final component of the schema bundle's resource name. + */ + // const schemaBundleId = 'abc123' + /** + * Required. The schema bundle to create. + */ + // const schemaBundle = {} + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callCreateSchemaBundle() { + // Construct request + const request = { + parent, + schemaBundleId, + schemaBundle, + }; + + // Run request + const [operation] = await adminClient.createSchemaBundle(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSchemaBundle(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateSchemaBundle_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_table.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_table.js new file mode 100644 index 00000000000..0e874701c14 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_table.js @@ -0,0 +1,91 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, tableId, table) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. + */ + // const parent = 'abc123' + /** + * Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * Maximum 50 characters. + */ + // const tableId = 'abc123' + /** + * Required. The Table to create. + */ + // const table = {} + /** + * The optional list of row keys that will be used to initially split the + * table into several tablets (tablets are similar to HBase regions). + * Given two split keys, `s1` and `s2`, three tablets will be created, + * spanning the key ranges: `[, s1), [s1, s2), [s2, )`. + * Example: + * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` + * `"other", "zz"` + * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` + * * Key assignment: + * - Tablet 1 `[, apple) => {"a"}.` + * - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` + * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` + * - Tablet 4 `[customer_2, other) => {"customer_2"}.` + * - Tablet 5 `[other, ) => {"other", "zz"}.` + */ + // const initialSplits = [1,2,3,4] + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callCreateTable() { + // Construct request + const request = { + parent, + tableId, + table, + }; + + // Run request + const response = await adminClient.createTable(request); + console.log(response); + } + + callCreateTable(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_table_from_snapshot.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_table_from_snapshot.js new file mode 100644 index 00000000000..4f69a37dcc0 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.create_table_from_snapshot.js @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, tableId, sourceSnapshot) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. + */ + // const parent = 'abc123' + /** + * Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + */ + // const tableId = 'abc123' + /** + * Required. The unique name of the snapshot from which to restore the table. + * The snapshot and the table must be in the same instance. Values are of the + * form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + */ + // const sourceSnapshot = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callCreateTableFromSnapshot() { + // Construct request + const request = { + parent, + tableId, + sourceSnapshot, + }; + + // Run request + const [operation] = await adminClient.createTableFromSnapshot(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTableFromSnapshot(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_authorized_view.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_authorized_view.js new file mode 100644 index 00000000000..36840ffdade --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_authorized_view.js @@ -0,0 +1,70 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteAuthorizedView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the AuthorizedView to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + */ + // const name = 'abc123' + /** + * Optional. The current etag of the AuthorizedView. + * If an etag is provided and does not match the current etag of the + * AuthorizedView, deletion will be blocked and an ABORTED error will be + * returned. + */ + // const etag = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callDeleteAuthorizedView() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteAuthorizedView(request); + console.log(response); + } + + callDeleteAuthorizedView(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteAuthorizedView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_backup.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_backup.js new file mode 100644 index 00000000000..e21057d2f2e --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_backup.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backup to delete. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callDeleteBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteBackup(request); + console.log(response); + } + + callDeleteBackup(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_schema_bundle.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_schema_bundle.js new file mode 100644 index 00000000000..022c1663eff --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_schema_bundle.js @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSchemaBundle_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the schema bundle to delete. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + */ + // const name = 'abc123' + /** + * Optional. The etag of the schema bundle. + * If this is provided, it must match the server's etag. The server + * returns an ABORTED error on a mismatched etag. + */ + // const etag = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callDeleteSchemaBundle() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteSchemaBundle(request); + console.log(response); + } + + callDeleteSchemaBundle(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSchemaBundle_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_snapshot.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_snapshot.js new file mode 100644 index 00000000000..5cd59ce8e5e --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_snapshot.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the snapshot to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callDeleteSnapshot() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteSnapshot(request); + console.log(response); + } + + callDeleteSnapshot(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_table.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_table.js new file mode 100644 index 00000000000..92cff8f6fd1 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.delete_table.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the table to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callDeleteTable() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteTable(request); + console.log(response); + } + + callDeleteTable(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.drop_row_range.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.drop_row_range.js new file mode 100644 index 00000000000..26c1d7a3b17 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.drop_row_range.js @@ -0,0 +1,72 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the table on which to drop a range of rows. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + */ + // const name = 'abc123' + /** + * Delete all rows that start with this row key prefix. Prefix cannot be + * zero length. + */ + // const rowKeyPrefix = Buffer.from('string') + /** + * Delete all rows in the table. Setting this to false is a no-op. + */ + // const deleteAllDataFromTable = true + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callDropRowRange() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.dropRowRange(request); + console.log(response); + } + + callDropRowRange(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.generate_consistency_token.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.generate_consistency_token.js new file mode 100644 index 00000000000..0918721d2e6 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.generate_consistency_token.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the Table for which to create a consistency + * token. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callGenerateConsistencyToken() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.generateConsistencyToken(request); + console.log(response); + } + + callGenerateConsistencyToken(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_authorized_view.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_authorized_view.js new file mode 100644 index 00000000000..e742a0a635e --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_authorized_view.js @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_GetAuthorizedView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the requested AuthorizedView. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + */ + // const name = 'abc123' + /** + * Optional. The resource_view to be applied to the returned AuthorizedView's + * fields. Default to BASIC. + */ + // const view = {} + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callGetAuthorizedView() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getAuthorizedView(request); + console.log(response); + } + + callGetAuthorizedView(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_GetAuthorizedView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_backup.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_backup.js new file mode 100644 index 00000000000..74a344c402b --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_backup.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backup. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callGetBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getBackup(request); + console.log(response); + } + + callGetBackup(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_iam_policy.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_iam_policy.js new file mode 100644 index 00000000000..4aef8347fea --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await adminClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_schema_bundle.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_schema_bundle.js new file mode 100644 index 00000000000..a8f635b6339 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_schema_bundle.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_GetSchemaBundle_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the schema bundle to retrieve. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + */ + // const name = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callGetSchemaBundle() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getSchemaBundle(request); + console.log(response); + } + + callGetSchemaBundle(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_GetSchemaBundle_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_snapshot.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_snapshot.js new file mode 100644 index 00000000000..7b7925ad057 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_snapshot.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the requested snapshot. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callGetSnapshot() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getSnapshot(request); + console.log(response); + } + + callGetSnapshot(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_table.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_table.js new file mode 100644 index 00000000000..3fbe9efe1b0 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.get_table.js @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the requested table. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + */ + // const name = 'abc123' + /** + * The view to be applied to the returned table's fields. + * Defaults to `SCHEMA_VIEW` if unspecified. + */ + // const view = {} + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callGetTable() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getTable(request); + console.log(response); + } + + callGetTable(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_authorized_views.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_authorized_views.js new file mode 100644 index 00000000000..966db55bc5c --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_authorized_views.js @@ -0,0 +1,84 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_ListAuthorizedViews_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the table for which AuthorizedViews should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + */ + // const pageSize = 1234 + /** + * Optional. The value of `next_page_token` returned by a previous call. + */ + // const pageToken = 'abc123' + /** + * Optional. The resource_view to be applied to the returned AuthorizedViews' + * fields. Default to NAME_ONLY. + */ + // const view = {} + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callListAuthorizedViews() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = adminClient.listAuthorizedViewsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAuthorizedViews(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_ListAuthorizedViews_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_backups.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_backups.js new file mode 100644 index 00000000000..18b2d729c7e --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_backups.js @@ -0,0 +1,131 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The cluster to list backups from. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list backups for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + */ + // const parent = 'abc123' + /** + * A filter expression that filters backups listed in the response. + * The expression must specify the field name, a comparison operator, + * and the value that you want to use for filtering. The value must be a + * string, a number, or a boolean. The comparison operator must be + * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is + * roughly synonymous with equality. Filter rules are case insensitive. + * The fields eligible for filtering are: + * * `name` + * * `source_table` + * * `state` + * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `size_bytes` + * To filter on multiple expressions, provide each separate expression within + * parentheses. By default, each expression is an AND expression. However, + * you can include AND, OR, and NOT expressions explicitly. + * Some examples of using filters are: + * * `name:"exact"` --> The backup's name is the string "exact". + * * `name:howl` --> The backup's name contains the string "howl". + * * `source_table:prod` + * --> The source_table's name contains the string "prod". + * * `state:CREATING` --> The backup is pending creation. + * * `state:READY` --> The backup is fully created and ready for use. + * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` + * --> The backup name contains the string "howl" and start_time + * of the backup is before 2018-03-28T14:50:00Z. + * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB + */ + // const filter = 'abc123' + /** + * An expression for specifying the sort order of the results of the request. + * The string value should specify one or more fields in + * Backup google.bigtable.admin.v2.Backup. The full syntax is described at + * https://aip.dev/132#ordering. + * Fields supported are: + * * name + * * source_table + * * expire_time + * * start_time + * * end_time + * * size_bytes + * * state + * For example, "start_time". The default sorting order is ascending. + * To specify descending order for the field, a suffix " desc" should + * be appended to the field name. For example, "start_time desc". + * Redundant space characters in the syntax are insigificant. + * If order_by is empty, results will be sorted by `start_time` in descending + * order starting from the most recently created backup. + */ + // const orderBy = 'abc123' + /** + * Number of backups to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + */ + // const pageSize = 1234 + /** + * If non-empty, `page_token` should contain a + * next_page_token google.bigtable.admin.v2.ListBackupsResponse.next_page_token + * from a previous + * ListBackupsResponse google.bigtable.admin.v2.ListBackupsResponse to the + * same `parent` and with the same `filter`. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callListBackups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = adminClient.listBackupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackups(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_schema_bundles.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_schema_bundles.js new file mode 100644 index 00000000000..859d28f09e8 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_schema_bundles.js @@ -0,0 +1,78 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_ListSchemaBundles_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of schema bundles. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + */ + // const parent = 'abc123' + /** + * The maximum number of schema bundles to return. If the value is positive, + * the server may return at most this value. If unspecified, the server will + * return the maximum allowed page size. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListSchemaBundles` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSchemaBundles` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callListSchemaBundles() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = adminClient.listSchemaBundlesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSchemaBundles(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_ListSchemaBundles_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_snapshots.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_snapshots.js new file mode 100644 index 00000000000..cc098c1bd49 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_snapshots.js @@ -0,0 +1,76 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the cluster for which snapshots should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + */ + // const parent = 'abc123' + /** + * The maximum number of snapshots to return per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. + */ + // const pageSize = 1234 + /** + * The value of `next_page_token` returned by a previous call. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callListSnapshots() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = adminClient.listSnapshotsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSnapshots(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_tables.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_tables.js new file mode 100644 index 00000000000..c1df6998068 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.list_tables.js @@ -0,0 +1,83 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the instance for which tables should be + * listed. Values are of the form `projects/{project}/instances/{instance}`. + */ + // const parent = 'abc123' + /** + * The view to be applied to the returned tables' fields. + * NAME_ONLY view (default) and REPLICATION_VIEW are supported. + */ + // const view = {} + /** + * Maximum number of results per page. + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + */ + // const pageSize = 1234 + /** + * The value of `next_page_token` returned by a previous call. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callListTables() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = adminClient.listTablesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTables(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.modify_column_families.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.modify_column_families.js new file mode 100644 index 00000000000..040331569e9 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.modify_column_families.js @@ -0,0 +1,75 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, modifications) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the table whose families should be modified. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + */ + // const name = 'abc123' + /** + * Required. Modifications to be atomically applied to the specified table's + * families. Entries are applied in order, meaning that earlier modifications + * can be masked by later ones (in the case of repeated updates to the same + * family, for example). + */ + // const modifications = [1,2,3,4] + /** + * Optional. If true, ignore safety checks when modifying the column families. + */ + // const ignoreWarnings = true + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callModifyColumnFamilies() { + // Construct request + const request = { + name, + modifications, + }; + + // Run request + const response = await adminClient.modifyColumnFamilies(request); + console.log(response); + } + + callModifyColumnFamilies(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.restore_table.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.restore_table.js new file mode 100644 index 00000000000..2a1534e45cd --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.restore_table.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, tableId) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async_internal] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the instance in which to create the restored + * table. Values are of the form `projects//instances/`. + */ + // const parent = 'abc123' + /** + * Required. The id of the table to create and restore to. This + * table must not already exist. The `table_id` appended to + * `parent` forms the full table name of the form + * `projects//instances//tables/`. + */ + // const tableId = 'abc123' + /** + * Name of the backup from which to restore. Values are of the form + * `projects//instances//clusters//backups/`. + */ + // const backup = 'abc123' + + // Imports the Admin library + const {BigtableTableAdminClient} = require('admin').v2; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callRestoreTable() { + // Construct request + const request = { + parent, + tableId, + }; + + // Run request + const [operation] = await adminClient.restoreTable(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreTable(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async_internal] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.set_iam_policy.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.set_iam_policy.js new file mode 100644 index 00000000000..c9024302477 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, policy) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await adminClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.snapshot_table.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.snapshot_table.js new file mode 100644 index 00000000000..152e9764a3b --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.snapshot_table.js @@ -0,0 +1,90 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, cluster, snapshotId) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the table to have the snapshot taken. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + */ + // const name = 'abc123' + /** + * Required. The name of the cluster where the snapshot will be created in. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + */ + // const cluster = 'abc123' + /** + * Required. The ID by which the new snapshot should be referred to within the + * parent cluster, e.g., `mysnapshot` of the form: + * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + */ + // const snapshotId = 'abc123' + /** + * The amount of time that the new snapshot can stay active after it is + * created. Once 'ttl' expires, the snapshot will get deleted. The maximum + * amount of time a snapshot can stay active is 7 days. If 'ttl' is not + * specified, the default value of 24 hours will be used. + */ + // const ttl = {} + /** + * Description of the snapshot. + */ + // const description = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callSnapshotTable() { + // Construct request + const request = { + name, + cluster, + snapshotId, + }; + + // Run request + const [operation] = await adminClient.snapshotTable(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSnapshotTable(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.test_iam_permissions.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.test_iam_permissions.js new file mode 100644 index 00000000000..7555a9480b1 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, permissions) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = ['abc','def'] + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await adminClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.undelete_table.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.undelete_table.js new file mode 100644 index 00000000000..e9a0031d691 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.undelete_table.js @@ -0,0 +1,64 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique name of the table to be restored. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + */ + // const name = 'abc123' + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callUndeleteTable() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await adminClient.undeleteTable(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeleteTable(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_authorized_view.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_authorized_view.js new file mode 100644 index 00000000000..48daf3dbc23 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_authorized_view.js @@ -0,0 +1,80 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(authorizedView) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateAuthorizedView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The AuthorizedView to update. The `name` in `authorized_view` is + * used to identify the AuthorizedView. AuthorizedView name must in this + * format: + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + */ + // const authorizedView = {} + /** + * Optional. The list of fields to update. + * A mask specifying which fields in the AuthorizedView resource should be + * updated. This mask is relative to the AuthorizedView resource, not to the + * request message. A field will be overwritten if it is in the mask. If + * empty, all fields set in the request will be overwritten. A special value + * `*` means to overwrite all fields (including fields not set in the + * request). + */ + // const updateMask = {} + /** + * Optional. If true, ignore the safety checks when updating the + * AuthorizedView. + */ + // const ignoreWarnings = true + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callUpdateAuthorizedView() { + // Construct request + const request = { + authorizedView, + }; + + // Run request + const [operation] = await adminClient.updateAuthorizedView(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateAuthorizedView(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateAuthorizedView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_backup.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_backup.js new file mode 100644 index 00000000000..3a1dca4fde6 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_backup.js @@ -0,0 +1,73 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(backup, updateMask) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The backup to update. `backup.name`, and the fields to be updated + * as specified by `update_mask` are required. Other fields are ignored. + * Update is only supported for the following fields: + * * `backup.expire_time`. + */ + // const backup = {} + /** + * Required. A mask specifying which fields (e.g. `expire_time`) in the + * Backup resource should be updated. This mask is relative to the Backup + * resource, not to the request message. The field mask must always be + * specified; this prevents any future fields from being erased accidentally + * by clients that do not know about them. + */ + // const updateMask = {} + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callUpdateBackup() { + // Construct request + const request = { + backup, + updateMask, + }; + + // Run request + const response = await adminClient.updateBackup(request); + console.log(response); + } + + callUpdateBackup(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_schema_bundle.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_schema_bundle.js new file mode 100644 index 00000000000..ec957fb320a --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_schema_bundle.js @@ -0,0 +1,76 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(schemaBundle) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateSchemaBundle_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The schema bundle to update. + * The schema bundle's `name` field is used to identify the schema bundle to + * update. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + */ + // const schemaBundle = {} + /** + * Optional. The list of fields to update. + */ + // const updateMask = {} + /** + * Optional. If set, ignore the safety checks when updating the Schema Bundle. + * The safety checks are: + * - The new Schema Bundle is backwards compatible with the existing Schema + * Bundle. + */ + // const ignoreWarnings = true + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callUpdateSchemaBundle() { + // Construct request + const request = { + schemaBundle, + }; + + // Run request + const [operation] = await adminClient.updateSchemaBundle(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateSchemaBundle(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateSchemaBundle_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_table.js b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_table.js new file mode 100644 index 00000000000..612331e48f7 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/bigtable_table_admin.update_table.js @@ -0,0 +1,82 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(table, updateMask) { + // [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The table to update. + * The table's `name` field is used to identify the table to update. + */ + // const table = {} + /** + * Required. The list of fields to update. + * A mask specifying which fields (e.g. `change_stream_config`) in the `table` + * field should be updated. This mask is relative to the `table` field, not to + * the request message. The wildcard (*) path is currently not supported. + * Currently UpdateTable is only supported for the following fields: + * * `change_stream_config` + * * `change_stream_config.retention_period` + * * `deletion_protection` + * * `row_key_schema` + * If `column_families` is set in `update_mask`, it will return an + * UNIMPLEMENTED error. + */ + // const updateMask = {} + /** + * Optional. If true, ignore safety checks when updating the table. + */ + // const ignoreWarnings = true + + // Imports the Admin library + const {TableAdminClient} = require('@google-cloud/bigtable').admin; + + // Instantiates a client + const adminClient = new TableAdminClient(); + + async function callUpdateTable() { + // Construct request + const request = { + table, + updateMask, + }; + + // Run request + const [operation] = await adminClient.updateTable(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateTable(); + // [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/handwritten/bigtable/samples/generated/admin/v2/snippet_metadata_google.bigtable.admin.v2.json b/handwritten/bigtable/samples/generated/admin/v2/snippet_metadata_google.bigtable.admin.v2.json new file mode 100644 index 00000000000..cc9e3e41035 --- /dev/null +++ b/handwritten/bigtable/samples/generated/admin/v2/snippet_metadata_google.bigtable.admin.v2.json @@ -0,0 +1,3087 @@ +{ + "clientLibrary": { + "name": "nodejs-admin", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.bigtable.admin.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_async", + "title": "bigtable createInstance Sample", + "origin": "API_DEFINITION", + "description": " Create an instance within a project. Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.", + "canonical": true, + "file": "bigtable_instance_admin.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.bigtable.admin.v2.Instance" + }, + { + "name": "clusters", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateInstance", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_async", + "title": "bigtable getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets information about an instance.", + "canonical": true, + "file": "bigtable_instance_admin.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.Instance", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetInstance", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_async", + "title": "bigtable listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists information about instances in a project.", + "canonical": true, + "file": "bigtable_instance_admin.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.ListInstancesResponse", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListInstances", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_async", + "title": "bigtable updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates an instance within a project. This method updates only the display name and type for an Instance. To update other Instance properties, such as labels, use PartialUpdateInstance.", + "canonical": true, + "file": "bigtable_instance_admin.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 111, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "display_name", + "type": "TYPE_STRING" + }, + { + "name": "state", + "type": ".google.bigtable.admin.v2.Instance.State" + }, + { + "name": "type", + "type": ".google.bigtable.admin.v2.Instance.Type" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "create_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "satisfies_pzs", + "type": "TYPE_BOOL" + }, + { + "name": "satisfies_pzi", + "type": "TYPE_BOOL" + }, + { + "name": "tags", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.bigtable.admin.v2.Instance", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateInstance", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_async", + "title": "bigtable partialUpdateInstance Sample", + "origin": "API_DEFINITION", + "description": " Partially updates an instance within a project. This method can modify all fields of an Instance and is the preferred way to update an Instance.", + "canonical": true, + "file": "bigtable_instance_admin.partial_update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PartialUpdateInstance", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateInstance", + "async": true, + "parameters": [ + { + "name": "instance", + "type": ".google.bigtable.admin.v2.Instance" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "PartialUpdateInstance", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateInstance", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_async", + "title": "bigtable deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Delete an instance from a project.", + "canonical": true, + "file": "bigtable_instance_admin.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteInstance", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_async", + "title": "bigtable createCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a cluster within an instance. Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.", + "canonical": true, + "file": "bigtable_instance_admin.create_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCluster", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.bigtable.admin.v2.Cluster" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "CreateCluster", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateCluster", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_async", + "title": "bigtable getCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a cluster.", + "canonical": true, + "file": "bigtable_instance_admin.get_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCluster", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.Cluster", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "GetCluster", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetCluster", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_async", + "title": "bigtable listClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists information about clusters in an instance.", + "canonical": true, + "file": "bigtable_instance_admin.list_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListClusters", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListClusters", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.ListClustersResponse", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "ListClusters", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListClusters", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async", + "title": "bigtable updateCluster Sample", + "origin": "API_DEFINITION", + "description": " Updates a cluster within an instance. Note that UpdateCluster does not support updating cluster_config.cluster_autoscaling_config. In order to update it, you must use PartialUpdateCluster.", + "canonical": true, + "file": "bigtable_instance_admin.update_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 93, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCluster", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "location", + "type": "TYPE_STRING" + }, + { + "name": "state", + "type": ".google.bigtable.admin.v2.Cluster.State" + }, + { + "name": "serve_nodes", + "type": "TYPE_INT32" + }, + { + "name": "node_scaling_factor", + "type": ".google.bigtable.admin.v2.Cluster.NodeScalingFactor" + }, + { + "name": "cluster_config", + "type": ".google.bigtable.admin.v2.Cluster.ClusterConfig" + }, + { + "name": "default_storage_type", + "type": ".google.bigtable.admin.v2.StorageType" + }, + { + "name": "encryption_config", + "type": ".google.bigtable.admin.v2.Cluster.EncryptionConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "UpdateCluster", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateCluster", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_async", + "title": "bigtable partialUpdateCluster Sample", + "origin": "API_DEFINITION", + "description": " Partially updates a cluster within a project. This method is the preferred way to update a Cluster. To enable and update autoscaling, set cluster_config.cluster_autoscaling_config. When autoscaling is enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it are ignored. Note that an update cannot simultaneously set serve_nodes to non-zero and cluster_config.cluster_autoscaling_config to non-empty, and also specify both in the update_mask. To disable autoscaling, clear cluster_config.cluster_autoscaling_config, and explicitly set a serve_node count via the update_mask.", + "canonical": true, + "file": "bigtable_instance_admin.partial_update_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PartialUpdateCluster", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateCluster", + "async": true, + "parameters": [ + { + "name": "cluster", + "type": ".google.bigtable.admin.v2.Cluster" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "PartialUpdateCluster", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateCluster", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_async", + "title": "bigtable deleteCluster Sample", + "origin": "API_DEFINITION", + "description": " Deletes a cluster from an instance.", + "canonical": true, + "file": "bigtable_instance_admin.delete_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCluster", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "DeleteCluster", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteCluster", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_async", + "title": "bigtable createAppProfile Sample", + "origin": "API_DEFINITION", + "description": " Creates an app profile within an instance.", + "canonical": true, + "file": "bigtable_instance_admin.create_app_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAppProfile", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateAppProfile", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "app_profile_id", + "type": "TYPE_STRING" + }, + { + "name": "app_profile", + "type": ".google.bigtable.admin.v2.AppProfile" + }, + { + "name": "ignore_warnings", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.bigtable.admin.v2.AppProfile", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "CreateAppProfile", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateAppProfile", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_async", + "title": "bigtable getAppProfile Sample", + "origin": "API_DEFINITION", + "description": " Gets information about an app profile.", + "canonical": true, + "file": "bigtable_instance_admin.get_app_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAppProfile", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetAppProfile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.AppProfile", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "GetAppProfile", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetAppProfile", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_async", + "title": "bigtable listAppProfiles Sample", + "origin": "API_DEFINITION", + "description": " Lists information about app profiles in an instance.", + "canonical": true, + "file": "bigtable_instance_admin.list_app_profiles.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAppProfiles", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListAppProfiles", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.ListAppProfilesResponse", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "ListAppProfiles", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListAppProfiles", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_async", + "title": "bigtable updateAppProfile Sample", + "origin": "API_DEFINITION", + "description": " Updates an app profile within an instance.", + "canonical": true, + "file": "bigtable_instance_admin.update_app_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAppProfile", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateAppProfile", + "async": true, + "parameters": [ + { + "name": "app_profile", + "type": ".google.bigtable.admin.v2.AppProfile" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "ignore_warnings", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "UpdateAppProfile", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateAppProfile", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_async", + "title": "bigtable deleteAppProfile Sample", + "origin": "API_DEFINITION", + "description": " Deletes an app profile from an instance.", + "canonical": true, + "file": "bigtable_instance_admin.delete_app_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAppProfile", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteAppProfile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "ignore_warnings", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "DeleteAppProfile", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteAppProfile", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_async", + "title": "bigtable getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy for an instance resource. Returns an empty policy if an instance exists but does not have a policy set.", + "canonical": true, + "file": "bigtable_instance_admin.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetIamPolicy", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_async", + "title": "bigtable setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on an instance resource. Replaces any existing policy.", + "canonical": true, + "file": "bigtable_instance_admin.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.SetIamPolicy", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_async", + "title": "bigtable testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns permissions that the caller has on the specified instance resource.", + "canonical": true, + "file": "bigtable_instance_admin.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.TestIamPermissions", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_async", + "title": "bigtable listHotTablets Sample", + "origin": "API_DEFINITION", + "description": " Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based on CPU usage.", + "canonical": true, + "file": "bigtable_instance_admin.list_hot_tablets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListHotTablets", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListHotTablets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "end_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.ListHotTabletsResponse", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "ListHotTablets", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListHotTablets", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateLogicalView_async", + "title": "bigtable createLogicalView Sample", + "origin": "API_DEFINITION", + "description": " Creates a logical view within an instance.", + "canonical": true, + "file": "bigtable_instance_admin.create_logical_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateLogicalView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateLogicalView", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "logical_view_id", + "type": "TYPE_STRING" + }, + { + "name": "logical_view", + "type": ".google.bigtable.admin.v2.LogicalView" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "CreateLogicalView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateLogicalView", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetLogicalView_async", + "title": "bigtable getLogicalView Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a logical view.", + "canonical": true, + "file": "bigtable_instance_admin.get_logical_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetLogicalView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetLogicalView", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.LogicalView", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "GetLogicalView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetLogicalView", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListLogicalViews_async", + "title": "bigtable listLogicalViews Sample", + "origin": "API_DEFINITION", + "description": " Lists information about logical views in an instance.", + "canonical": true, + "file": "bigtable_instance_admin.list_logical_views.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListLogicalViews", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListLogicalViews", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.ListLogicalViewsResponse", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "ListLogicalViews", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListLogicalViews", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateLogicalView_async", + "title": "bigtable updateLogicalView Sample", + "origin": "API_DEFINITION", + "description": " Updates a logical view within an instance.", + "canonical": true, + "file": "bigtable_instance_admin.update_logical_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateLogicalView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateLogicalView", + "async": true, + "parameters": [ + { + "name": "logical_view", + "type": ".google.bigtable.admin.v2.LogicalView" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "UpdateLogicalView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateLogicalView", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteLogicalView_async", + "title": "bigtable deleteLogicalView Sample", + "origin": "API_DEFINITION", + "description": " Deletes a logical view from an instance.", + "canonical": true, + "file": "bigtable_instance_admin.delete_logical_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteLogicalView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteLogicalView", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "DeleteLogicalView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteLogicalView", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateMaterializedView_async", + "title": "bigtable createMaterializedView Sample", + "origin": "API_DEFINITION", + "description": " Creates a materialized view within an instance.", + "canonical": true, + "file": "bigtable_instance_admin.create_materialized_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMaterializedView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateMaterializedView", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "materialized_view_id", + "type": "TYPE_STRING" + }, + { + "name": "materialized_view", + "type": ".google.bigtable.admin.v2.MaterializedView" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "CreateMaterializedView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateMaterializedView", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetMaterializedView_async", + "title": "bigtable getMaterializedView Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a materialized view.", + "canonical": true, + "file": "bigtable_instance_admin.get_materialized_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMaterializedView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetMaterializedView", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.MaterializedView", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "GetMaterializedView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetMaterializedView", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListMaterializedViews_async", + "title": "bigtable listMaterializedViews Sample", + "origin": "API_DEFINITION", + "description": " Lists information about materialized views in an instance.", + "canonical": true, + "file": "bigtable_instance_admin.list_materialized_views.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMaterializedViews", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListMaterializedViews", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.ListMaterializedViewsResponse", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "ListMaterializedViews", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListMaterializedViews", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateMaterializedView_async", + "title": "bigtable updateMaterializedView Sample", + "origin": "API_DEFINITION", + "description": " Updates a materialized view within an instance.", + "canonical": true, + "file": "bigtable_instance_admin.update_materialized_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMaterializedView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateMaterializedView", + "async": true, + "parameters": [ + { + "name": "materialized_view", + "type": ".google.bigtable.admin.v2.MaterializedView" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "UpdateMaterializedView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateMaterializedView", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteMaterializedView_async", + "title": "bigtable deleteMaterializedView Sample", + "origin": "API_DEFINITION", + "description": " Deletes a materialized view from an instance.", + "canonical": true, + "file": "bigtable_instance_admin.delete_materialized_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMaterializedView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteMaterializedView", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigtableInstanceAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" + }, + "method": { + "shortName": "DeleteMaterializedView", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteMaterializedView", + "service": { + "shortName": "BigtableInstanceAdmin", + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_async", + "title": "bigtable createTable Sample", + "origin": "API_DEFINITION", + "description": " Creates a new table in the specified instance. The table can be created with a full set of initial column families, specified in the request.", + "canonical": true, + "file": "bigtable_table_admin.create_table.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateTable", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "table_id", + "type": "TYPE_STRING" + }, + { + "name": "table", + "type": ".google.bigtable.admin.v2.Table" + }, + { + "name": "initial_splits", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.bigtable.admin.v2.Table", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "CreateTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateTable", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_async", + "title": "bigtable createTableFromSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Creates a new table from the specified snapshot. The target table must not exist. The snapshot and the table must be in the same instance. Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.", + "canonical": true, + "file": "bigtable_table_admin.create_table_from_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTableFromSnapshot", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "table_id", + "type": "TYPE_STRING" + }, + { + "name": "source_snapshot", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "CreateTableFromSnapshot", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_async", + "title": "bigtable listTables Sample", + "origin": "API_DEFINITION", + "description": " Lists all tables served from a specified instance.", + "canonical": true, + "file": "bigtable_table_admin.list_tables.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTables", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListTables", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.bigtable.admin.v2.Table.View" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.ListTablesResponse", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "ListTables", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListTables", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_async", + "title": "bigtable getTable Sample", + "origin": "API_DEFINITION", + "description": " Gets metadata information about the specified table.", + "canonical": true, + "file": "bigtable_table_admin.get_table.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetTable", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.bigtable.admin.v2.Table.View" + } + ], + "resultType": ".google.bigtable.admin.v2.Table", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "GetTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetTable", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_async", + "title": "bigtable updateTable Sample", + "origin": "API_DEFINITION", + "description": " Updates a specified table.", + "canonical": true, + "file": "bigtable_table_admin.update_table.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable", + "async": true, + "parameters": [ + { + "name": "table", + "type": ".google.bigtable.admin.v2.Table" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "ignore_warnings", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "UpdateTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_async", + "title": "bigtable deleteTable Sample", + "origin": "API_DEFINITION", + "description": " Permanently deletes a specified table and all of its data.", + "canonical": true, + "file": "bigtable_table_admin.delete_table.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "DeleteTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_async", + "title": "bigtable undeleteTable Sample", + "origin": "API_DEFINITION", + "description": " Restores a specified table which was accidentally deleted.", + "canonical": true, + "file": "bigtable_table_admin.undelete_table.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeleteTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "UndeleteTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateAuthorizedView_async", + "title": "bigtable createAuthorizedView Sample", + "origin": "API_DEFINITION", + "description": " Creates a new AuthorizedView in a table.", + "canonical": true, + "file": "bigtable_table_admin.create_authorized_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAuthorizedView", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "authorized_view_id", + "type": "TYPE_STRING" + }, + { + "name": "authorized_view", + "type": ".google.bigtable.admin.v2.AuthorizedView" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "CreateAuthorizedView", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListAuthorizedViews_async", + "title": "bigtable listAuthorizedViews Sample", + "origin": "API_DEFINITION", + "description": " Lists all AuthorizedViews from a specific table.", + "canonical": true, + "file": "bigtable_table_admin.list_authorized_views.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAuthorizedViews", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.bigtable.admin.v2.AuthorizedView.ResponseView" + } + ], + "resultType": ".google.bigtable.admin.v2.ListAuthorizedViewsResponse", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "ListAuthorizedViews", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetAuthorizedView_async", + "title": "bigtable getAuthorizedView Sample", + "origin": "API_DEFINITION", + "description": " Gets information from a specified AuthorizedView.", + "canonical": true, + "file": "bigtable_table_admin.get_authorized_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAuthorizedView", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.bigtable.admin.v2.AuthorizedView.ResponseView" + } + ], + "resultType": ".google.bigtable.admin.v2.AuthorizedView", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "GetAuthorizedView", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UpdateAuthorizedView_async", + "title": "bigtable updateAuthorizedView Sample", + "origin": "API_DEFINITION", + "description": " Updates an AuthorizedView in a table.", + "canonical": true, + "file": "bigtable_table_admin.update_authorized_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAuthorizedView", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView", + "async": true, + "parameters": [ + { + "name": "authorized_view", + "type": ".google.bigtable.admin.v2.AuthorizedView" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "ignore_warnings", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "UpdateAuthorizedView", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteAuthorizedView_async", + "title": "bigtable deleteAuthorizedView Sample", + "origin": "API_DEFINITION", + "description": " Permanently deletes a specified AuthorizedView.", + "canonical": true, + "file": "bigtable_table_admin.delete_authorized_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAuthorizedView", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "DeleteAuthorizedView", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_async", + "title": "bigtable modifyColumnFamilies Sample", + "origin": "API_DEFINITION", + "description": " Performs a series of column family modifications on the specified table. Either all or none of the modifications will occur before this method returns, but data requests received prior to that point may see a table where only some modifications have taken effect.", + "canonical": true, + "file": "bigtable_table_admin.modify_column_families.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ModifyColumnFamilies", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "modifications", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "ignore_warnings", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.bigtable.admin.v2.Table", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "ModifyColumnFamilies", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_async", + "title": "bigtable dropRowRange Sample", + "origin": "API_DEFINITION", + "description": " Permanently drop/delete a row range from a specified table. The request can specify whether to delete all rows in a table, or only those that match a particular prefix.", + "canonical": true, + "file": "bigtable_table_admin.drop_row_range.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DropRowRange", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "row_key_prefix", + "type": "TYPE_BYTES" + }, + { + "name": "delete_all_data_from_table", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "DropRowRange", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_async", + "title": "bigtable generateConsistencyToken Sample", + "origin": "API_DEFINITION", + "description": " Generates a consistency token for a Table, which can be used in CheckConsistency to check whether mutations to the table that finished before this call started have been replicated. The tokens will be available for 90 days.", + "canonical": true, + "file": "bigtable_table_admin.generate_consistency_token.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateConsistencyToken", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.GenerateConsistencyTokenResponse", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "GenerateConsistencyToken", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async", + "title": "bigtable checkConsistency Sample", + "origin": "API_DEFINITION", + "description": " Checks replication consistency based on a consistency token, that is, if replication has caught up based on the conditions specified in the token and the check request.", + "canonical": true, + "file": "bigtable_table_admin.check_consistency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckConsistency", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "consistency_token", + "type": "TYPE_STRING" + }, + { + "name": "standard_read_remote_writes", + "type": ".google.bigtable.admin.v2.StandardReadRemoteWrites" + }, + { + "name": "data_boost_read_local_writes", + "type": ".google.bigtable.admin.v2.DataBoostReadLocalWrites" + } + ], + "resultType": ".google.bigtable.admin.v2.CheckConsistencyResponse", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "CheckConsistency", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_async", + "title": "bigtable snapshotTable Sample", + "origin": "API_DEFINITION", + "description": " Creates a new snapshot in the specified cluster from the specified source table. The cluster and the table must be in the same instance. Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.", + "canonical": true, + "file": "bigtable_table_admin.snapshot_table.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SnapshotTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_id", + "type": "TYPE_STRING" + }, + { + "name": "ttl", + "type": ".google.protobuf.Duration" + }, + { + "name": "description", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "SnapshotTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_async", + "title": "bigtable getSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Gets metadata information about the specified snapshot. Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.", + "canonical": true, + "file": "bigtable_table_admin.get_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSnapshot", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.Snapshot", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "GetSnapshot", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_async", + "title": "bigtable listSnapshots Sample", + "origin": "API_DEFINITION", + "description": " Lists all snapshots associated with the specified cluster. Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.", + "canonical": true, + "file": "bigtable_table_admin.list_snapshots.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSnapshots", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.ListSnapshotsResponse", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "ListSnapshots", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_async", + "title": "bigtable deleteSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Permanently deletes the specified snapshot. Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.", + "canonical": true, + "file": "bigtable_table_admin.delete_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSnapshot", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "DeleteSnapshot", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_async", + "title": "bigtable createBackup Sample", + "origin": "API_DEFINITION", + "description": " Starts creating a new Cloud Bigtable Backup. The returned backup [long-running operation][google.longrunning.Operation] can be used to track creation of the backup. The [metadata][google.longrunning.Operation.metadata] field type is [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The [response][google.longrunning.Operation.response] field type is [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the returned operation will stop the creation and delete the backup.", + "canonical": true, + "file": "bigtable_table_admin.create_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackup", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_id", + "type": "TYPE_STRING" + }, + { + "name": "backup", + "type": ".google.bigtable.admin.v2.Backup" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "CreateBackup", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_async", + "title": "bigtable getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets metadata on a pending or completed Cloud Bigtable Backup.", + "canonical": true, + "file": "bigtable_table_admin.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.Backup", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetBackup", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_async", + "title": "bigtable updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates a pending or completed Cloud Bigtable Backup.", + "canonical": true, + "file": "bigtable_table_admin.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "backup", + "type": ".google.bigtable.admin.v2.Backup" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.bigtable.admin.v2.Backup", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_async", + "title": "bigtable deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a pending or completed Cloud Bigtable backup.", + "canonical": true, + "file": "bigtable_table_admin.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_async", + "title": "bigtable listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists Cloud Bigtable backups. Returns both completed and pending backups.", + "canonical": true, + "file": "bigtable_table_admin.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 123, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListBackups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.ListBackupsResponse", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListBackups", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async", + "title": "bigtable restoreTable Sample", + "origin": "API_DEFINITION", + "description": " Create a new table by restoring from a completed backup. The returned table [long-running operation][google.longrunning.Operation] can be used to track the progress of the operation, and to cancel it. The [metadata][google.longrunning.Operation.metadata] field type is [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata]. The [response][google.longrunning.Operation.response] type is [Table][google.bigtable.admin.v2.Table], if successful.", + "canonical": true, + "file": "bigtable_table_admin.restore_table.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "table_id", + "type": "TYPE_STRING" + }, + { + "name": "backup", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "RestoreTable", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_async", + "title": "bigtable copyBackup Sample", + "origin": "API_DEFINITION", + "description": " Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the destination instance and project.", + "canonical": true, + "file": "bigtable_table_admin.copy_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CopyBackup", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_id", + "type": "TYPE_STRING" + }, + { + "name": "source_backup", + "type": "TYPE_STRING" + }, + { + "name": "expire_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "CopyBackup", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_async", + "title": "bigtable getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy for a Bigtable resource. Returns an empty policy if the resource exists but does not have a policy set.", + "canonical": true, + "file": "bigtable_table_admin.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetIamPolicy", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_async", + "title": "bigtable setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on a Bigtable resource. Replaces any existing policy.", + "canonical": true, + "file": "bigtable_table_admin.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.SetIamPolicy", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_async", + "title": "bigtable testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns permissions that the caller has on the specified Bigtable resource.", + "canonical": true, + "file": "bigtable_table_admin.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.TestIamPermissions", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateSchemaBundle_async", + "title": "bigtable createSchemaBundle Sample", + "origin": "API_DEFINITION", + "description": " Creates a new schema bundle in the specified table.", + "canonical": true, + "file": "bigtable_table_admin.create_schema_bundle.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSchemaBundle", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "schema_bundle_id", + "type": "TYPE_STRING" + }, + { + "name": "schema_bundle", + "type": ".google.bigtable.admin.v2.SchemaBundle" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "CreateSchemaBundle", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UpdateSchemaBundle_async", + "title": "bigtable updateSchemaBundle Sample", + "origin": "API_DEFINITION", + "description": " Updates a schema bundle in the specified table.", + "canonical": true, + "file": "bigtable_table_admin.update_schema_bundle.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSchemaBundle", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle", + "async": true, + "parameters": [ + { + "name": "schema_bundle", + "type": ".google.bigtable.admin.v2.SchemaBundle" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "ignore_warnings", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "UpdateSchemaBundle", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetSchemaBundle_async", + "title": "bigtable getSchemaBundle Sample", + "origin": "API_DEFINITION", + "description": " Gets metadata information about the specified schema bundle.", + "canonical": true, + "file": "bigtable_table_admin.get_schema_bundle.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSchemaBundle", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundle", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.SchemaBundle", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "GetSchemaBundle", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundle", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListSchemaBundles_async", + "title": "bigtable listSchemaBundles Sample", + "origin": "API_DEFINITION", + "description": " Lists all schema bundles associated with the specified table.", + "canonical": true, + "file": "bigtable_table_admin.list_schema_bundles.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSchemaBundles", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.bigtable.admin.v2.ListSchemaBundlesResponse", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "ListSchemaBundles", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + }, + { + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSchemaBundle_async", + "title": "bigtable deleteSchemaBundle Sample", + "origin": "API_DEFINITION", + "description": " Deletes a schema bundle in the specified table.", + "canonical": true, + "file": "bigtable_table_admin.delete_schema_bundle.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSchemaBundle", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundle", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigtableTableAdminClient", + "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" + }, + "method": { + "shortName": "DeleteSchemaBundle", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundle", + "service": { + "shortName": "BigtableTableAdmin", + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" + } + } + } + } + ] +} diff --git a/handwritten/bigtable/src/admin/clients.ts b/handwritten/bigtable/src/admin/clients.ts new file mode 100644 index 00000000000..6e07b65143d --- /dev/null +++ b/handwritten/bigtable/src/admin/clients.ts @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {Bigtable} from '../'; +import {TableAdminClient} from './table'; +import {InstanceAdminClient} from './instance'; +import * as gax from 'google-gax'; + +/** + * Bigtable admin client accessor. These methods let you instantiate the + * admin client classes more easily, if you already have a `Bigtable` object. + * You can still create them directly, but this saves you some trouble with + * figuring out auth and other configuration. + */ +export class BigtableAdmin { + private clientOptions?: gax.ClientOptions; + + constructor(clientOptions?: gax.ClientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a BigtableAdmin using the values derived by `Bigtable`. + * + * @param bigtable Bigtable The Bigtable object to read settings from + * @returns A configured BigtableAdmin + */ + static fromBigtable(bigtable: Bigtable) { + // The Bigtable object has separate values for table and instance clients, + // but they should functionally be the same. + return new BigtableAdmin(bigtable.options.BigtableTableAdminClient); + } + + /** + * Creates a client for table administration. + * + * @returns The admin client + */ + getTableAdminClient(options?: gax.ClientOptions) { + return new TableAdminClient(options ?? this.clientOptions); + } + + /** + * Creates a client for instance administration. + * + * @returns The admin client + */ + getInstanceAdminClient(options?: gax.ClientOptions) { + return new InstanceAdminClient(options ?? this.clientOptions); + } +} diff --git a/handwritten/bigtable/src/admin/gc-rule-builder.ts b/handwritten/bigtable/src/admin/gc-rule-builder.ts new file mode 100644 index 00000000000..25b9b3d1bc0 --- /dev/null +++ b/handwritten/bigtable/src/admin/gc-rule-builder.ts @@ -0,0 +1,182 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 util from 'node:util'; +import {google} from '../../protos/protos'; + +export type IGcRule = google.bigtable.admin.v2.IGcRule; +export type IDuration = google.protobuf.IDuration; + +// Builds a type that has exactly one key from another type. +type RequireExactlyOne = { + [K in Keys]-?: Required> & + Partial, never>>; +}[Keys]; + +// Builds a type from RequireExactlyOne that excludes certain keys. +type BuildExclusiveType = RequireExactlyOne< + Omit +>; + +export type GcUnion = Pick; +export type GcIntersection = Pick; +export type GcGrouping = GcUnion | GcIntersection; +export type GcRuleItem = BuildExclusiveType; + +function isUnion(rule: IGcRule): rule is GcUnion { + return !!rule.union; +} + +function isIntersection(rule: IGcRule): rule is GcIntersection { + return !!rule.intersection; +} + +function isGrouping(rule: IGcRule): rule is GcGrouping { + return isUnion(rule) || isIntersection(rule); +} + +function nonGroupKeys(rule: IGcRule): string[] { + return Object.keys(rule).filter(k => k !== 'union' && k !== 'intersection'); +} + +function isRuleItem(rule: IGcRule): rule is GcRuleItem { + const keys = nonGroupKeys(rule); + + // We'll handle === 1 below. + return keys.length > 0; +} + +/** + * Helper class for building valid garbage collection rules. TypeScript is + * recommended here for the maximum help, as types will guide user code at + * compile time; however, some correctness checking happens at runtime to help + * JavaScript users as well. + */ +export class GcRuleBuilder { + /** + * Formats exception strings. + * + * @private + * @param p The IGcRule parameter that's failing + * @param why A string describing why it's failing + * @returns A formatted exception message + */ + static formatErrorParameter(p: IGcRule, why: string): string { + return `Parameter ${util.format('%o', p)} ${why}`; + } + + /** + * Runtime checks for JavaScript code. + * @private + */ + static checkGroupingItem(p: GcGrouping | GcRuleItem): void { + if (isUnion(p) && isIntersection(p)) { + throw new Error( + GcRuleBuilder.formatErrorParameter( + p, + 'is both a union and intersection', + ), + ); + } + if (isGrouping(p) && isRuleItem(p)) { + throw new Error( + GcRuleBuilder.formatErrorParameter( + p, + 'is both a union and/or intersection, and a rule', + ), + ); + } + if (!isGrouping(p) && !isRuleItem(p)) { + throw new Error( + GcRuleBuilder.formatErrorParameter( + p, + 'is not a rule or a union/intersection', + ), + ); + } + } + + /** + * Runtime checks for JavaScript code. + * @private + */ + static checkRuleItem(p: GcRuleItem): void { + if (isGrouping(p)) { + throw new Error( + GcRuleBuilder.formatErrorParameter( + p, + 'is a union or intersection, not a rule', + ), + ); + } + if (!isRuleItem(p)) { + throw new Error( + GcRuleBuilder.formatErrorParameter(p, 'does not appear to be a rule'), + ); + } + if (nonGroupKeys(p).length > 1) { + throw new Error( + GcRuleBuilder.formatErrorParameter( + p, + 'is an invalid multiple-rule; please use a union or intersection', + ), + ); + } + } + + /** + * Unions are formed from other groupings (union, intersection) and potentially + * rules (e.g. maxAge). They will match if any of the items are true. + * + * @param params Groupings and/or rules to be included + * @returns [IGcRule] A newly built group + */ + static union(...params: Array): GcGrouping { + params.forEach(GcRuleBuilder.checkGroupingItem); + + return { + union: { + rules: params, + }, + }; + } + + /** + * Intersections are formed from other groupings (union, intersection) and potentially + * rules (e.g. maxAge). They will match if all of the items are true. + * + * @param params Groupings and/or rules to be included + * @returns [IGcRule] A newly built group + */ + static intersection(...params: Array): GcGrouping { + params.forEach(GcRuleBuilder.checkGroupingItem); + + return { + intersection: { + rules: params, + }, + }; + } + + /** + * Rules are leaf nodes and contain constraints such as maxAge and maxNumVersions. + * + * @param params [IGcRule] Filled rule + * @returns [IGcRule] A typed/checked rule + */ + static rule(rule: GcRuleItem): GcRuleItem { + GcRuleBuilder.checkRuleItem(rule); + return rule; + } +} diff --git a/handwritten/bigtable/src/admin/index.ts b/handwritten/bigtable/src/admin/index.ts new file mode 100644 index 00000000000..8475f4170d4 --- /dev/null +++ b/handwritten/bigtable/src/admin/index.ts @@ -0,0 +1,19 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +export * as v2 from './v2'; +export {TableAdminClient} from './table'; +export {InstanceAdminClient} from './instance'; +export {GcRuleBuilder} from './gc-rule-builder'; +export {BigtableAdmin} from './clients'; diff --git a/handwritten/bigtable/src/admin/instance.ts b/handwritten/bigtable/src/admin/instance.ts new file mode 100644 index 00000000000..32a02d26b19 --- /dev/null +++ b/handwritten/bigtable/src/admin/instance.ts @@ -0,0 +1,30 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 {BigtableInstanceAdminClient} from './v2'; + +/** + * Service for creating, configuring, and deleting Cloud Bigtable Instances and + * Clusters. Provides access to the Instance and Cluster schemas only, not the + * tables' metadata or data stored in those tables. + * + * While users may create an instance of this class using the standard GAPIC + * constructor parameters, it's recommended to obtain one by way of the + * Bigtable.getInstanceAdminClient() method so that authentication and configuration + * are all handled uniformly. + * + * @class + * @memberof admin + */ +export class InstanceAdminClient extends BigtableInstanceAdminClient {} diff --git a/handwritten/bigtable/src/admin/table.ts b/handwritten/bigtable/src/admin/table.ts new file mode 100644 index 00000000000..d74381db253 --- /dev/null +++ b/handwritten/bigtable/src/admin/table.ts @@ -0,0 +1,163 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 {BigtableTableAdminClient} from './v2'; +import {LROperation, CallOptions, ClientOptions} from 'google-gax'; +import type * as gax from 'google-gax'; + +import {google} from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Service for creating, configuring, and deleting Cloud Bigtable tables. + * Provides access to the table schemas only, not the data stored within + * the tables. + * + * While users may create an instance of this class using the standard GAPIC + * constructor parameters, it's recommended to obtain one by way of the + * Bigtable.getTableAdminClient() method so that authentication and + * configuration are all handled uniformly. + * + * @class + * @memberof admin + */ +export class TableAdminClient extends BigtableTableAdminClient { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + super(opts, gaxInstance); + + const protoFilesRoot = this.pGaxModule.protobufFromJSON(jsonProtos); + + // This one isn't included since it's not a directly callable method on the proto. + const optimizeRestoredTableResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Table', + ) as gax.protobuf.Type; + const optimizeRestoredTableMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.OptimizeRestoredTableMetadata', + ) as gax.protobuf.Type; + this.descriptors.longrunning['optimizeRestoredTable'] = + new this.pGaxModule.LongrunningDescriptor( + this.operationsClient, + optimizeRestoredTableResponse.decode.bind( + optimizeRestoredTableResponse, + ), + optimizeRestoredTableMetadata.decode.bind( + optimizeRestoredTableMetadata, + ), + ); + } + + // We want to use the same gax module as the base class, but it's private. + private get pGaxModule() { + return this['_gaxModule']; + } + + // We want to use the same logger as the base class, but it's private. + private get pLog() { + return this['_log']; + } + + /* + * This one doesn't get generated in GAPIC, because it's "hidden" in proto + * return types rather than being part of a method. This helper does the same + * thing as e.g. checkRestoreTableStatus. + */ + /** + * Check the status of the long running operation returned when the `restoreTable()` + * LRO has concluded. + * + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkOptimizeRestoredTableProgress( + name: string, + ): Promise< + LROperation< + google.bigtable.admin.v2.Table, + google.bigtable.admin.v2.OptimizeRestoredTableMetadata + > + > { + this.pLog.info('optimizeRestoredTable long-running'); + const request = + new this.pGaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this.pGaxModule.Operation( + operation, + this.descriptors.longrunning.optimizeRestoredTable, + this.pGaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + google.bigtable.admin.v2.Table, + google.bigtable.admin.v2.OptimizeRestoredTableMetadata + >; + } + + /** + * Waits for a table to become consistent. This gets a consistency check token + * for you, and waits until its status has returned `consistent`. + * + * @param tableName The name of the table to check + * @param [token] An existing token string, if one exists + * @param [options] CallOptions, if desired + * @returns A Promise that completes when the table is consistent + */ + async waitForConsistency( + tableName: string, + token?: string, + options?: CallOptions, + ): Promise { + const checkIntervalSeconds = 5; + + // 1. Generate a consistency token (or use the one the user passed) + let resolvedToken = token; + if (!resolvedToken) { + const [generatedToken] = await this.generateConsistencyToken( + { + name: tableName, + }, + options, + ); + resolvedToken = generatedToken.consistencyToken!; + } + + let isConsistent = false; + while (!isConsistent) { + // 2. Check for consistency + const request = { + name: tableName, + consistencyToken: resolvedToken, + }; + const [consistent] = await this.checkConsistency(request, options); + + // Protos assume optional, so just be sure. + isConsistent = consistent.consistent ?? false; + + if (isConsistent) { + return; + } else { + await new Promise(resolve => { + setTimeout(resolve, checkIntervalSeconds * 1000); + }); + } + } + } +} diff --git a/handwritten/bigtable/src/admin/v2/bigtable_instance_admin_client.ts b/handwritten/bigtable/src/admin/v2/bigtable_instance_admin_client.ts new file mode 100644 index 00000000000..18251284e18 --- /dev/null +++ b/handwritten/bigtable/src/admin/v2/bigtable_instance_admin_client.ts @@ -0,0 +1,6451 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../../protos/protos'; +import jsonProtos = require('../../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/bigtable_instance_admin_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './bigtable_instance_admin_client_config.json'; +const version = require('../../../../package.json').version; + +/** + * Service for creating, configuring, and deleting Cloud Bigtable Instances and + * Clusters. Provides access to the Instance and Cluster schemas only, not the + * tables' metadata or data stored in those tables. + * @class + * @memberof v2 + */ +export class BigtableInstanceAdminClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('bigtable'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + bigtableInstanceAdminStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BigtableInstanceAdminClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new BigtableInstanceAdminClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof BigtableInstanceAdminClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'bigtableadmin.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + appProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/appProfiles/{app_profile}', + ), + authorizedViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}', + ), + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}', + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/clusters/{cluster}', + ), + hotTabletPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}', + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}', + ), + logicalViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/logicalViews/{logical_view}', + ), + materializedViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/materializedViews/{materialized_view}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + schemaBundlePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}', + ), + snapshotPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}', + ), + tablePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/tables/{table}', + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listAppProfiles: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'appProfiles', + ), + listHotTablets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'hotTablets', + ), + listLogicalViews: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'logicalViews', + ), + listMaterializedViews: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'materializedViews', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v2/{name=operations/**}:cancel', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v2/{name=operations/**}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v2/{name=operations/**}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v2/{name=operations/projects/**}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createInstanceResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Instance', + ) as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.CreateInstanceMetadata', + ) as gax.protobuf.Type; + const partialUpdateInstanceResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Instance', + ) as gax.protobuf.Type; + const partialUpdateInstanceMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.UpdateInstanceMetadata', + ) as gax.protobuf.Type; + const createClusterResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Cluster', + ) as gax.protobuf.Type; + const createClusterMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.CreateClusterMetadata', + ) as gax.protobuf.Type; + const updateClusterResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Cluster', + ) as gax.protobuf.Type; + const updateClusterMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.UpdateClusterMetadata', + ) as gax.protobuf.Type; + const partialUpdateClusterResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Cluster', + ) as gax.protobuf.Type; + const partialUpdateClusterMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.PartialUpdateClusterMetadata', + ) as gax.protobuf.Type; + const updateAppProfileResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.AppProfile', + ) as gax.protobuf.Type; + const updateAppProfileMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.UpdateAppProfileMetadata', + ) as gax.protobuf.Type; + const createLogicalViewResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.LogicalView', + ) as gax.protobuf.Type; + const createLogicalViewMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.CreateLogicalViewMetadata', + ) as gax.protobuf.Type; + const updateLogicalViewResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.LogicalView', + ) as gax.protobuf.Type; + const updateLogicalViewMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.UpdateLogicalViewMetadata', + ) as gax.protobuf.Type; + const createMaterializedViewResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.MaterializedView', + ) as gax.protobuf.Type; + const createMaterializedViewMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.CreateMaterializedViewMetadata', + ) as gax.protobuf.Type; + const updateMaterializedViewResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.MaterializedView', + ) as gax.protobuf.Type; + const updateMaterializedViewMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.UpdateMaterializedViewMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata), + ), + partialUpdateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + partialUpdateInstanceResponse.decode.bind( + partialUpdateInstanceResponse, + ), + partialUpdateInstanceMetadata.decode.bind( + partialUpdateInstanceMetadata, + ), + ), + createCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createClusterResponse.decode.bind(createClusterResponse), + createClusterMetadata.decode.bind(createClusterMetadata), + ), + updateCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateClusterResponse.decode.bind(updateClusterResponse), + updateClusterMetadata.decode.bind(updateClusterMetadata), + ), + partialUpdateCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + partialUpdateClusterResponse.decode.bind(partialUpdateClusterResponse), + partialUpdateClusterMetadata.decode.bind(partialUpdateClusterMetadata), + ), + updateAppProfile: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateAppProfileResponse.decode.bind(updateAppProfileResponse), + updateAppProfileMetadata.decode.bind(updateAppProfileMetadata), + ), + createLogicalView: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createLogicalViewResponse.decode.bind(createLogicalViewResponse), + createLogicalViewMetadata.decode.bind(createLogicalViewMetadata), + ), + updateLogicalView: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateLogicalViewResponse.decode.bind(updateLogicalViewResponse), + updateLogicalViewMetadata.decode.bind(updateLogicalViewMetadata), + ), + createMaterializedView: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createMaterializedViewResponse.decode.bind( + createMaterializedViewResponse, + ), + createMaterializedViewMetadata.decode.bind( + createMaterializedViewMetadata, + ), + ), + updateMaterializedView: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateMaterializedViewResponse.decode.bind( + updateMaterializedViewResponse, + ), + updateMaterializedViewMetadata.decode.bind( + updateMaterializedViewMetadata, + ), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.bigtable.admin.v2.BigtableInstanceAdmin', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')}, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.bigtableInstanceAdminStub) { + return this.bigtableInstanceAdminStub; + } + + // Put together the "service stub" for + // google.bigtable.admin.v2.BigtableInstanceAdmin. + this.bigtableInstanceAdminStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.bigtable.admin.v2.BigtableInstanceAdmin', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.bigtable.admin.v2.BigtableInstanceAdmin, + this._opts, + this._providedCustomServicePath, + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const bigtableInstanceAdminStubMethods = [ + 'createInstance', + 'getInstance', + 'listInstances', + 'updateInstance', + 'partialUpdateInstance', + 'deleteInstance', + 'createCluster', + 'getCluster', + 'listClusters', + 'updateCluster', + 'partialUpdateCluster', + 'deleteCluster', + 'createAppProfile', + 'getAppProfile', + 'listAppProfiles', + 'updateAppProfile', + 'deleteAppProfile', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + 'listHotTablets', + 'createLogicalView', + 'getLogicalView', + 'listLogicalViews', + 'updateLogicalView', + 'deleteLogicalView', + 'createMaterializedView', + 'getMaterializedView', + 'listMaterializedViews', + 'updateMaterializedView', + 'deleteMaterializedView', + ]; + for (const methodName of bigtableInstanceAdminStubMethods) { + const callPromise = this.bigtableInstanceAdminStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.bigtableInstanceAdminStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigtableadmin.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigtableadmin.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/bigtable.admin', + 'https://www.googleapis.com/auth/bigtable.admin.cluster', + 'https://www.googleapis.com/auth/bigtable.admin.instance', + 'https://www.googleapis.com/auth/cloud-bigtable.admin', + 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets information about an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the requested instance. Values are of the form + * `projects/{project}/instances/{instance}`. + * @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 {@link protos.google.bigtable.admin.v2.Instance|Instance}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_async + */ + getInstance( + request?: protos.google.bigtable.admin.v2.IGetInstanceRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IGetInstanceRequest | undefined, + {} | undefined, + ] + >; + getInstance( + request: protos.google.bigtable.admin.v2.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IGetInstanceRequest | null | undefined, + {} | null | undefined + >, + ): void; + getInstance( + request: protos.google.bigtable.admin.v2.IGetInstanceRequest, + callback: Callback< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IGetInstanceRequest | null | undefined, + {} | null | undefined + >, + ): void; + getInstance( + request?: protos.google.bigtable.admin.v2.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.IInstance, + | protos.google.bigtable.admin.v2.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IGetInstanceRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IGetInstanceRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.IInstance, + | protos.google.bigtable.admin.v2.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IGetInstanceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Lists information about instances in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the project for which a list of instances is + * requested. Values are of the form `projects/{project}`. + * @param {string} request.pageToken + * DEPRECATED: This field is unused and ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.bigtable.admin.v2.ListInstancesResponse|ListInstancesResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_async + */ + listInstances( + request?: protos.google.bigtable.admin.v2.IListInstancesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IListInstancesResponse, + protos.google.bigtable.admin.v2.IListInstancesRequest | undefined, + {} | undefined, + ] + >; + listInstances( + request: protos.google.bigtable.admin.v2.IListInstancesRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.IListInstancesResponse, + protos.google.bigtable.admin.v2.IListInstancesRequest | null | undefined, + {} | null | undefined + >, + ): void; + listInstances( + request: protos.google.bigtable.admin.v2.IListInstancesRequest, + callback: Callback< + protos.google.bigtable.admin.v2.IListInstancesResponse, + protos.google.bigtable.admin.v2.IListInstancesRequest | null | undefined, + {} | null | undefined + >, + ): void; + listInstances( + request?: protos.google.bigtable.admin.v2.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.IListInstancesResponse, + | protos.google.bigtable.admin.v2.IListInstancesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.IListInstancesResponse, + protos.google.bigtable.admin.v2.IListInstancesRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IListInstancesResponse, + protos.google.bigtable.admin.v2.IListInstancesRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listInstances request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.IListInstancesResponse, + | protos.google.bigtable.admin.v2.IListInstancesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('listInstances response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .listInstances(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.IListInstancesResponse, + protos.google.bigtable.admin.v2.IListInstancesRequest | undefined, + {} | undefined, + ]) => { + this._log.info('listInstances response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates an instance within a project. This method updates only the display + * name and type for an Instance. To update other Instance properties, such as + * labels, use PartialUpdateInstance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The unique name of the instance. Values are of the form + * `projects/{project}/instances/{@link protos.a-z0-9\\-|a-z}+[a-z0-9]`. + * @param {string} request.displayName + * Required. The descriptive name for this instance as it appears in UIs. + * Can be changed at any time, but should be kept globally unique + * to avoid confusion. + * @param {google.bigtable.admin.v2.Instance.State} request.state + * Output only. The current state of the instance. + * @param {google.bigtable.admin.v2.Instance.Type} request.type + * The type of the instance. Defaults to `PRODUCTION`. + * @param {number[]} request.labels + * Labels are a flexible and lightweight mechanism for organizing cloud + * resources into groups that reflect a customer's organizational needs and + * deployment strategies. They can be used to filter resources and aggregate + * metrics. + * + * * Label keys must be between 1 and 63 characters long and must conform to + * the regular expression: `{@link protos.\p{Ll}\p{Lo}\p{N}_-|\p{Ll}\p{Lo}}{0,62}`. + * * Label values must be between 0 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. + * * No more than 64 labels can be associated with a given resource. + * * Keys and values must both be under 128 bytes. + * @param {google.protobuf.Timestamp} request.createTime + * Output only. A commit timestamp representing when this Instance was + * created. For instances created before this field was added (August 2021), + * this value is `seconds: 0, nanos: 1`. + * @param {boolean} request.satisfiesPzs + * Output only. Reserved for future use. + * @param {boolean} request.satisfiesPzi + * Output only. Reserved for future use. + * @param {number[]} request.tags + * Optional. Input only. Immutable. Tag keys/values directly bound to this + * resource. For example: + * - "123/environment": "production", + * - "123/costCenter": "marketing" + * + * Tags and Labels (above) are both used to bind metadata to resources, with + * different use-cases. See + * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an + * in-depth overview on the difference between tags and labels. + * @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 {@link protos.google.bigtable.admin.v2.Instance|Instance}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_async + */ + updateInstance( + request?: protos.google.bigtable.admin.v2.IInstance, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IInstance | undefined, + {} | undefined, + ] + >; + updateInstance( + request: protos.google.bigtable.admin.v2.IInstance, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IInstance | null | undefined, + {} | null | undefined + >, + ): void; + updateInstance( + request: protos.google.bigtable.admin.v2.IInstance, + callback: Callback< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IInstance | null | undefined, + {} | null | undefined + >, + ): void; + updateInstance( + request?: protos.google.bigtable.admin.v2.IInstance, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IInstance | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IInstance | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IInstance | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('updateInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IInstance | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IInstance | undefined, + {} | undefined, + ]) => { + this._log.info('updateInstance response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Delete an instance from a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the instance to be deleted. + * Values are of the form `projects/{project}/instances/{instance}`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.bigtable.admin.v2.IDeleteInstanceRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteInstanceRequest | undefined, + {} | undefined, + ] + >; + deleteInstance( + request: protos.google.bigtable.admin.v2.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteInstanceRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteInstance( + request: protos.google.bigtable.admin.v2.IDeleteInstanceRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteInstanceRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteInstance( + request?: protos.google.bigtable.admin.v2.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteInstanceRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteInstanceRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteInstanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteInstanceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteInstance response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets information about a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the requested cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @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 {@link protos.google.bigtable.admin.v2.Cluster|Cluster}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_async + */ + getCluster( + request?: protos.google.bigtable.admin.v2.IGetClusterRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IGetClusterRequest | undefined, + {} | undefined, + ] + >; + getCluster( + request: protos.google.bigtable.admin.v2.IGetClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IGetClusterRequest | null | undefined, + {} | null | undefined + >, + ): void; + getCluster( + request: protos.google.bigtable.admin.v2.IGetClusterRequest, + callback: Callback< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IGetClusterRequest | null | undefined, + {} | null | undefined + >, + ): void; + getCluster( + request?: protos.google.bigtable.admin.v2.IGetClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IGetClusterRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IGetClusterRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IGetClusterRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getCluster request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IGetClusterRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCluster response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCluster(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IGetClusterRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getCluster response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Lists information about clusters in an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which a list of clusters is + * requested. Values are of the form + * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list + * Clusters for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + * @param {string} request.pageToken + * DEPRECATED: This field is unused and ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.bigtable.admin.v2.ListClustersResponse|ListClustersResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_async + */ + listClusters( + request?: protos.google.bigtable.admin.v2.IListClustersRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IListClustersResponse, + protos.google.bigtable.admin.v2.IListClustersRequest | undefined, + {} | undefined, + ] + >; + listClusters( + request: protos.google.bigtable.admin.v2.IListClustersRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.IListClustersResponse, + protos.google.bigtable.admin.v2.IListClustersRequest | null | undefined, + {} | null | undefined + >, + ): void; + listClusters( + request: protos.google.bigtable.admin.v2.IListClustersRequest, + callback: Callback< + protos.google.bigtable.admin.v2.IListClustersResponse, + protos.google.bigtable.admin.v2.IListClustersRequest | null | undefined, + {} | null | undefined + >, + ): void; + listClusters( + request?: protos.google.bigtable.admin.v2.IListClustersRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.IListClustersResponse, + | protos.google.bigtable.admin.v2.IListClustersRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.IListClustersResponse, + protos.google.bigtable.admin.v2.IListClustersRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IListClustersResponse, + protos.google.bigtable.admin.v2.IListClustersRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listClusters request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.IListClustersResponse, + | protos.google.bigtable.admin.v2.IListClustersRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('listClusters response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .listClusters(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.IListClustersResponse, + protos.google.bigtable.admin.v2.IListClustersRequest | undefined, + {} | undefined, + ]) => { + this._log.info('listClusters response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a cluster from an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the cluster to be deleted. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.bigtable.admin.v2.IDeleteClusterRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteClusterRequest | undefined, + {} | undefined, + ] + >; + deleteCluster( + request: protos.google.bigtable.admin.v2.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteClusterRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteCluster( + request: protos.google.bigtable.admin.v2.IDeleteClusterRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteClusterRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteCluster( + request?: protos.google.bigtable.admin.v2.IDeleteClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteClusterRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteClusterRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteCluster request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteClusterRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCluster response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteCluster(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteClusterRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteCluster response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates an app profile within an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance in which to create the new app + * profile. Values are of the form `projects/{project}/instances/{instance}`. + * @param {string} request.appProfileId + * Required. The ID to be used when referring to the new app profile within + * its instance, e.g., just `myprofile` rather than + * `projects/myproject/instances/myinstance/appProfiles/myprofile`. + * @param {google.bigtable.admin.v2.AppProfile} request.appProfile + * Required. The app profile to be created. + * Fields marked `OutputOnly` will be ignored. + * @param {boolean} request.ignoreWarnings + * If true, ignore safety checks when creating the app profile. + * @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 {@link protos.google.bigtable.admin.v2.AppProfile|AppProfile}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_async + */ + createAppProfile( + request?: protos.google.bigtable.admin.v2.ICreateAppProfileRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.ICreateAppProfileRequest | undefined, + {} | undefined, + ] + >; + createAppProfile( + request: protos.google.bigtable.admin.v2.ICreateAppProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.IAppProfile, + | protos.google.bigtable.admin.v2.ICreateAppProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createAppProfile( + request: protos.google.bigtable.admin.v2.ICreateAppProfileRequest, + callback: Callback< + protos.google.bigtable.admin.v2.IAppProfile, + | protos.google.bigtable.admin.v2.ICreateAppProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createAppProfile( + request?: protos.google.bigtable.admin.v2.ICreateAppProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.IAppProfile, + | protos.google.bigtable.admin.v2.ICreateAppProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.IAppProfile, + | protos.google.bigtable.admin.v2.ICreateAppProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.ICreateAppProfileRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('createAppProfile request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.IAppProfile, + | protos.google.bigtable.admin.v2.ICreateAppProfileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAppProfile response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAppProfile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.ICreateAppProfileRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createAppProfile response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets information about an app profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the requested app profile. Values are of the + * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * @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 {@link protos.google.bigtable.admin.v2.AppProfile|AppProfile}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_async + */ + getAppProfile( + request?: protos.google.bigtable.admin.v2.IGetAppProfileRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IGetAppProfileRequest | undefined, + {} | undefined, + ] + >; + getAppProfile( + request: protos.google.bigtable.admin.v2.IGetAppProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IGetAppProfileRequest | null | undefined, + {} | null | undefined + >, + ): void; + getAppProfile( + request: protos.google.bigtable.admin.v2.IGetAppProfileRequest, + callback: Callback< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IGetAppProfileRequest | null | undefined, + {} | null | undefined + >, + ): void; + getAppProfile( + request?: protos.google.bigtable.admin.v2.IGetAppProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.IAppProfile, + | protos.google.bigtable.admin.v2.IGetAppProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IGetAppProfileRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IGetAppProfileRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getAppProfile request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.IAppProfile, + | protos.google.bigtable.admin.v2.IGetAppProfileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAppProfile response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAppProfile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IGetAppProfileRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getAppProfile response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes an app profile from an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the app profile to be deleted. Values are of + * the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * @param {boolean} request.ignoreWarnings + * Required. If true, ignore safety checks when deleting the app profile. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_async + */ + deleteAppProfile( + request?: protos.google.bigtable.admin.v2.IDeleteAppProfileRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteAppProfileRequest | undefined, + {} | undefined, + ] + >; + deleteAppProfile( + request: protos.google.bigtable.admin.v2.IDeleteAppProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteAppProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteAppProfile( + request: protos.google.bigtable.admin.v2.IDeleteAppProfileRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteAppProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteAppProfile( + request?: protos.google.bigtable.admin.v2.IDeleteAppProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteAppProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteAppProfileRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteAppProfileRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteAppProfile request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteAppProfileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAppProfile response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAppProfile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteAppProfileRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteAppProfile response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets the access control policy for an instance resource. Returns an empty + * policy if an instance exists but does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @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 {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Sets the access control policy on an instance resource. Replaces any + * existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .setIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns permissions that the caller has on the specified instance resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .testIamPermissions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets information about a logical view. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the requested logical view. Values are of the + * form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + * @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 {@link protos.google.bigtable.admin.v2.LogicalView|LogicalView}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_GetLogicalView_async + */ + getLogicalView( + request?: protos.google.bigtable.admin.v2.IGetLogicalViewRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IGetLogicalViewRequest | undefined, + {} | undefined, + ] + >; + getLogicalView( + request: protos.google.bigtable.admin.v2.IGetLogicalViewRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IGetLogicalViewRequest | null | undefined, + {} | null | undefined + >, + ): void; + getLogicalView( + request: protos.google.bigtable.admin.v2.IGetLogicalViewRequest, + callback: Callback< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IGetLogicalViewRequest | null | undefined, + {} | null | undefined + >, + ): void; + getLogicalView( + request?: protos.google.bigtable.admin.v2.IGetLogicalViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.ILogicalView, + | protos.google.bigtable.admin.v2.IGetLogicalViewRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IGetLogicalViewRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IGetLogicalViewRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getLogicalView request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.ILogicalView, + | protos.google.bigtable.admin.v2.IGetLogicalViewRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getLogicalView response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getLogicalView(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IGetLogicalViewRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getLogicalView response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a logical view from an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the logical view to be deleted. + * Format: + * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + * @param {string} [request.etag] + * Optional. The current etag of the logical view. + * If an etag is provided and does not match the current etag of the + * logical view, deletion will be blocked and an ABORTED error will be + * returned. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteLogicalView_async + */ + deleteLogicalView( + request?: protos.google.bigtable.admin.v2.IDeleteLogicalViewRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteLogicalViewRequest | undefined, + {} | undefined, + ] + >; + deleteLogicalView( + request: protos.google.bigtable.admin.v2.IDeleteLogicalViewRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteLogicalViewRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteLogicalView( + request: protos.google.bigtable.admin.v2.IDeleteLogicalViewRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteLogicalViewRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteLogicalView( + request?: protos.google.bigtable.admin.v2.IDeleteLogicalViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteLogicalViewRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteLogicalViewRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteLogicalViewRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteLogicalView request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteLogicalViewRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteLogicalView response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteLogicalView(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteLogicalViewRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteLogicalView response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets information about a materialized view. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the requested materialized view. Values are of + * the form + * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + * @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 {@link protos.google.bigtable.admin.v2.MaterializedView|MaterializedView}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_GetMaterializedView_async + */ + getMaterializedView( + request?: protos.google.bigtable.admin.v2.IGetMaterializedViewRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.IGetMaterializedViewRequest | undefined, + {} | undefined, + ] + >; + getMaterializedView( + request: protos.google.bigtable.admin.v2.IGetMaterializedViewRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.IMaterializedView, + | protos.google.bigtable.admin.v2.IGetMaterializedViewRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getMaterializedView( + request: protos.google.bigtable.admin.v2.IGetMaterializedViewRequest, + callback: Callback< + protos.google.bigtable.admin.v2.IMaterializedView, + | protos.google.bigtable.admin.v2.IGetMaterializedViewRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getMaterializedView( + request?: protos.google.bigtable.admin.v2.IGetMaterializedViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.IMaterializedView, + | protos.google.bigtable.admin.v2.IGetMaterializedViewRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.IMaterializedView, + | protos.google.bigtable.admin.v2.IGetMaterializedViewRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.IGetMaterializedViewRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getMaterializedView request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.IMaterializedView, + | protos.google.bigtable.admin.v2.IGetMaterializedViewRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMaterializedView response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMaterializedView(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.IMaterializedView, + ( + | protos.google.bigtable.admin.v2.IGetMaterializedViewRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getMaterializedView response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a materialized view from an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the materialized view to be deleted. + * Format: + * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + * @param {string} [request.etag] + * Optional. The current etag of the materialized view. + * If an etag is provided and does not match the current etag of the + * materialized view, deletion will be blocked and an ABORTED error will be + * returned. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteMaterializedView_async + */ + deleteMaterializedView( + request?: protos.google.bigtable.admin.v2.IDeleteMaterializedViewRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.bigtable.admin.v2.IDeleteMaterializedViewRequest + | undefined + ), + {} | undefined, + ] + >; + deleteMaterializedView( + request: protos.google.bigtable.admin.v2.IDeleteMaterializedViewRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteMaterializedViewRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteMaterializedView( + request: protos.google.bigtable.admin.v2.IDeleteMaterializedViewRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteMaterializedViewRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteMaterializedView( + request?: protos.google.bigtable.admin.v2.IDeleteMaterializedViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteMaterializedViewRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteMaterializedViewRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.bigtable.admin.v2.IDeleteMaterializedViewRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteMaterializedView request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteMaterializedViewRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteMaterializedView response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteMaterializedView(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.bigtable.admin.v2.IDeleteMaterializedViewRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteMaterializedView response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Create an instance within a project. + * + * Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If + * serve_nodes is set to non-zero, then the cluster is manually scaled. If + * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is + * enabled. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the project in which to create the new + * instance. Values are of the form `projects/{project}`. + * @param {string} request.instanceId + * Required. The ID to be used when referring to the new instance within its + * project, e.g., just `myinstance` rather than + * `projects/myproject/instances/myinstance`. + * @param {google.bigtable.admin.v2.Instance} request.instance + * Required. The instance to create. + * Fields marked `OutputOnly` must be left blank. + * @param {number[]} request.clusters + * Required. The clusters to be created within the instance, mapped by desired + * cluster ID, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * Fields marked `OutputOnly` must be left blank. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_async + */ + createInstance( + request?: protos.google.bigtable.admin.v2.ICreateInstanceRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createInstance( + request: protos.google.bigtable.admin.v2.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createInstance( + request: protos.google.bigtable.admin.v2.ICreateInstanceRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createInstance( + request?: protos.google.bigtable.admin.v2.ICreateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInstance request %j', request); + return this.innerApiCalls + .createInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createInstance response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_async + */ + async checkCreateInstanceProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.Instance, + protos.google.bigtable.admin.v2.CreateInstanceMetadata + > + > { + this._log.info('createInstance long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createInstance, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.Instance, + protos.google.bigtable.admin.v2.CreateInstanceMetadata + >; + } + /** + * Partially updates an instance within a project. This method can modify all + * fields of an Instance and is the preferred way to update an Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.bigtable.admin.v2.Instance} request.instance + * Required. The Instance which will (partially) replace the current value. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The subset of Instance fields which should be replaced. + * Must be explicitly set. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_async + */ + partialUpdateInstance( + request?: protos.google.bigtable.admin.v2.IPartialUpdateInstanceRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + partialUpdateInstance( + request: protos.google.bigtable.admin.v2.IPartialUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + partialUpdateInstance( + request: protos.google.bigtable.admin.v2.IPartialUpdateInstanceRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + partialUpdateInstance( + request?: protos.google.bigtable.admin.v2.IPartialUpdateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'instance.name': request.instance!.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('partialUpdateInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('partialUpdateInstance request %j', request); + return this.innerApiCalls + .partialUpdateInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('partialUpdateInstance response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `partialUpdateInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_async + */ + async checkPartialUpdateInstanceProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.Instance, + protos.google.bigtable.admin.v2.UpdateInstanceMetadata + > + > { + this._log.info('partialUpdateInstance long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.partialUpdateInstance, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.Instance, + protos.google.bigtable.admin.v2.UpdateInstanceMetadata + >; + } + /** + * Creates a cluster within an instance. + * + * Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If + * serve_nodes is set to non-zero, then the cluster is manually scaled. If + * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is + * enabled. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance in which to create the new + * cluster. Values are of the form `projects/{project}/instances/{instance}`. + * @param {string} request.clusterId + * Required. The ID to be used when referring to the new cluster within its + * instance, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * @param {google.bigtable.admin.v2.Cluster} request.cluster + * Required. The cluster to be created. + * Fields marked `OutputOnly` must be left blank. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_async + */ + createCluster( + request?: protos.google.bigtable.admin.v2.ICreateClusterRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createCluster( + request: protos.google.bigtable.admin.v2.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCluster( + request: protos.google.bigtable.admin.v2.ICreateClusterRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCluster( + request?: protos.google.bigtable.admin.v2.ICreateClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCluster request %j', request); + return this.innerApiCalls + .createCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCluster response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_async + */ + async checkCreateClusterProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.Cluster, + protos.google.bigtable.admin.v2.CreateClusterMetadata + > + > { + this._log.info('createCluster long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createCluster, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.Cluster, + protos.google.bigtable.admin.v2.CreateClusterMetadata + >; + } + /** + * Updates a cluster within an instance. + * + * Note that UpdateCluster does not support updating + * cluster_config.cluster_autoscaling_config. In order to update it, you + * must use PartialUpdateCluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The unique name of the cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{@link protos.-a-z0-9|a-z}*`. + * @param {string} request.location + * Immutable. The location where this cluster's nodes and storage reside. For + * best performance, clients should be located as close as possible to this + * cluster. Currently only zones are supported, so values should be of the + * form `projects/{project}/locations/{zone}`. + * @param {google.bigtable.admin.v2.Cluster.State} request.state + * Output only. The current state of the cluster. + * @param {number} request.serveNodes + * The number of nodes in the cluster. If no value is set, + * Cloud Bigtable automatically allocates nodes based on your data footprint + * and optimized for 50% storage utilization. + * @param {google.bigtable.admin.v2.Cluster.NodeScalingFactor} request.nodeScalingFactor + * Immutable. The node scaling factor of this cluster. + * @param {google.bigtable.admin.v2.Cluster.ClusterConfig} request.clusterConfig + * Configuration for this cluster. + * @param {google.bigtable.admin.v2.StorageType} request.defaultStorageType + * Immutable. The type of storage used by this cluster to serve its + * parent instance's tables, unless explicitly overridden. + * @param {google.bigtable.admin.v2.Cluster.EncryptionConfig} request.encryptionConfig + * Immutable. The encryption configuration for CMEK-protected clusters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async + */ + updateCluster( + request?: protos.google.bigtable.admin.v2.ICluster, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateCluster( + request: protos.google.bigtable.admin.v2.ICluster, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCluster( + request: protos.google.bigtable.admin.v2.ICluster, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCluster( + request?: protos.google.bigtable.admin.v2.ICluster, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCluster request %j', request); + return this.innerApiCalls + .updateCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateCluster response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async + */ + async checkUpdateClusterProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.Cluster, + protos.google.bigtable.admin.v2.UpdateClusterMetadata + > + > { + this._log.info('updateCluster long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateCluster, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.Cluster, + protos.google.bigtable.admin.v2.UpdateClusterMetadata + >; + } + /** + * Partially updates a cluster within a project. This method is the preferred + * way to update a Cluster. + * + * To enable and update autoscaling, set + * cluster_config.cluster_autoscaling_config. When autoscaling is enabled, + * serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it + * are ignored. Note that an update cannot simultaneously set serve_nodes to + * non-zero and cluster_config.cluster_autoscaling_config to non-empty, and + * also specify both in the update_mask. + * + * To disable autoscaling, clear cluster_config.cluster_autoscaling_config, + * and explicitly set a serve_node count via the update_mask. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.bigtable.admin.v2.Cluster} request.cluster + * Required. The Cluster which contains the partial updates to be applied, + * subject to the update_mask. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The subset of Cluster fields which should be replaced. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_async + */ + partialUpdateCluster( + request?: protos.google.bigtable.admin.v2.IPartialUpdateClusterRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IPartialUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + partialUpdateCluster( + request: protos.google.bigtable.admin.v2.IPartialUpdateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IPartialUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + partialUpdateCluster( + request: protos.google.bigtable.admin.v2.IPartialUpdateClusterRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IPartialUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + partialUpdateCluster( + request?: protos.google.bigtable.admin.v2.IPartialUpdateClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IPartialUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IPartialUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IPartialUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'cluster.name': request.cluster!.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IPartialUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('partialUpdateCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('partialUpdateCluster request %j', request); + return this.innerApiCalls + .partialUpdateCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IPartialUpdateClusterMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('partialUpdateCluster response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `partialUpdateCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_async + */ + async checkPartialUpdateClusterProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.Cluster, + protos.google.bigtable.admin.v2.PartialUpdateClusterMetadata + > + > { + this._log.info('partialUpdateCluster long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.partialUpdateCluster, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.Cluster, + protos.google.bigtable.admin.v2.PartialUpdateClusterMetadata + >; + } + /** + * Updates an app profile within an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.bigtable.admin.v2.AppProfile} request.appProfile + * Required. The app profile which will (partially) replace the current value. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The subset of app profile fields which should be replaced. + * If unset, all fields will be replaced. + * @param {boolean} request.ignoreWarnings + * If true, ignore safety checks when updating the app profile. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_async + */ + updateAppProfile( + request?: protos.google.bigtable.admin.v2.IUpdateAppProfileRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateAppProfile( + request: protos.google.bigtable.admin.v2.IUpdateAppProfileRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateAppProfile( + request: protos.google.bigtable.admin.v2.IUpdateAppProfileRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateAppProfile( + request?: protos.google.bigtable.admin.v2.IUpdateAppProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'app_profile.name': request.appProfile!.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateAppProfile response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateAppProfile request %j', request); + return this.innerApiCalls + .updateAppProfile(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateAppProfile response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateAppProfile()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_async + */ + async checkUpdateAppProfileProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.AppProfile, + protos.google.bigtable.admin.v2.UpdateAppProfileMetadata + > + > { + this._log.info('updateAppProfile long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateAppProfile, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.AppProfile, + protos.google.bigtable.admin.v2.UpdateAppProfileMetadata + >; + } + /** + * Creates a logical view within an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent instance where this logical view will be created. + * Format: `projects/{project}/instances/{instance}`. + * @param {string} request.logicalViewId + * Required. The ID to use for the logical view, which will become the final + * component of the logical view's resource name. + * @param {google.bigtable.admin.v2.LogicalView} request.logicalView + * Required. The logical view to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateLogicalView_async + */ + createLogicalView( + request?: protos.google.bigtable.admin.v2.ICreateLogicalViewRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.ICreateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createLogicalView( + request: protos.google.bigtable.admin.v2.ICreateLogicalViewRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.ICreateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createLogicalView( + request: protos.google.bigtable.admin.v2.ICreateLogicalViewRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.ICreateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createLogicalView( + request?: protos.google.bigtable.admin.v2.ICreateLogicalViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.ICreateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.ICreateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.ICreateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.ICreateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createLogicalView response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createLogicalView request %j', request); + return this.innerApiCalls + .createLogicalView(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.ICreateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createLogicalView response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createLogicalView()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateLogicalView_async + */ + async checkCreateLogicalViewProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.LogicalView, + protos.google.bigtable.admin.v2.CreateLogicalViewMetadata + > + > { + this._log.info('createLogicalView long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createLogicalView, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.LogicalView, + protos.google.bigtable.admin.v2.CreateLogicalViewMetadata + >; + } + /** + * Updates a logical view within an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.bigtable.admin.v2.LogicalView} request.logicalView + * Required. The logical view to update. + * + * The logical view's `name` field is used to identify the view to update. + * Format: + * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateLogicalView_async + */ + updateLogicalView( + request?: protos.google.bigtable.admin.v2.IUpdateLogicalViewRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IUpdateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateLogicalView( + request: protos.google.bigtable.admin.v2.IUpdateLogicalViewRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IUpdateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateLogicalView( + request: protos.google.bigtable.admin.v2.IUpdateLogicalViewRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IUpdateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateLogicalView( + request?: protos.google.bigtable.admin.v2.IUpdateLogicalViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IUpdateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IUpdateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IUpdateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'logical_view.name': request.logicalView!.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IUpdateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateLogicalView response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateLogicalView request %j', request); + return this.innerApiCalls + .updateLogicalView(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IUpdateLogicalViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateLogicalView response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateLogicalView()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateLogicalView_async + */ + async checkUpdateLogicalViewProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.LogicalView, + protos.google.bigtable.admin.v2.UpdateLogicalViewMetadata + > + > { + this._log.info('updateLogicalView long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateLogicalView, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.LogicalView, + protos.google.bigtable.admin.v2.UpdateLogicalViewMetadata + >; + } + /** + * Creates a materialized view within an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent instance where this materialized view will be created. + * Format: `projects/{project}/instances/{instance}`. + * @param {string} request.materializedViewId + * Required. The ID to use for the materialized view, which will become the + * final component of the materialized view's resource name. + * @param {google.bigtable.admin.v2.MaterializedView} request.materializedView + * Required. The materialized view to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateMaterializedView_async + */ + createMaterializedView( + request?: protos.google.bigtable.admin.v2.ICreateMaterializedViewRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.ICreateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createMaterializedView( + request: protos.google.bigtable.admin.v2.ICreateMaterializedViewRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.ICreateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createMaterializedView( + request: protos.google.bigtable.admin.v2.ICreateMaterializedViewRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.ICreateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createMaterializedView( + request?: protos.google.bigtable.admin.v2.ICreateMaterializedViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.ICreateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.ICreateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.ICreateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.ICreateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createMaterializedView response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createMaterializedView request %j', request); + return this.innerApiCalls + .createMaterializedView(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.ICreateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createMaterializedView response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createMaterializedView()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateMaterializedView_async + */ + async checkCreateMaterializedViewProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.MaterializedView, + protos.google.bigtable.admin.v2.CreateMaterializedViewMetadata + > + > { + this._log.info('createMaterializedView long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createMaterializedView, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.MaterializedView, + protos.google.bigtable.admin.v2.CreateMaterializedViewMetadata + >; + } + /** + * Updates a materialized view within an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.bigtable.admin.v2.MaterializedView} request.materializedView + * Required. The materialized view to update. + * + * The materialized view's `name` field is used to identify the view to + * update. Format: + * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateMaterializedView_async + */ + updateMaterializedView( + request?: protos.google.bigtable.admin.v2.IUpdateMaterializedViewRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.IUpdateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateMaterializedView( + request: protos.google.bigtable.admin.v2.IUpdateMaterializedViewRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.IUpdateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateMaterializedView( + request: protos.google.bigtable.admin.v2.IUpdateMaterializedViewRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.IUpdateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateMaterializedView( + request?: protos.google.bigtable.admin.v2.IUpdateMaterializedViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.IUpdateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.IUpdateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.IUpdateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'materialized_view.name': request.materializedView!.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.IUpdateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateMaterializedView response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateMaterializedView request %j', request); + return this.innerApiCalls + .updateMaterializedView(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.IUpdateMaterializedViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateMaterializedView response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateMaterializedView()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateMaterializedView_async + */ + async checkUpdateMaterializedViewProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.MaterializedView, + protos.google.bigtable.admin.v2.UpdateMaterializedViewMetadata + > + > { + this._log.info('updateMaterializedView long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateMaterializedView, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.MaterializedView, + protos.google.bigtable.admin.v2.UpdateMaterializedViewMetadata + >; + } + /** + * Lists information about app profiles in an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which a list of app profiles + * is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. + * @param {number} request.pageSize + * Maximum number of results per page. + * + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * @param {string} request.pageToken + * The value of `next_page_token` returned by a previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.bigtable.admin.v2.AppProfile|AppProfile}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAppProfilesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAppProfiles( + request?: protos.google.bigtable.admin.v2.IListAppProfilesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IAppProfile[], + protos.google.bigtable.admin.v2.IListAppProfilesRequest | null, + protos.google.bigtable.admin.v2.IListAppProfilesResponse, + ] + >; + listAppProfiles( + request: protos.google.bigtable.admin.v2.IListAppProfilesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListAppProfilesRequest, + | protos.google.bigtable.admin.v2.IListAppProfilesResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IAppProfile + >, + ): void; + listAppProfiles( + request: protos.google.bigtable.admin.v2.IListAppProfilesRequest, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListAppProfilesRequest, + | protos.google.bigtable.admin.v2.IListAppProfilesResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IAppProfile + >, + ): void; + listAppProfiles( + request?: protos.google.bigtable.admin.v2.IListAppProfilesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.bigtable.admin.v2.IListAppProfilesRequest, + | protos.google.bigtable.admin.v2.IListAppProfilesResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IAppProfile + >, + callback?: PaginationCallback< + protos.google.bigtable.admin.v2.IListAppProfilesRequest, + | protos.google.bigtable.admin.v2.IListAppProfilesResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IAppProfile + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IAppProfile[], + protos.google.bigtable.admin.v2.IListAppProfilesRequest | null, + protos.google.bigtable.admin.v2.IListAppProfilesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.bigtable.admin.v2.IListAppProfilesRequest, + | protos.google.bigtable.admin.v2.IListAppProfilesResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IAppProfile + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAppProfiles values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAppProfiles request %j', request); + return this.innerApiCalls + .listAppProfiles(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.bigtable.admin.v2.IAppProfile[], + protos.google.bigtable.admin.v2.IListAppProfilesRequest | null, + protos.google.bigtable.admin.v2.IListAppProfilesResponse, + ]) => { + this._log.info('listAppProfiles values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listAppProfiles`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which a list of app profiles + * is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. + * @param {number} request.pageSize + * Maximum number of results per page. + * + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * @param {string} request.pageToken + * The value of `next_page_token` returned by a previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.bigtable.admin.v2.AppProfile|AppProfile} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAppProfilesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAppProfilesStream( + request?: protos.google.bigtable.admin.v2.IListAppProfilesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAppProfiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listAppProfiles stream %j', request); + return this.descriptors.page.listAppProfiles.createStream( + this.innerApiCalls.listAppProfiles as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listAppProfiles`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which a list of app profiles + * is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. + * @param {number} request.pageSize + * Maximum number of results per page. + * + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * @param {string} request.pageToken + * The value of `next_page_token` returned by a previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.bigtable.admin.v2.AppProfile|AppProfile}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_async + */ + listAppProfilesAsync( + request?: protos.google.bigtable.admin.v2.IListAppProfilesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAppProfiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listAppProfiles iterate %j', request); + return this.descriptors.page.listAppProfiles.asyncIterate( + this.innerApiCalls['listAppProfiles'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists hot tablets in a cluster, within the time range provided. Hot + * tablets are ordered based on CPU usage. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param {google.protobuf.Timestamp} request.startTime + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + * @param {google.protobuf.Timestamp} request.endTime + * The end time to list hot tablets. + * @param {number} request.pageSize + * Maximum number of results per page. + * + * A page_size that is empty or zero lets the server choose the number of + * items to return. A page_size which is strictly positive will return at most + * that many items. A negative page_size will cause an error. + * + * Following the first request, subsequent paginated calls do not need a + * page_size field. If a page_size is set in subsequent calls, it must match + * the page_size given in the first request. + * @param {string} request.pageToken + * The value of `next_page_token` returned by a previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.bigtable.admin.v2.HotTablet|HotTablet}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listHotTabletsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listHotTablets( + request?: protos.google.bigtable.admin.v2.IListHotTabletsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IHotTablet[], + protos.google.bigtable.admin.v2.IListHotTabletsRequest | null, + protos.google.bigtable.admin.v2.IListHotTabletsResponse, + ] + >; + listHotTablets( + request: protos.google.bigtable.admin.v2.IListHotTabletsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListHotTabletsRequest, + | protos.google.bigtable.admin.v2.IListHotTabletsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IHotTablet + >, + ): void; + listHotTablets( + request: protos.google.bigtable.admin.v2.IListHotTabletsRequest, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListHotTabletsRequest, + | protos.google.bigtable.admin.v2.IListHotTabletsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IHotTablet + >, + ): void; + listHotTablets( + request?: protos.google.bigtable.admin.v2.IListHotTabletsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.bigtable.admin.v2.IListHotTabletsRequest, + | protos.google.bigtable.admin.v2.IListHotTabletsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IHotTablet + >, + callback?: PaginationCallback< + protos.google.bigtable.admin.v2.IListHotTabletsRequest, + | protos.google.bigtable.admin.v2.IListHotTabletsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IHotTablet + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IHotTablet[], + protos.google.bigtable.admin.v2.IListHotTabletsRequest | null, + protos.google.bigtable.admin.v2.IListHotTabletsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.bigtable.admin.v2.IListHotTabletsRequest, + | protos.google.bigtable.admin.v2.IListHotTabletsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IHotTablet + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listHotTablets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listHotTablets request %j', request); + return this.innerApiCalls + .listHotTablets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.bigtable.admin.v2.IHotTablet[], + protos.google.bigtable.admin.v2.IListHotTabletsRequest | null, + protos.google.bigtable.admin.v2.IListHotTabletsResponse, + ]) => { + this._log.info('listHotTablets values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listHotTablets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param {google.protobuf.Timestamp} request.startTime + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + * @param {google.protobuf.Timestamp} request.endTime + * The end time to list hot tablets. + * @param {number} request.pageSize + * Maximum number of results per page. + * + * A page_size that is empty or zero lets the server choose the number of + * items to return. A page_size which is strictly positive will return at most + * that many items. A negative page_size will cause an error. + * + * Following the first request, subsequent paginated calls do not need a + * page_size field. If a page_size is set in subsequent calls, it must match + * the page_size given in the first request. + * @param {string} request.pageToken + * The value of `next_page_token` returned by a previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.bigtable.admin.v2.HotTablet|HotTablet} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listHotTabletsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listHotTabletsStream( + request?: protos.google.bigtable.admin.v2.IListHotTabletsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listHotTablets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listHotTablets stream %j', request); + return this.descriptors.page.listHotTablets.createStream( + this.innerApiCalls.listHotTablets as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listHotTablets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param {google.protobuf.Timestamp} request.startTime + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + * @param {google.protobuf.Timestamp} request.endTime + * The end time to list hot tablets. + * @param {number} request.pageSize + * Maximum number of results per page. + * + * A page_size that is empty or zero lets the server choose the number of + * items to return. A page_size which is strictly positive will return at most + * that many items. A negative page_size will cause an error. + * + * Following the first request, subsequent paginated calls do not need a + * page_size field. If a page_size is set in subsequent calls, it must match + * the page_size given in the first request. + * @param {string} request.pageToken + * The value of `next_page_token` returned by a previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.bigtable.admin.v2.HotTablet|HotTablet}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_async + */ + listHotTabletsAsync( + request?: protos.google.bigtable.admin.v2.IListHotTabletsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listHotTablets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listHotTablets iterate %j', request); + return this.descriptors.page.listHotTablets.asyncIterate( + this.innerApiCalls['listHotTablets'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists information about logical views in an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which the list of logical + * views is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of logical views to return. The service may + * return fewer than this value + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListLogicalViews` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListLogicalViews` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.bigtable.admin.v2.LogicalView|LogicalView}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listLogicalViewsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listLogicalViews( + request?: protos.google.bigtable.admin.v2.IListLogicalViewsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.ILogicalView[], + protos.google.bigtable.admin.v2.IListLogicalViewsRequest | null, + protos.google.bigtable.admin.v2.IListLogicalViewsResponse, + ] + >; + listLogicalViews( + request: protos.google.bigtable.admin.v2.IListLogicalViewsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListLogicalViewsRequest, + | protos.google.bigtable.admin.v2.IListLogicalViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ILogicalView + >, + ): void; + listLogicalViews( + request: protos.google.bigtable.admin.v2.IListLogicalViewsRequest, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListLogicalViewsRequest, + | protos.google.bigtable.admin.v2.IListLogicalViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ILogicalView + >, + ): void; + listLogicalViews( + request?: protos.google.bigtable.admin.v2.IListLogicalViewsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.bigtable.admin.v2.IListLogicalViewsRequest, + | protos.google.bigtable.admin.v2.IListLogicalViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ILogicalView + >, + callback?: PaginationCallback< + protos.google.bigtable.admin.v2.IListLogicalViewsRequest, + | protos.google.bigtable.admin.v2.IListLogicalViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ILogicalView + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.ILogicalView[], + protos.google.bigtable.admin.v2.IListLogicalViewsRequest | null, + protos.google.bigtable.admin.v2.IListLogicalViewsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.bigtable.admin.v2.IListLogicalViewsRequest, + | protos.google.bigtable.admin.v2.IListLogicalViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ILogicalView + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listLogicalViews values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listLogicalViews request %j', request); + return this.innerApiCalls + .listLogicalViews(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.bigtable.admin.v2.ILogicalView[], + protos.google.bigtable.admin.v2.IListLogicalViewsRequest | null, + protos.google.bigtable.admin.v2.IListLogicalViewsResponse, + ]) => { + this._log.info('listLogicalViews values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listLogicalViews`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which the list of logical + * views is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of logical views to return. The service may + * return fewer than this value + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListLogicalViews` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListLogicalViews` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.bigtable.admin.v2.LogicalView|LogicalView} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listLogicalViewsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listLogicalViewsStream( + request?: protos.google.bigtable.admin.v2.IListLogicalViewsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listLogicalViews']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listLogicalViews stream %j', request); + return this.descriptors.page.listLogicalViews.createStream( + this.innerApiCalls.listLogicalViews as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listLogicalViews`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which the list of logical + * views is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of logical views to return. The service may + * return fewer than this value + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListLogicalViews` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListLogicalViews` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.bigtable.admin.v2.LogicalView|LogicalView}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_ListLogicalViews_async + */ + listLogicalViewsAsync( + request?: protos.google.bigtable.admin.v2.IListLogicalViewsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listLogicalViews']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listLogicalViews iterate %j', request); + return this.descriptors.page.listLogicalViews.asyncIterate( + this.innerApiCalls['listLogicalViews'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists information about materialized views in an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which the list of + * materialized views is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of materialized views to return. The service + * may return fewer than this value + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListMaterializedViews` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMaterializedViews` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.bigtable.admin.v2.MaterializedView|MaterializedView}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMaterializedViewsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMaterializedViews( + request?: protos.google.bigtable.admin.v2.IListMaterializedViewsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IMaterializedView[], + protos.google.bigtable.admin.v2.IListMaterializedViewsRequest | null, + protos.google.bigtable.admin.v2.IListMaterializedViewsResponse, + ] + >; + listMaterializedViews( + request: protos.google.bigtable.admin.v2.IListMaterializedViewsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListMaterializedViewsRequest, + | protos.google.bigtable.admin.v2.IListMaterializedViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IMaterializedView + >, + ): void; + listMaterializedViews( + request: protos.google.bigtable.admin.v2.IListMaterializedViewsRequest, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListMaterializedViewsRequest, + | protos.google.bigtable.admin.v2.IListMaterializedViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IMaterializedView + >, + ): void; + listMaterializedViews( + request?: protos.google.bigtable.admin.v2.IListMaterializedViewsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.bigtable.admin.v2.IListMaterializedViewsRequest, + | protos.google.bigtable.admin.v2.IListMaterializedViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IMaterializedView + >, + callback?: PaginationCallback< + protos.google.bigtable.admin.v2.IListMaterializedViewsRequest, + | protos.google.bigtable.admin.v2.IListMaterializedViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IMaterializedView + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IMaterializedView[], + protos.google.bigtable.admin.v2.IListMaterializedViewsRequest | null, + protos.google.bigtable.admin.v2.IListMaterializedViewsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.bigtable.admin.v2.IListMaterializedViewsRequest, + | protos.google.bigtable.admin.v2.IListMaterializedViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IMaterializedView + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMaterializedViews values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMaterializedViews request %j', request); + return this.innerApiCalls + .listMaterializedViews(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.bigtable.admin.v2.IMaterializedView[], + protos.google.bigtable.admin.v2.IListMaterializedViewsRequest | null, + protos.google.bigtable.admin.v2.IListMaterializedViewsResponse, + ]) => { + this._log.info('listMaterializedViews values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listMaterializedViews`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which the list of + * materialized views is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of materialized views to return. The service + * may return fewer than this value + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListMaterializedViews` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMaterializedViews` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.bigtable.admin.v2.MaterializedView|MaterializedView} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMaterializedViewsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMaterializedViewsStream( + request?: protos.google.bigtable.admin.v2.IListMaterializedViewsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMaterializedViews']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listMaterializedViews stream %j', request); + return this.descriptors.page.listMaterializedViews.createStream( + this.innerApiCalls.listMaterializedViews as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listMaterializedViews`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which the list of + * materialized views is requested. Values are of the form + * `projects/{project}/instances/{instance}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of materialized views to return. The service + * may return fewer than this value + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListMaterializedViews` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMaterializedViews` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.bigtable.admin.v2.MaterializedView|MaterializedView}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_ListMaterializedViews_async + */ + listMaterializedViewsAsync( + request?: protos.google.bigtable.admin.v2.IListMaterializedViewsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMaterializedViews']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listMaterializedViews iterate %j', request); + return this.descriptors.page.listMaterializedViews.asyncIterate( + this.innerApiCalls['listMaterializedViews'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified appProfile resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} app_profile + * @returns {string} Resource name string. + */ + appProfilePath(project: string, instance: string, appProfile: string) { + return this.pathTemplates.appProfilePathTemplate.render({ + project: project, + instance: instance, + app_profile: appProfile, + }); + } + + /** + * Parse the project from AppProfile resource. + * + * @param {string} appProfileName + * A fully-qualified path representing AppProfile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppProfileName(appProfileName: string) { + return this.pathTemplates.appProfilePathTemplate.match(appProfileName) + .project; + } + + /** + * Parse the instance from AppProfile resource. + * + * @param {string} appProfileName + * A fully-qualified path representing AppProfile resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromAppProfileName(appProfileName: string) { + return this.pathTemplates.appProfilePathTemplate.match(appProfileName) + .instance; + } + + /** + * Parse the app_profile from AppProfile resource. + * + * @param {string} appProfileName + * A fully-qualified path representing AppProfile resource. + * @returns {string} A string representing the app_profile. + */ + matchAppProfileFromAppProfileName(appProfileName: string) { + return this.pathTemplates.appProfilePathTemplate.match(appProfileName) + .app_profile; + } + + /** + * Return a fully-qualified authorizedView resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} table + * @param {string} authorized_view + * @returns {string} Resource name string. + */ + authorizedViewPath( + project: string, + instance: string, + table: string, + authorizedView: string, + ) { + return this.pathTemplates.authorizedViewPathTemplate.render({ + project: project, + instance: instance, + table: table, + authorized_view: authorizedView, + }); + } + + /** + * Parse the project from AuthorizedView resource. + * + * @param {string} authorizedViewName + * A fully-qualified path representing AuthorizedView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthorizedViewName(authorizedViewName: string) { + return this.pathTemplates.authorizedViewPathTemplate.match( + authorizedViewName, + ).project; + } + + /** + * Parse the instance from AuthorizedView resource. + * + * @param {string} authorizedViewName + * A fully-qualified path representing AuthorizedView resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromAuthorizedViewName(authorizedViewName: string) { + return this.pathTemplates.authorizedViewPathTemplate.match( + authorizedViewName, + ).instance; + } + + /** + * Parse the table from AuthorizedView resource. + * + * @param {string} authorizedViewName + * A fully-qualified path representing AuthorizedView resource. + * @returns {string} A string representing the table. + */ + matchTableFromAuthorizedViewName(authorizedViewName: string) { + return this.pathTemplates.authorizedViewPathTemplate.match( + authorizedViewName, + ).table; + } + + /** + * Parse the authorized_view from AuthorizedView resource. + * + * @param {string} authorizedViewName + * A fully-qualified path representing AuthorizedView resource. + * @returns {string} A string representing the authorized_view. + */ + matchAuthorizedViewFromAuthorizedViewName(authorizedViewName: string) { + return this.pathTemplates.authorizedViewPathTemplate.match( + authorizedViewName, + ).authorized_view; + } + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} cluster + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath( + project: string, + instance: string, + cluster: string, + backup: string, + ) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + instance: instance, + cluster: cluster, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the instance from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).instance; + } + + /** + * Parse the cluster from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).cluster; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project: string, instance: string, cluster: string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + instance: instance, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the instance from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).instance; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified hotTablet resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} cluster + * @param {string} hot_tablet + * @returns {string} Resource name string. + */ + hotTabletPath( + project: string, + instance: string, + cluster: string, + hotTablet: string, + ) { + return this.pathTemplates.hotTabletPathTemplate.render({ + project: project, + instance: instance, + cluster: cluster, + hot_tablet: hotTablet, + }); + } + + /** + * Parse the project from HotTablet resource. + * + * @param {string} hotTabletName + * A fully-qualified path representing HotTablet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHotTabletName(hotTabletName: string) { + return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName) + .project; + } + + /** + * Parse the instance from HotTablet resource. + * + * @param {string} hotTabletName + * A fully-qualified path representing HotTablet resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromHotTabletName(hotTabletName: string) { + return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName) + .instance; + } + + /** + * Parse the cluster from HotTablet resource. + * + * @param {string} hotTabletName + * A fully-qualified path representing HotTablet resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromHotTabletName(hotTabletName: string) { + return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName) + .cluster; + } + + /** + * Parse the hot_tablet from HotTablet resource. + * + * @param {string} hotTabletName + * A fully-qualified path representing HotTablet resource. + * @returns {string} A string representing the hot_tablet. + */ + matchHotTabletFromHotTabletName(hotTabletName: string) { + return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName) + .hot_tablet; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project: string, instance: string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified logicalView resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} logical_view + * @returns {string} Resource name string. + */ + logicalViewPath(project: string, instance: string, logicalView: string) { + return this.pathTemplates.logicalViewPathTemplate.render({ + project: project, + instance: instance, + logical_view: logicalView, + }); + } + + /** + * Parse the project from LogicalView resource. + * + * @param {string} logicalViewName + * A fully-qualified path representing LogicalView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLogicalViewName(logicalViewName: string) { + return this.pathTemplates.logicalViewPathTemplate.match(logicalViewName) + .project; + } + + /** + * Parse the instance from LogicalView resource. + * + * @param {string} logicalViewName + * A fully-qualified path representing LogicalView resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromLogicalViewName(logicalViewName: string) { + return this.pathTemplates.logicalViewPathTemplate.match(logicalViewName) + .instance; + } + + /** + * Parse the logical_view from LogicalView resource. + * + * @param {string} logicalViewName + * A fully-qualified path representing LogicalView resource. + * @returns {string} A string representing the logical_view. + */ + matchLogicalViewFromLogicalViewName(logicalViewName: string) { + return this.pathTemplates.logicalViewPathTemplate.match(logicalViewName) + .logical_view; + } + + /** + * Return a fully-qualified materializedView resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} materialized_view + * @returns {string} Resource name string. + */ + materializedViewPath( + project: string, + instance: string, + materializedView: string, + ) { + return this.pathTemplates.materializedViewPathTemplate.render({ + project: project, + instance: instance, + materialized_view: materializedView, + }); + } + + /** + * Parse the project from MaterializedView resource. + * + * @param {string} materializedViewName + * A fully-qualified path representing MaterializedView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMaterializedViewName(materializedViewName: string) { + return this.pathTemplates.materializedViewPathTemplate.match( + materializedViewName, + ).project; + } + + /** + * Parse the instance from MaterializedView resource. + * + * @param {string} materializedViewName + * A fully-qualified path representing MaterializedView resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromMaterializedViewName(materializedViewName: string) { + return this.pathTemplates.materializedViewPathTemplate.match( + materializedViewName, + ).instance; + } + + /** + * Parse the materialized_view from MaterializedView resource. + * + * @param {string} materializedViewName + * A fully-qualified path representing MaterializedView resource. + * @returns {string} A string representing the materialized_view. + */ + matchMaterializedViewFromMaterializedViewName(materializedViewName: string) { + return this.pathTemplates.materializedViewPathTemplate.match( + materializedViewName, + ).materialized_view; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified schemaBundle resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} table + * @param {string} schema_bundle + * @returns {string} Resource name string. + */ + schemaBundlePath( + project: string, + instance: string, + table: string, + schemaBundle: string, + ) { + return this.pathTemplates.schemaBundlePathTemplate.render({ + project: project, + instance: instance, + table: table, + schema_bundle: schemaBundle, + }); + } + + /** + * Parse the project from SchemaBundle resource. + * + * @param {string} schemaBundleName + * A fully-qualified path representing SchemaBundle resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSchemaBundleName(schemaBundleName: string) { + return this.pathTemplates.schemaBundlePathTemplate.match(schemaBundleName) + .project; + } + + /** + * Parse the instance from SchemaBundle resource. + * + * @param {string} schemaBundleName + * A fully-qualified path representing SchemaBundle resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromSchemaBundleName(schemaBundleName: string) { + return this.pathTemplates.schemaBundlePathTemplate.match(schemaBundleName) + .instance; + } + + /** + * Parse the table from SchemaBundle resource. + * + * @param {string} schemaBundleName + * A fully-qualified path representing SchemaBundle resource. + * @returns {string} A string representing the table. + */ + matchTableFromSchemaBundleName(schemaBundleName: string) { + return this.pathTemplates.schemaBundlePathTemplate.match(schemaBundleName) + .table; + } + + /** + * Parse the schema_bundle from SchemaBundle resource. + * + * @param {string} schemaBundleName + * A fully-qualified path representing SchemaBundle resource. + * @returns {string} A string representing the schema_bundle. + */ + matchSchemaBundleFromSchemaBundleName(schemaBundleName: string) { + return this.pathTemplates.schemaBundlePathTemplate.match(schemaBundleName) + .schema_bundle; + } + + /** + * Return a fully-qualified snapshot resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} cluster + * @param {string} snapshot + * @returns {string} Resource name string. + */ + snapshotPath( + project: string, + instance: string, + cluster: string, + snapshot: string, + ) { + return this.pathTemplates.snapshotPathTemplate.render({ + project: project, + instance: instance, + cluster: cluster, + snapshot: snapshot, + }); + } + + /** + * Parse the project from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; + } + + /** + * Parse the instance from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).instance; + } + + /** + * Parse the cluster from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).cluster; + } + + /** + * Parse the snapshot from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the snapshot. + */ + matchSnapshotFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; + } + + /** + * Return a fully-qualified table resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} table + * @returns {string} Resource name string. + */ + tablePath(project: string, instance: string, table: string) { + return this.pathTemplates.tablePathTemplate.render({ + project: project, + instance: instance, + table: table, + }); + } + + /** + * Parse the project from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).project; + } + + /** + * Parse the instance from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).instance; + } + + /** + * Parse the table from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the table. + */ + matchTableFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).table; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.bigtableInstanceAdminStub && !this._terminated) { + return this.bigtableInstanceAdminStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/handwritten/bigtable/src/admin/v2/bigtable_instance_admin_client_config.json b/handwritten/bigtable/src/admin/v2/bigtable_instance_admin_client_config.json new file mode 100644 index 00000000000..08bab472f91 --- /dev/null +++ b/handwritten/bigtable/src/admin/v2/bigtable_instance_admin_client_config.json @@ -0,0 +1,179 @@ +{ + "interfaces": { + "google.bigtable.admin.v2.BigtableInstanceAdmin": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "264268458a9e88347dbacbd9398202ff5885a40b": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateInstance": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "PartialUpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCluster": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ListClusters": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "UpdateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "PartialUpdateCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAppProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAppProfile": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ListAppProfiles": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "UpdateAppProfile": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "DeleteAppProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ListHotTablets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "CreateLogicalView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetLogicalView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListLogicalViews": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateLogicalView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteLogicalView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMaterializedView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMaterializedView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMaterializedViews": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMaterializedView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMaterializedView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/handwritten/bigtable/src/admin/v2/bigtable_instance_admin_proto_list.json b/handwritten/bigtable/src/admin/v2/bigtable_instance_admin_proto_list.json new file mode 100644 index 00000000000..64ece0d4cc4 --- /dev/null +++ b/handwritten/bigtable/src/admin/v2/bigtable_instance_admin_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../../protos/google/bigtable/admin/v2/bigtable_instance_admin.proto", + "../../../protos/google/bigtable/admin/v2/bigtable_table_admin.proto", + "../../../protos/google/bigtable/admin/v2/common.proto", + "../../../protos/google/bigtable/admin/v2/instance.proto", + "../../../protos/google/bigtable/admin/v2/table.proto", + "../../../protos/google/bigtable/admin/v2/types.proto" +] diff --git a/handwritten/bigtable/src/admin/v2/bigtable_table_admin_client.ts b/handwritten/bigtable/src/admin/v2/bigtable_table_admin_client.ts new file mode 100644 index 00000000000..a654d5df8ae --- /dev/null +++ b/handwritten/bigtable/src/admin/v2/bigtable_table_admin_client.ts @@ -0,0 +1,7380 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../../protos/protos'; +import jsonProtos = require('../../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/bigtable_table_admin_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './bigtable_table_admin_client_config.json'; +const version = require('../../../../package.json').version; + +/** + * Service for creating, configuring, and deleting Cloud Bigtable tables. + * + * + * Provides access to the table schemas only, not the data stored within + * the tables. + * @class + * @memberof v2 + */ +export class BigtableTableAdminClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('bigtable'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + bigtableTableAdminStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BigtableTableAdminClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new BigtableTableAdminClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof BigtableTableAdminClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'bigtableadmin.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + appProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/appProfiles/{app_profile}', + ), + authorizedViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}', + ), + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}', + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/clusters/{cluster}', + ), + hotTabletPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}', + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}', + ), + logicalViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/logicalViews/{logical_view}', + ), + materializedViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/materializedViews/{materialized_view}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + schemaBundlePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}', + ), + snapshotPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}', + ), + tablePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/tables/{table}', + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listTables: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tables', + ), + listAuthorizedViews: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'authorizedViews', + ), + listSnapshots: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'snapshots', + ), + listBackups: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backups', + ), + listSchemaBundles: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'schemaBundles', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v2/{name=operations/**}:cancel', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v2/{name=operations/**}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v2/{name=operations/**}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v2/{name=operations/projects/**}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createTableFromSnapshotResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Table', + ) as gax.protobuf.Type; + const createTableFromSnapshotMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata', + ) as gax.protobuf.Type; + const updateTableResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Table', + ) as gax.protobuf.Type; + const updateTableMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.UpdateTableMetadata', + ) as gax.protobuf.Type; + const undeleteTableResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Table', + ) as gax.protobuf.Type; + const undeleteTableMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.UndeleteTableMetadata', + ) as gax.protobuf.Type; + const createAuthorizedViewResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.AuthorizedView', + ) as gax.protobuf.Type; + const createAuthorizedViewMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.CreateAuthorizedViewMetadata', + ) as gax.protobuf.Type; + const updateAuthorizedViewResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.AuthorizedView', + ) as gax.protobuf.Type; + const updateAuthorizedViewMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata', + ) as gax.protobuf.Type; + const snapshotTableResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Snapshot', + ) as gax.protobuf.Type; + const snapshotTableMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.SnapshotTableMetadata', + ) as gax.protobuf.Type; + const createBackupResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Backup', + ) as gax.protobuf.Type; + const createBackupMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.CreateBackupMetadata', + ) as gax.protobuf.Type; + const restoreTableResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Table', + ) as gax.protobuf.Type; + const restoreTableMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.RestoreTableMetadata', + ) as gax.protobuf.Type; + const copyBackupResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.Backup', + ) as gax.protobuf.Type; + const copyBackupMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.CopyBackupMetadata', + ) as gax.protobuf.Type; + const createSchemaBundleResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.SchemaBundle', + ) as gax.protobuf.Type; + const createSchemaBundleMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.CreateSchemaBundleMetadata', + ) as gax.protobuf.Type; + const updateSchemaBundleResponse = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.SchemaBundle', + ) as gax.protobuf.Type; + const updateSchemaBundleMetadata = protoFilesRoot.lookup( + '.google.bigtable.admin.v2.UpdateSchemaBundleMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createTableFromSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTableFromSnapshotResponse.decode.bind( + createTableFromSnapshotResponse, + ), + createTableFromSnapshotMetadata.decode.bind( + createTableFromSnapshotMetadata, + ), + ), + updateTable: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateTableResponse.decode.bind(updateTableResponse), + updateTableMetadata.decode.bind(updateTableMetadata), + ), + undeleteTable: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeleteTableResponse.decode.bind(undeleteTableResponse), + undeleteTableMetadata.decode.bind(undeleteTableMetadata), + ), + createAuthorizedView: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createAuthorizedViewResponse.decode.bind(createAuthorizedViewResponse), + createAuthorizedViewMetadata.decode.bind(createAuthorizedViewMetadata), + ), + updateAuthorizedView: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateAuthorizedViewResponse.decode.bind(updateAuthorizedViewResponse), + updateAuthorizedViewMetadata.decode.bind(updateAuthorizedViewMetadata), + ), + snapshotTable: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + snapshotTableResponse.decode.bind(snapshotTableResponse), + snapshotTableMetadata.decode.bind(snapshotTableMetadata), + ), + createBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupResponse.decode.bind(createBackupResponse), + createBackupMetadata.decode.bind(createBackupMetadata), + ), + restoreTable: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreTableResponse.decode.bind(restoreTableResponse), + restoreTableMetadata.decode.bind(restoreTableMetadata), + ), + copyBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + copyBackupResponse.decode.bind(copyBackupResponse), + copyBackupMetadata.decode.bind(copyBackupMetadata), + ), + createSchemaBundle: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSchemaBundleResponse.decode.bind(createSchemaBundleResponse), + createSchemaBundleMetadata.decode.bind(createSchemaBundleMetadata), + ), + updateSchemaBundle: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateSchemaBundleResponse.decode.bind(updateSchemaBundleResponse), + updateSchemaBundleMetadata.decode.bind(updateSchemaBundleMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.bigtable.admin.v2.BigtableTableAdmin', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')}, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.bigtableTableAdminStub) { + return this.bigtableTableAdminStub; + } + + // Put together the "service stub" for + // google.bigtable.admin.v2.BigtableTableAdmin. + this.bigtableTableAdminStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.bigtable.admin.v2.BigtableTableAdmin', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.bigtable.admin.v2.BigtableTableAdmin, + this._opts, + this._providedCustomServicePath, + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const bigtableTableAdminStubMethods = [ + 'createTable', + 'createTableFromSnapshot', + 'listTables', + 'getTable', + 'updateTable', + 'deleteTable', + 'undeleteTable', + 'createAuthorizedView', + 'listAuthorizedViews', + 'getAuthorizedView', + 'updateAuthorizedView', + 'deleteAuthorizedView', + 'modifyColumnFamilies', + 'dropRowRange', + 'generateConsistencyToken', + 'checkConsistency', + 'snapshotTable', + 'getSnapshot', + 'listSnapshots', + 'deleteSnapshot', + 'createBackup', + 'getBackup', + 'updateBackup', + 'deleteBackup', + 'listBackups', + 'restoreTable', + 'copyBackup', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + 'createSchemaBundle', + 'updateSchemaBundle', + 'getSchemaBundle', + 'listSchemaBundles', + 'deleteSchemaBundle', + ]; + for (const methodName of bigtableTableAdminStubMethods) { + const callPromise = this.bigtableTableAdminStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.bigtableTableAdminStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigtableadmin.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigtableadmin.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/bigtable.admin', + 'https://www.googleapis.com/auth/bigtable.admin.table', + 'https://www.googleapis.com/auth/cloud-bigtable.admin', + 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates a new table in the specified instance. + * The table can be created with a full set of initial column families, + * specified in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. + * @param {string} request.tableId + * Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * Maximum 50 characters. + * @param {google.bigtable.admin.v2.Table} request.table + * Required. The Table to create. + * @param {number[]} request.initialSplits + * The optional list of row keys that will be used to initially split the + * table into several tablets (tablets are similar to HBase regions). + * Given two split keys, `s1` and `s2`, three tablets will be created, + * spanning the key ranges: `[, s1), [s1, s2), [s2, )`. + * + * Example: + * + * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` + * `"other", "zz"]` + * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` + * * Key assignment: + * - Tablet 1 `[, apple) => {"a"}.` + * - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` + * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` + * - Tablet 4 `[customer_2, other) => {"customer_2"}.` + * - Tablet 5 `[other, ) => {"other", "zz"}.` + * @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 {@link protos.google.bigtable.admin.v2.Table|Table}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_async + */ + createTable( + request?: protos.google.bigtable.admin.v2.ICreateTableRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableRequest | undefined, + {} | undefined, + ] + >; + createTable( + request: protos.google.bigtable.admin.v2.ICreateTableRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableRequest | null | undefined, + {} | null | undefined + >, + ): void; + createTable( + request: protos.google.bigtable.admin.v2.ICreateTableRequest, + callback: Callback< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableRequest | null | undefined, + {} | null | undefined + >, + ): void; + createTable( + request?: protos.google.bigtable.admin.v2.ICreateTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.ITable, + | protos.google.bigtable.admin.v2.ICreateTableRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('createTable request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.ITable, + | protos.google.bigtable.admin.v2.ICreateTableRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createTable response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createTable(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createTable response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets metadata information about the specified table. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the requested table. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {google.bigtable.admin.v2.Table.View} request.view + * The view to be applied to the returned table's fields. + * Defaults to `SCHEMA_VIEW` if unspecified. + * @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 {@link protos.google.bigtable.admin.v2.Table|Table}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_async + */ + getTable( + request?: protos.google.bigtable.admin.v2.IGetTableRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IGetTableRequest | undefined, + {} | undefined, + ] + >; + getTable( + request: protos.google.bigtable.admin.v2.IGetTableRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IGetTableRequest | null | undefined, + {} | null | undefined + >, + ): void; + getTable( + request: protos.google.bigtable.admin.v2.IGetTableRequest, + callback: Callback< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IGetTableRequest | null | undefined, + {} | null | undefined + >, + ): void; + getTable( + request?: protos.google.bigtable.admin.v2.IGetTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IGetTableRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IGetTableRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IGetTableRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getTable request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IGetTableRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTable response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTable(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IGetTableRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTable response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Permanently deletes a specified table and all of its data. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the table to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_async + */ + deleteTable( + request?: protos.google.bigtable.admin.v2.IDeleteTableRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteTableRequest | undefined, + {} | undefined, + ] + >; + deleteTable( + request: protos.google.bigtable.admin.v2.IDeleteTableRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteTableRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteTable( + request: protos.google.bigtable.admin.v2.IDeleteTableRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteTableRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteTable( + request?: protos.google.bigtable.admin.v2.IDeleteTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteTableRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteTableRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteTableRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteTable request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteTableRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTable response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteTable(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteTableRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteTable response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets information from a specified AuthorizedView. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the requested AuthorizedView. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * @param {google.bigtable.admin.v2.AuthorizedView.ResponseView} [request.view] + * Optional. The resource_view to be applied to the returned AuthorizedView's + * fields. Default to BASIC. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.bigtable.admin.v2.AuthorizedView|AuthorizedView}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_GetAuthorizedView_async + */ + getAuthorizedView( + request?: protos.google.bigtable.admin.v2.IGetAuthorizedViewRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IGetAuthorizedViewRequest | undefined, + {} | undefined, + ] + >; + getAuthorizedView( + request: protos.google.bigtable.admin.v2.IGetAuthorizedViewRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.IAuthorizedView, + | protos.google.bigtable.admin.v2.IGetAuthorizedViewRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getAuthorizedView( + request: protos.google.bigtable.admin.v2.IGetAuthorizedViewRequest, + callback: Callback< + protos.google.bigtable.admin.v2.IAuthorizedView, + | protos.google.bigtable.admin.v2.IGetAuthorizedViewRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getAuthorizedView( + request?: protos.google.bigtable.admin.v2.IGetAuthorizedViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.IAuthorizedView, + | protos.google.bigtable.admin.v2.IGetAuthorizedViewRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.IAuthorizedView, + | protos.google.bigtable.admin.v2.IGetAuthorizedViewRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IGetAuthorizedViewRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getAuthorizedView request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.IAuthorizedView, + | protos.google.bigtable.admin.v2.IGetAuthorizedViewRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAuthorizedView response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAuthorizedView(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IGetAuthorizedViewRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getAuthorizedView response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Permanently deletes a specified AuthorizedView. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the AuthorizedView to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * @param {string} [request.etag] + * Optional. The current etag of the AuthorizedView. + * If an etag is provided and does not match the current etag of the + * AuthorizedView, deletion will be blocked and an ABORTED error will be + * returned. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_DeleteAuthorizedView_async + */ + deleteAuthorizedView( + request?: protos.google.bigtable.admin.v2.IDeleteAuthorizedViewRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteAuthorizedViewRequest | undefined, + {} | undefined, + ] + >; + deleteAuthorizedView( + request: protos.google.bigtable.admin.v2.IDeleteAuthorizedViewRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteAuthorizedViewRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteAuthorizedView( + request: protos.google.bigtable.admin.v2.IDeleteAuthorizedViewRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteAuthorizedViewRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteAuthorizedView( + request?: protos.google.bigtable.admin.v2.IDeleteAuthorizedViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteAuthorizedViewRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteAuthorizedViewRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteAuthorizedViewRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteAuthorizedView request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteAuthorizedViewRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAuthorizedView response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAuthorizedView(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.bigtable.admin.v2.IDeleteAuthorizedViewRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteAuthorizedView response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Performs a series of column family modifications on the specified table. + * Either all or none of the modifications will occur before this method + * returns, but data requests received prior to that point may see a table + * where only some modifications have taken effect. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the table whose families should be modified. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {number[]} request.modifications + * Required. Modifications to be atomically applied to the specified table's + * families. Entries are applied in order, meaning that earlier modifications + * can be masked by later ones (in the case of repeated updates to the same + * family, for example). + * @param {boolean} [request.ignoreWarnings] + * Optional. If true, ignore safety checks when modifying the column families. + * @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 {@link protos.google.bigtable.admin.v2.Table|Table}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_async + */ + modifyColumnFamilies( + request?: protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest | undefined, + {} | undefined, + ] + >; + modifyColumnFamilies( + request: protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.ITable, + | protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + modifyColumnFamilies( + request: protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest, + callback: Callback< + protos.google.bigtable.admin.v2.ITable, + | protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + modifyColumnFamilies( + request?: protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.ITable, + | protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.ITable, + | protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('modifyColumnFamilies request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.ITable, + | protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('modifyColumnFamilies response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .modifyColumnFamilies(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.ITable, + ( + | protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('modifyColumnFamilies response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Permanently drop/delete a row range from a specified table. The request can + * specify whether to delete all rows in a table, or only those that match a + * particular prefix. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the table on which to drop a range of rows. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {Buffer} request.rowKeyPrefix + * Delete all rows that start with this row key prefix. Prefix cannot be + * zero length. + * @param {boolean} request.deleteAllDataFromTable + * Delete all rows in the table. Setting this to false is a no-op. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_async + */ + dropRowRange( + request?: protos.google.bigtable.admin.v2.IDropRowRangeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDropRowRangeRequest | undefined, + {} | undefined, + ] + >; + dropRowRange( + request: protos.google.bigtable.admin.v2.IDropRowRangeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDropRowRangeRequest | null | undefined, + {} | null | undefined + >, + ): void; + dropRowRange( + request: protos.google.bigtable.admin.v2.IDropRowRangeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDropRowRangeRequest | null | undefined, + {} | null | undefined + >, + ): void; + dropRowRange( + request?: protos.google.bigtable.admin.v2.IDropRowRangeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDropRowRangeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDropRowRangeRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDropRowRangeRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('dropRowRange request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDropRowRangeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('dropRowRange response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .dropRowRange(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDropRowRangeRequest | undefined, + {} | undefined, + ]) => { + this._log.info('dropRowRange response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Generates a consistency token for a Table, which can be used in + * CheckConsistency to check whether mutations to the table that finished + * before this call started have been replicated. The tokens will be available + * for 90 days. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the Table for which to create a consistency + * token. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @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 {@link protos.google.bigtable.admin.v2.GenerateConsistencyTokenResponse|GenerateConsistencyTokenResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_async + */ + generateConsistencyToken( + request?: protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + ( + | protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | undefined + ), + {} | undefined, + ] + >; + generateConsistencyToken( + request: protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + | protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + generateConsistencyToken( + request: protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, + callback: Callback< + protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + | protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + generateConsistencyToken( + request?: protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + | protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + | protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + ( + | protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('generateConsistencyToken request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + | protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateConsistencyToken response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateConsistencyToken(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + ( + | protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateConsistencyToken response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Checks replication consistency based on a consistency token, that is, if + * replication has caught up based on the conditions specified in the token + * and the check request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the Table for which to check replication + * consistency. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {string} request.consistencyToken + * Required. The token created using GenerateConsistencyToken for the Table. + * @param {google.bigtable.admin.v2.StandardReadRemoteWrites} request.standardReadRemoteWrites + * Checks that reads using an app profile with `StandardIsolation` can + * see all writes committed before the token was created, even if the + * read and write target different clusters. + * @param {google.bigtable.admin.v2.DataBoostReadLocalWrites} request.dataBoostReadLocalWrites + * Checks that reads using an app profile with `DataBoostIsolationReadOnly` + * can see all writes committed before the token was created, but only if + * the read and write target the same cluster. + * @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 {@link protos.google.bigtable.admin.v2.CheckConsistencyResponse|CheckConsistencyResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async + */ + checkConsistency( + request?: protos.google.bigtable.admin.v2.ICheckConsistencyRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.ICheckConsistencyResponse, + protos.google.bigtable.admin.v2.ICheckConsistencyRequest | undefined, + {} | undefined, + ] + >; + checkConsistency( + request: protos.google.bigtable.admin.v2.ICheckConsistencyRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.ICheckConsistencyResponse, + | protos.google.bigtable.admin.v2.ICheckConsistencyRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + checkConsistency( + request: protos.google.bigtable.admin.v2.ICheckConsistencyRequest, + callback: Callback< + protos.google.bigtable.admin.v2.ICheckConsistencyResponse, + | protos.google.bigtable.admin.v2.ICheckConsistencyRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + checkConsistency( + request?: protos.google.bigtable.admin.v2.ICheckConsistencyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.ICheckConsistencyResponse, + | protos.google.bigtable.admin.v2.ICheckConsistencyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.ICheckConsistencyResponse, + | protos.google.bigtable.admin.v2.ICheckConsistencyRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.ICheckConsistencyResponse, + protos.google.bigtable.admin.v2.ICheckConsistencyRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('checkConsistency request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.ICheckConsistencyResponse, + | protos.google.bigtable.admin.v2.ICheckConsistencyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('checkConsistency response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .checkConsistency(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.ICheckConsistencyResponse, + protos.google.bigtable.admin.v2.ICheckConsistencyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('checkConsistency response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets metadata information about the specified snapshot. + * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the requested snapshot. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @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 {@link protos.google.bigtable.admin.v2.Snapshot|Snapshot}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_async + */ + getSnapshot( + request?: protos.google.bigtable.admin.v2.IGetSnapshotRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.IGetSnapshotRequest | undefined, + {} | undefined, + ] + >; + getSnapshot( + request: protos.google.bigtable.admin.v2.IGetSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.IGetSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): void; + getSnapshot( + request: protos.google.bigtable.admin.v2.IGetSnapshotRequest, + callback: Callback< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.IGetSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): void; + getSnapshot( + request?: protos.google.bigtable.admin.v2.IGetSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.ISnapshot, + | protos.google.bigtable.admin.v2.IGetSnapshotRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.IGetSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.IGetSnapshotRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getSnapshot request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.ISnapshot, + | protos.google.bigtable.admin.v2.IGetSnapshotRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSnapshot response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSnapshot(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.IGetSnapshotRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSnapshot response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Permanently deletes the specified snapshot. + * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the snapshot to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_async + */ + deleteSnapshot( + request?: protos.google.bigtable.admin.v2.IDeleteSnapshotRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteSnapshotRequest | undefined, + {} | undefined, + ] + >; + deleteSnapshot( + request: protos.google.bigtable.admin.v2.IDeleteSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteSnapshot( + request: protos.google.bigtable.admin.v2.IDeleteSnapshotRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteSnapshot( + request?: protos.google.bigtable.admin.v2.IDeleteSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteSnapshotRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteSnapshotRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteSnapshot request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteSnapshotRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSnapshot response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSnapshot(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteSnapshotRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteSnapshot response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets metadata on a pending or completed Cloud Bigtable Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * @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 {@link protos.google.bigtable.admin.v2.Backup|Backup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_async + */ + getBackup( + request?: protos.google.bigtable.admin.v2.IGetBackupRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IGetBackupRequest | undefined, + {} | undefined, + ] + >; + getBackup( + request: protos.google.bigtable.admin.v2.IGetBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IGetBackupRequest | null | undefined, + {} | null | undefined + >, + ): void; + getBackup( + request: protos.google.bigtable.admin.v2.IGetBackupRequest, + callback: Callback< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IGetBackupRequest | null | undefined, + {} | null | undefined + >, + ): void; + getBackup( + request?: protos.google.bigtable.admin.v2.IGetBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IGetBackupRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IGetBackupRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IGetBackupRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getBackup request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IGetBackupRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBackup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IGetBackupRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getBackup response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates a pending or completed Cloud Bigtable Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.bigtable.admin.v2.Backup} request.backup + * Required. The backup to update. `backup.name`, and the fields to be updated + * as specified by `update_mask` are required. Other fields are ignored. + * Update is only supported for the following fields: + * + * * `backup.expire_time`. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A mask specifying which fields (e.g. `expire_time`) in the + * Backup resource should be updated. This mask is relative to the Backup + * resource, not to the request message. The field mask must always be + * specified; this prevents any future fields from being erased accidentally + * by clients that do not know about them. + * @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 {@link protos.google.bigtable.admin.v2.Backup|Backup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_async + */ + updateBackup( + request?: protos.google.bigtable.admin.v2.IUpdateBackupRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IUpdateBackupRequest | undefined, + {} | undefined, + ] + >; + updateBackup( + request: protos.google.bigtable.admin.v2.IUpdateBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IUpdateBackupRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateBackup( + request: protos.google.bigtable.admin.v2.IUpdateBackupRequest, + callback: Callback< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IUpdateBackupRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateBackup( + request?: protos.google.bigtable.admin.v2.IUpdateBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.IBackup, + | protos.google.bigtable.admin.v2.IUpdateBackupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IUpdateBackupRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IUpdateBackupRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'backup.name': request.backup!.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('updateBackup request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.IBackup, + | protos.google.bigtable.admin.v2.IUpdateBackupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateBackup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.IUpdateBackupRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateBackup response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a pending or completed Cloud Bigtable backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup to delete. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_async + */ + deleteBackup( + request?: protos.google.bigtable.admin.v2.IDeleteBackupRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteBackupRequest | undefined, + {} | undefined, + ] + >; + deleteBackup( + request: protos.google.bigtable.admin.v2.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteBackupRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteBackup( + request: protos.google.bigtable.admin.v2.IDeleteBackupRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteBackupRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteBackup( + request?: protos.google.bigtable.admin.v2.IDeleteBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteBackupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteBackupRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteBackupRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteBackup request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteBackupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteBackup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteBackupRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteBackup response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets the access control policy for a Bigtable resource. + * Returns an empty policy if the resource exists but does not have a policy + * set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @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 {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Sets the access control policy on a Bigtable resource. + * Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .setIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns permissions that the caller has on the specified Bigtable + * resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .testIamPermissions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets metadata information about the specified schema bundle. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the schema bundle to retrieve. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + * @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 {@link protos.google.bigtable.admin.v2.SchemaBundle|SchemaBundle}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_GetSchemaBundle_async + */ + getSchemaBundle( + request?: protos.google.bigtable.admin.v2.IGetSchemaBundleRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IGetSchemaBundleRequest | undefined, + {} | undefined, + ] + >; + getSchemaBundle( + request: protos.google.bigtable.admin.v2.IGetSchemaBundleRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.admin.v2.ISchemaBundle, + | protos.google.bigtable.admin.v2.IGetSchemaBundleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSchemaBundle( + request: protos.google.bigtable.admin.v2.IGetSchemaBundleRequest, + callback: Callback< + protos.google.bigtable.admin.v2.ISchemaBundle, + | protos.google.bigtable.admin.v2.IGetSchemaBundleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSchemaBundle( + request?: protos.google.bigtable.admin.v2.IGetSchemaBundleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.admin.v2.ISchemaBundle, + | protos.google.bigtable.admin.v2.IGetSchemaBundleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.admin.v2.ISchemaBundle, + | protos.google.bigtable.admin.v2.IGetSchemaBundleRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IGetSchemaBundleRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getSchemaBundle request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.admin.v2.ISchemaBundle, + | protos.google.bigtable.admin.v2.IGetSchemaBundleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSchemaBundle response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSchemaBundle(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IGetSchemaBundleRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSchemaBundle response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a schema bundle in the specified table. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the schema bundle to delete. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + * @param {string} [request.etag] + * Optional. The etag of the schema bundle. + * If this is provided, it must match the server's etag. The server + * returns an ABORTED error on a mismatched etag. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSchemaBundle_async + */ + deleteSchemaBundle( + request?: protos.google.bigtable.admin.v2.IDeleteSchemaBundleRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteSchemaBundleRequest | undefined, + {} | undefined, + ] + >; + deleteSchemaBundle( + request: protos.google.bigtable.admin.v2.IDeleteSchemaBundleRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteSchemaBundleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSchemaBundle( + request: protos.google.bigtable.admin.v2.IDeleteSchemaBundleRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteSchemaBundleRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSchemaBundle( + request?: protos.google.bigtable.admin.v2.IDeleteSchemaBundleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteSchemaBundleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteSchemaBundleRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.bigtable.admin.v2.IDeleteSchemaBundleRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteSchemaBundle request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.bigtable.admin.v2.IDeleteSchemaBundleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSchemaBundle response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSchemaBundle(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.bigtable.admin.v2.IDeleteSchemaBundleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteSchemaBundle response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Creates a new table from the specified snapshot. The target table must + * not exist. The snapshot and the table must be in the same instance. + * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance in which to create the table. + * Values are of the form `projects/{project}/instances/{instance}`. + * @param {string} request.tableId + * Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * @param {string} request.sourceSnapshot + * Required. The unique name of the snapshot from which to restore the table. + * The snapshot and the table must be in the same instance. Values are of the + * form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_async + */ + createTableFromSnapshot( + request?: protos.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createTableFromSnapshot( + request: protos.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createTableFromSnapshot( + request: protos.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createTableFromSnapshot( + request?: protos.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createTableFromSnapshot response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createTableFromSnapshot request %j', request); + return this.innerApiCalls + .createTableFromSnapshot(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createTableFromSnapshot response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createTableFromSnapshot()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_async + */ + async checkCreateTableFromSnapshotProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.Table, + protos.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + > + > { + this._log.info('createTableFromSnapshot long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createTableFromSnapshot, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.Table, + protos.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + >; + } + /** + * Updates a specified table. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.bigtable.admin.v2.Table} request.table + * Required. The table to update. + * The table's `name` field is used to identify the table to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * A mask specifying which fields (e.g. `change_stream_config`) in the `table` + * field should be updated. This mask is relative to the `table` field, not to + * the request message. The wildcard (*) path is currently not supported. + * Currently UpdateTable is only supported for the following fields: + * + * * `change_stream_config` + * * `change_stream_config.retention_period` + * * `deletion_protection` + * * `row_key_schema` + * + * If `column_families` is set in `update_mask`, it will return an + * UNIMPLEMENTED error. + * @param {boolean} [request.ignoreWarnings] + * Optional. If true, ignore safety checks when updating the table. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_async + */ + updateTable( + request?: protos.google.bigtable.admin.v2.IUpdateTableRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUpdateTableMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateTable( + request: protos.google.bigtable.admin.v2.IUpdateTableRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUpdateTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateTable( + request: protos.google.bigtable.admin.v2.IUpdateTableRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUpdateTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateTable( + request?: protos.google.bigtable.admin.v2.IUpdateTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUpdateTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUpdateTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUpdateTableMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'table.name': request.table!.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUpdateTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateTable response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateTable request %j', request); + return this.innerApiCalls + .updateTable(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUpdateTableMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateTable response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateTable()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_async + */ + async checkUpdateTableProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.Table, + protos.google.bigtable.admin.v2.UpdateTableMetadata + > + > { + this._log.info('updateTable long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateTable, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.Table, + protos.google.bigtable.admin.v2.UpdateTableMetadata + >; + } + /** + * Restores a specified table which was accidentally deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the table to be restored. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_async + */ + undeleteTable( + request?: protos.google.bigtable.admin.v2.IUndeleteTableRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUndeleteTableMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + undeleteTable( + request: protos.google.bigtable.admin.v2.IUndeleteTableRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUndeleteTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + undeleteTable( + request: protos.google.bigtable.admin.v2.IUndeleteTableRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUndeleteTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + undeleteTable( + request?: protos.google.bigtable.admin.v2.IUndeleteTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUndeleteTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUndeleteTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUndeleteTableMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUndeleteTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('undeleteTable response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeleteTable request %j', request); + return this.innerApiCalls + .undeleteTable(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUndeleteTableMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('undeleteTable response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `undeleteTable()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_async + */ + async checkUndeleteTableProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.Table, + protos.google.bigtable.admin.v2.UndeleteTableMetadata + > + > { + this._log.info('undeleteTable long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.undeleteTable, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.Table, + protos.google.bigtable.admin.v2.UndeleteTableMetadata + >; + } + /** + * Creates a new AuthorizedView in a table. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. This is the name of the table the AuthorizedView belongs to. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {string} request.authorizedViewId + * Required. The id of the AuthorizedView to create. This AuthorizedView must + * not already exist. The `authorized_view_id` appended to `parent` forms the + * full AuthorizedView name of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`. + * @param {google.bigtable.admin.v2.AuthorizedView} request.authorizedView + * Required. The AuthorizedView to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateAuthorizedView_async + */ + createAuthorizedView( + request?: protos.google.bigtable.admin.v2.ICreateAuthorizedViewRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.ICreateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createAuthorizedView( + request: protos.google.bigtable.admin.v2.ICreateAuthorizedViewRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.ICreateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createAuthorizedView( + request: protos.google.bigtable.admin.v2.ICreateAuthorizedViewRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.ICreateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createAuthorizedView( + request?: protos.google.bigtable.admin.v2.ICreateAuthorizedViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.ICreateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.ICreateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.ICreateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.ICreateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createAuthorizedView response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createAuthorizedView request %j', request); + return this.innerApiCalls + .createAuthorizedView(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.ICreateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createAuthorizedView response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createAuthorizedView()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateAuthorizedView_async + */ + async checkCreateAuthorizedViewProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.AuthorizedView, + protos.google.bigtable.admin.v2.CreateAuthorizedViewMetadata + > + > { + this._log.info('createAuthorizedView long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createAuthorizedView, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.AuthorizedView, + protos.google.bigtable.admin.v2.CreateAuthorizedViewMetadata + >; + } + /** + * Updates an AuthorizedView in a table. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.bigtable.admin.v2.AuthorizedView} request.authorizedView + * Required. The AuthorizedView to update. The `name` in `authorized_view` is + * used to identify the AuthorizedView. AuthorizedView name must in this + * format: + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * A mask specifying which fields in the AuthorizedView resource should be + * updated. This mask is relative to the AuthorizedView resource, not to the + * request message. A field will be overwritten if it is in the mask. If + * empty, all fields set in the request will be overwritten. A special value + * `*` means to overwrite all fields (including fields not set in the + * request). + * @param {boolean} [request.ignoreWarnings] + * Optional. If true, ignore the safety checks when updating the + * AuthorizedView. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UpdateAuthorizedView_async + */ + updateAuthorizedView( + request?: protos.google.bigtable.admin.v2.IUpdateAuthorizedViewRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateAuthorizedView( + request: protos.google.bigtable.admin.v2.IUpdateAuthorizedViewRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateAuthorizedView( + request: protos.google.bigtable.admin.v2.IUpdateAuthorizedViewRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateAuthorizedView( + request?: protos.google.bigtable.admin.v2.IUpdateAuthorizedViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'authorized_view.name': request.authorizedView!.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateAuthorizedView response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateAuthorizedView request %j', request); + return this.innerApiCalls + .updateAuthorizedView(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateAuthorizedView response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateAuthorizedView()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UpdateAuthorizedView_async + */ + async checkUpdateAuthorizedViewProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.AuthorizedView, + protos.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + > + > { + this._log.info('updateAuthorizedView long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateAuthorizedView, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.AuthorizedView, + protos.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + >; + } + /** + * Creates a new snapshot in the specified cluster from the specified + * source table. The cluster and the table must be in the same instance. + * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the table to have the snapshot taken. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {string} request.cluster + * Required. The name of the cluster where the snapshot will be created in. + * Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param {string} request.snapshotId + * Required. The ID by which the new snapshot should be referred to within the + * parent cluster, e.g., `mysnapshot` of the form: + * `{@link protos.-_.a-zA-Z0-9|_a-zA-Z0-9}*` rather than + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + * @param {google.protobuf.Duration} request.ttl + * The amount of time that the new snapshot can stay active after it is + * created. Once 'ttl' expires, the snapshot will get deleted. The maximum + * amount of time a snapshot can stay active is 7 days. If 'ttl' is not + * specified, the default value of 24 hours will be used. + * @param {string} request.description + * Description of the snapshot. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_async + */ + snapshotTable( + request?: protos.google.bigtable.admin.v2.ISnapshotTableRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + snapshotTable( + request: protos.google.bigtable.admin.v2.ISnapshotTableRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + snapshotTable( + request: protos.google.bigtable.admin.v2.ISnapshotTableRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + snapshotTable( + request?: protos.google.bigtable.admin.v2.ISnapshotTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('snapshotTable response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('snapshotTable request %j', request); + return this.innerApiCalls + .snapshotTable(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('snapshotTable response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `snapshotTable()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_async + */ + async checkSnapshotTableProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.Snapshot, + protos.google.bigtable.admin.v2.SnapshotTableMetadata + > + > { + this._log.info('snapshotTable long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.snapshotTable, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.Snapshot, + protos.google.bigtable.admin.v2.SnapshotTableMetadata + >; + } + /** + * Starts creating a new Cloud Bigtable Backup. The returned backup + * {@link protos.google.longrunning.Operation|long-running operation} can be used to + * track creation of the backup. The + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.bigtable.admin.v2.CreateBackupMetadata|CreateBackupMetadata}. The + * {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.bigtable.admin.v2.Backup|Backup}, if successful. Cancelling the + * returned operation will stop the creation and delete the backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. This must be one of the clusters in the instance in which this + * table is located. The backup will be stored in this cluster. Values are + * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param {string} request.backupId + * Required. The id of the backup to be created. The `backup_id` along with + * the parent `parent` are combined as {parent}/backups/{backup_id} to create + * the full backup name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex {@link protos.-_.a-zA-Z0-9|_a-zA-Z0-9}*. + * @param {google.bigtable.admin.v2.Backup} request.backup + * Required. The backup to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_async + */ + createBackup( + request?: protos.google.bigtable.admin.v2.ICreateBackupRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICreateBackupMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createBackup( + request: protos.google.bigtable.admin.v2.ICreateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICreateBackupMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createBackup( + request: protos.google.bigtable.admin.v2.ICreateBackupRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICreateBackupMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createBackup( + request?: protos.google.bigtable.admin.v2.ICreateBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICreateBackupMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICreateBackupMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICreateBackupMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICreateBackupMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackup request %j', request); + return this.innerApiCalls + .createBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICreateBackupMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createBackup response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_async + */ + async checkCreateBackupProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.Backup, + protos.google.bigtable.admin.v2.CreateBackupMetadata + > + > { + this._log.info('createBackup long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createBackup, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.Backup, + protos.google.bigtable.admin.v2.CreateBackupMetadata + >; + } + /** + * Create a new table by restoring from a completed backup. The + * returned table {@link protos.google.longrunning.Operation|long-running operation} can + * be used to track the progress of the operation, and to cancel it. The + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.bigtable.admin.v2.RestoreTableMetadata|RestoreTableMetadata}. The + * {@link protos.google.longrunning.Operation.response|response} type is + * {@link protos.google.bigtable.admin.v2.Table|Table}, if successful. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the instance in which to create the restored + * table. Values are of the form `projects//instances/`. + * @param {string} request.tableId + * Required. The id of the table to create and restore to. This + * table must not already exist. The `table_id` appended to + * `parent` forms the full table name of the form + * `projects//instances//tables/`. + * @param {string} request.backup + * Name of the backup from which to restore. Values are of the form + * `projects//instances//clusters//backups/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async + */ + restoreTable( + request?: protos.google.bigtable.admin.v2.IRestoreTableRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IRestoreTableMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + restoreTable( + request: protos.google.bigtable.admin.v2.IRestoreTableRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IRestoreTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + restoreTable( + request: protos.google.bigtable.admin.v2.IRestoreTableRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IRestoreTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + restoreTable( + request?: protos.google.bigtable.admin.v2.IRestoreTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IRestoreTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IRestoreTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IRestoreTableMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IRestoreTableMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreTable response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreTable request %j', request); + return this.innerApiCalls + .restoreTable(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IRestoreTableMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('restoreTable response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `restoreTable()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async + */ + async checkRestoreTableProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.Table, + protos.google.bigtable.admin.v2.RestoreTableMetadata + > + > { + this._log.info('restoreTable long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.restoreTable, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.Table, + protos.google.bigtable.admin.v2.RestoreTableMetadata + >; + } + /** + * Copy a Cloud Bigtable backup to a new backup in the destination cluster + * located in the destination instance and project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the destination cluster that will contain the backup + * copy. The cluster must already exist. Values are of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param {string} request.backupId + * Required. The id of the new backup. The `backup_id` along with `parent` + * are combined as {parent}/backups/{backup_id} to create the full backup + * name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + * This string must be between 1 and 50 characters in length and match the + * regex {@link protos.-_.a-zA-Z0-9|_a-zA-Z0-9}*. + * @param {string} request.sourceBackup + * Required. The source backup to be copied from. + * The source backup needs to be in READY state for it to be copied. + * Copying a copied backup is not allowed. + * Once CopyBackup is in progress, the source backup cannot be deleted or + * cleaned up on expiration until CopyBackup is finished. + * Values are of the form: + * `projects//instances//clusters//backups/`. + * @param {google.protobuf.Timestamp} request.expireTime + * Required. Required. The expiration time of the copied backup with + * microsecond granularity that must be at least 6 hours and at most 30 days + * from the time the request is received. Once the `expire_time` has + * passed, Cloud Bigtable will delete the backup and free the resources used + * by the backup. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_async + */ + copyBackup( + request?: protos.google.bigtable.admin.v2.ICopyBackupRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICopyBackupMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + copyBackup( + request: protos.google.bigtable.admin.v2.ICopyBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICopyBackupMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + copyBackup( + request: protos.google.bigtable.admin.v2.ICopyBackupRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICopyBackupMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + copyBackup( + request?: protos.google.bigtable.admin.v2.ICopyBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICopyBackupMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICopyBackupMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICopyBackupMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICopyBackupMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('copyBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('copyBackup request %j', request); + return this.innerApiCalls + .copyBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICopyBackupMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('copyBackup response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `copyBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_async + */ + async checkCopyBackupProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.Backup, + protos.google.bigtable.admin.v2.CopyBackupMetadata + > + > { + this._log.info('copyBackup long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.copyBackup, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.Backup, + protos.google.bigtable.admin.v2.CopyBackupMetadata + >; + } + /** + * Creates a new schema bundle in the specified table. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this schema bundle will be created. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {string} request.schemaBundleId + * Required. The unique ID to use for the schema bundle, which will become the + * final component of the schema bundle's resource name. + * @param {google.bigtable.admin.v2.SchemaBundle} request.schemaBundle + * Required. The schema bundle to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateSchemaBundle_async + */ + createSchemaBundle( + request?: protos.google.bigtable.admin.v2.ICreateSchemaBundleRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.ICreateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createSchemaBundle( + request: protos.google.bigtable.admin.v2.ICreateSchemaBundleRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.ICreateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createSchemaBundle( + request: protos.google.bigtable.admin.v2.ICreateSchemaBundleRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.ICreateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createSchemaBundle( + request?: protos.google.bigtable.admin.v2.ICreateSchemaBundleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.ICreateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.ICreateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.ICreateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.ICreateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSchemaBundle response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSchemaBundle request %j', request); + return this.innerApiCalls + .createSchemaBundle(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.ICreateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createSchemaBundle response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createSchemaBundle()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateSchemaBundle_async + */ + async checkCreateSchemaBundleProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.SchemaBundle, + protos.google.bigtable.admin.v2.CreateSchemaBundleMetadata + > + > { + this._log.info('createSchemaBundle long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createSchemaBundle, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.SchemaBundle, + protos.google.bigtable.admin.v2.CreateSchemaBundleMetadata + >; + } + /** + * Updates a schema bundle in the specified table. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.bigtable.admin.v2.SchemaBundle} request.schemaBundle + * Required. The schema bundle to update. + * + * The schema bundle's `name` field is used to identify the schema bundle to + * update. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * @param {boolean} [request.ignoreWarnings] + * Optional. If set, ignore the safety checks when updating the Schema Bundle. + * The safety checks are: + * - The new Schema Bundle is backwards compatible with the existing Schema + * Bundle. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UpdateSchemaBundle_async + */ + updateSchemaBundle( + request?: protos.google.bigtable.admin.v2.IUpdateSchemaBundleRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IUpdateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateSchemaBundle( + request: protos.google.bigtable.admin.v2.IUpdateSchemaBundleRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IUpdateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateSchemaBundle( + request: protos.google.bigtable.admin.v2.IUpdateSchemaBundleRequest, + callback: Callback< + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IUpdateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateSchemaBundle( + request?: protos.google.bigtable.admin.v2.IUpdateSchemaBundleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IUpdateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IUpdateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IUpdateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'schema_bundle.name': request.schemaBundle!.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IUpdateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateSchemaBundle response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateSchemaBundle request %j', request); + return this.innerApiCalls + .updateSchemaBundle(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IUpdateSchemaBundleMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateSchemaBundle response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateSchemaBundle()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UpdateSchemaBundle_async + */ + async checkUpdateSchemaBundleProgress( + name: string, + ): Promise< + LROperation< + protos.google.bigtable.admin.v2.SchemaBundle, + protos.google.bigtable.admin.v2.UpdateSchemaBundleMetadata + > + > { + this._log.info('updateSchemaBundle long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name}, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateSchemaBundle, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.bigtable.admin.v2.SchemaBundle, + protos.google.bigtable.admin.v2.UpdateSchemaBundleMetadata + >; + } + /** + * Lists all tables served from a specified instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which tables should be + * listed. Values are of the form `projects/{project}/instances/{instance}`. + * @param {google.bigtable.admin.v2.Table.View} request.view + * The view to be applied to the returned tables' fields. + * NAME_ONLY view (default) and REPLICATION_VIEW are supported. + * @param {number} request.pageSize + * Maximum number of results per page. + * + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * @param {string} request.pageToken + * The value of `next_page_token` returned by a previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.bigtable.admin.v2.Table|Table}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTablesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTables( + request?: protos.google.bigtable.admin.v2.IListTablesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.ITable[], + protos.google.bigtable.admin.v2.IListTablesRequest | null, + protos.google.bigtable.admin.v2.IListTablesResponse, + ] + >; + listTables( + request: protos.google.bigtable.admin.v2.IListTablesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListTablesRequest, + protos.google.bigtable.admin.v2.IListTablesResponse | null | undefined, + protos.google.bigtable.admin.v2.ITable + >, + ): void; + listTables( + request: protos.google.bigtable.admin.v2.IListTablesRequest, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListTablesRequest, + protos.google.bigtable.admin.v2.IListTablesResponse | null | undefined, + protos.google.bigtable.admin.v2.ITable + >, + ): void; + listTables( + request?: protos.google.bigtable.admin.v2.IListTablesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.bigtable.admin.v2.IListTablesRequest, + | protos.google.bigtable.admin.v2.IListTablesResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ITable + >, + callback?: PaginationCallback< + protos.google.bigtable.admin.v2.IListTablesRequest, + protos.google.bigtable.admin.v2.IListTablesResponse | null | undefined, + protos.google.bigtable.admin.v2.ITable + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.ITable[], + protos.google.bigtable.admin.v2.IListTablesRequest | null, + protos.google.bigtable.admin.v2.IListTablesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.bigtable.admin.v2.IListTablesRequest, + | protos.google.bigtable.admin.v2.IListTablesResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ITable + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTables values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTables request %j', request); + return this.innerApiCalls + .listTables(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.bigtable.admin.v2.ITable[], + protos.google.bigtable.admin.v2.IListTablesRequest | null, + protos.google.bigtable.admin.v2.IListTablesResponse, + ]) => { + this._log.info('listTables values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTables`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which tables should be + * listed. Values are of the form `projects/{project}/instances/{instance}`. + * @param {google.bigtable.admin.v2.Table.View} request.view + * The view to be applied to the returned tables' fields. + * NAME_ONLY view (default) and REPLICATION_VIEW are supported. + * @param {number} request.pageSize + * Maximum number of results per page. + * + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * @param {string} request.pageToken + * The value of `next_page_token` returned by a previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.bigtable.admin.v2.Table|Table} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTablesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTablesStream( + request?: protos.google.bigtable.admin.v2.IListTablesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTables']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listTables stream %j', request); + return this.descriptors.page.listTables.createStream( + this.innerApiCalls.listTables as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTables`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the instance for which tables should be + * listed. Values are of the form `projects/{project}/instances/{instance}`. + * @param {google.bigtable.admin.v2.Table.View} request.view + * The view to be applied to the returned tables' fields. + * NAME_ONLY view (default) and REPLICATION_VIEW are supported. + * @param {number} request.pageSize + * Maximum number of results per page. + * + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * @param {string} request.pageToken + * The value of `next_page_token` returned by a previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.bigtable.admin.v2.Table|Table}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_async + */ + listTablesAsync( + request?: protos.google.bigtable.admin.v2.IListTablesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTables']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listTables iterate %j', request); + return this.descriptors.page.listTables.asyncIterate( + this.innerApiCalls['listTables'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists all AuthorizedViews from a specific table. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the table for which AuthorizedViews should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of results per page. + * + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * @param {string} [request.pageToken] + * Optional. The value of `next_page_token` returned by a previous call. + * @param {google.bigtable.admin.v2.AuthorizedView.ResponseView} [request.view] + * Optional. The resource_view to be applied to the returned AuthorizedViews' + * fields. Default to NAME_ONLY. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.bigtable.admin.v2.AuthorizedView|AuthorizedView}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAuthorizedViewsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAuthorizedViews( + request?: protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IAuthorizedView[], + protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest | null, + protos.google.bigtable.admin.v2.IListAuthorizedViewsResponse, + ] + >; + listAuthorizedViews( + request: protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest, + | protos.google.bigtable.admin.v2.IListAuthorizedViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IAuthorizedView + >, + ): void; + listAuthorizedViews( + request: protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest, + | protos.google.bigtable.admin.v2.IListAuthorizedViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IAuthorizedView + >, + ): void; + listAuthorizedViews( + request?: protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest, + | protos.google.bigtable.admin.v2.IListAuthorizedViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IAuthorizedView + >, + callback?: PaginationCallback< + protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest, + | protos.google.bigtable.admin.v2.IListAuthorizedViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IAuthorizedView + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IAuthorizedView[], + protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest | null, + protos.google.bigtable.admin.v2.IListAuthorizedViewsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest, + | protos.google.bigtable.admin.v2.IListAuthorizedViewsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IAuthorizedView + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAuthorizedViews values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAuthorizedViews request %j', request); + return this.innerApiCalls + .listAuthorizedViews(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.bigtable.admin.v2.IAuthorizedView[], + protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest | null, + protos.google.bigtable.admin.v2.IListAuthorizedViewsResponse, + ]) => { + this._log.info('listAuthorizedViews values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listAuthorizedViews`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the table for which AuthorizedViews should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of results per page. + * + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * @param {string} [request.pageToken] + * Optional. The value of `next_page_token` returned by a previous call. + * @param {google.bigtable.admin.v2.AuthorizedView.ResponseView} [request.view] + * Optional. The resource_view to be applied to the returned AuthorizedViews' + * fields. Default to NAME_ONLY. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.bigtable.admin.v2.AuthorizedView|AuthorizedView} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAuthorizedViewsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAuthorizedViewsStream( + request?: protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAuthorizedViews']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listAuthorizedViews stream %j', request); + return this.descriptors.page.listAuthorizedViews.createStream( + this.innerApiCalls.listAuthorizedViews as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listAuthorizedViews`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the table for which AuthorizedViews should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of results per page. + * + * A page_size of zero lets the server choose the number of items to return. + * A page_size which is strictly positive will return at most that many items. + * A negative page_size will cause an error. + * + * Following the first request, subsequent paginated calls are not required + * to pass a page_size. If a page_size is set in subsequent calls, it must + * match the page_size given in the first request. + * @param {string} [request.pageToken] + * Optional. The value of `next_page_token` returned by a previous call. + * @param {google.bigtable.admin.v2.AuthorizedView.ResponseView} [request.view] + * Optional. The resource_view to be applied to the returned AuthorizedViews' + * fields. Default to NAME_ONLY. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.bigtable.admin.v2.AuthorizedView|AuthorizedView}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_ListAuthorizedViews_async + */ + listAuthorizedViewsAsync( + request?: protos.google.bigtable.admin.v2.IListAuthorizedViewsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAuthorizedViews']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listAuthorizedViews iterate %j', request); + return this.descriptors.page.listAuthorizedViews.asyncIterate( + this.innerApiCalls['listAuthorizedViews'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists all snapshots associated with the specified cluster. + * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the cluster for which snapshots should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * @param {number} request.pageSize + * The maximum number of snapshots to return per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. + * @param {string} request.pageToken + * The value of `next_page_token` returned by a previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.bigtable.admin.v2.Snapshot|Snapshot}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSnapshotsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSnapshots( + request?: protos.google.bigtable.admin.v2.IListSnapshotsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.ISnapshot[], + protos.google.bigtable.admin.v2.IListSnapshotsRequest | null, + protos.google.bigtable.admin.v2.IListSnapshotsResponse, + ] + >; + listSnapshots( + request: protos.google.bigtable.admin.v2.IListSnapshotsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListSnapshotsRequest, + protos.google.bigtable.admin.v2.IListSnapshotsResponse | null | undefined, + protos.google.bigtable.admin.v2.ISnapshot + >, + ): void; + listSnapshots( + request: protos.google.bigtable.admin.v2.IListSnapshotsRequest, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListSnapshotsRequest, + protos.google.bigtable.admin.v2.IListSnapshotsResponse | null | undefined, + protos.google.bigtable.admin.v2.ISnapshot + >, + ): void; + listSnapshots( + request?: protos.google.bigtable.admin.v2.IListSnapshotsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.bigtable.admin.v2.IListSnapshotsRequest, + | protos.google.bigtable.admin.v2.IListSnapshotsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ISnapshot + >, + callback?: PaginationCallback< + protos.google.bigtable.admin.v2.IListSnapshotsRequest, + protos.google.bigtable.admin.v2.IListSnapshotsResponse | null | undefined, + protos.google.bigtable.admin.v2.ISnapshot + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.ISnapshot[], + protos.google.bigtable.admin.v2.IListSnapshotsRequest | null, + protos.google.bigtable.admin.v2.IListSnapshotsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.bigtable.admin.v2.IListSnapshotsRequest, + | protos.google.bigtable.admin.v2.IListSnapshotsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ISnapshot + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSnapshots values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSnapshots request %j', request); + return this.innerApiCalls + .listSnapshots(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.bigtable.admin.v2.ISnapshot[], + protos.google.bigtable.admin.v2.IListSnapshotsRequest | null, + protos.google.bigtable.admin.v2.IListSnapshotsResponse, + ]) => { + this._log.info('listSnapshots values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSnapshots`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the cluster for which snapshots should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * @param {number} request.pageSize + * The maximum number of snapshots to return per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. + * @param {string} request.pageToken + * The value of `next_page_token` returned by a previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.bigtable.admin.v2.Snapshot|Snapshot} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSnapshotsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSnapshotsStream( + request?: protos.google.bigtable.admin.v2.IListSnapshotsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSnapshots']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listSnapshots stream %j', request); + return this.descriptors.page.listSnapshots.createStream( + this.innerApiCalls.listSnapshots as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSnapshots`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique name of the cluster for which snapshots should be + * listed. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * @param {number} request.pageSize + * The maximum number of snapshots to return per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. + * @param {string} request.pageToken + * The value of `next_page_token` returned by a previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.bigtable.admin.v2.Snapshot|Snapshot}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_async + */ + listSnapshotsAsync( + request?: protos.google.bigtable.admin.v2.IListSnapshotsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSnapshots']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listSnapshots iterate %j', request); + return this.descriptors.page.listSnapshots.asyncIterate( + this.innerApiCalls['listSnapshots'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists Cloud Bigtable backups. Returns both completed and pending + * backups. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The cluster to list backups from. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list backups for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * @param {string} request.filter + * A filter expression that filters backups listed in the response. + * The expression must specify the field name, a comparison operator, + * and the value that you want to use for filtering. The value must be a + * string, a number, or a boolean. The comparison operator must be + * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is + * roughly synonymous with equality. Filter rules are case insensitive. + * + * The fields eligible for filtering are: + * + * * `name` + * * `source_table` + * * `state` + * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `size_bytes` + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. By default, each expression is an AND expression. However, + * you can include AND, OR, and NOT expressions explicitly. + * + * Some examples of using filters are: + * + * * `name:"exact"` --> The backup's name is the string "exact". + * * `name:howl` --> The backup's name contains the string "howl". + * * `source_table:prod` + * --> The source_table's name contains the string "prod". + * * `state:CREATING` --> The backup is pending creation. + * * `state:READY` --> The backup is fully created and ready for use. + * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` + * --> The backup name contains the string "howl" and start_time + * of the backup is before 2018-03-28T14:50:00Z. + * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB + * @param {string} request.orderBy + * An expression for specifying the sort order of the results of the request. + * The string value should specify one or more fields in + * {@link protos.google.bigtable.admin.v2.Backup|Backup}. The full syntax is described at + * https://aip.dev/132#ordering. + * + * Fields supported are: + * + * * name + * * source_table + * * expire_time + * * start_time + * * end_time + * * size_bytes + * * state + * + * For example, "start_time". The default sorting order is ascending. + * To specify descending order for the field, a suffix " desc" should + * be appended to the field name. For example, "start_time desc". + * Redundant space characters in the syntax are insigificant. + * + * If order_by is empty, results will be sorted by `start_time` in descending + * order starting from the most recently created backup. + * @param {number} request.pageSize + * Number of backups to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.bigtable.admin.v2.ListBackupsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.bigtable.admin.v2.ListBackupsResponse|ListBackupsResponse} to the + * same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.bigtable.admin.v2.Backup|Backup}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackups( + request?: protos.google.bigtable.admin.v2.IListBackupsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.IBackup[], + protos.google.bigtable.admin.v2.IListBackupsRequest | null, + protos.google.bigtable.admin.v2.IListBackupsResponse, + ] + >; + listBackups( + request: protos.google.bigtable.admin.v2.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListBackupsRequest, + protos.google.bigtable.admin.v2.IListBackupsResponse | null | undefined, + protos.google.bigtable.admin.v2.IBackup + >, + ): void; + listBackups( + request: protos.google.bigtable.admin.v2.IListBackupsRequest, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListBackupsRequest, + protos.google.bigtable.admin.v2.IListBackupsResponse | null | undefined, + protos.google.bigtable.admin.v2.IBackup + >, + ): void; + listBackups( + request?: protos.google.bigtable.admin.v2.IListBackupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.bigtable.admin.v2.IListBackupsRequest, + | protos.google.bigtable.admin.v2.IListBackupsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IBackup + >, + callback?: PaginationCallback< + protos.google.bigtable.admin.v2.IListBackupsRequest, + protos.google.bigtable.admin.v2.IListBackupsResponse | null | undefined, + protos.google.bigtable.admin.v2.IBackup + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.IBackup[], + protos.google.bigtable.admin.v2.IListBackupsRequest | null, + protos.google.bigtable.admin.v2.IListBackupsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.bigtable.admin.v2.IListBackupsRequest, + | protos.google.bigtable.admin.v2.IListBackupsResponse + | null + | undefined, + protos.google.bigtable.admin.v2.IBackup + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackups request %j', request); + return this.innerApiCalls + .listBackups(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.bigtable.admin.v2.IBackup[], + protos.google.bigtable.admin.v2.IListBackupsRequest | null, + protos.google.bigtable.admin.v2.IListBackupsResponse, + ]) => { + this._log.info('listBackups values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listBackups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The cluster to list backups from. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list backups for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * @param {string} request.filter + * A filter expression that filters backups listed in the response. + * The expression must specify the field name, a comparison operator, + * and the value that you want to use for filtering. The value must be a + * string, a number, or a boolean. The comparison operator must be + * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is + * roughly synonymous with equality. Filter rules are case insensitive. + * + * The fields eligible for filtering are: + * + * * `name` + * * `source_table` + * * `state` + * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `size_bytes` + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. By default, each expression is an AND expression. However, + * you can include AND, OR, and NOT expressions explicitly. + * + * Some examples of using filters are: + * + * * `name:"exact"` --> The backup's name is the string "exact". + * * `name:howl` --> The backup's name contains the string "howl". + * * `source_table:prod` + * --> The source_table's name contains the string "prod". + * * `state:CREATING` --> The backup is pending creation. + * * `state:READY` --> The backup is fully created and ready for use. + * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` + * --> The backup name contains the string "howl" and start_time + * of the backup is before 2018-03-28T14:50:00Z. + * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB + * @param {string} request.orderBy + * An expression for specifying the sort order of the results of the request. + * The string value should specify one or more fields in + * {@link protos.google.bigtable.admin.v2.Backup|Backup}. The full syntax is described at + * https://aip.dev/132#ordering. + * + * Fields supported are: + * + * * name + * * source_table + * * expire_time + * * start_time + * * end_time + * * size_bytes + * * state + * + * For example, "start_time". The default sorting order is ascending. + * To specify descending order for the field, a suffix " desc" should + * be appended to the field name. For example, "start_time desc". + * Redundant space characters in the syntax are insigificant. + * + * If order_by is empty, results will be sorted by `start_time` in descending + * order starting from the most recently created backup. + * @param {number} request.pageSize + * Number of backups to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.bigtable.admin.v2.ListBackupsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.bigtable.admin.v2.ListBackupsResponse|ListBackupsResponse} to the + * same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.bigtable.admin.v2.Backup|Backup} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupsStream( + request?: protos.google.bigtable.admin.v2.IListBackupsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listBackups stream %j', request); + return this.descriptors.page.listBackups.createStream( + this.innerApiCalls.listBackups as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listBackups`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The cluster to list backups from. Values are of the + * form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * Use `{cluster} = '-'` to list backups for all clusters in an instance, + * e.g., `projects/{project}/instances/{instance}/clusters/-`. + * @param {string} request.filter + * A filter expression that filters backups listed in the response. + * The expression must specify the field name, a comparison operator, + * and the value that you want to use for filtering. The value must be a + * string, a number, or a boolean. The comparison operator must be + * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is + * roughly synonymous with equality. Filter rules are case insensitive. + * + * The fields eligible for filtering are: + * + * * `name` + * * `source_table` + * * `state` + * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `size_bytes` + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. By default, each expression is an AND expression. However, + * you can include AND, OR, and NOT expressions explicitly. + * + * Some examples of using filters are: + * + * * `name:"exact"` --> The backup's name is the string "exact". + * * `name:howl` --> The backup's name contains the string "howl". + * * `source_table:prod` + * --> The source_table's name contains the string "prod". + * * `state:CREATING` --> The backup is pending creation. + * * `state:READY` --> The backup is fully created and ready for use. + * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` + * --> The backup name contains the string "howl" and start_time + * of the backup is before 2018-03-28T14:50:00Z. + * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB + * @param {string} request.orderBy + * An expression for specifying the sort order of the results of the request. + * The string value should specify one or more fields in + * {@link protos.google.bigtable.admin.v2.Backup|Backup}. The full syntax is described at + * https://aip.dev/132#ordering. + * + * Fields supported are: + * + * * name + * * source_table + * * expire_time + * * start_time + * * end_time + * * size_bytes + * * state + * + * For example, "start_time". The default sorting order is ascending. + * To specify descending order for the field, a suffix " desc" should + * be appended to the field name. For example, "start_time desc". + * Redundant space characters in the syntax are insigificant. + * + * If order_by is empty, results will be sorted by `start_time` in descending + * order starting from the most recently created backup. + * @param {number} request.pageSize + * Number of backups to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.bigtable.admin.v2.ListBackupsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.bigtable.admin.v2.ListBackupsResponse|ListBackupsResponse} to the + * same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.bigtable.admin.v2.Backup|Backup}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_async + */ + listBackupsAsync( + request?: protos.google.bigtable.admin.v2.IListBackupsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listBackups iterate %j', request); + return this.descriptors.page.listBackups.asyncIterate( + this.innerApiCalls['listBackups'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists all schema bundles associated with the specified table. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of schema bundles. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {number} request.pageSize + * The maximum number of schema bundles to return. If the value is positive, + * the server may return at most this value. If unspecified, the server will + * return the maximum allowed page size. + * @param {string} request.pageToken + * A page token, received from a previous `ListSchemaBundles` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSchemaBundles` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.bigtable.admin.v2.SchemaBundle|SchemaBundle}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSchemaBundlesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSchemaBundles( + request?: protos.google.bigtable.admin.v2.IListSchemaBundlesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.admin.v2.ISchemaBundle[], + protos.google.bigtable.admin.v2.IListSchemaBundlesRequest | null, + protos.google.bigtable.admin.v2.IListSchemaBundlesResponse, + ] + >; + listSchemaBundles( + request: protos.google.bigtable.admin.v2.IListSchemaBundlesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListSchemaBundlesRequest, + | protos.google.bigtable.admin.v2.IListSchemaBundlesResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ISchemaBundle + >, + ): void; + listSchemaBundles( + request: protos.google.bigtable.admin.v2.IListSchemaBundlesRequest, + callback: PaginationCallback< + protos.google.bigtable.admin.v2.IListSchemaBundlesRequest, + | protos.google.bigtable.admin.v2.IListSchemaBundlesResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ISchemaBundle + >, + ): void; + listSchemaBundles( + request?: protos.google.bigtable.admin.v2.IListSchemaBundlesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.bigtable.admin.v2.IListSchemaBundlesRequest, + | protos.google.bigtable.admin.v2.IListSchemaBundlesResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ISchemaBundle + >, + callback?: PaginationCallback< + protos.google.bigtable.admin.v2.IListSchemaBundlesRequest, + | protos.google.bigtable.admin.v2.IListSchemaBundlesResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ISchemaBundle + >, + ): Promise< + [ + protos.google.bigtable.admin.v2.ISchemaBundle[], + protos.google.bigtable.admin.v2.IListSchemaBundlesRequest | null, + protos.google.bigtable.admin.v2.IListSchemaBundlesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.bigtable.admin.v2.IListSchemaBundlesRequest, + | protos.google.bigtable.admin.v2.IListSchemaBundlesResponse + | null + | undefined, + protos.google.bigtable.admin.v2.ISchemaBundle + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSchemaBundles values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSchemaBundles request %j', request); + return this.innerApiCalls + .listSchemaBundles(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.bigtable.admin.v2.ISchemaBundle[], + protos.google.bigtable.admin.v2.IListSchemaBundlesRequest | null, + protos.google.bigtable.admin.v2.IListSchemaBundlesResponse, + ]) => { + this._log.info('listSchemaBundles values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSchemaBundles`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of schema bundles. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {number} request.pageSize + * The maximum number of schema bundles to return. If the value is positive, + * the server may return at most this value. If unspecified, the server will + * return the maximum allowed page size. + * @param {string} request.pageToken + * A page token, received from a previous `ListSchemaBundles` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSchemaBundles` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.bigtable.admin.v2.SchemaBundle|SchemaBundle} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSchemaBundlesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSchemaBundlesStream( + request?: protos.google.bigtable.admin.v2.IListSchemaBundlesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSchemaBundles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listSchemaBundles stream %j', request); + return this.descriptors.page.listSchemaBundles.createStream( + this.innerApiCalls.listSchemaBundles as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSchemaBundles`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of schema bundles. + * Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @param {number} request.pageSize + * The maximum number of schema bundles to return. If the value is positive, + * the server may return at most this value. If unspecified, the server will + * return the maximum allowed page size. + * @param {string} request.pageToken + * A page token, received from a previous `ListSchemaBundles` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSchemaBundles` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.bigtable.admin.v2.SchemaBundle|SchemaBundle}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_ListSchemaBundles_async + */ + listSchemaBundlesAsync( + request?: protos.google.bigtable.admin.v2.IListSchemaBundlesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSchemaBundles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listSchemaBundles iterate %j', request); + return this.descriptors.page.listSchemaBundles.asyncIterate( + this.innerApiCalls['listSchemaBundles'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified appProfile resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} app_profile + * @returns {string} Resource name string. + */ + appProfilePath(project: string, instance: string, appProfile: string) { + return this.pathTemplates.appProfilePathTemplate.render({ + project: project, + instance: instance, + app_profile: appProfile, + }); + } + + /** + * Parse the project from AppProfile resource. + * + * @param {string} appProfileName + * A fully-qualified path representing AppProfile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppProfileName(appProfileName: string) { + return this.pathTemplates.appProfilePathTemplate.match(appProfileName) + .project; + } + + /** + * Parse the instance from AppProfile resource. + * + * @param {string} appProfileName + * A fully-qualified path representing AppProfile resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromAppProfileName(appProfileName: string) { + return this.pathTemplates.appProfilePathTemplate.match(appProfileName) + .instance; + } + + /** + * Parse the app_profile from AppProfile resource. + * + * @param {string} appProfileName + * A fully-qualified path representing AppProfile resource. + * @returns {string} A string representing the app_profile. + */ + matchAppProfileFromAppProfileName(appProfileName: string) { + return this.pathTemplates.appProfilePathTemplate.match(appProfileName) + .app_profile; + } + + /** + * Return a fully-qualified authorizedView resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} table + * @param {string} authorized_view + * @returns {string} Resource name string. + */ + authorizedViewPath( + project: string, + instance: string, + table: string, + authorizedView: string, + ) { + return this.pathTemplates.authorizedViewPathTemplate.render({ + project: project, + instance: instance, + table: table, + authorized_view: authorizedView, + }); + } + + /** + * Parse the project from AuthorizedView resource. + * + * @param {string} authorizedViewName + * A fully-qualified path representing AuthorizedView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthorizedViewName(authorizedViewName: string) { + return this.pathTemplates.authorizedViewPathTemplate.match( + authorizedViewName, + ).project; + } + + /** + * Parse the instance from AuthorizedView resource. + * + * @param {string} authorizedViewName + * A fully-qualified path representing AuthorizedView resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromAuthorizedViewName(authorizedViewName: string) { + return this.pathTemplates.authorizedViewPathTemplate.match( + authorizedViewName, + ).instance; + } + + /** + * Parse the table from AuthorizedView resource. + * + * @param {string} authorizedViewName + * A fully-qualified path representing AuthorizedView resource. + * @returns {string} A string representing the table. + */ + matchTableFromAuthorizedViewName(authorizedViewName: string) { + return this.pathTemplates.authorizedViewPathTemplate.match( + authorizedViewName, + ).table; + } + + /** + * Parse the authorized_view from AuthorizedView resource. + * + * @param {string} authorizedViewName + * A fully-qualified path representing AuthorizedView resource. + * @returns {string} A string representing the authorized_view. + */ + matchAuthorizedViewFromAuthorizedViewName(authorizedViewName: string) { + return this.pathTemplates.authorizedViewPathTemplate.match( + authorizedViewName, + ).authorized_view; + } + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} cluster + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath( + project: string, + instance: string, + cluster: string, + backup: string, + ) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + instance: instance, + cluster: cluster, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the instance from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).instance; + } + + /** + * Parse the cluster from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).cluster; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project: string, instance: string, cluster: string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + instance: instance, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the instance from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).instance; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified hotTablet resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} cluster + * @param {string} hot_tablet + * @returns {string} Resource name string. + */ + hotTabletPath( + project: string, + instance: string, + cluster: string, + hotTablet: string, + ) { + return this.pathTemplates.hotTabletPathTemplate.render({ + project: project, + instance: instance, + cluster: cluster, + hot_tablet: hotTablet, + }); + } + + /** + * Parse the project from HotTablet resource. + * + * @param {string} hotTabletName + * A fully-qualified path representing HotTablet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHotTabletName(hotTabletName: string) { + return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName) + .project; + } + + /** + * Parse the instance from HotTablet resource. + * + * @param {string} hotTabletName + * A fully-qualified path representing HotTablet resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromHotTabletName(hotTabletName: string) { + return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName) + .instance; + } + + /** + * Parse the cluster from HotTablet resource. + * + * @param {string} hotTabletName + * A fully-qualified path representing HotTablet resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromHotTabletName(hotTabletName: string) { + return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName) + .cluster; + } + + /** + * Parse the hot_tablet from HotTablet resource. + * + * @param {string} hotTabletName + * A fully-qualified path representing HotTablet resource. + * @returns {string} A string representing the hot_tablet. + */ + matchHotTabletFromHotTabletName(hotTabletName: string) { + return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName) + .hot_tablet; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project: string, instance: string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified logicalView resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} logical_view + * @returns {string} Resource name string. + */ + logicalViewPath(project: string, instance: string, logicalView: string) { + return this.pathTemplates.logicalViewPathTemplate.render({ + project: project, + instance: instance, + logical_view: logicalView, + }); + } + + /** + * Parse the project from LogicalView resource. + * + * @param {string} logicalViewName + * A fully-qualified path representing LogicalView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLogicalViewName(logicalViewName: string) { + return this.pathTemplates.logicalViewPathTemplate.match(logicalViewName) + .project; + } + + /** + * Parse the instance from LogicalView resource. + * + * @param {string} logicalViewName + * A fully-qualified path representing LogicalView resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromLogicalViewName(logicalViewName: string) { + return this.pathTemplates.logicalViewPathTemplate.match(logicalViewName) + .instance; + } + + /** + * Parse the logical_view from LogicalView resource. + * + * @param {string} logicalViewName + * A fully-qualified path representing LogicalView resource. + * @returns {string} A string representing the logical_view. + */ + matchLogicalViewFromLogicalViewName(logicalViewName: string) { + return this.pathTemplates.logicalViewPathTemplate.match(logicalViewName) + .logical_view; + } + + /** + * Return a fully-qualified materializedView resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} materialized_view + * @returns {string} Resource name string. + */ + materializedViewPath( + project: string, + instance: string, + materializedView: string, + ) { + return this.pathTemplates.materializedViewPathTemplate.render({ + project: project, + instance: instance, + materialized_view: materializedView, + }); + } + + /** + * Parse the project from MaterializedView resource. + * + * @param {string} materializedViewName + * A fully-qualified path representing MaterializedView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMaterializedViewName(materializedViewName: string) { + return this.pathTemplates.materializedViewPathTemplate.match( + materializedViewName, + ).project; + } + + /** + * Parse the instance from MaterializedView resource. + * + * @param {string} materializedViewName + * A fully-qualified path representing MaterializedView resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromMaterializedViewName(materializedViewName: string) { + return this.pathTemplates.materializedViewPathTemplate.match( + materializedViewName, + ).instance; + } + + /** + * Parse the materialized_view from MaterializedView resource. + * + * @param {string} materializedViewName + * A fully-qualified path representing MaterializedView resource. + * @returns {string} A string representing the materialized_view. + */ + matchMaterializedViewFromMaterializedViewName(materializedViewName: string) { + return this.pathTemplates.materializedViewPathTemplate.match( + materializedViewName, + ).materialized_view; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified schemaBundle resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} table + * @param {string} schema_bundle + * @returns {string} Resource name string. + */ + schemaBundlePath( + project: string, + instance: string, + table: string, + schemaBundle: string, + ) { + return this.pathTemplates.schemaBundlePathTemplate.render({ + project: project, + instance: instance, + table: table, + schema_bundle: schemaBundle, + }); + } + + /** + * Parse the project from SchemaBundle resource. + * + * @param {string} schemaBundleName + * A fully-qualified path representing SchemaBundle resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSchemaBundleName(schemaBundleName: string) { + return this.pathTemplates.schemaBundlePathTemplate.match(schemaBundleName) + .project; + } + + /** + * Parse the instance from SchemaBundle resource. + * + * @param {string} schemaBundleName + * A fully-qualified path representing SchemaBundle resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromSchemaBundleName(schemaBundleName: string) { + return this.pathTemplates.schemaBundlePathTemplate.match(schemaBundleName) + .instance; + } + + /** + * Parse the table from SchemaBundle resource. + * + * @param {string} schemaBundleName + * A fully-qualified path representing SchemaBundle resource. + * @returns {string} A string representing the table. + */ + matchTableFromSchemaBundleName(schemaBundleName: string) { + return this.pathTemplates.schemaBundlePathTemplate.match(schemaBundleName) + .table; + } + + /** + * Parse the schema_bundle from SchemaBundle resource. + * + * @param {string} schemaBundleName + * A fully-qualified path representing SchemaBundle resource. + * @returns {string} A string representing the schema_bundle. + */ + matchSchemaBundleFromSchemaBundleName(schemaBundleName: string) { + return this.pathTemplates.schemaBundlePathTemplate.match(schemaBundleName) + .schema_bundle; + } + + /** + * Return a fully-qualified snapshot resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} cluster + * @param {string} snapshot + * @returns {string} Resource name string. + */ + snapshotPath( + project: string, + instance: string, + cluster: string, + snapshot: string, + ) { + return this.pathTemplates.snapshotPathTemplate.render({ + project: project, + instance: instance, + cluster: cluster, + snapshot: snapshot, + }); + } + + /** + * Parse the project from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; + } + + /** + * Parse the instance from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).instance; + } + + /** + * Parse the cluster from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).cluster; + } + + /** + * Parse the snapshot from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the snapshot. + */ + matchSnapshotFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; + } + + /** + * Return a fully-qualified table resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} table + * @returns {string} Resource name string. + */ + tablePath(project: string, instance: string, table: string) { + return this.pathTemplates.tablePathTemplate.render({ + project: project, + instance: instance, + table: table, + }); + } + + /** + * Parse the project from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).project; + } + + /** + * Parse the instance from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).instance; + } + + /** + * Parse the table from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the table. + */ + matchTableFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).table; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.bigtableTableAdminStub && !this._terminated) { + return this.bigtableTableAdminStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/handwritten/bigtable/src/admin/v2/bigtable_table_admin_client_config.json b/handwritten/bigtable/src/admin/v2/bigtable_table_admin_client_config.json new file mode 100644 index 00000000000..57ad564bfe3 --- /dev/null +++ b/handwritten/bigtable/src/admin/v2/bigtable_table_admin_client_config.json @@ -0,0 +1,195 @@ +{ + "interfaces": { + "google.bigtable.admin.v2.BigtableTableAdmin": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "264268458a9e88347dbacbd9398202ff5885a40b": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateTable": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTableFromSnapshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTables": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "GetTable": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "UpdateTable": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTable": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeleteTable": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAuthorizedView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAuthorizedViews": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAuthorizedView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAuthorizedView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAuthorizedView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ModifyColumnFamilies": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DropRowRange": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GenerateConsistencyToken": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "CheckConsistency": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "SnapshotTable": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ListSnapshots": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "DeleteSnapshot": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackup": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "RestoreTable": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CopyBackup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "CreateSchemaBundle": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSchemaBundle": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSchemaBundle": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSchemaBundles": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSchemaBundle": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/handwritten/bigtable/src/admin/v2/bigtable_table_admin_proto_list.json b/handwritten/bigtable/src/admin/v2/bigtable_table_admin_proto_list.json new file mode 100644 index 00000000000..64ece0d4cc4 --- /dev/null +++ b/handwritten/bigtable/src/admin/v2/bigtable_table_admin_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../../protos/google/bigtable/admin/v2/bigtable_instance_admin.proto", + "../../../protos/google/bigtable/admin/v2/bigtable_table_admin.proto", + "../../../protos/google/bigtable/admin/v2/common.proto", + "../../../protos/google/bigtable/admin/v2/instance.proto", + "../../../protos/google/bigtable/admin/v2/table.proto", + "../../../protos/google/bigtable/admin/v2/types.proto" +] diff --git a/handwritten/bigtable/src/admin/v2/gapic_metadata.json b/handwritten/bigtable/src/admin/v2/gapic_metadata.json new file mode 100644 index 00000000000..354d051fa3f --- /dev/null +++ b/handwritten/bigtable/src/admin/v2/gapic_metadata.json @@ -0,0 +1,733 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.bigtable.admin.v2", + "libraryPackage": "@google-cloud/bigtable", + "services": { + "BigtableInstanceAdmin": { + "clients": { + "grpc": { + "libraryClient": "BigtableInstanceAdminClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ListInstances": { + "methods": [ + "listInstances" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "CreateAppProfile": { + "methods": [ + "createAppProfile" + ] + }, + "GetAppProfile": { + "methods": [ + "getAppProfile" + ] + }, + "DeleteAppProfile": { + "methods": [ + "deleteAppProfile" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "GetLogicalView": { + "methods": [ + "getLogicalView" + ] + }, + "DeleteLogicalView": { + "methods": [ + "deleteLogicalView" + ] + }, + "GetMaterializedView": { + "methods": [ + "getMaterializedView" + ] + }, + "DeleteMaterializedView": { + "methods": [ + "deleteMaterializedView" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "PartialUpdateInstance": { + "methods": [ + "partialUpdateInstance" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "PartialUpdateCluster": { + "methods": [ + "partialUpdateCluster" + ] + }, + "UpdateAppProfile": { + "methods": [ + "updateAppProfile" + ] + }, + "CreateLogicalView": { + "methods": [ + "createLogicalView" + ] + }, + "UpdateLogicalView": { + "methods": [ + "updateLogicalView" + ] + }, + "CreateMaterializedView": { + "methods": [ + "createMaterializedView" + ] + }, + "UpdateMaterializedView": { + "methods": [ + "updateMaterializedView" + ] + }, + "ListAppProfiles": { + "methods": [ + "listAppProfiles", + "listAppProfilesStream", + "listAppProfilesAsync" + ] + }, + "ListHotTablets": { + "methods": [ + "listHotTablets", + "listHotTabletsStream", + "listHotTabletsAsync" + ] + }, + "ListLogicalViews": { + "methods": [ + "listLogicalViews", + "listLogicalViewsStream", + "listLogicalViewsAsync" + ] + }, + "ListMaterializedViews": { + "methods": [ + "listMaterializedViews", + "listMaterializedViewsStream", + "listMaterializedViewsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BigtableInstanceAdminClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ListInstances": { + "methods": [ + "listInstances" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "CreateAppProfile": { + "methods": [ + "createAppProfile" + ] + }, + "GetAppProfile": { + "methods": [ + "getAppProfile" + ] + }, + "DeleteAppProfile": { + "methods": [ + "deleteAppProfile" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "GetLogicalView": { + "methods": [ + "getLogicalView" + ] + }, + "DeleteLogicalView": { + "methods": [ + "deleteLogicalView" + ] + }, + "GetMaterializedView": { + "methods": [ + "getMaterializedView" + ] + }, + "DeleteMaterializedView": { + "methods": [ + "deleteMaterializedView" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "PartialUpdateInstance": { + "methods": [ + "partialUpdateInstance" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "PartialUpdateCluster": { + "methods": [ + "partialUpdateCluster" + ] + }, + "UpdateAppProfile": { + "methods": [ + "updateAppProfile" + ] + }, + "CreateLogicalView": { + "methods": [ + "createLogicalView" + ] + }, + "UpdateLogicalView": { + "methods": [ + "updateLogicalView" + ] + }, + "CreateMaterializedView": { + "methods": [ + "createMaterializedView" + ] + }, + "UpdateMaterializedView": { + "methods": [ + "updateMaterializedView" + ] + }, + "ListAppProfiles": { + "methods": [ + "listAppProfiles", + "listAppProfilesStream", + "listAppProfilesAsync" + ] + }, + "ListHotTablets": { + "methods": [ + "listHotTablets", + "listHotTabletsStream", + "listHotTabletsAsync" + ] + }, + "ListLogicalViews": { + "methods": [ + "listLogicalViews", + "listLogicalViewsStream", + "listLogicalViewsAsync" + ] + }, + "ListMaterializedViews": { + "methods": [ + "listMaterializedViews", + "listMaterializedViewsStream", + "listMaterializedViewsAsync" + ] + } + } + } + } + }, + "BigtableTableAdmin": { + "clients": { + "grpc": { + "libraryClient": "BigtableTableAdminClient", + "rpcs": { + "CreateTable": { + "methods": [ + "createTable" + ] + }, + "GetTable": { + "methods": [ + "getTable" + ] + }, + "DeleteTable": { + "methods": [ + "deleteTable" + ] + }, + "GetAuthorizedView": { + "methods": [ + "getAuthorizedView" + ] + }, + "DeleteAuthorizedView": { + "methods": [ + "deleteAuthorizedView" + ] + }, + "ModifyColumnFamilies": { + "methods": [ + "modifyColumnFamilies" + ] + }, + "DropRowRange": { + "methods": [ + "dropRowRange" + ] + }, + "GenerateConsistencyToken": { + "methods": [ + "generateConsistencyToken" + ] + }, + "CheckConsistency": { + "methods": [ + "checkConsistency" + ] + }, + "GetSnapshot": { + "methods": [ + "getSnapshot" + ] + }, + "DeleteSnapshot": { + "methods": [ + "deleteSnapshot" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "GetSchemaBundle": { + "methods": [ + "getSchemaBundle" + ] + }, + "DeleteSchemaBundle": { + "methods": [ + "deleteSchemaBundle" + ] + }, + "CreateTableFromSnapshot": { + "methods": [ + "createTableFromSnapshot" + ] + }, + "UpdateTable": { + "methods": [ + "updateTable" + ] + }, + "UndeleteTable": { + "methods": [ + "undeleteTable" + ] + }, + "CreateAuthorizedView": { + "methods": [ + "createAuthorizedView" + ] + }, + "UpdateAuthorizedView": { + "methods": [ + "updateAuthorizedView" + ] + }, + "SnapshotTable": { + "methods": [ + "snapshotTable" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "RestoreTable": { + "methods": [ + "restoreTable" + ] + }, + "CopyBackup": { + "methods": [ + "copyBackup" + ] + }, + "CreateSchemaBundle": { + "methods": [ + "createSchemaBundle" + ] + }, + "UpdateSchemaBundle": { + "methods": [ + "updateSchemaBundle" + ] + }, + "ListTables": { + "methods": [ + "listTables", + "listTablesStream", + "listTablesAsync" + ] + }, + "ListAuthorizedViews": { + "methods": [ + "listAuthorizedViews", + "listAuthorizedViewsStream", + "listAuthorizedViewsAsync" + ] + }, + "ListSnapshots": { + "methods": [ + "listSnapshots", + "listSnapshotsStream", + "listSnapshotsAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListSchemaBundles": { + "methods": [ + "listSchemaBundles", + "listSchemaBundlesStream", + "listSchemaBundlesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BigtableTableAdminClient", + "rpcs": { + "CreateTable": { + "methods": [ + "createTable" + ] + }, + "GetTable": { + "methods": [ + "getTable" + ] + }, + "DeleteTable": { + "methods": [ + "deleteTable" + ] + }, + "GetAuthorizedView": { + "methods": [ + "getAuthorizedView" + ] + }, + "DeleteAuthorizedView": { + "methods": [ + "deleteAuthorizedView" + ] + }, + "ModifyColumnFamilies": { + "methods": [ + "modifyColumnFamilies" + ] + }, + "DropRowRange": { + "methods": [ + "dropRowRange" + ] + }, + "GenerateConsistencyToken": { + "methods": [ + "generateConsistencyToken" + ] + }, + "CheckConsistency": { + "methods": [ + "checkConsistency" + ] + }, + "GetSnapshot": { + "methods": [ + "getSnapshot" + ] + }, + "DeleteSnapshot": { + "methods": [ + "deleteSnapshot" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "GetSchemaBundle": { + "methods": [ + "getSchemaBundle" + ] + }, + "DeleteSchemaBundle": { + "methods": [ + "deleteSchemaBundle" + ] + }, + "CreateTableFromSnapshot": { + "methods": [ + "createTableFromSnapshot" + ] + }, + "UpdateTable": { + "methods": [ + "updateTable" + ] + }, + "UndeleteTable": { + "methods": [ + "undeleteTable" + ] + }, + "CreateAuthorizedView": { + "methods": [ + "createAuthorizedView" + ] + }, + "UpdateAuthorizedView": { + "methods": [ + "updateAuthorizedView" + ] + }, + "SnapshotTable": { + "methods": [ + "snapshotTable" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "RestoreTable": { + "methods": [ + "restoreTable" + ] + }, + "CopyBackup": { + "methods": [ + "copyBackup" + ] + }, + "CreateSchemaBundle": { + "methods": [ + "createSchemaBundle" + ] + }, + "UpdateSchemaBundle": { + "methods": [ + "updateSchemaBundle" + ] + }, + "ListTables": { + "methods": [ + "listTables", + "listTablesStream", + "listTablesAsync" + ] + }, + "ListAuthorizedViews": { + "methods": [ + "listAuthorizedViews", + "listAuthorizedViewsStream", + "listAuthorizedViewsAsync" + ] + }, + "ListSnapshots": { + "methods": [ + "listSnapshots", + "listSnapshotsStream", + "listSnapshotsAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListSchemaBundles": { + "methods": [ + "listSchemaBundles", + "listSchemaBundlesStream", + "listSchemaBundlesAsync" + ] + } + } + } + } + } + } +} diff --git a/handwritten/bigtable/src/admin/v2/index.ts b/handwritten/bigtable/src/admin/v2/index.ts new file mode 100644 index 00000000000..a9cddbf4e4e --- /dev/null +++ b/handwritten/bigtable/src/admin/v2/index.ts @@ -0,0 +1,20 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 {BigtableInstanceAdminClient} from './bigtable_instance_admin_client'; +export {BigtableTableAdminClient} from './bigtable_table_admin_client'; diff --git a/handwritten/bigtable/src/app-profile.ts b/handwritten/bigtable/src/app-profile.ts new file mode 100644 index 00000000000..1b3f1468184 --- /dev/null +++ b/handwritten/bigtable/src/app-profile.ts @@ -0,0 +1,548 @@ +// 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. + +import {promisifyAll} from '@google-cloud/promisify'; +import * as is from 'is'; +import snakeCase = require('lodash.snakecase'); +import {Cluster} from './cluster'; +import {Bigtable} from '.'; +import {Instance} from './instance'; +import {CallOptions} from 'google-gax'; +import {google} from '../protos/protos'; +import {ServiceError} from 'google-gax'; + +export interface AppProfileOptions { + /** + * The routing policy for all read/write requests which use this app profile. + * This can be either the string 'any' or a cluster of an instance. This + * value is required when creating the app profile and optional when setting + * the metadata. + */ + routing?: 'any' | Cluster | Set | Set; + /** + * Whether or not CheckAndMutateRow and ReadModifyWriteRow requests are + * allowed by this app profile. It is unsafe to send these requests to the + * same table/row/column in multiple clusters. This is only used when the + * routing value is a cluster. + */ + allowTransactionalWrites?: boolean; + /** + * The long form description of the use case for this AppProfile. + */ + description?: string; + /** + * Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + */ + gaxOptions?: CallOptions; + /** + * Whether to ignore safety checks when creating the app profile. + */ + ignoreWarnings?: boolean; +} + +export interface DeleteAppProfileOptions { + /** + * Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions + */ + gaxOptions?: CallOptions; + + /** + * Whether to ignore safety checks when deleting the app profile. + */ + ignoreWarnings?: boolean; +} + +export type CreateAppProfileCallback = ( + err: ServiceError | null, + appProfile?: AppProfile, + apiResponse?: google.bigtable.admin.v2.IAppProfile, +) => void; +export type CreateAppProfileResponse = [ + AppProfile, + google.bigtable.admin.v2.IAppProfile, +]; +export type DeleteAppProfileCallback = ( + err: ServiceError | null, + apiResponse?: google.protobuf.Empty, +) => void; +export type DeleteAppProfileResponse = [google.protobuf.Empty]; +export type AppProfileExistsCallback = ( + err: ServiceError | null, + exists?: boolean, +) => void; +export type AppProfileExistsResponse = [boolean]; +export type GetAppProfileMetadataCallback = ( + err: ServiceError | null, + metadata?: google.bigtable.admin.v2.IAppProfile, + apiResponse?: google.bigtable.admin.v2.IAppProfile, +) => void; +export type GetAppProfileMetadataResponse = [ + google.bigtable.admin.v2.IAppProfile, + google.bigtable.admin.v2.IAppProfile, +]; +export type GetAppProfileCallback = ( + err: ServiceError | null, + appProfile?: AppProfile, + apiResponse?: google.bigtable.admin.v2.IAppProfile, +) => void; +export type GetAppProfileResponse = [ + AppProfile, + google.bigtable.admin.v2.IAppProfile, +]; +export type GetAppProfilesCallback = ( + err: ServiceError | null, + appProfiles?: AppProfile[], + apiResponse?: google.bigtable.admin.v2.IAppProfile[], +) => void; +export type GetAppProfilesResponse = [ + AppProfile[], + google.bigtable.admin.v2.IAppProfile[], +]; +export type SetAppProfileMetadataCallback = ( + err: ServiceError | null, + apiResponse?: google.protobuf.Empty, +) => void; +export type SetAppProfileMetadataResponse = [google.protobuf.Empty]; + +/** + * Create an app profile object to interact with your app profile. + * + * @class + * @param {Instance} instance The parent instance of this app profile. + * @param {string} name Name of the app profile. + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * const appProfile = instance.appProfile('my-app-profile'); + * ``` + */ +export class AppProfile { + bigtable: Bigtable; + instance: Instance; + name: string; + id: string; + metadata?: google.bigtable.admin.v2.IAppProfile; + constructor(instance: Instance, id: string) { + this.bigtable = instance.bigtable; + this.instance = instance; + + let name; + + if (id.includes('/')) { + if (id.startsWith(`${instance.name}/appProfiles/`)) { + name = id; + } else { + throw new Error(`AppProfile id '${id}' is not formatted correctly. +Please use the format 'my-app-profile' or '${instance.name}/appProfiles/my-app-profile'.`); + } + } else { + name = `${instance.name}/appProfiles/${id}`; + } + + this.id = name.split('/').pop()!; + this.name = name; + } + + /** + * Formats a app profile options object into proto format. + * + * @private + * + * @param {object} options The options object. + * @returns {object} + * + * @example + * ``` + * // Any cluster routing: + * Family.formatAppProfile_({ + * routing: 'any', + * description: 'My App Profile', + * }); + * // { + * // multiClusterRoutingUseAny: {}, + * // description: 'My App Profile', + * // } + * + * // Single cluster routing: + * const cluster = myInstance.cluster('my-cluster'); + * Family.formatAppProfile_({ + * routing: cluster, + * allowTransactionalWrites: true, + * description: 'My App Profile', + * }); + * // { + * // singleClusterRouting: { + * // clusterId: 'my-cluster', + * // allowTransactionalWrites: true, + * // }, + * // description: 'My App Profile', + * // } + * ``` + */ + static formatAppProfile_( + options: AppProfileOptions, + ): google.bigtable.admin.v2.IAppProfile { + const appProfile: google.bigtable.admin.v2.IAppProfile = {}; + + const errMessage = + 'An app profile routing policy can only contain "any" for multi cluster routing, a `Cluster` for single routing, or a set of clusterIds as strings or `Clusters` for multi cluster routing.'; + if (options.routing) { + if (options.routing === 'any') { + appProfile.multiClusterRoutingUseAny = {}; + } else if (options.routing instanceof Set) { + const routingAsArray = [...options.routing]; + if (isClusterArray(routingAsArray)) { + // Runs if routing is a set and every element in it is a cluster + appProfile.multiClusterRoutingUseAny = { + clusterIds: routingAsArray.map(cluster => cluster.id), + }; + } else if (isStringArray(routingAsArray)) { + // Runs if routing is a set and every element in it is a string + appProfile.multiClusterRoutingUseAny = { + clusterIds: routingAsArray, + }; + } else { + throw new Error(errMessage); + } + } else if (options.routing instanceof Cluster) { + appProfile.singleClusterRouting = { + clusterId: options.routing.id, + }; + if (is.boolean(options.allowTransactionalWrites)) { + appProfile.singleClusterRouting.allowTransactionalWrites = + options.allowTransactionalWrites; + } + } else { + throw new Error(errMessage); + } + } + + if (is.string(options.description)) { + appProfile.description = options.description; + } + + return appProfile; + } + + create(options: AppProfileOptions): Promise; + create(options: AppProfileOptions, callback: CreateAppProfileCallback): void; + create(callback: CreateAppProfileCallback): void; + /** + * Create an app profile. + * + * @param {object} [options] See {@link Instance#createAppProfile}. + * + * @example + * ``` + * + * region_tag:bigtable_api_create_app_profile + * ``` + */ + create( + optionsOrCallback?: AppProfileOptions | CreateAppProfileCallback, + cb?: CreateAppProfileCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + this.instance.createAppProfile(this.id, options, callback); + } + + delete(options?: DeleteAppProfileOptions): Promise; + delete( + options: DeleteAppProfileOptions, + callback: DeleteAppProfileCallback, + ): void; + delete(callback: DeleteAppProfileCallback): void; + /** + * Delete the app profile. + * + * @param {object} [options] Cluster creation options. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {boolean} [options.ignoreWarnings] Whether to ignore safety checks + * when deleting the app profile. + * @param {function} [callback] The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * ``` + * + * region_tag:bigtable_api_delete_app_profile + * ``` + */ + delete( + optionsOrCallback?: DeleteAppProfileOptions | DeleteAppProfileCallback, + cb?: DeleteAppProfileCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + + const reqOpts = { + name: this.name, + } as google.bigtable.admin.v2.IDeleteAppProfileRequest; + + if (is.boolean(options.ignoreWarnings)) { + reqOpts.ignoreWarnings = options.ignoreWarnings; + } + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'deleteAppProfile', + reqOpts, + gaxOpts: options.gaxOptions, + }, + callback, + ); + } + + exists(options?: CallOptions): Promise; + exists(options: CallOptions, callback: AppProfileExistsCallback): void; + exists(callback: AppProfileExistsCallback): void; + /** + * Check if an app profile exists. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {boolean} callback.exists Whether the app profile exists or not. + * + * @example + * ``` + * + * region_tag:bigtable_api_exists_app_profile + * ``` + */ + exists( + optionsOrCallback?: CallOptions | AppProfileExistsCallback, + cb?: AppProfileExistsCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + this.getMetadata(gaxOptions, err => { + if (err) { + if (err.code === 5) { + callback(null, false); + return; + } + callback(err); + return; + } + callback(null, true); + }); + } + + get(options?: CallOptions): Promise; + get(options: CallOptions, callback: GetAppProfileCallback): void; + get(callback: GetAppProfileCallback): void; + /** + * Get a appProfile if it exists. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * + * @example + * ``` + * + * region_tag:bigtable_api_get_app_profile + * ``` + */ + get( + optionsOrCallback?: CallOptions | GetAppProfileCallback, + cb?: GetAppProfileCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + this.getMetadata(gaxOptions, (err, metadata) => { + if (err) { + callback(err, undefined, metadata); + } else { + callback(null, this, metadata); + } + }); + } + + getMetadata(options?: CallOptions): Promise; + getMetadata( + options: CallOptions, + callback: GetAppProfileMetadataCallback, + ): void; + getMetadata(callback: GetAppProfileMetadataCallback): void; + /** + * Get the app profile metadata. + * + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.metadata The metadata. + * @param {object} callback.apiResponse The full API response. + * + * @example + * ``` + * + * region_tag:bigtable_api_app_profile_get_meta + * ``` + */ + getMetadata( + optionsOrCallback?: CallOptions | GetAppProfileMetadataCallback, + cb?: GetAppProfileMetadataCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'getAppProfile', + reqOpts: { + name: this.name, + }, + gaxOpts: gaxOptions, + }, + (err, resp) => { + if (resp) { + this.metadata = resp; + } + callback(err, resp, resp); + }, + ); + } + + setMetadata( + metadata: AppProfileOptions, + options?: CallOptions, + ): Promise; + setMetadata( + metadata: AppProfileOptions, + options: CallOptions, + callback: SetAppProfileMetadataCallback, + ): void; + setMetadata( + metadata: AppProfileOptions, + callback: SetAppProfileMetadataCallback, + ): void; + /** + * Set the app profile metadata. + * + * @param {object} metadata See {@link Instance#createAppProfile} for the + * available metadata options. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * ``` + * + * region_tag:bigtable_api_app_profile_set_meta + * ``` + */ + setMetadata( + metadata: AppProfileOptions, + optionsOrCallback?: CallOptions | SetAppProfileMetadataCallback, + cb?: SetAppProfileMetadataCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const reqOpts = { + appProfile: AppProfile.formatAppProfile_(metadata as AppProfileOptions), + updateMask: { + paths: [], + }, + } as google.bigtable.admin.v2.IUpdateAppProfileRequest; + reqOpts.appProfile!.name = this.name; + const fieldsForMask = [ + 'description', + 'singleClusterRouting', + 'multiClusterRoutingUseAny', + 'allowTransactionalWrites', + ]; + fieldsForMask.forEach(field => { + if ((reqOpts.appProfile as {[index: string]: string})![field]) { + reqOpts.updateMask!.paths!.push(snakeCase(field)); + } + }); + + if (is.boolean(metadata.ignoreWarnings)) { + reqOpts.ignoreWarnings = metadata.ignoreWarnings; + } + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'updateAppProfile', + reqOpts, + gaxOpts: gaxOptions, + }, + callback, + ); + } +} + +function isStringArray(array: any): array is string[] { + return array.every((cluster: any) => { + return typeof cluster === 'string'; + }); +} + +function isClusterArray(array: any): array is Cluster[] { + return array.every((cluster: any) => { + return isCluster(cluster); + }); +} + +function isCluster(cluster: any): cluster is Cluster { + return ( + (cluster as Cluster).bigtable !== undefined && + (cluster as Cluster).instance !== undefined && + (cluster as Cluster).id !== undefined && + (cluster as Cluster).name !== undefined + ); +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(AppProfile); + +/** + * Reference to the {@link AppProfile} class. + * @name module:@google-cloud/bigtable.AppProfile + * @see AppProfile + */ diff --git a/handwritten/bigtable/src/authorized-view.ts b/handwritten/bigtable/src/authorized-view.ts new file mode 100644 index 00000000000..13065a2a378 --- /dev/null +++ b/handwritten/bigtable/src/authorized-view.ts @@ -0,0 +1,260 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {TabularApiSurface} from './tabular-api-surface'; +import {CallOptions} from 'google-gax'; +import { + CreateRulesCallback, + CreateRulesResponse, + FilterCallback, + FilterConfig, + FilterResponse, + IncrementCallback, + IncrementResponse, + Rule, +} from './row'; +import {RowDataUtils, RowProperties} from './row-data-utils'; +import {RawFilter} from './filter'; +import {Family} from './chunktransformer'; +import {Instance} from './instance'; +import {promisifyAll} from '@google-cloud/promisify'; + +interface FilterInformation { + filter: RawFilter; + rowId: string; +} + +interface CreateRulesInformation { + rules: Rule | Rule[]; + rowId: string; +} + +interface IncrementInformation { + column: string; + rowId: string; +} + +/** + * The AuthorizedView class is a class that is available to the user that + * contains methods the user can call to work with authorized views. + * + * @class + * @param {Table} table The table that the authorized view exists on. + * @param {string} id Unique identifier of the authorized view. + * + */ +export class AuthorizedView extends TabularApiSurface { + private readonly rowData: {[id: string]: {[index: string]: Family}}; + + constructor(instance: Instance, tableName: string, viewName: string) { + super(instance, tableName, viewName); + this.rowData = {}; + } + + createRules( + createRulesInfo: CreateRulesInformation, + options?: CallOptions, + ): Promise; + createRules( + createRulesInfo: CreateRulesInformation, + options: CallOptions, + callback: CreateRulesCallback, + ): void; + createRules( + createRulesInfo: CreateRulesInformation, + callback: CreateRulesCallback, + ): void; + /** + * Update a row with rules specifying how the row's contents are to be + * transformed into writes. Rules are applied in order, meaning that earlier + * rules will affect the results of later ones. + * + * @throws {error} If no rules are provided. + * + * @param {CreateRulesInformation} createRulesInfo The rules to apply to a row + * along with the row id of the row to update. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_create_rules + */ + createRules( + createRulesInfo: CreateRulesInformation, + optionsOrCallback?: CallOptions | CreateRulesCallback, + cb?: CreateRulesCallback, + ): void | Promise { + this.initializeRow(createRulesInfo.rowId); + RowDataUtils.createRulesUtil( + createRulesInfo.rules, + this.generateProperties(createRulesInfo.rowId), + optionsOrCallback, + cb, + ); + } + + /** + * Mutates a row atomically based on the output of a filter. Depending on + * whether or not any results are yielded, either the `onMatch` or `onNoMatch` + * callback will be executed. + * + * @param {FilterInformation} filter Filter to be applied to the contents of + * the row along with the row id of the affected row. + * @param {object} config Configuration object. + * @param {?object[]} config.onMatch A list of entries to be ran if a match is + * found. + * @param {object[]} [config.onNoMatch] A list of entries to be ran if no + * matches are found. + * @param {object} [config.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {boolean} callback.matched Whether a match was found or not. + * + * @example + * region_tag:bigtable_api_row_filter + */ + filter( + filterInfo: FilterInformation, + config?: FilterConfig, + ): Promise; + filter( + filterInfo: FilterInformation, + config: FilterConfig, + callback: FilterCallback, + ): void; + filter(filterInfo: FilterInformation, callback: FilterCallback): void; + filter( + filterInfo: FilterInformation, + configOrCallback?: FilterConfig | FilterCallback, + cb?: FilterCallback, + ): void | Promise { + this.initializeRow(filterInfo.rowId); + RowDataUtils.filterUtil( + filterInfo.filter, + this.generateProperties(filterInfo.rowId), + configOrCallback, + cb, + ); + } + + /** + * Generates request properties necessary for making an rpc call for an + * authorized view. + * + * @param {string} id The row id to generate the properties for. + * @private + */ + private generateProperties(id: string): RowProperties { + return { + requestData: { + data: this.rowData[id], + id, + table: this, + bigtable: this.bigtable, + }, + reqOpts: { + authorizedViewName: this.name + '/authorizedViews/' + this.viewName, + }, + }; + } + + increment( + columnInfo: IncrementInformation, + value?: number, + ): Promise; + increment( + columnInfo: IncrementInformation, + value: number, + options?: CallOptions, + ): Promise; + increment( + columnInfo: IncrementInformation, + options?: CallOptions, + ): Promise; + increment( + columnInfo: IncrementInformation, + value: number, + options: CallOptions, + callback: IncrementCallback, + ): void; + increment( + columnInfo: IncrementInformation, + value: number, + callback: IncrementCallback, + ): void; + increment( + columnInfo: IncrementInformation, + options: CallOptions, + callback: IncrementCallback, + ): void; + increment( + columnInfo: IncrementInformation, + callback: IncrementCallback, + ): void; + /** + * Increment a specific column within the row. If the column does not + * exist, it is automatically initialized to 0 before being incremented. + * + * @param {IncrementInformation} columnInfo The column we are incrementing a + * value in along with the row id of the affected row. + * @param {number} [value] The amount to increment by, defaults to 1. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {number} callback.value The updated value of the column. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_row_increment + */ + increment( + columnInfo: IncrementInformation, + valueOrOptionsOrCallback?: number | CallOptions | IncrementCallback, + optionsOrCallback?: CallOptions | IncrementCallback, + cb?: IncrementCallback, + ): void | Promise { + this.initializeRow(columnInfo.rowId); + RowDataUtils.incrementUtils( + columnInfo.column, + this.generateProperties(columnInfo.rowId), + valueOrOptionsOrCallback, + optionsOrCallback, + cb, + ); + } + + /** + * Sets the row data for a particular row to an empty object + * + * @param {string} id An string with the key of the row to initialize. + * @private + */ + private initializeRow(id: string) { + if (!this.rowData[id]) { + this.rowData[id] = {}; + } + } +} + +promisifyAll(AuthorizedView, { + exclude: ['initializeRow', 'generateProperties'], +}); diff --git a/handwritten/bigtable/src/backup.ts b/handwritten/bigtable/src/backup.ts new file mode 100644 index 00000000000..f20109a4698 --- /dev/null +++ b/handwritten/bigtable/src/backup.ts @@ -0,0 +1,796 @@ +// 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. + +import {PreciseDate} from '@google-cloud/precise-date'; +import {promisifyAll} from '@google-cloud/promisify'; +import snakeCase = require('lodash.snakecase'); +import {google} from '../protos/protos'; +import { + Bigtable, + Cluster, + GetIamPolicyCallback, + GetIamPolicyOptions, + GetIamPolicyResponse, + Policy, + SetIamPolicyCallback, + SetIamPolicyResponse, + TestIamPermissionsCallback, + TestIamPermissionsResponse, +} from './'; +import {Table} from '../src/table'; +import { + CreateBackupConfig, + CreateBackupCallback, + CreateBackupResponse, + IOperation, +} from './cluster'; +import {CallOptions, LROperation, Operation, ServiceError} from 'google-gax'; +import {Instance} from './instance'; +import {ClusterUtils} from './utils/cluster'; + +export type CopyBackupResponse = GenericBackupPromise; +export type CopyBackupCallback = GenericBackupCallback; +export interface CopyBackupConfig extends ModifiableBackupFields { + cluster: Cluster; + gaxOptions?: CallOptions; + id: string; +} + +type IEmpty = google.protobuf.IEmpty; +export type IBackup = google.bigtable.admin.v2.IBackup; + +export type BackupTimestamp = google.protobuf.ITimestamp | PreciseDate | Date; +export interface ModifiableBackupFields { + /** + * The ITimestamp (Date or PreciseDate will be converted) representing + * when the backup will automatically be deleted. This must be at a + * minimum 6 hours from the time of the backup request and a maximum of 30 + * days. + */ + expireTime?: BackupTimestamp; +} + +export interface GenericBackupCallback { + ( + err?: ServiceError | null, + backup?: Backup | null, + apiResponse?: T | null, + ): void; +} +export type GenericBackupPromise = [Backup, T]; + +export type DeleteBackupCallback = ( + err: ServiceError | null, + apiResponse?: IEmpty, +) => void; +export type DeleteBackupResponse = [IEmpty]; + +export type BackupExistsCallback = ( + err: ServiceError | null, + exists?: boolean, +) => void; +export type BackupExistsResponse = [boolean]; + +export type GetBackupCallback = GenericBackupCallback; +export type GetBackupResponse = [Backup, IBackup]; + +export type BackupGetMetadataCallback = ( + err?: ServiceError | null, + metadata?: IBackup | null, +) => void; +export type BackupGetMetadataResponse = [IBackup]; + +export type BackupSetMetadataCallback = ( + err: ServiceError | null, + metadata: IBackup, + resp: IBackup, +) => void; +export type BackupSetMetadataResponse = [IBackup, IBackup]; + +export interface RestoreTableConfig { + tableId: string; + instance?: Instance | string; + gaxOptions?: CallOptions; +} + +export type RestoreTableCallback = ( + err: ServiceError | null, + table?: Table, + operation?: Operation, + apiResponse?: IOperation, +) => void; +export type RestoreTableResponse = [Table, Operation, IOperation]; + +export interface GetBackupsOptions { + /** + * A filter expression that filters backups listed in the response. The + * expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be <, >, <=, >=, !=, =, + * or :. Colon ‘:’ represents a HAS operator which is roughly synonymous with + * equality. Filter rules are case insensitive. + */ + filter?: string; + + /** + * An expression for specifying the sort order of the results of the request. + * The string value should specify one or more fields in + * {@link google.bigtable.admin.v2.Backup|Backup}. The full syntax is + * described at https://aip.dev/132#ordering. + */ + orderBy?: string; + + gaxOptions?: CallOptions; + + pageSize?: number; + pageToken?: string; + autoPaginate?: boolean; +} + +export type GetBackupsResponse = [ + Backup[], + GetBackupsOptions, + google.bigtable.admin.v2.IListBackupsResponse, +]; +export type GetBackupsCallback = ( + err: ServiceError | null, + backups?: Backup[], + nextQuery?: GetBackupsOptions, + apiResponse?: google.bigtable.admin.v2.IListBackupsResponse, +) => void; + +/** + * Interact with backups like get detailed information from BigTable, create + * a backup, or restore a backup to a table. + * + * @class + * @param {Cluster} cluster The parent instance of this backup. + * @param {string} name Name of the backup. + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * const cluster = instance.cluster('my-cluster'); + * const backup = cluster.backup('my-backup'); + * ``` + */ +export class Backup { + bigtable: Bigtable; + cluster: Cluster; + + /** + * A unique backup string, e.g. "my-backup". + */ + id: string; + + /** + * The full path of the backup which is in the form of: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + */ + name: string; + metadata?: IBackup; + + /** + * @param {Cluster} cluster + * @param {string} id The backup name or id. + */ + constructor(cluster: Cluster, id: string) { + this.bigtable = cluster.bigtable; + this.cluster = cluster; + + if (id.includes('/')) { + if (id.startsWith(cluster.name)) { + this.name = id; + this.id = id.split('/').pop()!; + } else { + throw new Error(`Backup id '${id}' is not formatted correctly. +Please use the format 'my-backup' or '${cluster.name}/backups/my-backup'.`); + } + } else { + this.name = `${this.cluster.name}/backups/${id}`; + this.id = id; + } + } + + /** + * A Date-compatible PreciseDate representing the time that the backup was + * finished. + * @readonly + * @return {PreciseDate} + */ + get endDate(): PreciseDate { + if (!this.metadata || !this.metadata.endTime) { + throw new TypeError('An endTime is required to convert to Date.'); + } + return new PreciseDate({ + seconds: this.metadata.endTime.seconds!, + nanos: this.metadata.endTime.nanos!, + }); + } + + /** + * A Date-compatible PreciseDate representing the expiration time of this + * backup. + * @readonly + * @return {PreciseDate} + */ + get expireDate(): PreciseDate { + if (!this.metadata || !this.metadata.expireTime) { + throw new TypeError('An expireTime is required to convert to Date.'); + } + return new PreciseDate({ + seconds: this.metadata.expireTime.seconds!, + nanos: this.metadata.expireTime.nanos!, + }); + } + + /** + * A Date-compatible PreciseDate representing the time that this backup was + * started. + * @readonly + * @return {PreciseDate} + */ + get startDate(): PreciseDate { + if (!this.metadata || !this.metadata.startTime) { + throw new TypeError('A startTime is required to convert to Date.'); + } + return new PreciseDate({ + seconds: this.metadata.startTime.seconds!, + nanos: this.metadata.startTime.nanos!, + }); + } + + /** + * When this backup object represents a backup that has already been created, + * copy will copy this created backup to the location and with the settings + * specified by the config parameter. After running this function the original + * backup will exist as well as a second backup matching the parameters given + * by the config argument. + * + * @param {CopyBackupConfig} [config] The config that specifies all of the + * information about the destination backup which is the new backup that gets + * created as a result of calling copy. + * @param {CopyBackupCallback} [callback] The callback function that passes an + * error or results back to the user. + */ + copy(config: CopyBackupConfig, callback: CopyBackupCallback): void; + copy(config: CopyBackupConfig): Promise; + copy( + config: CopyBackupConfig, + callback?: CopyBackupCallback, + ): void | Promise { + const reqOpts = { + parent: config.cluster.name, + backupId: config.id, + sourceBackup: `${this.cluster.name}/backups/${this.id}`, + expireTime: config?.expireTime, + }; + ClusterUtils.formatBackupExpiryTime(reqOpts); + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'copyBackup', + reqOpts, + gaxOpts: config.gaxOptions, + }, + (err, ...args) => { + if (err) { + callback!(err, undefined, ...args); + return; + } + // Second argument is a backup for the new backup id + callback!(null, config.cluster.backup(config.id), ...args); + }, + ); + } + + create(config: CreateBackupConfig, callback?: CreateBackupCallback): void; + create(config: CreateBackupConfig): Promise; + /** + * Starts creating a new Cloud Bigtable Backup. + * + * The returned {@link google.longrunning.Operation|long-running operation} + * can be used to track creation of the backup. Cancelling the returned + * operation will stop the creation and delete the backup. + * + * @param {CreateBackupConfig} config Configuration object. + * @param {BackupTimestamp} config.expireTime When the backup will be + * automatically deleted. + * @param {string|Table} config.table Table to create the backup from. + * @param {CallOptions} [config.gaxOptions] Request configuration options, + * outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {CreateBackupCallback} [callback] The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Backup} callback.backup The newly created Backup. + * @param {Operation} callback.operation An operation object that can be used + * to check the status of the request. + * @param {object} callback.apiResponse The full API response. + * @return {void | Promise} + * + * @example + * region_tag:bigtable_api_create_backup + */ + create( + config: CreateBackupConfig, + callback?: CreateBackupCallback, + ): void | Promise { + this.cluster.createBackup(this.id, config, callback!); + } + + delete(gaxOptions?: CallOptions): Promise; + delete(callback: DeleteBackupCallback): void; + delete(gaxOptions: CallOptions, callback: DeleteBackupCallback): void; + /** + * Deletes this pending or completed Cloud Bigtable backup. + * + * @param {CallOptions | DeleteBackupCallback} [gaxOptionsOrCallback] + * @param {DeleteBackupCallback} [callback] The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {object} callback.apiResponse The full API response. + * @return {void | Promise} + * + * @example + * region_tag:bigtable_api_delete_backup + */ + delete( + gaxOptionsOrCallback?: CallOptions | DeleteBackupCallback, + cb?: DeleteBackupCallback, + ): void | Promise { + const gaxOpts = + typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'deleteBackup', + reqOpts: { + name: this.name, + }, + gaxOpts, + }, + callback, + ); + } + + exists(gaxOptions?: CallOptions): Promise; + exists(gaxOptions: CallOptions, callback: BackupExistsCallback): void; + exists(callback: BackupExistsCallback): void; + /** + * Check if a backup exists. + * + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {boolean} callback.exists Whether the backup exists or not. + */ + exists( + optionsOrCallback?: CallOptions | BackupExistsCallback, + cb?: BackupExistsCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + + this.getMetadata(gaxOptions, err => { + if (err) { + if (err.code === 5) { + callback(null, false); + return; + } + callback(err); + return; + } + callback(null, true); + }); + } + + get(gaxOptions?: CallOptions): Promise; + get(callback: GetBackupCallback): void; + get(gaxOptions: CallOptions, callback: GetBackupCallback): void; + /** + * Get a backup if it exists. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {Backup} callback.backup The Backup instance. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_get_backup + */ + get( + gaxOptionsOrCallback?: CallOptions | GetBackupCallback, + cb?: GetBackupCallback, + ): void | Promise { + const gaxOpts = + typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + + this.getMetadata( + gaxOpts, + (err?: ServiceError | null, metadata?: IBackup | null) => { + callback(err, err ? null : this, metadata); + }, + ); + } + + getIamPolicy(options?: GetIamPolicyOptions): Promise; + getIamPolicy( + options: GetIamPolicyOptions, + callback: GetIamPolicyCallback, + ): void; + /** + * @param {object} [options] Configuration object. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {number} [options.requestedPolicyVersion] The policy format version + * to be returned. Valid values are 0, 1, and 3. Requests specifying an + * invalid value will be rejected. Requests for policies with any + * conditional bindings must specify version 3. Policies without any + * conditional bindings may specify any valid value or leave the field unset. + * @param {function} [cb] The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {Policy} policy The policy. + * + * @example + * region_tag:bigtable_api_get_table_Iam_policy + */ + getIamPolicy( + optionsOrCallback?: GetIamPolicyOptions | GetIamPolicyCallback, + cb?: GetIamPolicyCallback, + ): void | Promise { + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + Table.prototype.getIamPolicy.call(this, options, callback); + } + + getMetadata(gaxOptions?: CallOptions): Promise; + getMetadata(callback: BackupGetMetadataCallback): void; + getMetadata( + gaxOptions: CallOptions, + callback: BackupGetMetadataCallback, + ): void; + /** + * Get a backup if it exists. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.metadata The metadata. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_get_backup + */ + getMetadata( + gaxOptionsOrCallback?: CallOptions | BackupGetMetadataCallback, + cb?: BackupGetMetadataCallback, + ): void | Promise { + const gaxOpts = + typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'getBackup', + reqOpts: { + name: this.name, + }, + gaxOpts, + }, + (err, resp) => { + if (resp) { + this.metadata = resp; + } + callback(err, resp); + }, + ); + } + + restore( + tableId: string, + gaxOptions?: CallOptions, + ): Promise; + restore( + tableId: string, + gaxOptions: CallOptions, + callback: RestoreTableCallback, + ): void; + restore(tableId: string, callback: RestoreTableCallback): void; + /** + * Create a new table by restoring from this completed backup. + * + * The new table must be in the same instance as the instance containing + * the backup. The returned + * {@link google.longrunning.Operation|long-running operation} can be used + * to track the progress of the operation, and to cancel it. + * + * @param {string} tableId The id of the table to create and restore to. This + * table must not already exist. + * @param {CallOptions | RestoreTableCallback} [gaxOptionsOrCallback] + * @param {RestoreTableCallback} [callback] The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Table} callback.table The newly created Table. + * @param {Operation} callback.operation An operation object that can be used + * to check the status of the request. + * @param {object} callback.apiResponse The full API response. + * @return {void | Promise} + * + * @example + * region_tag:bigtable_api_restore_backup + */ + restore( + tableId: string, + gaxOptionsOrCallback?: CallOptions | RestoreTableCallback, + cb?: RestoreTableCallback, + ): void | Promise { + const gaxOpts = + typeof gaxOptionsOrCallback === 'object' + ? gaxOptionsOrCallback + : undefined; + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + + this.restoreTo( + { + tableId, + instance: this.cluster.instance, + gaxOptions: gaxOpts, + }, + callback, + ); + } + + restoreTo(config: RestoreTableConfig): Promise; + restoreTo(config: RestoreTableConfig, callback: RestoreTableCallback): void; + /** + * Create a new table by restoring from this completed backup. + * + * The returned + * {@link google.longrunning.Operation|long-running operation} can be used + * to track the progress of the operation, and to cancel it. + * + * @param {RestoreTableConfig} config Configuration object. + * @param {string} tableId The id of the table to create and restore to. This + * table must not already exist. + * @param {Instance|string} [instance] Instance in which the new table will + * be created and restored to. Instance must be in the same project as the + * project containing backup. + * If omitted the instance containing the backup will be used instead. + * @param {CallOptions} [gaxOptions] Request configuration options, + * outlined here: + * https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html. + * @param {RestoreTableCallback} [callback] The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Table} callback.table The newly created Table. + * @param {Operation} callback.operation An operation object that can be used + * to check the status of the request. + * @param {object} callback.apiResponse The full API response. + * @return {void | Promise} + */ + restoreTo( + config: RestoreTableConfig, + callback?: RestoreTableCallback, + ): void | Promise { + let parent: string; + if (config.instance) { + if (config.instance instanceof Instance) { + parent = config.instance.name; + } else { + parent = this.bigtable.instance(config.instance).name; + } + } else { + parent = this.cluster.instance.name; + } + + this.bigtable.request< + LROperation< + google.bigtable.admin.v2.ITable, + google.bigtable.admin.v2.IRestoreTableMetadata + > + >( + { + client: 'BigtableTableAdminClient', + method: 'restoreTable', + reqOpts: { + parent, + tableId: config.tableId, + backup: this.name, + }, + gaxOpts: config.gaxOptions, + }, + (err, ...args) => { + if (err) { + callback!(err, undefined, ...args); + return; + } + callback!(err, this.cluster.instance.table(config.tableId), ...args); + }, + ); + } + + setIamPolicy( + policy: Policy, + gaxOptions?: CallOptions, + ): Promise; + setIamPolicy( + policy: Policy, + gaxOptions: CallOptions, + callback: SetIamPolicyCallback, + ): void; + setIamPolicy(policy: Policy, callback: SetIamPolicyCallback): void; + /** + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {Policy} policy The policy. + * + * @example + * region_tag:bigtable_api_set_instance_Iam_policy + */ + setIamPolicy( + policy: Policy, + gaxOptionsOrCallback?: CallOptions | SetIamPolicyCallback, + cb?: SetIamPolicyCallback, + ): void | Promise { + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + Table.prototype.setIamPolicy.call(this, policy, gaxOptions, callback); + } + + setMetadata( + metadata: ModifiableBackupFields, + gaxOptions?: CallOptions, + ): Promise; + setMetadata( + metadata: ModifiableBackupFields, + callback: BackupSetMetadataCallback, + ): void; + setMetadata( + metadata: ModifiableBackupFields, + gaxOptions: CallOptions, + callback: BackupSetMetadataCallback, + ): void; + /** + * Updates this pending or completed Cloud Bigtable Backup. + * + * @param {ModifiableBackupFields} metadata - The fields to be updated. + * @param {CallOptions | BackupSetMetadataCallback} [gaxOptionsOrCallback] + * @param {BackupSetMetadataCallback} [callback] The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param + * @param {object} callback.apiResponse The full API response. + * @return {void | Promise} + * + * @example + * region_tag:bigtable_api_update_backup + */ + setMetadata( + metadata: ModifiableBackupFields, + gaxOptionsOrCallback?: CallOptions | BackupSetMetadataCallback, + cb?: BackupSetMetadataCallback, + ): void | Promise { + const gaxOpts = + typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + + const backup = { + name: this.name, + ...metadata, + }; + + if (backup.expireTime instanceof Date) { + backup.expireTime = new PreciseDate(backup.expireTime).toStruct(); + } + + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'updateBackup', + reqOpts: { + backup, + updateMask: { + paths: Object.keys(metadata).map(snakeCase), + }, + }, + gaxOpts, + }, + (err, resp) => { + if (resp) { + this.metadata = resp; + } + + callback(err, this.metadata!, resp!); + }, + ); + } + + testIamPermissions( + permissions: string | string[], + gaxOptions?: CallOptions, + ): Promise; + testIamPermissions( + permissions: string | string[], + callback: TestIamPermissionsCallback, + ): void; + testIamPermissions( + permissions: string | string[], + gaxOptions: CallOptions, + callback: TestIamPermissionsCallback, + ): void; + /** + * + * @param {string | string[]} permissions The permission(s) to test for. + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {string[]} permissions A subset of permissions that the caller is + * allowed. + * + * @example + * region_tag:bigtable_api_test_table_Iam_permissions + */ + testIamPermissions( + permissions: string | string[], + gaxOptionsOrCallback?: CallOptions | TestIamPermissionsCallback, + cb?: TestIamPermissionsCallback, + ): void | Promise { + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + Table.prototype.testIamPermissions.call( + this, + permissions, + gaxOptions, + callback, + ); + } +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(Backup, {exclude: ['endDate', 'expireDate', 'startDate']}); + +/** + * Reference to the {@link Backup} class. + * @name module:@google-cloud/bigtable.Backup + * @see Backup + */ diff --git a/handwritten/bigtable/src/chunktransformer.ts b/handwritten/bigtable/src/chunktransformer.ts new file mode 100644 index 00000000000..32faa7c0d6f --- /dev/null +++ b/handwritten/bigtable/src/chunktransformer.ts @@ -0,0 +1,488 @@ +// 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. + +import {Transform, TransformOptions} from 'stream'; +import {Bytes, Mutation} from './mutation'; +import {TableUtils} from './utils/table'; + +export type Value = string | number | boolean | Uint8Array; + +export enum DataEvent { + LAST_ROW_KEY_UPDATE, +} + +export interface Chunk { + rowContents: Value; + commitRow: boolean; + resetRow: boolean; + rowKey?: string | Bytes; + familyName?: {value: string}; + qualifier?: Qualifier | {value: Value}; + timestampMicros?: number | Long; + labels?: string[]; + value?: string | Buffer; + valueSize?: number; +} +export interface Data { + chunks: Chunk[]; + lastScannedRowKey?: Buffer; +} +export interface Family { + [qualifier: string]: Qualifier[]; +} +export interface Qualifier { + value?: string | Buffer; + labels?: string[]; + timestamp?: number | Long; + size?: number; +} +export interface Row { + key?: Value; + data?: {[index: string]: Family}; +} +export interface TransformErrorProps { + message: string; + chunk: Chunk | null; +} +export interface ChunkPushLastScannedRowData { + eventType: DataEvent.LAST_ROW_KEY_UPDATE; + lastScannedRowKey?: string; +} + +export type ChunkPushData = Row | ChunkPushLastScannedRowData; + +class TransformError extends Error { + constructor(props: TransformErrorProps) { + super(); + this.name = 'TransformError'; + this.message = `${props.message}: ${JSON.stringify(props.chunk)}`; + } +} + +/** + * Enum for chunk formatter Row state. + * NEW_ROW: initial state or state after commitRow or resetRow + * ROW_IN_PROGRESS: state after first valid chunk without commitRow or resetRow + * CELL_IN_PROGRESS: state when valueSize > 0(partial cell) + */ +export enum RowStateEnum { + NEW_ROW = 1, + ROW_IN_PROGRESS = 2, + CELL_IN_PROGRESS = 3, +} + +/** + * ChunkTransformer formats all incoming chunks in to row + * keeps all intermediate state until end of stream. + * Should use new instance for each request. + */ +export class ChunkTransformer extends Transform { + options: TransformOptions; + _destroyed: boolean; + lastRowKey?: Value; + state?: number; + row?: Row; + family?: Family; + qualifiers?: Qualifier[]; + qualifier?: Qualifier; + constructor(options: TransformOptions = {}) { + options.objectMode = true; // forcing object mode + super(options); + this.options = options; + this._destroyed = false; + this.lastRowKey = undefined; + this.reset(); + } + + /** + * called at end of the stream. + * @public + * @param {callback} cb callback will be called with error if there is any uncommitted row + */ + _flush(cb: Function): void { + if (typeof this.row!.key !== 'undefined') { + this.destroy( + new TransformError({ + message: 'Response ended with pending row without commit', + chunk: null, + }), + ); + return; + } + cb(); + } + + /** + * transform the readrowsresponse chunks into friendly format. Chunks contain + * 3 properties: + * + * `rowContents` The row contents, this essentially is all data pertaining + * to a single family. + * + * `commitRow` This is a boolean telling us the all previous chunks for this + * row are ok to consume. + * + * `resetRow` This is a boolean telling us that all the previous chunks are to + * be discarded. + * + * @public + * + * @param {object} data readrows response containing array of chunks. + * @param {object} [_encoding] encoding options. + * @param {callback} next callback will be called once data is processed, with error if any error in processing + */ + _transform(data: Data, _encoding: string, next: Function): void { + for (const chunk of data.chunks!) { + switch (this.state) { + case RowStateEnum.NEW_ROW: + this.processNewRow(chunk); + break; + case RowStateEnum.ROW_IN_PROGRESS: + this.processRowInProgress(chunk); + break; + case RowStateEnum.CELL_IN_PROGRESS: + this.processCellInProgress(chunk); + break; + default: + break; + } + if (this._destroyed) { + next(); + return; + } + } + if (data.lastScannedRowKey && data.lastScannedRowKey.length > 0) { + this.lastRowKey = Mutation.convertFromBytes( + data.lastScannedRowKey as Bytes, + { + userOptions: this.options, + }, + ); + /** + * Push an event that will update the lastRowKey in the user stream after + * all rows ahead of this event have reached the user stream. This will + * ensure that a retry excludes the lastScannedRow as this is required + * for the TestReadRows_Retry_LastScannedRow conformance test to pass. It + * is important to use a 'data' event to update the last row key in order + * to allow all the data queued ahead of this event to reach the user + * stream first. + */ + this.push({ + eventType: DataEvent.LAST_ROW_KEY_UPDATE, + lastScannedRowKey: this.lastRowKey, + }); + } + next(); + } + + /** + * called when stream is destroyed. + * @public + * @param {error} err error if any + */ + destroy(err?: Error): this { + if (this._destroyed) return this; + this._destroyed = true; + if (err) { + this.emit('error', err); + } + this.emit('close'); + return this; + } + + /** + * Resets state of formatter + * @private + */ + reset(): void { + this.family = {} as Family; + this.qualifiers = []; + this.qualifier = {}; + this.row = {}; + this.state = RowStateEnum.NEW_ROW; + } + + /** + * sets lastRowkey and calls reset when row is committed. + * @private + */ + commit(): void { + const row = this.row; + this.reset(); + this.lastRowKey = row!.key; + } + + /** + * Validates valuesize and commitrow in a chunk + * @private + * @param {chunk} chunk chunk to validate for valuesize and commitRow + */ + validateValueSizeAndCommitRow(chunk: Chunk): void { + if (chunk.valueSize! > 0 && chunk.commitRow) { + this.destroy( + new TransformError({ + message: 'A row cannot be have a value size and be a commit row', + chunk, + }), + ); + } + } + + /** + * Validates resetRow condition for chunk + * @private + * @param {chunk} chunk chunk to validate for resetrow + */ + validateResetRow(chunk: Chunk): void { + const containsData = + (chunk.rowKey && chunk.rowKey.length !== 0) || + chunk.familyName || + chunk.qualifier || + (chunk.value && chunk.value.length !== 0) || + // timestampMicros is an int64 in the protobuf definition, + // which can be either a number or an instance of Long. + // If it's a number... + (typeof chunk.timestampMicros === 'number' && + chunk.timestampMicros! > 0) || + // If it's an instance of Long... + (typeof chunk.timestampMicros === 'object' && + 'compare' in chunk.timestampMicros && + typeof chunk.timestampMicros.compare === 'function' && + chunk.timestampMicros.compare(0) === 1); + if (chunk.resetRow && containsData) { + this.destroy( + new TransformError({ + message: 'A reset should have no data', + chunk, + }), + ); + } + } + + /** + * Validates state for new row. + * @private + * @param {chunk} chunk chunk to validate + * @param {newRowKey} newRowKey newRowKey of the new row + */ + validateNewRow(chunk: Chunk, newRowKey: string | Buffer): void { + const row = this.row; + const lastRowKey = this.lastRowKey; + let errorMessage: string | undefined; + + if (typeof row!.key !== 'undefined') { + errorMessage = 'A new row cannot have existing state'; + } else if ( + typeof chunk.rowKey === 'undefined' || + chunk.rowKey.length === 0 || + newRowKey.length === 0 + ) { + errorMessage = 'A row key must be set'; + } else if (chunk.resetRow) { + errorMessage = 'A new row cannot be reset'; + } else if (lastRowKey === newRowKey) { + errorMessage = 'A commit happened but the same key followed'; + } else if ( + typeof lastRowKey !== 'undefined' && + TableUtils.lessThanOrEqualTo(newRowKey as string, lastRowKey as string) + ) { + errorMessage = 'A row key must be strictly increasing'; + } else if (!chunk.familyName) { + errorMessage = 'A family must be set'; + } else if (chunk.qualifier === null || chunk.qualifier === undefined) { + errorMessage = 'A column qualifier must be set'; + } + if (errorMessage) { + this.destroy(new TransformError({message: errorMessage, chunk})); + return; + } + this.validateValueSizeAndCommitRow(chunk); + } + + /** + * Validates state for rowInProgress + * @private + * @param {chunk} chunk chunk to validate + */ + validateRowInProgress(chunk: Chunk): void { + const row = this.row; + if (chunk.rowKey && chunk.rowKey.length) { + const newRowKey = Mutation.convertFromBytes(chunk.rowKey as Bytes, { + userOptions: this.options, + }); + const oldRowKey = row!.key || ''; + if ( + newRowKey && + chunk.rowKey && + (newRowKey as string).length !== 0 && + newRowKey.toString() !== oldRowKey.toString() + ) { + this.destroy( + new TransformError({ + message: 'A commit is required between row keys', + chunk, + }), + ); + return; + } + } + if ( + chunk.familyName && + (chunk.qualifier === null || chunk.qualifier === undefined) + ) { + this.destroy( + new TransformError({ + message: 'A qualifier must be specified', + chunk, + }), + ); + return; + } + this.validateResetRow(chunk); + this.validateValueSizeAndCommitRow(chunk); + } + + /** + * Validates chunk for cellInProgress state. + * @private + * @param {chunk} chunk chunk to validate + */ + validateCellInProgress(chunk: Chunk): void { + this.validateResetRow(chunk); + this.validateValueSizeAndCommitRow(chunk); + } + + /** + * Moves to next state in processing. + * @private + * @param {chunk} chunk chunk in process + */ + moveToNextState(chunk: Chunk): void { + const row = this.row; + if (chunk.commitRow) { + this.push(row); + this.commit(); + this.lastRowKey = row!.key; + } else { + if (chunk.valueSize! > 0) { + this.state = RowStateEnum.CELL_IN_PROGRESS; + } else { + this.state = RowStateEnum.ROW_IN_PROGRESS; + } + } + } + + /** + * Process chunk when in NEW_ROW state. + * @private + * @param {chunks} chunk chunk to process + */ + processNewRow(chunk: Chunk): void { + const newRowKey = Mutation.convertFromBytes(chunk.rowKey! as Bytes, { + userOptions: this.options, + }) as string; + this.validateNewRow(chunk, newRowKey); + if (chunk.familyName && chunk.qualifier) { + const row = this.row!; + row.key = newRowKey; + row.data = {}; + this.family = row.data[chunk.familyName.value] = {} as Family; + const qualifierName = Mutation.convertFromBytes( + chunk.qualifier.value as Bytes, + { + userOptions: this.options, + }, + ); + this.qualifiers = this.family[qualifierName as {} as string] = []; + this.qualifier = { + value: Mutation.convertFromBytes(chunk.value! as Bytes, { + userOptions: this.options, + isPossibleNumber: true, + }) as string, + labels: chunk.labels, + timestamp: chunk.timestampMicros, + }; + this.qualifiers.push(this.qualifier); + this.moveToNextState(chunk); + } + } + + /** + * Process chunk when in ROW_IN_PROGRESS state. + * @private + * @param {chunk} chunk chunk to process + */ + processRowInProgress(chunk: Chunk): void { + this.validateRowInProgress(chunk); + if (chunk.resetRow) { + return this.reset(); + } + const row = this.row!; + if (chunk.familyName) { + this.family = row.data![chunk.familyName.value] = + row.data![chunk.familyName.value] || {}; + } + if (chunk.qualifier) { + const qualifierName = Mutation.convertFromBytes( + chunk.qualifier.value as Bytes, + { + userOptions: this.options, + }, + ) as string; + this.qualifiers = this.family![qualifierName] = + this.family![qualifierName] || []; + } + this.qualifier = { + value: Mutation.convertFromBytes(chunk.value! as Bytes, { + userOptions: this.options, + isPossibleNumber: true, + }) as string, + labels: chunk.labels, + timestamp: chunk.timestampMicros, + }; + this.qualifiers!.push(this.qualifier); + this.moveToNextState(chunk); + } + + /** + * Process chunk when in CELl_IN_PROGRESS state. + * @private + * @param {chunk} chunk chunk to process + */ + processCellInProgress(chunk: Chunk): void { + this.validateCellInProgress(chunk); + if (chunk.resetRow) { + return this.reset(); + } + const chunkQualifierValue = Mutation.convertFromBytes( + chunk.value! as Bytes, + { + userOptions: this.options, + }, + ); + + if ( + chunkQualifierValue instanceof Buffer && + this.qualifier!.value instanceof Buffer + ) { + this.qualifier!.value = Buffer.concat([ + this.qualifier!.value, + chunkQualifierValue, + ]); + } else { + (this.qualifier!.value as string) += chunkQualifierValue; + } + this.moveToNextState(chunk); + } +} diff --git a/handwritten/bigtable/src/client-side-metrics/client-side-metrics-attributes.ts b/handwritten/bigtable/src/client-side-metrics/client-side-metrics-attributes.ts new file mode 100644 index 00000000000..1946cacddcb --- /dev/null +++ b/handwritten/bigtable/src/client-side-metrics/client-side-metrics-attributes.ts @@ -0,0 +1,35 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +// The backend is expecting true/false and will fail if other values are provided. +// export in open telemetry is expecting string value attributes so we don't use boolean +// true/false. +export enum StreamingState { + STREAMING = 'true', + UNARY = 'false', +} + +/** + * Represents the names of Bigtable methods. These are used as attributes for + * metrics, allowing for differentiation of performance by method. + */ +export enum MethodName { + READ_ROW = 'Bigtable.ReadRow', + READ_ROWS = 'Bigtable.ReadRows', + MUTATE_ROW = 'Bigtable.MutateRow', + CHECK_AND_MUTATE_ROW = 'Bigtable.CheckAndMutateRow', + READ_MODIFY_WRITE_ROW = 'Bigtable.ReadModifyWriteRow', + SAMPLE_ROW_KEYS = 'Bigtable.SampleRowKeys', + MUTATE_ROWS = 'Bigtable.MutateRows', +} diff --git a/handwritten/bigtable/src/client-side-metrics/exporter.ts b/handwritten/bigtable/src/client-side-metrics/exporter.ts new file mode 100644 index 00000000000..fa4fd3a900a --- /dev/null +++ b/handwritten/bigtable/src/client-side-metrics/exporter.ts @@ -0,0 +1,329 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {MetricExporter} from '@google-cloud/opentelemetry-cloud-monitoring-exporter'; +import { + DataPoint, + ExponentialHistogram, + Histogram, + ResourceMetrics, +} from '@opentelemetry/sdk-metrics'; +import {ClientOptions, ServiceError} from 'google-gax'; +import {MetricServiceClient} from '@google-cloud/monitoring'; +import {google} from '@google-cloud/monitoring/build/protos/protos'; +import ICreateTimeSeriesRequest = google.monitoring.v3.ICreateTimeSeriesRequest; + +export interface ExportResult { + code: number; +} + +/** + * Type guard function to determine if a given value is a counter value (a number). + * + * This function checks if a value, which could be either a `DistributionValue` + * object or a `number`, is specifically a `number`. This is used to differentiate + * between counter metrics (which have numeric values) and distribution metrics + * (which have more complex, object-based values). + * + */ +function isCounterValue( + dataPoint: + | DataPoint + | DataPoint + | DataPoint, +): dataPoint is DataPoint { + return typeof dataPoint.value === 'number'; +} + +function getInterval( + dataPoint: + | DataPoint + | DataPoint + | DataPoint, +) { + return { + endTime: { + seconds: dataPoint.endTime[0], + nanos: dataPoint.endTime[1], + }, + startTime: { + seconds: dataPoint.startTime[0], + nanos: dataPoint.startTime[1], + }, + }; +} + +/** + * This function gets the timeseries data points for metrics that are + * represented as distributions on the backend. These data points are part of a + * timeseries object that is recorded to Google Cloud Monitoring. + * + * @param {DataPoint} dataPoint The datapoint containing the data we wish to + * send to the Google Cloud Monitoring dashboard + */ +function getDistributionPoints( + dataPoint: DataPoint | DataPoint, +) { + const value = dataPoint.value; + return [ + { + interval: getInterval(dataPoint), + value: { + distributionValue: { + count: String(value.count), + mean: value.count && value.sum ? value.sum / value.count : 0, + bucketOptions: { + explicitBuckets: { + bounds: (value as Histogram).buckets.boundaries, + }, + }, + bucketCounts: (value as Histogram).buckets.counts.map(String), + }, + }, + }, + ]; +} + +/** + * This function gets the timeseries data points for metrics that are + * represented as integers on the backend. These data points are part of a + * timeseries object that is recorded to Google Cloud Monitoring. + * + * @param {DataPoint} dataPoint The datapoint containing the data we wish to + * send to the Google Cloud Monitoring dashboard + */ +function getIntegerPoints(dataPoint: DataPoint) { + return [ + { + interval: getInterval(dataPoint), + value: { + int64Value: dataPoint.value, + }, + }, + ]; +} + +/** + * getResource gets the resource object which is used for building the timeseries + * object that will be sent to Google Cloud Monitoring dashboard + * + * @param {string} projectId The name of the project + * @param {DataPoint} dataPoint The datapoint containing the data we wish to + * send to the Google Cloud Monitoring dashboard + */ +function getResource( + dataPoint: + | DataPoint + | DataPoint + | DataPoint, +) { + const resourceLabels = { + cluster: dataPoint.attributes.cluster, + instance: dataPoint.attributes.instanceId, + project_id: dataPoint.attributes.projectId, + table: dataPoint.attributes.table, + zone: dataPoint.attributes.zone, + }; + return { + type: 'bigtable_client_raw', + labels: resourceLabels, + }; +} + +/** + * getMetric gets the metric object which is used for building the timeseries + * object that will be sent to Google Cloud Monitoring dashboard + * + * @param {string} metricName The backend name of the metric that we want to record + * @param {DataPoint} dataPoint The datapoint containing the data we wish to + * send to the Google Cloud Monitoring dashboard + */ +function getMetric( + metricName: string, + dataPoint: + | DataPoint + | DataPoint + | DataPoint, +) { + const streaming = dataPoint.attributes.streaming; + const app_profile = dataPoint.attributes.app_profile; + const status = dataPoint.attributes.status; + return { + type: metricName, + labels: Object.assign( + { + method: dataPoint.attributes.method, + client_uid: dataPoint.attributes.client_uid, + client_name: dataPoint.attributes.client_name, + }, + status ? {status} : null, + streaming ? {streaming} : null, + app_profile ? {app_profile} : null, + ), + }; +} + +/** + * Converts OpenTelemetry metrics data into a format suitable for the Google Cloud + * Monitoring API's `createTimeSeries` method. + * + * This function transforms the structured metrics data, including resource and + * metric attributes, data points, and aggregation information, into an object + * that conforms to the expected request format of the Cloud Monitoring API. + * + * @param {ResourceMetrics} exportArgs - The OpenTelemetry metrics data to be converted. This + * object contains resource attributes, scope information, and a list of + * metrics with their associated data points. + * + * @returns An object representing a `CreateTimeSeriesRequest`, ready for sending + * to the Google Cloud Monitoring API. This object contains the project name + * and an array of time series data points, formatted for ingestion by + * Cloud Monitoring. + * + * @throws Will throw an error if there are issues converting the data. + * + * @remarks + * The output format is specific to the Cloud Monitoring API and involves + * mapping OpenTelemetry concepts to Cloud Monitoring's data model, including: + * - Mapping resource attributes to resource labels. + * - Mapping metric attributes to metric labels. + * - Handling different metric types (counter, distribution). + * - Converting data points to the correct structure, including start and end + * times, values, and bucket information for distributions. + * + * @example + * const exportInput: ExportInput = { ... }; // Example ExportInput object + * const monitoringRequest = metricsToRequest(exportInput); + * // monitoringRequest can now be used in monitoringClient.createTimeSeries(monitoringRequest) + * + * + */ +export function metricsToRequest(exportArgs: ResourceMetrics) { + const timeSeriesArray = []; + let projectId; + for (const scopeMetrics of exportArgs.scopeMetrics) { + for (const scopeMetric of scopeMetrics.metrics) { + for (const dataPoint of scopeMetric.dataPoints) { + if (!projectId) { + projectId = dataPoint.attributes.projectId; + } + const metric = getMetric(scopeMetric.descriptor.name, dataPoint); + const resource = getResource(dataPoint); + if (isCounterValue(dataPoint)) { + timeSeriesArray.push({ + metric, + resource, + valueType: 'INT64', + points: getIntegerPoints(dataPoint), + }); + } else { + timeSeriesArray.push({ + metric, + resource, + metricKind: 'CUMULATIVE', + valueType: 'DISTRIBUTION', + points: getDistributionPoints(dataPoint), + unit: scopeMetric.descriptor.unit || 'ms', // Default to 'ms' if no unit is specified + }); + } + } + } + } + return { + name: `projects/${projectId}`, + timeSeries: timeSeriesArray, + }; +} + +/** + * A custom OpenTelemetry `MetricExporter` that sends metrics data to Google Cloud + * Monitoring. + * + * This class extends the base `MetricExporter` from `@google-cloud/opentelemetry-cloud-monitoring-exporter` + * and handles the process of converting OpenTelemetry metrics data into the + * format required by the Google Cloud Monitoring API. It uses the + * `MetricServiceClient` to send the data to Google Cloud Monitoring's + * `createTimeSeries` method. + * + * @remarks + * This exporter relies on the `metricsToRequest` function to perform the + * necessary transformation of OpenTelemetry metrics into Cloud Monitoring + * `TimeSeries` data. + * + * The exporter is asynchronous and will not block the calling thread while + * sending metrics. It manages the Google Cloud Monitoring client and handles + * potential errors during the export process. + * + * The class expects the `ResourceMetrics` to have been correctly configured + * and populated with the required resource attributes to correctly identify + * the monitored resource in Cloud Monitoring. + * + * @example + * // Create an instance of the CloudMonitoringExporter + * const exporter = new CloudMonitoringExporter(); + * + * // Use the exporter with a MeterProvider + * const meterProvider = new MeterProvider({ + * resource: new Resource({ + * 'service.name': 'my-service', + * // ... other resource attributes + * }), + * readers: [new PeriodicExportingMetricReader({ + * exporter: exporter, + * exportIntervalMillis: 10000 // Export every 10 seconds + * })] + * }); + * + * // Now start instrumenting your application using the meter + * const meter = meterProvider.getMeter('my-meter'); + * // ... create counters, histograms, etc. + * + * @beta + */ +export class CloudMonitoringExporter extends MetricExporter { + private client: MetricServiceClient; + + constructor(options: ClientOptions) { + super(); + if (options && options.apiEndpoint) { + // We want the MetricServiceClient to always hit its default endpoint. + delete options.apiEndpoint; + } + this.client = new MetricServiceClient(options); + } + + async export( + metrics: ResourceMetrics, + resultCallback: (result: ExportResult) => void, + ): Promise { + (async () => { + try { + const request = metricsToRequest(metrics); + await this.client.createServiceTimeSeries( + request as ICreateTimeSeriesRequest, + ); + // The resultCallback typically accepts a value equal to {code: x} + // for some value x along with other info. When the code is equal to 0 + // then the operation completed successfully. When the code is not equal + // to 0 then the operation failed. The resultCallback will not log + // anything to the console whether the error code was 0 or not. + resultCallback({code: 0}); + } catch (error) { + resultCallback(error as ServiceError); + } + })().catch(err => { + throw err; + }); + } +} diff --git a/handwritten/bigtable/src/client-side-metrics/gcp-metrics-handler.ts b/handwritten/bigtable/src/client-side-metrics/gcp-metrics-handler.ts new file mode 100644 index 00000000000..8f740629aa1 --- /dev/null +++ b/handwritten/bigtable/src/client-side-metrics/gcp-metrics-handler.ts @@ -0,0 +1,308 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {CloudMonitoringExporter} from './exporter'; +import { + IMetricsHandler, + OnAttemptCompleteData, + OnOperationCompleteData, +} from './metrics-handler'; +import * as Resources from '@opentelemetry/resources'; +import * as ResourceUtil from '@google-cloud/opentelemetry-resource-util'; +import {PushMetricExporter, View} from '@opentelemetry/sdk-metrics'; +import {ClientOptions} from 'google-gax'; +const { + Aggregation, + ExplicitBucketHistogramAggregation, + MeterProvider, + Histogram, + PeriodicExportingMetricReader, +} = require('@opentelemetry/sdk-metrics'); +import * as os from 'os'; +import * as crypto from 'crypto'; +import {MethodName} from './client-side-metrics-attributes'; + +/** + * Generates a unique client identifier string. + * + * This function creates a client identifier that incorporates the hostname, + * process ID, and a UUID to ensure uniqueness across different client instances + * and processes. The identifier follows the pattern: + * + * `node--` + * + * where: + * - `` is a randomly generated UUID (version 4). + * - `` is the process ID of the current Node.js process. + * - `` is the hostname of the machine. + * + * @returns {string} A unique client identifier string. + */ +function generateClientUuid() { + const hostname = os.hostname() || 'localhost'; + const currentPid = process.pid || ''; + const uuid4 = crypto.randomUUID(); + return `node-${uuid4}-${currentPid}${hostname}`; +} + +/** + * A collection of OpenTelemetry metric instruments used to record + * Bigtable client-side metrics. + */ +interface MetricsInstruments { + operationLatencies: typeof Histogram; + attemptLatencies: typeof Histogram; + retryCount: typeof Histogram; + applicationBlockingLatencies: typeof Histogram; + firstResponseLatencies: typeof Histogram; + serverLatencies: typeof Histogram; + connectivityErrorCount: typeof Histogram; + clientBlockingLatencies: typeof Histogram; +} + +/** + * This method gets the open telemetry instruments that will store GCP metrics + * for a particular project. + * + * @param exporter The exporter the metrics will be sent to. + */ +function createInstruments(exporter: PushMetricExporter): MetricsInstruments { + const latencyBuckets = [ + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0, 13.0, 16.0, 20.0, 25.0, 30.0, + 40.0, 50.0, 65.0, 80.0, 100.0, 130.0, 160.0, 200.0, 250.0, 300.0, 400.0, + 500.0, 650.0, 800.0, 1000.0, 2000.0, 5000.0, 10000.0, 20000.0, 50000.0, + 100000.0, 200000.0, 400000.0, 800000.0, 1600000.0, 3200000.0, + ]; + const viewList = [ + 'operation_latencies', + 'first_response_latencies', + 'attempt_latencies', + 'retry_count', + 'server_latencies', + 'connectivity_error_count', + 'application_latencies', + 'throttling_latencies', + ].map( + name => + new View({ + instrumentName: name, + name, + aggregation: !name.endsWith('latencies') + ? Aggregation.Sum() + : new ExplicitBucketHistogramAggregation(latencyBuckets), + }), + ); + const meterProvider = new MeterProvider({ + views: viewList, + resource: new Resources.Resource({ + 'service.name': 'Cloud Bigtable Table', + }).merge(new ResourceUtil.GcpDetectorSync().detect()), + readers: [ + // Register the exporter + new PeriodicExportingMetricReader({ + // Export metrics every 60 seconds. + exportIntervalMillis: 60_000, + exporter, + }), + ], + }); + const meter = meterProvider.getMeter('bigtable.googleapis.com'); + return { + operationLatencies: meter.createHistogram( + 'bigtable.googleapis.com/internal/client/operation_latencies', + { + description: + "The total end-to-end latency across all RPC attempts associated with a Bigtable operation. This metric measures an operation's round trip from the client to Bigtable and back to the client and includes all retries.", + unit: 'ms', + advice: { + explicitBucketBoundaries: latencyBuckets, + }, + }, + ), + attemptLatencies: meter.createHistogram( + 'bigtable.googleapis.com/internal/client/attempt_latencies', + { + description: + 'The latencies of a client RPC attempt. Under normal circumstances, this value is identical to operation_latencies. If the client receives transient errors, however, then operation_latencies is the sum of all attempt_latencies and the exponential delays.', + unit: 'ms', + advice: { + explicitBucketBoundaries: latencyBuckets, + }, + }, + ), + retryCount: meter.createCounter( + 'bigtable.googleapis.com/internal/client/retry_count', + { + description: + 'A counter that records the number of attempts that an operation required to complete. Under normal circumstances, this value is empty.', + }, + ), + applicationBlockingLatencies: meter.createHistogram( + 'bigtable.googleapis.com/internal/client/application_latencies', + { + description: + 'The time from when the client receives the response to a request until the application reads the response. This metric is most relevant for ReadRows requests. The start and stop times for this metric depend on the way that you send the read request; see Application blocking latencies timer examples for details.', + unit: 'ms', + advice: { + explicitBucketBoundaries: latencyBuckets, + }, + }, + ), + firstResponseLatencies: meter.createHistogram( + 'bigtable.googleapis.com/internal/client/first_response_latencies', + { + description: + 'Latencies from when a client sends a request and receives the first row of the response.', + unit: 'ms', + advice: { + explicitBucketBoundaries: latencyBuckets, + }, + }, + ), + serverLatencies: meter.createHistogram( + 'bigtable.googleapis.com/internal/client/server_latencies', + { + description: + 'Latencies between the time when the Google frontend receives an RPC and when it sends the first byte of the response.', + unit: 'ms', + + advice: { + explicitBucketBoundaries: latencyBuckets, + }, + }, + ), + connectivityErrorCount: meter.createCounter( + 'bigtable.googleapis.com/internal/client/connectivity_error_count', + { + description: + "The number of requests that failed to reach Google's network. In normal cases, this number is 0. When the number is not 0, it can indicate connectivity issues between the application and the Google network.", + }, + ), + clientBlockingLatencies: meter.createHistogram( + 'bigtable.googleapis.com/internal/client/throttling_latencies', + { + description: + 'Latencies introduced when the client blocks the sending of more requests to the server because of too many pending requests in a bulk operation.', + unit: 'ms', + advice: { + explicitBucketBoundaries: latencyBuckets, + }, + }, + ), + }; +} + +/** + * A metrics handler implementation that uses OpenTelemetry to export metrics to Google Cloud Monitoring. + * This handler records metrics such as operation latency, attempt latency, retry count, and more, + * associating them with relevant attributes for detailed analysis in Cloud Monitoring. + */ +export class GCPMetricsHandler implements IMetricsHandler { + private otelInstruments: MetricsInstruments; + private clientUid: string; + + /** + * The `GCPMetricsHandler` is responsible for managing and recording + * client-side metrics for Google Cloud Bigtable using OpenTelemetry. It + * handles the creation and configuration of various metric instruments + * (histograms and counters) and exports them to Google Cloud Monitoring + * through the provided `PushMetricExporter`. + * + */ + constructor(options: ClientOptions) { + this.clientUid = generateClientUuid(); + const exporter = new CloudMonitoringExporter(options); + this.otelInstruments = createInstruments(exporter); + } + + /** + * Records metrics for a completed Bigtable operation. + * This method records the operation latency and retry count, associating them with provided attributes. + * @param {OnOperationCompleteData} data Data related to the completed operation. + */ + onOperationComplete(data: OnOperationCompleteData) { + const otelInstruments = this.otelInstruments; + const commonAttributes = { + app_profile: data.metricsCollectorData.app_profile, + method: data.metricsCollectorData.method, + client_uid: this.clientUid, + client_name: data.client_name, + projectId: data.metricsCollectorData.projectId, + instanceId: data.metricsCollectorData.instanceId, + table: data.metricsCollectorData.table, + cluster: data.metricsCollectorData.cluster, + zone: data.metricsCollectorData.zone, + }; + otelInstruments.operationLatencies.record(data.operationLatency, { + streaming: data.streaming, + status: data.status, + ...commonAttributes, + }); + otelInstruments.retryCount.add(data.retryCount, { + status: data.status, + ...commonAttributes, + }); + if ( + data.metricsCollectorData.method === MethodName.READ_ROWS || + data.metricsCollectorData.method === MethodName.READ_ROW + ) { + otelInstruments.firstResponseLatencies.record(data.firstResponseLatency, { + status: data.status, + ...commonAttributes, + }); + } + + if (data.applicationLatency) { + otelInstruments.applicationBlockingLatencies.record( + data.applicationLatency, + commonAttributes, + ); + } + otelInstruments.retryCount.add(data.retryCount, commonAttributes); + } + + /** + * Records metrics for a completed attempt of a Bigtable operation. + * This method records attempt latency, connectivity error count, server latency, + * along with the provided attributes. + * @param {OnAttemptCompleteData} data Data related to the completed attempt. + */ + onAttemptComplete(data: OnAttemptCompleteData) { + const otelInstruments = this.otelInstruments; + const commonAttributes = { + app_profile: data.metricsCollectorData.app_profile, + method: data.metricsCollectorData.method, + client_uid: this.clientUid, + status: data.status, + client_name: data.client_name, + projectId: data.metricsCollectorData.projectId, + instanceId: data.metricsCollectorData.instanceId, + table: data.metricsCollectorData.table, + cluster: data.metricsCollectorData.cluster, + zone: data.metricsCollectorData.zone, + }; + otelInstruments.attemptLatencies.record(data.attemptLatency, { + streaming: data.streaming, + ...commonAttributes, + }); + otelInstruments.connectivityErrorCount.add( + data.connectivityErrorCount, + commonAttributes, + ); + otelInstruments.serverLatencies.record(data.serverLatency, { + streaming: data.streaming, + ...commonAttributes, + }); + } +} diff --git a/handwritten/bigtable/src/client-side-metrics/metric-interceptor.ts b/handwritten/bigtable/src/client-side-metrics/metric-interceptor.ts new file mode 100644 index 00000000000..89b23d4a36c --- /dev/null +++ b/handwritten/bigtable/src/client-side-metrics/metric-interceptor.ts @@ -0,0 +1,104 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {CallOptions} from 'google-gax'; +import {OperationMetricsCollector} from './operation-metrics-collector'; + +// Mock Server Implementation +import * as grpcJs from '@grpc/grpc-js'; +import {status as GrpcStatus} from '@grpc/grpc-js'; + +export type ServerStatus = { + metadata: {internalRepr: Map; options: {}}; + code: number; + details: string; +}; + +// Helper to create interceptor provider for OperationMetricsCollector +function createMetricsInterceptorProvider( + collector: OperationMetricsCollector, +) { + return (options: grpcJs.InterceptorOptions, nextCall: grpcJs.NextCall) => { + // savedReceiveMetadata and savedReceiveStatus are not strictly needed here anymore for the interceptor's own state + // OperationStart and AttemptStart will be called by the calling code (`fakeReadModifyWriteRow`) + return new grpcJs.InterceptingCall(nextCall(options), { + start: (metadata, listener, next) => { + // AttemptStart is called by the orchestrating code + const newListener: grpcJs.Listener = { + onReceiveMetadata: (metadata, nextMd) => { + collector.onMetadataReceived( + metadata as unknown as { + internalRepr: Map; + options: {}; + }, + ); + nextMd(metadata); + }, + onReceiveStatus: (status, nextStat) => { + collector.onStatusMetadataReceived( + status as unknown as ServerStatus, + ); + collector.onAttemptComplete(status.code); + nextStat(status); + }, + }; + next(metadata, newListener); + }, + sendMessage: function (message, next) { + collector.onAttemptStart(); + next(message); + }, + }); + }; +} + +/** + * Attaches a metrics interceptor to unary calls for collecting client-side metrics. + * + * This method modifies the given `gaxOptions` to include an interceptor that + * will be triggered during the execution of a unary gRPC call. The interceptor + * uses the provided `OperationMetricsCollector` to record various metrics + * related to the call, such as latency, retries, and errors. + * + * @param {CallOptions} gaxOptions The existing GAX call options to modify. + * @param {OperationMetricsCollector} metricsCollector The metrics collector + * for the operation. + * @returns {CallOptions} The modified `gaxOptions` with the interceptor attached. + */ +export function createMetricsUnaryInterceptorProvider( + gaxOptions: CallOptions, + metricsCollector?: OperationMetricsCollector, +) { + if (metricsCollector) { + const interceptor = createMetricsInterceptorProvider(metricsCollector); + if (!gaxOptions.otherArgs) { + gaxOptions.otherArgs = {}; + } + if (!gaxOptions.otherArgs.options) { + gaxOptions.otherArgs.options = {}; + } + if (!gaxOptions.otherArgs.options.interceptors) { + gaxOptions.otherArgs.options.interceptors = [interceptor]; + } else { + if (Array.isArray(gaxOptions.otherArgs.options.interceptors)) { + // We check that interceptors is an array so that the code has no + // chance of throwing an error. + // Then, if the interceptors is an array, make sure it also includes the + // client side metrics interceptor. + gaxOptions.otherArgs.options.interceptors.push(interceptor); + } + } + } + return gaxOptions; +} diff --git a/handwritten/bigtable/src/client-side-metrics/metrics-config-manager.ts b/handwritten/bigtable/src/client-side-metrics/metrics-config-manager.ts new file mode 100644 index 00000000000..a28d7f14fd7 --- /dev/null +++ b/handwritten/bigtable/src/client-side-metrics/metrics-config-manager.ts @@ -0,0 +1,44 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {IMetricsHandler} from './metrics-handler'; +import { + ITabularApiSurface, + OperationMetricsCollector, +} from './operation-metrics-collector'; +import {MethodName, StreamingState} from './client-side-metrics-attributes'; + +/** + * A class for tracing and recording client-side metrics related to Bigtable operations. + */ +export class ClientSideMetricsConfigManager { + private metricsHandlers: IMetricsHandler[]; + + constructor(handlers: IMetricsHandler[]) { + this.metricsHandlers = handlers; + } + + createOperation( + methodName: MethodName, + streaming: StreamingState, + table: ITabularApiSurface, + ): OperationMetricsCollector { + return new OperationMetricsCollector( + table, + methodName, + streaming, + this.metricsHandlers, + ); + } +} diff --git a/handwritten/bigtable/src/client-side-metrics/metrics-handler.ts b/handwritten/bigtable/src/client-side-metrics/metrics-handler.ts new file mode 100644 index 00000000000..d1ee289347c --- /dev/null +++ b/handwritten/bigtable/src/client-side-metrics/metrics-handler.ts @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {MethodName, StreamingState} from './client-side-metrics-attributes'; + +/** + * The interfaces below use undefined instead of null to indicate a metric is + * not available yet. The benefit of this is that new metrics can be added + * without requiring users to change the methods in their metrics handler. + */ + +type IMetricsCollectorData = { + projectId: string; + instanceId: string; + table: string; + cluster?: string; + zone?: string; + app_profile?: string; + method: MethodName; +}; + +interface StandardData { + metricsCollectorData: IMetricsCollectorData; + client_name: string; + streaming: StreamingState; + status: string; +} + +export interface OnOperationCompleteData extends StandardData { + firstResponseLatency?: number; + operationLatency: number; + applicationLatency?: number; + retryCount?: number; +} + +export interface OnAttemptCompleteData extends StandardData { + attemptLatency: number; + serverLatency?: number; + connectivityErrorCount: number; +} + +/** + * An interface for handling client-side metrics related to Bigtable operations. + * Implementations of this interface can define how metrics are recorded and processed. + */ +export interface IMetricsHandler { + /** + * Called when an operation completes (successfully or unsuccessfully). + * @param {OnOperationCompleteData} data Metrics and attributes related to the completed operation. + */ + onOperationComplete?(data: OnOperationCompleteData): void; + + /** + * Called when an attempt (e.g., an RPC attempt) completes. + * @param {OnAttemptCompleteData} data Metrics and attributes related to the completed attempt. + */ + onAttemptComplete?(data: OnAttemptCompleteData): void; +} diff --git a/handwritten/bigtable/src/client-side-metrics/operation-metrics-collector.ts b/handwritten/bigtable/src/client-side-metrics/operation-metrics-collector.ts new file mode 100644 index 00000000000..a92db691d01 --- /dev/null +++ b/handwritten/bigtable/src/client-side-metrics/operation-metrics-collector.ts @@ -0,0 +1,398 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 {status} = require('@grpc/grpc-js'); +import * as fs from 'fs'; +import {MethodName, StreamingState} from './client-side-metrics-attributes'; +import {grpc, ServiceError} from 'google-gax'; +import * as gax from 'google-gax'; +import {AbortableDuplex, BigtableOptions} from '../index'; +import * as path from 'path'; +import {IMetricsHandler} from './metrics-handler'; +import {TimedStream} from '../timed-stream'; + +// When this environment variable is set then print any errors associated +// with failures in the metrics collector. +const METRICS_DEBUG = process.env.METRICS_DEBUG; + +const protoPath = path.join( + __dirname, + '../../protos/google/bigtable/v2/response_params.proto', +); +const root = gax.protobuf.loadSync(protoPath); +const ResponseParams = root.lookupType('ResponseParams'); +const {hrtime} = require('node:process'); + +/** + * An interface representing a tabular API surface, such as a Bigtable table. + */ +export interface ITabularApiSurface { + instance: { + id: string; + }; + id: string; + bigtable: { + metricsEnabled?: boolean; + projectId?: string; + appProfileId?: string; + options: BigtableOptions; + }; +} + +const {version} = require('../../../package.json'); + +// MetricsCollectorState is a list of states that the metrics collector can be in. +// Tracking the OperationMetricsCollector state is done so that the +// OperationMetricsCollector methods are not called in the wrong order. If the +// methods are called in the wrong order they will not execute and they will +// throw warnings. +// +// The following state transitions are allowed: +// OPERATION_NOT_STARTED -> OPERATION_STARTED_ATTEMPT_NOT_IN_PROGRESS +// OPERATION_STARTED_ATTEMPT_NOT_IN_PROGRESS -> OPERATION_STARTED_ATTEMPT_IN_PROGRESS +// OPERATION_STARTED_ATTEMPT_IN_PROGRESS -> OPERATION_STARTED_ATTEMPT_NOT_IN_PROGRESS +// OPERATION_STARTED_ATTEMPT_IN_PROGRESS -> OPERATION_COMPLETE +enum MetricsCollectorState { + OPERATION_NOT_STARTED, + OPERATION_STARTED_ATTEMPT_NOT_IN_PROGRESS, + OPERATION_STARTED_ATTEMPT_IN_PROGRESS_NO_ROWS_YET, + OPERATION_STARTED_ATTEMPT_IN_PROGRESS_SOME_ROWS_RECEIVED, + OPERATION_COMPLETE, +} + +// This method displays warnings if METRICS_DEBUG is enabled. +function withMetricsDebug(fn: () => T): T | undefined { + try { + return fn(); + } catch (e) { + if (METRICS_DEBUG) { + console.warn('METRICS_DEBUG warning'); + console.warn((e as ServiceError).message); + } + } + return; +} + +// Checks that the state transition is valid and if not it throws a warning. +function checkState( + currentState: MetricsCollectorState, + allowedStates: MetricsCollectorState[], +): T | undefined { + if (allowedStates.includes(currentState)) { + return; + } else { + throw Error('Invalid state transition'); + } +} + +/** + * A class for tracing and recording client-side metrics related to Bigtable operations. + */ +export class OperationMetricsCollector { + // The following key corresponds to the key the instance information is + // stored in for the metadata that gets returned from the server. + private readonly INSTANCE_INFORMATION_KEY = 'x-goog-ext-425905942-bin'; + private state: MetricsCollectorState; + private operationStartTime: bigint | null; + private attemptStartTime: bigint | null; + private zone: string | undefined; + private cluster: string | undefined; + private tabularApiSurface: ITabularApiSurface; + private methodName: MethodName; + private attemptCount = 0; + private firstResponseLatency: number | null; + private serverTimeRead: boolean; + private serverTime: number | null; + private connectivityErrorCount: number; + private streamingOperation: StreamingState; + private handlers: IMetricsHandler[]; + public userStream?: TimedStream; + + /** + * @param {ITabularApiSurface} tabularApiSurface Information about the Bigtable table being accessed. + * @param {MethodName} methodName The name of the method being traced. + * @param {StreamingState} streamingOperation Whether or not the call is a streaming operation. + * @param {IMetricsHandler[]} handlers The metrics handlers used to store the record the metrics. + */ + constructor( + tabularApiSurface: ITabularApiSurface, + methodName: MethodName, + streamingOperation: StreamingState, + handlers: IMetricsHandler[], + ) { + this.state = MetricsCollectorState.OPERATION_NOT_STARTED; + this.zone = undefined; + this.cluster = undefined; + this.tabularApiSurface = tabularApiSurface; + this.methodName = methodName; + this.operationStartTime = null; + this.attemptStartTime = null; + this.firstResponseLatency = null; + this.serverTimeRead = false; + this.serverTime = null; + this.connectivityErrorCount = 0; + this.streamingOperation = streamingOperation; + this.handlers = handlers; + } + + private getMetricsCollectorData() { + const appProfileId = this.tabularApiSurface.bigtable.appProfileId; + return Object.assign( + { + instanceId: this.tabularApiSurface.instance.id, + table: this.tabularApiSurface.id, + cluster: this.cluster || '', + zone: this.zone || 'global', + method: this.methodName, + projectId: this.tabularApiSurface.bigtable.projectId as string, + }, + appProfileId ? {app_profile: appProfileId} : {}, + ); + } + + /** + * Called to add handlers to the stream so that we can observe + * header and trailer data for client side metrics. + * + * @param stream + */ + wrapRequest(stream: AbortableDuplex) { + stream + .on( + 'metadata', + (metadata: {internalRepr: Map; options: {}}) => { + this.onMetadataReceived(metadata); + }, + ) + .on( + 'status', + (status: { + metadata: {internalRepr: Map; options: {}}; + }) => { + this.onStatusMetadataReceived(status); + }, + ); + } + + /** + * Called when the operation starts. Records the start time. + */ + onOperationStart() { + withMetricsDebug(() => { + checkState(this.state, [MetricsCollectorState.OPERATION_NOT_STARTED]); + this.operationStartTime = hrtime.bigint(); + this.firstResponseLatency = null; + this.state = + MetricsCollectorState.OPERATION_STARTED_ATTEMPT_NOT_IN_PROGRESS; + }); + } + + /** + * Called when an attempt (e.g., an RPC attempt) completes. Records attempt latencies. + * @param {grpc.status} attemptStatus The grpc status for the attempt. + */ + onAttemptComplete(attemptStatus: grpc.status) { + withMetricsDebug(() => { + checkState(this.state, [ + MetricsCollectorState.OPERATION_STARTED_ATTEMPT_IN_PROGRESS_NO_ROWS_YET, + MetricsCollectorState.OPERATION_STARTED_ATTEMPT_IN_PROGRESS_SOME_ROWS_RECEIVED, + ]); + this.state = + MetricsCollectorState.OPERATION_STARTED_ATTEMPT_NOT_IN_PROGRESS; + this.attemptCount++; + const endTime = hrtime.bigint(); + if (this.attemptStartTime) { + const totalMilliseconds = Number( + (endTime - this.attemptStartTime) / BigInt(1000000), + ); + this.handlers.forEach(metricsHandler => { + if (metricsHandler.onAttemptComplete) { + metricsHandler.onAttemptComplete({ + attemptLatency: totalMilliseconds, + serverLatency: this.serverTime ?? undefined, + connectivityErrorCount: this.connectivityErrorCount, + streaming: this.streamingOperation, + status: status[attemptStatus], + client_name: `nodejs-bigtable/${version}`, + metricsCollectorData: this.getMetricsCollectorData(), + }); + } + }); + } else { + console.warn('Start time should always be provided'); + } + }); + } + + /** + * Called when a new attempt starts. Records the start time of the attempt. + */ + onAttemptStart() { + withMetricsDebug(() => { + checkState(this.state, [ + MetricsCollectorState.OPERATION_STARTED_ATTEMPT_NOT_IN_PROGRESS, + ]); + this.state = + MetricsCollectorState.OPERATION_STARTED_ATTEMPT_IN_PROGRESS_NO_ROWS_YET; + this.attemptStartTime = hrtime.bigint(); + this.serverTime = null; + this.serverTimeRead = false; + this.connectivityErrorCount = 0; + }); + } + + /** + * Called when the first response is received. Records first response latencies. + */ + onResponse() { + withMetricsDebug(() => { + if (!this.firstResponseLatency) { + checkState(this.state, [ + MetricsCollectorState.OPERATION_STARTED_ATTEMPT_IN_PROGRESS_NO_ROWS_YET, + ]); + this.state = + MetricsCollectorState.OPERATION_STARTED_ATTEMPT_IN_PROGRESS_SOME_ROWS_RECEIVED; + const endTime = hrtime.bigint(); + if (this.operationStartTime) { + this.firstResponseLatency = Number( + (endTime - this.operationStartTime) / BigInt(1000000), + ); + } else { + console.warn( + 'ProjectId and operationStartTime should always be provided', + ); + } + } + }); + } + + /** + * Called when an operation completes (successfully or unsuccessfully). + * Records operation latencies, retry counts, and connectivity error counts. + * @param {grpc.status} finalOperationStatus Information about the completed operation. + * @param {number} applicationLatency The application latency measurement. + */ + onOperationComplete( + finalOperationStatus: grpc.status, + applicationLatency?: number, + ) { + withMetricsDebug(() => { + if ( + this.state === + MetricsCollectorState.OPERATION_STARTED_ATTEMPT_IN_PROGRESS_NO_ROWS_YET || + this.state === + MetricsCollectorState.OPERATION_STARTED_ATTEMPT_IN_PROGRESS_SOME_ROWS_RECEIVED + ) { + this.onAttemptComplete(finalOperationStatus); + } + checkState(this.state, [ + MetricsCollectorState.OPERATION_STARTED_ATTEMPT_NOT_IN_PROGRESS, + ]); + this.state = MetricsCollectorState.OPERATION_COMPLETE; + const endTime = hrtime.bigint(); + if (this.operationStartTime) { + const totalMilliseconds = Number( + (endTime - this.operationStartTime) / BigInt(1000000), + ); + { + this.handlers.forEach(metricsHandler => { + if (metricsHandler.onOperationComplete) { + metricsHandler.onOperationComplete({ + status: status[finalOperationStatus], + streaming: this.streamingOperation, + metricsCollectorData: this.getMetricsCollectorData(), + client_name: `nodejs-bigtable/${version}`, + operationLatency: totalMilliseconds, + retryCount: this.attemptCount - 1, + firstResponseLatency: this.firstResponseLatency ?? 0, + applicationLatency: applicationLatency ?? 0, + }); + } + }); + } + } else { + console.warn('operation start time should always be available here'); + } + }); + } + + /** + * Called when metadata is received. Extracts server timing information if available. + * @param {object} metadata The received metadata. + */ + onMetadataReceived(metadata: { + internalRepr: Map; + options: {}; + }) { + if (!this.serverTimeRead && this.connectivityErrorCount < 1) { + // Check serverTimeRead, connectivityErrorCount here to reduce latency. + const mappedEntries = new Map( + Array.from(metadata.internalRepr.entries(), ([key, value]) => [ + key, + value.toString(), + ]), + ); + const SERVER_TIMING_REGEX = /.*gfet4t7;\s*dur=(\d+\.?\d*).*/; + const SERVER_TIMING_KEY = 'server-timing'; + const durationValues = mappedEntries.get(SERVER_TIMING_KEY); + const matchedDuration = durationValues?.match(SERVER_TIMING_REGEX); + if (matchedDuration && matchedDuration[1]) { + if (!this.serverTimeRead) { + this.serverTimeRead = true; + this.serverTime = isNaN(parseInt(matchedDuration[1])) + ? null + : parseInt(matchedDuration[1]); + } + } else { + this.connectivityErrorCount = 1; + } + } + } + + /** + * Called when status information is received. Extracts zone and cluster information. + * @param {object} status The received status information. + */ + onStatusMetadataReceived(status: { + metadata: {internalRepr: Map; options: {}}; + }) { + withMetricsDebug(() => { + if (!this.zone || !this.cluster) { + const mappedValue = status.metadata.internalRepr.get( + this.INSTANCE_INFORMATION_KEY, + ) as Buffer[]; + if (mappedValue && mappedValue[0] && ResponseParams) { + const decodedValue = ResponseParams.decode( + mappedValue[0], + mappedValue[0].length, + ); + if ( + decodedValue && + (decodedValue as unknown as {zoneId: string}).zoneId + ) { + this.zone = (decodedValue as unknown as {zoneId: string}).zoneId; + } + if ( + decodedValue && + (decodedValue as unknown as {clusterId: string}).clusterId + ) { + this.cluster = ( + decodedValue as unknown as {clusterId: string} + ).clusterId; + } + } + } + }); + } +} diff --git a/handwritten/bigtable/src/cluster.ts b/handwritten/bigtable/src/cluster.ts new file mode 100644 index 00000000000..55fd9a07b59 --- /dev/null +++ b/handwritten/bigtable/src/cluster.ts @@ -0,0 +1,731 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {promisifyAll} from '@google-cloud/promisify'; +import {CallOptions, LROperation, Operation, ServiceError} from 'google-gax'; + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const pumpify = require('pumpify'); + +import {google} from '../protos/protos'; +import {Bigtable} from '.'; +import {Instance} from './instance'; +import {ClusterUtils} from './utils/cluster'; + +import { + Backup, + GetBackupsCallback, + GetBackupsOptions, + GetBackupsResponse, + IBackup, + ModifiableBackupFields, +} from './backup'; +import {Transform} from 'stream'; +import {Table} from './table'; +import extend = require('extend'); + +export interface GenericCallback { + (err?: ServiceError | null, apiResponse?: T | null): void; +} +export interface GenericClusterCallback { + ( + err?: ServiceError | null, + cluster?: Cluster | null, + apiResponse?: T | null, + ): void; +} +export interface GenericOperationCallback { + ( + err?: ServiceError | null, + operation?: Operation | null, + apiResponse?: T | null, + ): void; +} + +export type IEmpty = google.protobuf.IEmpty; +export type ICluster = google.bigtable.admin.v2.ICluster; +export type IOperation = google.longrunning.IOperation; + +export type ApiResponse = [IOperation]; +export type CreateClusterResponse = [ICluster, Operation, IOperation]; +export type BooleanResponse = [boolean]; +export type GetClusterResponse = [ICluster, IOperation]; +export type GetClustersResponse = [Cluster[], IOperation]; +export type GetClusterMetadataResponse = [ICluster, IOperation]; +export type SetClusterMetadataResponse = [Operation, google.protobuf.Empty]; + +export type CreateClusterCallback = GenericCallback; +export type DeleteClusterCallback = GenericCallback; +export type ExistsClusterCallback = GenericCallback; +export type GetClusterCallback = GenericClusterCallback; +export type GetClustersCallback = ( + err: ServiceError | null, + clusters?: Cluster[], + apiResponse?: google.bigtable.admin.v2.IListClustersResponse, +) => void; +export interface SetClusterMetadataOptions { + nodes?: number; + minServeNodes?: number; + maxServeNodes?: number; + cpuUtilizationPercent?: number; + location?: string; +} +export type SetClusterMetadataCallback = GenericOperationCallback< + Operation | null | undefined +>; +export interface BasicClusterConfig { + encryption?: google.bigtable.admin.v2.Cluster.IEncryptionConfig; + key?: string; + location: string; + nodes?: number; + storage?: string; + minServeNodes?: number; + maxServeNodes?: number; + cpuUtilizationPercent?: number; +} + +export interface CreateBackupConfig extends ModifiableBackupFields { + table?: string | Table; + gaxOptions?: CallOptions; +} + +export type CreateBackupCallback = ( + err: ServiceError | Error | null, + backup?: Backup, + operation?: Operation, + apiResponse?: IOperation, +) => void; +export type CreateBackupResponse = [Backup, Operation, IOperation]; + +export interface CreateClusterOptions extends BasicClusterConfig { + gaxOptions?: CallOptions; +} +export type GetClusterMetadataCallback = ( + err: ServiceError | null, + metadata?: ICluster | null, + apiResponse?: IOperation | null, +) => void; + +/** + * Create a cluster object to interact with your cluster. + * + * @class + * @param {Instance} instance The parent instance of this cluster. + * @param {string} id Id of the cluster. + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * const cluster = instance.cluster('my-cluster'); + * ``` + */ +export class Cluster { + bigtable: Bigtable; + instance: Instance; + id: string; + name: string; + metadata?: ICluster; + constructor(instance: Instance, id: string) { + this.bigtable = instance.bigtable; + this.instance = instance; + + let name: string; + + if (id.includes('/')) { + if (id.startsWith(`${instance.name}/clusters/`)) { + name = id; + } else { + throw new Error(`Cluster id '${id}' is not formatted correctly. +Please use the format 'my-cluster' or '${instance.name}/clusters/my-cluster'.`); + } + } else { + name = `${instance.name}/clusters/${id}`; + } + this.id = name.split('/').pop()!; + this.name = name; + } + + /** + * Formats zone location. + * + * @private + * + * @param {string} project The project ID. + * @param {string} location The zone location. + * @returns {string} + * + * @example + * ``` + * Cluster.getLocation_('my-project', 'us-central1-b'); + * // 'projects/my-project/locations/us-central1-b' + * ``` + */ + static getLocation_(project: string, location: string): string { + if (location.includes('/')) { + return location; + } + + // in-case project has '/', split and pick last component + if (project.includes('/')) { + project = project.split('/').pop()!; + } + + return `projects/${project}/locations/${location}`; + } + + /** + * Maps the storage type to the proper integer. + * + * @private + * + * @param {string} type The storage type (hdd, ssd). + * @returns {number} + * + * @example + * ``` + * Cluster.getStorageType_('ssd'); + * // 1 + * ``` + */ + static getStorageType_(type: string): number { + const storageTypes: {[k: string]: number} = { + unspecified: 0, + ssd: 1, + hdd: 2, + }; + + if (typeof type === 'string') { + type = type.toLowerCase(); + } + + return storageTypes[type] || storageTypes.unspecified; + } + + /** + * Get a reference to a Bigtable Cluster. + * + * @param {string} id The backup name or id. + * @returns {Backup} + */ + backup(id: string): Backup { + return new Backup(this, id); + } + + create(): Promise; + create(options: CreateClusterOptions): Promise; + create(callback: CreateClusterCallback): void; + create(options: CreateClusterOptions, callback: CreateClusterCallback): void; + /** + * Create a cluster. + * + * @param {object} [options] See {@link Instance#createCluster}. + * @param {function} [callback] The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_create_cluster + */ + create( + optionsOrCallback?: CreateClusterOptions | CreateClusterCallback, + cb?: CreateClusterCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const options = + typeof optionsOrCallback === 'object' && optionsOrCallback + ? optionsOrCallback + : ({} as CreateClusterOptions); + + this.instance.createCluster(this.id, options, callback); + } + + createBackup( + id: string, + config: CreateBackupConfig, + ): Promise; + createBackup( + id: string, + config: CreateBackupConfig, + callback: CreateBackupCallback, + ): void; + /** + * Backup a table from this cluster. + * + * @param {string} id A unique ID for the backup. + * @param {object} config Configuration object. + * @param {BackupTimestamp} config.expireTime When the backup will be + * automatically deleted. + * @param {string|Table} config.table Table to create the backup from. + * @param {CallOptions} [config.gaxOptions] Request configuration options, + * outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {CreateBackupCallback} [callback] The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Backup} callback.backup The newly created Backup. + * @param {Operation} callback.operation An operation object that can be used + * to check the status of the request. + * @param {object} callback.apiResponse The full API response. + * @return {void | Promise} + * + * @example + * region_tag:bigtable_api_create_backup + */ + createBackup( + id: string, + config: CreateBackupConfig, + callback?: CreateBackupCallback, + ): void | Promise { + if (!id) { + throw new TypeError('An id is required to create a backup.'); + } + + if (typeof config !== 'object') { + throw new Error('A configuration object is required.'); + } + + const table = config.table; + + if (!table) { + throw new Error('A source table is required to backup.'); + } + + const reqOpts = { + parent: this.name, + backupId: id, + backup: { + sourceTable: typeof table === 'string' ? table : table.name, + ...config, + }, + }; + + ClusterUtils.formatBackupExpiryTime(reqOpts.backup); + + delete reqOpts.backup.table; + delete reqOpts.backup.gaxOptions; + + this.bigtable.request< + LROperation + >( + { + client: 'BigtableTableAdminClient', + method: 'createBackup', + reqOpts, + gaxOpts: config.gaxOptions, + }, + (err, ...args) => { + if (err) { + callback!(err, undefined, ...args); + return; + } + + callback!(null, this.backup(id), ...args); + }, + ); + } + + delete(): Promise; + delete(gaxOptions: CallOptions): Promise; + delete(callback: DeleteClusterCallback): void; + delete(gaxOptions: CallOptions, callback: DeleteClusterCallback): void; + /** + * Delete the cluster. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_delete_cluster + */ + delete( + gaxOptionsOrCallback?: CallOptions | DeleteClusterCallback, + cb?: DeleteClusterCallback, + ): void | Promise { + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' && gaxOptionsOrCallback + ? gaxOptionsOrCallback + : ({} as CallOptions); + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'deleteCluster', + reqOpts: { + name: this.name, + }, + gaxOpts: gaxOptions, + }, + callback, + ); + } + + exists(): Promise; + exists(gaxOptions: CallOptions): Promise; + exists(callback: ExistsClusterCallback): void; + exists(gaxOptions: CallOptions, callback: ExistsClusterCallback): void; + /** + * Check if a cluster exists. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {boolean} callback.exists Whether the cluster exists or not. + * + * @example + * region_tag:bigtable_api_exists_cluster + */ + exists( + gaxOptionsOrCallback?: CallOptions | ExistsClusterCallback, + cb?: ExistsClusterCallback, + ): void | Promise { + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' && gaxOptionsOrCallback + ? gaxOptionsOrCallback + : ({} as CallOptions); + + this.getMetadata(gaxOptions, (err?: ServiceError | null) => { + if (err) { + if (err.code === 5) { + callback(null, false); + return; + } + + callback(err); + return; + } + + callback(null, true); + }); + } + + get(): Promise; + get(gaxOptions: CallOptions): Promise; + get(callback: GetClusterCallback): void; + get(gaxOptions: CallOptions, callback: GetClusterCallback): void; + /** + * Get a cluster if it exists. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_get_cluster + */ + get( + gaxOptionsOrCallback?: CallOptions | GetClusterCallback, + cb?: GetClusterCallback, + ): void | Promise { + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' && gaxOptionsOrCallback + ? gaxOptionsOrCallback + : ({} as CallOptions); + + this.getMetadata( + gaxOptions, + (err?: ServiceError | null, metadata?: ICluster | null) => { + callback(err, err ? null : this, metadata); + }, + ); + } + + getBackups(options?: GetBackupsOptions): Promise; + getBackups(options: GetBackupsOptions, callback: GetBackupsCallback): void; + getBackups(callback: GetBackupsCallback): void; + /** + * Get Cloud Bigtable Backup instances within this cluster. This returns both + * completed and pending backups. + * + * @param {GetBackupsOptions | GetBackupsCallback} [optionsOrCallback] + * @param {GetBackupsResponse} [callback] The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {Backup[]} callback.backups All matching Backup instances. + * @param {object} callback.apiResponse The full API response. + * @return {void | Promise} + * + * @example + * region_tag:bigtable_api_list_backups + */ + getBackups( + optionsOrCallback?: GetBackupsOptions | GetBackupsCallback, + cb?: GetBackupsCallback, + ): void | Promise { + let options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + + options = extend(true, {}, options); + + const gaxOpts = options.gaxOptions || {}; + + const reqOpts: google.bigtable.admin.v2.IListBackupsRequest = { + parent: this.name, + pageSize: (gaxOpts as GetBackupsOptions).pageSize, + pageToken: (gaxOpts as GetBackupsOptions).pageToken, + ...options, + }; + + delete (gaxOpts as GetBackupsOptions).pageSize; + delete (gaxOpts as GetBackupsOptions).pageToken; + delete (reqOpts as CallOptions).autoPaginate; + delete (reqOpts as GetBackupsOptions).gaxOptions; + + if ( + typeof options.autoPaginate === 'boolean' && + typeof gaxOpts.autoPaginate === 'undefined' + ) { + gaxOpts.autoPaginate = options.autoPaginate; + } + + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'listBackups', + reqOpts, + gaxOpts, + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (err, ...resp: any[]) => { + let backups: Backup[] = []; + + if (resp[0]) { + backups = resp[0].map((backup: IBackup) => { + // Instance#getBackups() uses `-` as a cluster id, which tells the + // API to return backups from any cluster. + const backupInstance = + this.id === '-' + ? this.instance + // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain + .cluster(backup.name?.match(/clusters\/([^/]+)/)![1]!) + .backup(backup.name!.split('/').pop()!) + : this.backup(backup.name!.split('/').pop()!); + backupInstance.metadata = backup; + return backupInstance; + }); + } + + const nextQuery = resp[1]! ? Object.assign(options, resp[1]) : null; + const apiResp: google.bigtable.admin.v2.IListBackupsResponse = resp[2]; + + callback(err, backups, nextQuery, apiResp); + }, + ); + } + + /** + * Lists Cloud Bigtable backups within this cluster. Provides both + * completed and pending backups as a readable object stream. + * + * @param {GetBackupsOptions} [options] Configuration object. See + * {@link Cluster#getBackups} for a complete list of options. + * @returns {ReadableStream} + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * const cluster = instance.cluster('my-cluster'); + * + * cluster.getBackupsStream() + * .on('error', console.error) + * .on('data', function(backup) { + * // backup is a Backup object. + * }) + * .on('end', () => { + * // All backups retrieved. + * }); + * + * //- + * // If you anticipate many results, you can end a stream early to prevent + * // unnecessary processing and API requests. + * //- + * cluster.getBackupsStream() + * .on('data', function(backup) { + * this.end(); + * }); + * ``` + */ + getBackupsStream(options?: GetBackupsOptions): NodeJS.ReadableStream { + const {gaxOptions, ...restOptions} = options || {}; + const reqOpts: google.bigtable.admin.v2.IListBackupsRequest = { + ...restOptions, + parent: this.name, + }; + + return pumpify.obj([ + this.bigtable.request({ + client: 'BigtableTableAdminClient', + method: 'listBackupsStream', + reqOpts, + gaxOpts: gaxOptions, + }), + new Transform({ + objectMode: true, + transform: (backup: IBackup, enc: string, cb: Function) => { + // Instance#getBackupsStream() uses `-` as a cluster id, which tells + // the API to return backups from any cluster. + const backupInstance = + this.id === '-' + ? this.instance + // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain + .cluster(backup.name?.match(/clusters\/([^/]+)/)![1]!) + .backup(backup.name!.split('/').pop()!) + : this.backup(backup.name!.split('/').pop()!); + backupInstance.metadata = backup; + cb(null, backupInstance); + }, + }), + ]); + } + + getMetadata(): Promise; + getMetadata(gaxOptions: CallOptions): Promise; + getMetadata(callback: GetClusterMetadataCallback): void; + getMetadata( + gaxOptions: CallOptions, + callback: GetClusterMetadataCallback, + ): void; + /** + * Get the cluster metadata. + * + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.metadata The metadata. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_cluster_get_meta + */ + getMetadata( + gaxOptionsOrCallback?: CallOptions | GetClusterMetadataCallback, + cb?: GetClusterMetadataCallback, + ): void | Promise { + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' && gaxOptionsOrCallback + ? gaxOptionsOrCallback + : ({} as CallOptions); + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'getCluster', + reqOpts: { + name: this.name, + }, + gaxOpts: gaxOptions, + }, + (err, resp) => { + if (resp) { + this.metadata = resp; + } + callback(err, resp); + }, + ); + } + + setMetadata( + metadata: SetClusterMetadataOptions, + gaxOptions?: CallOptions, + ): Promise; + setMetadata( + metadata: SetClusterMetadataOptions, + callback: SetClusterMetadataCallback, + ): void; + setMetadata( + metadata: SetClusterMetadataOptions, + gaxOptions: CallOptions, + callback: SetClusterMetadataCallback, + ): void; + /** + * Set the cluster metadata. + * + * @param {object} metadata See {@link Instance#createCluster} for the + * available metadata options. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Operation} callback.operation An operation object that can be used + * to check the status of the request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_cluster_set_meta + */ + setMetadata( + metadata: SetClusterMetadataOptions, + gaxOptionsOrCallback?: CallOptions | SetClusterMetadataCallback, + cb?: SetClusterMetadataCallback, + ): void | Promise { + ClusterUtils.validateClusterMetadata(metadata); + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' + ? gaxOptionsOrCallback + : ({} as CallOptions); + const reqOpts = ClusterUtils.getRequestFromMetadata(metadata, this.name); + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'partialUpdateCluster', + reqOpts: reqOpts, + gaxOpts: gaxOptions, + }, + (err, resp) => { + callback(err, resp); + }, + ); + } +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(Cluster, { + exclude: ['backup'], +}); + +/** + * Reference to the {@link Cluster} class. + * @name module:@google-cloud/bigtable.Cluster + * @see Cluster + */ diff --git a/handwritten/bigtable/src/execute-query/bytebuffertransformer.ts b/handwritten/bigtable/src/execute-query/bytebuffertransformer.ts new file mode 100644 index 00000000000..c2222fa6ea6 --- /dev/null +++ b/handwritten/bigtable/src/execute-query/bytebuffertransformer.ts @@ -0,0 +1,150 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {Transform, TransformCallback} from 'stream'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +import {google} from '../../protos/protos'; +import * as SqlValues from './values'; + +/** + * stream.Transform which buffers bytes from `ExecuteQuery` responses until + * resumeToken is received. At that point all buffered messages are passed + * forward. + */ +export class ByteBufferTransformer extends Transform { + private messageQueue: Buffer[] = []; + private messageBuffer: Uint8Array[] = []; + private protoBytesEncoding?: BufferEncoding; + + constructor(protoBytesEncoding?: BufferEncoding) { + super({objectMode: true, highWaterMark: 0}); + this.protoBytesEncoding = protoBytesEncoding; + } + + private resetQueueAndBuffer = ( + estimatedBatchSize: number | null | undefined, + ): void => { + this.messageQueue = []; + this.messageBuffer = new Array(estimatedBatchSize || 0); + }; + + private flushMessageBuffer = ( + batchChecksum: number, + estimatedBatchSize: number | null | undefined, + ): void => { + if (this.messageBuffer.length === 0) { + throw new Error('Recieved empty batch with non-zero checksum.'); + } + const newBatch = Buffer.concat(this.messageBuffer); + if (!SqlValues.checksumValid(newBatch, batchChecksum)) { + throw new Error('Failed to validate next batch of results'); + } + this.messageQueue.push(newBatch); + this.messageBuffer = new Array(estimatedBatchSize || 0); + }; + + private pushMessages = (resumeToken: string | Uint8Array): void => { + const token = SqlValues.ensureUint8Array( + resumeToken, + this.protoBytesEncoding, + ); + if (this.messageBuffer.length !== 0) { + throw new Error('Recieved incomplete batch of rows.'); + } + this.push([this.messageQueue, token]); + this.messageBuffer = []; + this.messageQueue = []; + }; + + /** + * Process a `PartialResultSet` message from the server. + * For more info refer to the PartialResultSet protobuf definition. + * @param partialResultSet The `PartialResultSet` message to process. + */ + private processProtoRowsBatch = ( + partialResultSet: google.bigtable.v2.IPartialResultSet, + ): void => { + let handled = false; + if (partialResultSet.reset) { + this.resetQueueAndBuffer(partialResultSet.estimatedBatchSize); + handled = true; + } + + if (partialResultSet.protoRowsBatch?.batchData?.length) { + this.messageBuffer.push( + SqlValues.ensureUint8Array( + partialResultSet.protoRowsBatch.batchData, + this.protoBytesEncoding, + ), + ); + handled = true; + } + + if (partialResultSet.batchChecksum) { + this.flushMessageBuffer( + partialResultSet.batchChecksum, + partialResultSet.estimatedBatchSize, + ); + handled = true; + } + + if ( + partialResultSet.resumeToken && + partialResultSet.resumeToken.length > 0 + ) { + this.pushMessages(partialResultSet.resumeToken); + handled = true; + } + + if (!handled) { + throw new Error('Response did not contain any results!'); + } + }; + + _transform( + chunk: google.bigtable.v2.ExecuteQueryResponse, + _encoding: BufferEncoding, + callback: TransformCallback, + ) { + let maybeError: Error | null = null; + const reponse = chunk as google.bigtable.v2.ExecuteQueryResponse; + try { + switch (reponse.response) { + case 'results': { + this.processProtoRowsBatch(reponse.results!); + break; + } + default: + throw Error(`Response contains unknown type ${reponse.response}`); + } + } catch (error) { + maybeError = new Error( + `Internal Error. Failed to process response: ${error}`, + ); + } + callback(maybeError); + } + + _flush(callback: TransformCallback): void { + if (this.messageBuffer.length > 0) { + callback( + new Error( + 'Internal Error. Last message did not contain a resumeToken.', + ), + ); + return; + } + callback(null); + } +} diff --git a/handwritten/bigtable/src/execute-query/executequerystatemachine.ts b/handwritten/bigtable/src/execute-query/executequerystatemachine.ts new file mode 100644 index 00000000000..1f2b89a1b3a --- /dev/null +++ b/handwritten/bigtable/src/execute-query/executequerystatemachine.ts @@ -0,0 +1,589 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. +import { + PreparedStatement, + PreparedStatementDataCallback, +} from './preparedstatement'; +import {Bigtable} from '..'; +import {ServiceError, RetryOptions} from 'google-gax'; +import {google} from '../../protos/protos'; +import * as SqlTypes from './types'; +import {AbortableDuplex} from '..'; +import {ByteBufferTransformer} from './bytebuffertransformer'; +import { + DEFAULT_RETRY_COUNT, + isExpiredQueryError, + RETRYABLE_STATUS_CODES, +} from '../utils/retry-options'; +import {ExecuteQueryStreamWithMetadata} from './values'; +import {ProtobufReaderTransformer} from './protobufreadertransformer'; +import {MetadataConsumer} from './metadataconsumer'; +import {DEFAULT_BACKOFF_SETTINGS} from '../tabular-api-surface'; +import {isRstStreamError} from '../utils/createReadStreamInternal'; +const pumpify = require('pumpify'); + +/** + * Creates a stream with some additional functionalities used by + * the ExecuteQueryStateMachine. + */ +interface CallerStream extends ExecuteQueryStreamWithMetadata { + /** + * Sets the metadata used to parse the executeQuery responses. + */ + updateMetadata: (metadata: SqlTypes.ResultSetMetadata) => void; + /** + * @returns the latest resumeToken before which all data was processed. + */ + getLatestResumeToken: () => Uint8Array | string | null; + /** + * @param callback guaranteed to be called *after* the last message + * was processed. + */ + onDrain: (callback: () => void) => void; + /** + * No other data event will be emitted after this method is called. + */ + close: () => void; + /** + * keeps a reference to the state machine. + */ + _stateMachine: ExecuteQueryStateMachine; +} + +interface StreamRetryOptions { + maxRetries: number; + totalTimeout: number; + retryCodes: Set; + initialRetryDelayMillis: number; + retryDelayMultiplier: number; + maxRetryDelayMillis: number; +} + +export type State = + /** + * This is the starting state. When the executeQuery starts we try to + * fetch the query plan from the PreparedStatement object. It is done via a callback + * If the query plan is expired, it might take time to refresh and the callback + * won't be called immediately. + */ + | 'AwaitingQueryPlan' + /** + * We may have recieved some data from the server, but no resumeToken has beed reached. + * This is an important distinction, because before the resumeToken, if the server + * returns an "expired query plan" error, we can still try to refresh it. + */ + | 'BeforeFirstResumeToken' + /** + * After the first resumeToken has been reached, we can't refresh the query plan, + * because the schema could have changed in the mean time. This would cause the + * new rows to be parsed differently than the previous ones. That's why, in this + * state, we treat the "expired query plan" error as non-retryable. + */ + | 'AfterFirstResumeToken' + /** + * When we need to properly dispose of the* old responseStream and buteBuffer, we + * enter a "Draining..." state. Depending on what we want to do next, we have + * DrainAndRefreshQueryPlan - moves to AwaitingQueryPlan after draining completed + * DrainingBeforeResumeToken - moves to BeforeFirstResumeToken after draining completed + * DrainingAfterResumeToken - moves to AfterFirstResumeToken after draining completed + * + * We want to make a new request only when all requests already written to the Reader + * by our previous active request stream were processed. + * + * For simplicity, we will drop the previous Bigtable stream and ByteBuffer transform + * and recreate them. We could also keep the ByteBuffer alive, but that would require + * us to clean up its internal state and still wait for the entire buffer to be + * read—just one step upstream. + * + * Please note that we cannot use gax's built-in streaming retries, as we have no way + * of informing it that we'd like to wait for an event before retrying. An alternative + * approach would be to purge all buffers of all streams before making a request, but + * there is no standard API for that. Additionally, this would not help us with gax, + * as we cannot traverse all streams upstream of our ByteBuffer to purge their buffers, + * nor can we rely on implementation details. + * + * We cannot simply wait until all events are processed by ByteBuffer's _transform() method, + * as there might still be events left in ByteBuffer's readable buffer that we do not want + * to discard. + * + * Our solution is to wait until all events in the Reader's writable buffer are processed + * and use the last resumeToken seen by the Reader to make a new request. + * + * We will detach (unpipe) the ByteBuffer from the Reader and wait until all requests + * written to theReader by the ByteBuffer are processed using the _transform() method. + * This ensures that all events written before detachment are handled by _transform(), + * and the last resumption token seen by the Reader is the correct one to use. + * + * Thus, we will wait for the buffer to clear before making a new request and use the + * last resumeToken seen by the Reader to determine the correct token for the retry request. + * + * This guarantees that no responses will be lost—everything processed by the + * Reader's `_transform()` method has been pushed to the caller and won't be discarded. + * Additionally, no duplicates will occur, as no more responses will be seen by `_transform()` + * until a new request is made. + */ + | 'DrainAndRefreshQueryPlan' + /** + * Moves to BeforeFirstResumeToken after draining. For more info see 'DrainAndRefreshQueryPlan' state. + */ + | 'DrainingBeforeResumeToken' + /** + * Moves to AfterFirstResumeToken after draining. For more info see 'DrainAndRefreshQueryPlan' state. + */ + | 'DrainingAfterResumeToken' + /** + * This state indicates that the stream has finished without error. + */ + | 'Finished' + /** + * This state indicates that a non-retryable error occured and the stream + * cannot be recovered. + */ + | 'Failed'; + +const DEFAULT_TOTAL_TIMEOUT_MS = 60000; + +/** + * This object handles creating and piping the streams + * which are used to process the responses from the server. + * It's main purpose is to make sure that the callerStream, which + * the user gets as a result of Instance.executeQuery, behaves properly: + * - closes in case of a failure + * - doesn't close in case of a retryable error. + * + * We create the following streams: + * responseStream -> byteBuffer -> readerStream -> resultStream + * + * The last two (readerStream and resultStream) are connected + * and returned to the caller - hence called the callerStream. + * + * When a request is made responseStream and byteBuffer are created, + * connected and piped to the readerStream. + * + * On retry, the old responseStream-byteBuffer pair is discarded and a + * new pair is crated. + * + * For more info please refer to the `State` type + */ +export class ExecuteQueryStateMachine { + private bigtable: Bigtable; + private callerStream: CallerStream; + private originalEnd: (chunk?: any, encoding?: any, cb?: () => void) => void; + private retryOptions: StreamRetryOptions; + private valuesStream: AbortableDuplex | null; + private requestParams: any; + private lastPreparedStatementBytes?: Uint8Array | string; + private preparedStatement: PreparedStatement; + private state: State; + private deadlineTs: number; + private protoBytesEncoding?: BufferEncoding; + private numErrors: number; + private retryTimer: NodeJS.Timeout | null; + private timeoutTimer: NodeJS.Timeout | null; + + constructor( + bigtable: Bigtable, + callerStream: CallerStream, + preparedStatement: PreparedStatement, + requestParams: any, + retryOptions?: Partial | null, + protoBytesEncoding?: BufferEncoding, + ) { + this.bigtable = bigtable; + this.callerStream = callerStream; + this.originalEnd = callerStream.end.bind(callerStream); + this.callerStream.end = this.handleCallersEnd.bind(this); + this.requestParams = requestParams; + this.retryOptions = this.parseRetryOptions(retryOptions); + this.deadlineTs = Date.now() + this.retryOptions.totalTimeout; + this.valuesStream = null; + this.preparedStatement = preparedStatement; + this.protoBytesEncoding = protoBytesEncoding; + this.numErrors = 0; + this.retryTimer = null; + this.timeoutTimer = setTimeout( + this.handleTotalTimeout, + this.calculateTotalTimeout(), + ); + + this.state = 'AwaitingQueryPlan'; + this.preparedStatement.getData( + this.handleQueryPlan, + this.calculateTotalTimeout(), + ); + } + + private parseRetryOptions = ( + input?: Partial | null, + ): StreamRetryOptions => { + const rCodes = input?.retryCodes + ? new Set(input?.retryCodes) + : RETRYABLE_STATUS_CODES; + const backoffSettings = input?.backoffSettings; + const clientTotalTimeout = + this?.bigtable?.options?.BigtableClient?.clientConfig?.interfaces && + this?.bigtable?.options?.BigtableClient?.clientConfig?.interfaces[ + 'google.bigtable.v2.Bigtable' + ]?.methods['ExecuteQuery']?.timeout_millis; + return { + maxRetries: backoffSettings?.maxRetries || DEFAULT_RETRY_COUNT, + totalTimeout: + backoffSettings?.totalTimeoutMillis || + clientTotalTimeout || + DEFAULT_TOTAL_TIMEOUT_MS, + retryCodes: rCodes, + initialRetryDelayMillis: + backoffSettings?.initialRetryDelayMillis || + DEFAULT_BACKOFF_SETTINGS.initialRetryDelayMillis, + retryDelayMultiplier: + backoffSettings?.retryDelayMultiplier || + DEFAULT_BACKOFF_SETTINGS.retryDelayMultiplier, + maxRetryDelayMillis: + backoffSettings?.maxRetryDelayMillis || + DEFAULT_BACKOFF_SETTINGS.maxRetryDelayMillis, + }; + }; + + private calculateTotalTimeout = () => { + return Math.max(this.deadlineTs - Date.now(), 0); + }; + + private fail = (err: Error) => { + if (this.state !== 'Failed' && this.state !== 'Finished') { + this.state = 'Failed'; + this.clearTimers(); + this.callerStream.emit('error', err); + } + }; + + private createValuesStream = (): AbortableDuplex => { + const reqOpts: google.bigtable.v2.IExecuteQueryRequest = { + ...this.requestParams, + preparedQuery: this.lastPreparedStatementBytes, + resumeToken: this.callerStream.getLatestResumeToken(), + }; + + const retryOpts = { + currentRetryAttempt: 0, + // Handling retries in this client. + // Options below prevent gax from retrying. + noResponseRetries: 0, + shouldRetryFn: () => { + return false; + }, + }; + + const responseStream = this.bigtable.request({ + client: 'BigtableClient', + method: 'executeQuery', + reqOpts, + gaxOpts: retryOpts, + }); + + const byteBuffer = new ByteBufferTransformer(this.protoBytesEncoding); + const rowValuesStream = pumpify.obj([responseStream, byteBuffer]); + + let aborted = false; + const abort = () => { + if (!aborted) { + aborted = true; + responseStream.abort(); + } + }; + rowValuesStream.abort = abort; + + return rowValuesStream; + }; + + private makeNewRequest = ( + preparedStatementBytes?: Uint8Array | string, + metadata?: SqlTypes.ResultSetMetadata, + ) => { + if (this.valuesStream !== null) { + // assume old streams were scrached. + this.fail( + new Error( + 'Internal error: making a request before streams from the last one was cleaned up.', + ), + ); + } + + if (preparedStatementBytes) { + this.lastPreparedStatementBytes = preparedStatementBytes; + } + if (metadata) { + this.callerStream.updateMetadata(metadata); + } + this.valuesStream = this.createValuesStream(); + + this.valuesStream + .on('error', this.handleStreamError) + .on('data', this.handleStreamData) + .on('close', this.handleStreamEnd) + .on('end', this.handleStreamEnd); + + this.valuesStream.pipe(this.callerStream, {end: false}); + }; + + private discardOldValueStream = () => { + if (this.valuesStream) { + this.valuesStream.abort(); + this.valuesStream.unpipe(this.callerStream); + this.valuesStream.removeAllListeners('error'); + this.valuesStream.removeAllListeners('data'); + this.valuesStream.removeAllListeners('end'); + this.valuesStream.removeAllListeners('close'); + this.valuesStream.destroy(); + this.valuesStream = null; + } + }; + + private getNextRetryDelay = (): number => { + // 0 - 100 ms jitter + const jitter = Math.floor(Math.random() * 100); + const calculatedNextRetryDelay = + this.retryOptions.initialRetryDelayMillis * + Math.pow(this.retryOptions.retryDelayMultiplier, this.numErrors) + + jitter; + + return Math.min( + calculatedNextRetryDelay, + this.retryOptions.maxRetryDelayMillis, + ); + }; + + private clearTimers = (): void => { + if (this.retryTimer) { + clearTimeout(this.retryTimer); + this.retryTimer = null; + } + if (this.timeoutTimer) { + clearTimeout(this.timeoutTimer); + this.timeoutTimer = null; + } + }; + + // Transitions: + + private startNextAttempt = (): void => { + if (this.state === 'DrainAndRefreshQueryPlan') { + this.state = 'AwaitingQueryPlan'; + this.preparedStatement.getData( + this.handleQueryPlan, + this.calculateTotalTimeout(), + ); + } else if (this.state === 'DrainingBeforeResumeToken') { + this.state = 'BeforeFirstResumeToken'; + this.makeNewRequest(this.lastPreparedStatementBytes); + } else if (this.state === 'DrainingAfterResumeToken') { + this.state = 'AfterFirstResumeToken'; + this.makeNewRequest(this.lastPreparedStatementBytes); + } else { + this.fail( + new Error( + `startNextAttempt can't be invoked on a current state ${this.state}`, + ), + ); + } + }; + + private handleDrainingDone = (): void => { + if ( + this.state === 'DrainAndRefreshQueryPlan' || + this.state === 'DrainingBeforeResumeToken' || + this.state === 'DrainingAfterResumeToken' + ) { + this.retryTimer = setTimeout( + this.startNextAttempt, + this.getNextRetryDelay(), + ); + } else { + this.fail( + new Error( + `handleDrainingDone can't be invoked on a current state ${this.state}`, + ), + ); + } + }; + + private handleTotalTimeout = (): void => { + this.discardOldValueStream(); + if (this.retryTimer) { + clearTimeout(this.retryTimer); + this.retryTimer = null; + } + this.fail(new Error('Deadline exceeded.')); + }; + + private handleStreamError = (err: ServiceError): void => { + this.discardOldValueStream(); + if ( + this.retryOptions.retryCodes.has(err.code) || // retryable error + isRstStreamError(err) + ) { + // We want to make a new request only when all requests already written to the Reader by our + // previous active request stream were processed. + this.numErrors += 1; + if (this.numErrors <= this.retryOptions.maxRetries) { + if (this.state === 'AfterFirstResumeToken') { + this.state = 'DrainingAfterResumeToken'; + this.callerStream.onDrain(this.handleDrainingDone); + } else if (this.state === 'BeforeFirstResumeToken') { + this.state = 'DrainingBeforeResumeToken'; + this.callerStream.onDrain(this.handleDrainingDone); + } else { + this.fail( + new Error( + `Can't handle a stream error in the current state ${this.state}`, + ), + ); + } + } else { + this.fail( + new Error(`Maximum retry limit exeeded. Last error: ${err.message}`), + ); + } + } else if (isExpiredQueryError(err)) { + if (this.state === 'AfterFirstResumeToken') { + this.fail(new Error('Query plan expired during a retry attempt.')); + } else if (this.state === 'BeforeFirstResumeToken') { + this.state = 'DrainAndRefreshQueryPlan'; + // If the server returned the "expired query error" we mark it as expired. + this.preparedStatement.markAsExpired(); + this.callerStream.onDrain(this.handleDrainingDone); + } else { + this.fail( + new Error( + `Can't handle expired query error in the current state ${this.state}`, + ), + ); + } + } else { + this.fail(new Error(`Unexpected error: ${err.message}`)); + } + }; + + private handleQueryPlan: PreparedStatementDataCallback = ( + err?: Error, + preparedStatementBytes?: Uint8Array | string, + metadata?: SqlTypes.ResultSetMetadata, + ) => { + if (this.state === 'AwaitingQueryPlan') { + if (err) { + this.numErrors += 1; + if (this.numErrors <= this.retryOptions.maxRetries) { + this.preparedStatement.getData( + this.handleQueryPlan, + this.calculateTotalTimeout(), + ); + } else { + this.fail( + new Error( + `Failed to get query plan. Maximum retry limit exceeded. Last error: ${err.message}`, + ), + ); + } + } else { + this.state = 'BeforeFirstResumeToken'; + this.makeNewRequest(preparedStatementBytes, metadata); + } + } else { + this.fail( + new Error( + `handleQueryPlan can't be invoked on a current state ${this.state}`, + ), + ); + } + }; + + /** + * This method is called when the valuesStream emits data. + * The valuesStream yelds data only after the resume token + * is recieved, hence the state change. + */ + private handleStreamData = (data: any) => { + if ( + this.state === 'BeforeFirstResumeToken' || + this.state === 'AfterFirstResumeToken' + ) { + this.state = 'AfterFirstResumeToken'; + } else { + this.fail( + new Error( + `Internal Error: recieved data in an invalid state ${this.state}`, + ), + ); + } + }; + + private handleStreamEnd = (): void => { + if ( + this.state === 'AfterFirstResumeToken' || + this.state === 'BeforeFirstResumeToken' + ) { + this.clearTimers(); + this.state = 'Finished'; + this.originalEnd(); + } else if (this.state === 'Finished') { + // noop + } else { + this.fail( + new Error( + `Internal Error: Cannot handle stream end in state: ${this.state}`, + ), + ); + } + }; + + /** + * The caller should be able to call callerStream.end() to stop receiving + * more rows and cancel the stream prematurely. However this has a side effect + * the 'end' event will be emitted. + * We don't want that, because it also gets emitted if the stream ended + * normally. To tell these two situations apart, we'll overwrite the end + * function, but save the "original" end() function which will be called + * on valuesStream.on('end'). + */ + private handleCallersEnd = ( + chunk?: any, + encoding?: any, + cb?: () => void, + ): CallerStream => { + if (this.state !== 'Failed' && this.state !== 'Finished') { + this.clearTimers(); + this.discardOldValueStream(); + this.state = 'Finished'; + this.callerStream.close(); + } + return this.callerStream; + }; +} + +export function createCallerStream( + readerStream: ProtobufReaderTransformer, + resultStream: ExecuteQueryStreamWithMetadata, + metadataConsumer: MetadataConsumer, + setCallerCancelled: (v: boolean) => void, +): CallerStream { + const callerStream = pumpify.obj([readerStream, resultStream]); + callerStream.getMetadata = resultStream.getMetadata.bind(resultStream); + callerStream.updateMetadata = metadataConsumer.consume.bind(metadataConsumer); + callerStream.getLatestResumeToken = () => readerStream.resumeToken; + callerStream.onDrain = readerStream.onDrain.bind(readerStream); + callerStream.close = () => { + setCallerCancelled(true); + callerStream.destroy(); + }; + return callerStream; +} diff --git a/handwritten/bigtable/src/execute-query/metadataconsumer.ts b/handwritten/bigtable/src/execute-query/metadataconsumer.ts new file mode 100644 index 00000000000..8fa3ecc2b6e --- /dev/null +++ b/handwritten/bigtable/src/execute-query/metadataconsumer.ts @@ -0,0 +1,122 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. +import * as Types from './types'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +import {google} from '../../protos/protos'; + +/** + * This class keeps and parses the metadata. + */ +export class MetadataConsumer { + private metadata: Types.ResultSetMetadata | null; + + constructor() { + this.metadata = null; + } + + getMetadata = (): Types.ResultSetMetadata | null => { + return this.metadata; + }; + + consume = (new_metadata: Types.ResultSetMetadata) => { + this.metadata = new_metadata; + }; + + static parsePBType(type: google.bigtable.v2.Type): Types.Type { + switch (type.kind) { + case 'bytesType': + return Types.Bytes(); + case 'stringType': + return Types.String(); + case 'int64Type': + return Types.Int64(); + case 'float64Type': + return Types.Float64(); + case 'float32Type': + return Types.Float32(); + case 'boolType': + return Types.Bool(); + case 'timestampType': + return Types.Timestamp(); + case 'dateType': + return Types.Date(); + case 'structType': + return Types.Struct( + ...type.structType!.fields!.map(field => ({ + name: field.fieldName as string | null, + type: MetadataConsumer.parsePBType( + field.type as google.bigtable.v2.Type, + ), + })), + ); + case 'arrayType': + return Types.Array( + MetadataConsumer.parsePBType( + type.arrayType!.elementType! as google.bigtable.v2.Type, + ), + ); + case 'mapType': { + const keyType = MetadataConsumer.parsePBType( + type.mapType!.keyType! as google.bigtable.v2.Type, + ); + if ( + keyType.type !== 'int64' && + keyType.type !== 'string' && + keyType.type !== 'bytes' + ) { + throw new Error( + `Unsupported type of map key received: ${keyType.type}`, + ); + } + return Types.Map( + keyType, + MetadataConsumer.parsePBType( + type.mapType!.valueType! as google.bigtable.v2.Type, + ), + ); + } + default: + throw new Error( + `Type ${type.kind} not supported by current client version`, + ); + } + } + + static parseMetadata( + metadata: google.bigtable.v2.IResultSetMetadata, + ): Types.ResultSetMetadata { + if (!metadata.protoSchema) { + throw new Error('Only protoSchemas are supported.'); + } + const columns = metadata.protoSchema.columns!; + if (columns.length === 0) { + throw new Error('Invalid empty ResultSetMetadata received.'); + } + + return Types.ResultSetMetadata.fromTuples( + columns.map(column => { + if (column.name === null || column.name === '') { + throw new Error(`Invalid column name "${column.name}"`); + } else { + return [ + column.name ?? null, + MetadataConsumer.parsePBType( + column.type! as google.bigtable.v2.Type, + ), + ]; + } + }), + ); + } +} diff --git a/handwritten/bigtable/src/execute-query/namedlist.ts b/handwritten/bigtable/src/execute-query/namedlist.ts new file mode 100644 index 00000000000..6dd5dfa3c7e --- /dev/null +++ b/handwritten/bigtable/src/execute-query/namedlist.ts @@ -0,0 +1,98 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +/** + * Represents how field names correspond to field indexes in a NamedList. + */ +export type FieldMapping = { + validFieldNames: Map; + duplicateFieldNames: Map; + fieldNames: (string | null)[]; +}; + +function constructFieldMapping(values: (string | null)[]): FieldMapping { + const fieldMapping: Map = new Map(); + for (let i = 0; i < values.length; i++) { + const name = values[i]; + if (name) { + if (!fieldMapping.has(name)) { + fieldMapping.set(name, []); + } + fieldMapping.get(name)!.push(i); + } + } + const validFieldNames = new Map(); + const duplicateFieldNames = new Map(); + for (const [name, indexes] of fieldMapping.entries()) { + if (indexes.length > 1) { + duplicateFieldNames.set(name, indexes); + } else { + validFieldNames.set(name, indexes[0]); + } + } + return { + validFieldNames, + duplicateFieldNames, + fieldNames: values, + }; +} + +/** + * Class representing a list which allows retrieving elements both by index + * and by name. If multiple elements have the same name, they have to be + * retrieved by index. Otherwise an error is thrown. + */ +export class NamedList { + values: Array; + fieldMapping: FieldMapping; + + constructor(values: Array, fieldMapping: FieldMapping) { + this.values = values; + this.fieldMapping = fieldMapping; + } + + protected static _fromTuples, T>( + type: {new (values: Array, fieldMapping: FieldMapping): R}, + tuples: [string | null, T][], + ): R { + return new type( + tuples.map(tuple => tuple[1]), + constructFieldMapping(tuples.map(tuple => tuple[0])), + ); + } + + get(indexOrName: string | number): T { + let index; + if (typeof indexOrName === 'string') { + if (this.fieldMapping.duplicateFieldNames.has(indexOrName)) { + throw new Error( + `Cannot access ${indexOrName} by name because it is available on multiple indexes: ${this.fieldMapping.duplicateFieldNames + .get(indexOrName)! + .join(', ')}`, + ); + } + index = this.fieldMapping.validFieldNames.get(indexOrName); + if (index === undefined) { + throw new Error(`Unknown field name '${indexOrName}'.`); + } + } else { + index = indexOrName; + } + return this.values[index]; + } + + getFieldNameAtIndex(index: number): string | null { + return this.fieldMapping.fieldNames[index]; + } +} diff --git a/handwritten/bigtable/src/execute-query/parameterparsing.ts b/handwritten/bigtable/src/execute-query/parameterparsing.ts new file mode 100644 index 00000000000..658c0b50c7f --- /dev/null +++ b/handwritten/bigtable/src/execute-query/parameterparsing.ts @@ -0,0 +1,308 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {PreciseDate} from '@google-cloud/precise-date'; +import {google} from '../../protos/protos'; +import {BigtableDate, ExecuteQueryParameterValue} from './values'; +import * as SqlTypes from './types'; +import * as is from 'is'; +import Long = require('long'); + +/** + * Creates protobuf objects with explicit types from passed parameters. + * The protobuf Value objects have a field describing their type explicitly. + * For each param we create a Value object based on the provided type. + * @param parameters map from parameter name to parameter value + * @param parameter_types map from parameter name to parameter type + * @returns map from parameter name to a Value object + */ +export function parseParameters( + parameters: {[param: string]: ExecuteQueryParameterValue}, + parameterTypes: {[param: string]: SqlTypes.Type}, +): {[param: string]: google.bigtable.v2.IValue} { + // Assert both objects contain the same keys: + const parameterKeys = Object.keys(parameters); + const parameterTypeKeys = Object.keys(parameterTypes); + if (parameterKeys.length !== parameterTypeKeys.length) { + throw new Error( + `Number of parameters (${parameterKeys.length}) does not match number of parameter types (${parameterTypeKeys.length}).`, + ); + } + // if the numbers of keys match, but keys differ we will catch it in the next step + const entries: [string, google.bigtable.v2.IValue][] = []; + for (const [key, value] of Object.entries(parameters)) { + let type: SqlTypes.Type; + if (Object.prototype.hasOwnProperty.call(parameterTypes, key)) { + type = parameterTypes[key]; + } else { + throw new Error(`Unrecognized parameter: ${key}`); + } + + entries.push([key, setTypeField(convertJsValueToValue(value, type), type)]); + } + return Object.fromEntries(entries); +} + +export function parseParameterTypes(parameter_types: { + [param: string]: SqlTypes.Type; +}): {[param: string]: google.bigtable.v2.IType} { + return Object.fromEntries( + Object.entries(parameter_types).map(([key, value]) => [ + key, + executeQueryTypeToPBType(value), + ]), + ); +} + +function inferType(value: ExecuteQueryParameterValue): SqlTypes.Type { + if (is.number(value)) { + return SqlTypes.Float64(); + } else if (typeof value === 'bigint') { + return SqlTypes.Int64(); + } else if (is.string(value)) { + return SqlTypes.String(); + } else if (is.boolean(value)) { + return SqlTypes.Bool(); + } else if (is.array(value)) { + // eslint-disable-next-line + throw new Error( + `Cannot infer type of an array ${value}. Please provide a type hint using parameter_types.`, + ); + } else if (typeof value === 'object') { + if (value instanceof Uint8Array) { + return SqlTypes.Bytes(); + } else if (value instanceof PreciseDate) { + return SqlTypes.Timestamp(); + } else if (value instanceof Date) { + throw new Error( + 'Date is not supported as a parameter type. Please use PreciseDate for Sql TIMESTAMP or BigtableDate for SQL DATE', + ); + } else if (value instanceof BigtableDate) { + return SqlTypes.Date(); + } + } + + const typeString = typeof value; + let prototypeString = null; + if (typeString === 'object') { + if (value === null) { + prototypeString = 'null'; + } else { + prototypeString = `constructor.name = ${value.constructor.name}`; + } + } + const typeInfo = `typeof == ${typeString}${ + prototypeString ? `, ${prototypeString}` : '' + })`; + throw new Error( + `Cannot infer type of ${value} (${typeInfo}). Please provide a type hint using parameter_types.`, + ); +} + +export function setTypeField( + value: google.bigtable.v2.IValue, + type: SqlTypes.Type, +): google.bigtable.v2.IValue { + value.type = executeQueryTypeToPBType(type); + return value; +} + +export function executeQueryTypeToPBType( + type: SqlTypes.Type, +): google.bigtable.v2.IType { + switch (type.type) { + case 'string': + return {stringType: {}}; + case 'int64': + return {int64Type: {}}; + case 'float32': + return {float32Type: {}}; + case 'float64': + return {float64Type: {}}; + case 'bytes': + return {bytesType: {}}; + case 'bool': + return {boolType: {}}; + case 'timestamp': + return {timestampType: {}}; + case 'date': + return {dateType: {}}; + case 'array': + return { + arrayType: {elementType: executeQueryTypeToPBType(type.elementType)}, + }; + case 'struct': + return { + structType: { + fields: type.values.map((value, index) => ({ + fieldName: type.getFieldNameAtIndex(index), + type: executeQueryTypeToPBType(value), + })), + }, + }; + case 'map': + return { + mapType: { + keyType: executeQueryTypeToPBType(type.keyType), + valueType: executeQueryTypeToPBType(type.valueType), + }, + }; + } +} + +export function convertJsValueToValue( + value: ExecuteQueryParameterValue, + type: SqlTypes.Type, +): google.bigtable.v2.IValue { + if (value === null) { + return {}; + } + + switch (type.type) { + case 'string': + return convertToString(value); + case 'int64': + return convertToInt64(value); + case 'float32': + return convertToFloat64(value); + case 'float64': + return convertToFloat64(value); + case 'bytes': + return convertToBytes(value); + case 'bool': + return convertToBool(value); + case 'timestamp': + return convertToTimestamp(value); + case 'date': + return convertToDate(value); + case 'array': + return convertToArray(value, type); + case 'struct': + throw new Error('Struct is not a supported query param type'); + case 'map': + throw new Error('Map is not a supported query param type'); + } +} + +function convertToString( + value: ExecuteQueryParameterValue, +): google.bigtable.v2.IValue { + if (is.string(value)) { + return {stringValue: value as string}; + } + throw new Error(`Value ${value} cannot be converted to string.`); +} + +const MAX_LONG = BigInt(Long.MAX_VALUE.toString()); +const MIN_LONG = BigInt(Long.MIN_VALUE.toString()); + +function bigintToLong(value: bigint): Long { + // Long fromString does not check this + if (value > MAX_LONG || value < MIN_LONG) { + throw new Error( + `Value ${value} cannot be converted to int64 - it is out of range.`, + ); + } + return Long.fromString(value.toString()); +} + +function convertToInt64( + value: ExecuteQueryParameterValue, +): google.bigtable.v2.IValue { + if (typeof value === 'bigint') { + return { + intValue: bigintToLong(value), + }; + } else if (typeof value === 'number') { + throw new Error( + `Value ${value} cannot be converted to int64 - argument of type INT64 should by passed as BigInt.`, + ); + } + throw new Error(`Value ${value} cannot be converted to int64.`); +} + +function convertToFloat64( + value: ExecuteQueryParameterValue, +): google.bigtable.v2.IValue { + if (typeof value === 'number') { + return {floatValue: value}; + } + throw new Error(`Value ${value} cannot be converted to float64.`); +} + +function convertToBytes( + value: ExecuteQueryParameterValue, +): google.bigtable.v2.IValue { + if (typeof value === 'object' && value instanceof Uint8Array) { + return {bytesValue: value}; + } + throw new Error(`Value ${value} cannot be converted to bytes.`); +} + +function convertToBool( + value: ExecuteQueryParameterValue, +): google.bigtable.v2.IValue { + if (typeof value === 'boolean') { + return {boolValue: value}; + } + throw new Error(`Value ${value} cannot be converted to boolean.`); +} + +function convertToTimestamp( + value: ExecuteQueryParameterValue, +): google.bigtable.v2.IValue { + if (typeof value === 'object' && value instanceof PreciseDate) { + return {timestampValue: value.toStruct()}; + } + throw new Error( + `Value ${value} cannot be converted to timestamp, please use PreciseDate instead.`, + ); +} + +function convertToDate( + value: ExecuteQueryParameterValue, +): google.bigtable.v2.IValue { + if (typeof value === 'object' && value instanceof BigtableDate) { + return {dateValue: value}; + } + throw new Error(`Value ${value} cannot be converted to date.`); +} + +function convertToArray( + value: ExecuteQueryParameterValue, + type: SqlTypes.ArrayType, +): google.bigtable.v2.IValue { + if (!is.array(value)) { + throw new Error(`Value ${value} cannot be converted to an array.`); + } + const arrayValue = value as Array; + return { + arrayValue: { + values: arrayValue.map((element, index) => { + try { + return convertJsValueToValue(element, type.elementType); + // eslint-disable-next-line + } catch (conversionError: any) { + if (conversionError instanceof Error) { + throw new Error( + `Error while converting element ${index} of an array: ${conversionError.message}`, + ); + } else { + throw conversionError; + } + } + }), + }, + }; +} diff --git a/handwritten/bigtable/src/execute-query/preparedstatement.ts b/handwritten/bigtable/src/execute-query/preparedstatement.ts new file mode 100644 index 00000000000..8a2dbc0401d --- /dev/null +++ b/handwritten/bigtable/src/execute-query/preparedstatement.ts @@ -0,0 +1,287 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. +import {Bigtable} from '..'; +import * as SqlTypes from './types'; +import {PreciseDate} from '@google-cloud/precise-date'; + +import {google} from '../../protos/protos'; +import {MetadataConsumer} from './metadataconsumer'; +import {EventEmitter} from 'events'; +import {ServiceError, CallOptions} from 'google-gax'; + +export const SHOULD_REFRESH_SOON_PERIOD_MS = 1000; + +export type PreparedStatementDataCallback = ( + err?: Error, + preparedQueryBytes?: Uint8Array | string, + metadata?: SqlTypes.ResultSetMetadata, +) => void; + +interface IRetryRequest { + client: string; + method: string; + reqOpts: google.bigtable.v2.IPrepareQueryRequest; + retryOpts?: CallOptions; +} + +/** + * This object keeps track of the query plan a.k.a. metadata and preparedQuery bytes. + * It provides a way of retrieving last retrieved query plan. + * If a query plan is marked as expired, it will be refreshed. + * You can get the query plan via the getData method. + * If the query plan is not expired, getData will return the value immediately. + * If the object is marked as expired, getting the query plan will wait for + * a refresh to happen. If the refresh fails, all awaiting getData calls + * also return an error. + */ +export class PreparedStatement extends EventEmitter { + private bigtable: Bigtable; + private retryRequest: IRetryRequest; + private metadata: SqlTypes.ResultSetMetadata; + private preparedQueryBytes: Uint8Array | string; + private validUntilTimestamp: number | null; + private forcedExpiration: boolean; + private isRefreshing: boolean; + private timer: NodeJS.Timeout | null; + private lastRefreshError: ServiceError | Error | null; + private parameterTypes: {[param: string]: SqlTypes.Type}; + + constructor( + bigtable: Bigtable, + response: google.bigtable.v2.PrepareQueryResponse, + retryRequest: IRetryRequest, + parameterTypes: {[param: string]: SqlTypes.Type}, + ) { + super(); + this.bigtable = bigtable; + this.metadata = MetadataConsumer.parseMetadata(response.metadata!); + this.preparedQueryBytes = response.preparedQuery; + this.validUntilTimestamp = timestampFromResponse(response); + this.timer = null; + this.isRefreshing = false; + this.lastRefreshError = null; + this.forcedExpiration = false; + this.retryRequest = retryRequest; + this.parameterTypes = parameterTypes; + } + + /** + * Returns true if the validUntilTimestamp is close, + * meaning less than SHOULD_REFRESH_SOON_PERIOD_MS away. + */ + private shouldRefreshSoon = (): boolean => { + if (!this.validUntilTimestamp) { + return false; + } + return ( + Date.now() > this.validUntilTimestamp - SHOULD_REFRESH_SOON_PERIOD_MS + ); + }; + + /** + * Schedules the refresh. It is deffered to the next tick to ensure + * that the current call stack is finished before a request to bigtable is made. + */ + private setupTimer = (): void => { + this.timer = setTimeout(this.handleTimerEnd, 0); + }; + + private discardTimer = (): void => { + if (this.timer) { + clearTimeout(this.timer); + this.timer = null; + } + }; + + /** + * Performs a request to bigtable to get a refreshed query plan. + */ + private startRefreshing = (): void => { + this.isRefreshing = true; + this.bigtable.request(this.retryRequest, this.handlePrepareQueryResponse); + }; + + /** + * Begins the refresh. + */ + private handleTimerEnd = (): void => { + if (!this.isRefreshing) { + this.discardTimer(); + this.startRefreshing(); + } + }; + + /** + * Callback for handling the call to bigtable. + */ + private handlePrepareQueryResponse = ( + err: ServiceError | null, + response?: google.bigtable.v2.PrepareQueryResponse, + ): void => { + if (this.isRefreshing) { + this.isRefreshing = false; + this.discardTimer(); + if (err) { + this.lastRefreshError = err; + this.emit('refreshDone'); + } else { + try { + this.lastRefreshError = null; + this.forcedExpiration = false; + this.validUntilTimestamp = timestampFromResponse(response!); + this.metadata = MetadataConsumer.parseMetadata(response!.metadata!); + this.preparedQueryBytes = response!.preparedQuery; + } catch (err: any) { + this.lastRefreshError = err as Error; + } + this.emit('refreshDone'); + } + } else { + const err = new Error( + 'Invalid state: PrepareQueryResponse recieved when not refreshing.', + ); + console.error(err); + throw err; + } + }; + + /** + * Invoked when the query plan is retrieved from this object. + */ + private scheduleRefreshIfNeeded = (): void => { + if (!this.isRefreshing && this.timer === null) { + if (this.isExpired() || this.shouldRefreshSoon()) { + this.setupTimer(); + } // else noop + } // else noop + }; + + /** + * This function should be called, when the server returns + * the FAILED_PRECONDITION error saying the query plan + * is expired. For more info refer to the ExecuteQueryStateMachine. + */ + markAsExpired = (): void => { + this.forcedExpiration = true; + }; + + /** + * Used for retrieveing the query plan (preparedQuery bytes and metadata) + * @param callback called when query plan is available + * @param timeoutMs when callback should be called with an error. + */ + getData = ( + callback: PreparedStatementDataCallback, + timeoutMs: number, + ): void => { + this.scheduleRefreshIfNeeded(); + if (this.isExpired()) { + const listener = new CallbackWithTimeout(callback, timeoutMs); + this.once('refreshDone', () => { + // If there are many listeners, the query plan could have expired again + // before we got to processing this one, so we have to check it again. + if (this.isExpired() || this.lastRefreshError) { + listener.tryInvoke( + this.lastRefreshError || + new Error('Getting a fresh query plan failed.'), + undefined, + undefined, + ); + } else { + listener.tryInvoke(undefined, this.preparedQueryBytes, this.metadata); + } + }); + } else { + // for the sake of consistency we should call the callback asynchornously + // regardless if the plan needs refreshing or not. + setTimeout( + () => callback(undefined, this.preparedQueryBytes, this.metadata), + 0, + ); + } + }; + + /** + * @returns parameter types used to create the query plan + */ + getParameterTypes = (): {[param: string]: SqlTypes.Type} => + this.parameterTypes; + + /** + * @returns true if the object has been marked as expired. + */ + isExpired = (): boolean => { + return this.forcedExpiration; + }; +} + +/** + * This class makes sure the callback is called only once. + * If the timeout expired, the callback is called with a "Timeout Expired" error. + * Otherwise it is called with provided args. + */ +class CallbackWithTimeout { + private callback: PreparedStatementDataCallback | null; + private timer: NodeJS.Timeout | null; + private isValid: boolean; + + constructor(callback: PreparedStatementDataCallback, timeout: number) { + this.callback = callback; + this.isValid = true; + this.timer = setTimeout(() => { + this.tryInvoke( + new Error( + 'Deadline Exceeded waiting for prepared statement to refresh.', + ), + ); + }, timeout); + } + + /** + * If this object has not yet been invalidated, the callback is called. + * @param args + */ + tryInvoke(...args: Parameters): void { + if (!this.isValid || !this.callback) { + return; + } + const callback = this.callback; + this.invalidate(); + callback(...args); + } + + /** + * After this method is called, the callback can no longer be invoked. + */ + private invalidate(): void { + if (this.timer) { + clearTimeout(this.timer); + this.timer = null; + } + this.callback = null; + this.isValid = false; + } +} + +function timestampFromResponse( + response: google.bigtable.v2.PrepareQueryResponse, +): number | null { + if (!response.validUntil?.seconds) { + return null; + } + return new PreciseDate({ + seconds: response.validUntil?.seconds ?? undefined, + nanos: response.validUntil?.nanos ?? undefined, + }).getTime(); +} diff --git a/handwritten/bigtable/src/execute-query/protobufreadertransformer.ts b/handwritten/bigtable/src/execute-query/protobufreadertransformer.ts new file mode 100644 index 00000000000..f98517d8372 --- /dev/null +++ b/handwritten/bigtable/src/execute-query/protobufreadertransformer.ts @@ -0,0 +1,135 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {Transform, TransformOptions, TransformCallback} from 'stream'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +import {google} from '../../protos/protos'; +import {MetadataConsumer} from './metadataconsumer'; + +class DrainGuard { + callback: () => void; + + constructor(callback: () => void) { + this.callback = callback; + } +} + +export type BatchAndToken = [Buffer[], Uint8Array]; + +/** + * This transformer is responsible for deserializing bytes sent from the + * server to an appropriate object which can be used to construct rows. + * Right now only google.bigtable.v2.ProtoRows is supported. + */ +export class ProtobufReaderTransformer extends Transform { + metadataConsumer: MetadataConsumer; + resumeToken: Uint8Array | null; + + constructor(metadataConsumer: MetadataConsumer, opts?: TransformOptions) { + super({...opts, objectMode: true, highWaterMark: 1024}); + this.metadataConsumer = metadataConsumer; + this.resumeToken = null; + } + + _transform( + batchAndToken: BatchAndToken | DrainGuard, + _encoding: BufferEncoding, + callback: TransformCallback, + ) { + if (batchAndToken instanceof DrainGuard) { + batchAndToken.callback(); + } else { + const maybeMetadata = this.metadataConsumer.getMetadata(); + if (maybeMetadata) { + const [batches, resumeToken] = batchAndToken; + this.resumeToken = resumeToken; + const valuesBuffer: google.bigtable.v2.IValue[] = []; + + const expectedLength = maybeMetadata.columns.length; + + for (let batchIdx = 0; batchIdx < batches.length; batchIdx++) { + const batch = batches[batchIdx]; + const protoRows = google.bigtable.v2.ProtoRows.decode(batch); + + if (protoRows.values.length % expectedLength) { + callback(new Error('Internal error - received incomplete row.')); + return; + } + + for ( + let valueIdx = 0; + valueIdx < protoRows.values.length; + valueIdx++ + ) { + valuesBuffer.push(protoRows.values[valueIdx]); + } + } + + if (valuesBuffer.length > 0) { + for (let i = 0; i < valuesBuffer.length; i += expectedLength) { + this.push(valuesBuffer.slice(i, i + expectedLength)); + } + } + } else { + return callback(new Error('Internal error - missing metadata')); + } + } + + callback(); + } + + /** + * @param callback guaranteed to be called **after** the last message + * was processed. + */ + onDrain = (callback: () => void) => { + // Writable streams keep a buffer of objects to + // process (in case of a Transform processing means calling _transform() method). Readable streams + // keep a buffer of objects to be read by downstream processors. Transforms are both Writable and + // Readable, thus they have one buffer for parameters to, and one buffer for results of + // _transform() method. + // Objects can end up in a writeable's buffer if they are written after previous write call + // returned false but before 'drain' event is emitted or when a write happens while another + // objects is processed. + // Objects can end up in a readable's buffer if there are no downstream processors ready to accept + // new objects (either there are none or at least one of them is paused). + // + // Our data pipeline looks as follows: + // bigtable stream -> ByteBuffer transform -> Reader transform -> ... + // + // But if we include buffers in this diagram this becomes more complicated: + // + // (bigtable stream -> [readable buffer]) + // -> ([writable buffer] -> ByteBuffer transform() -> [readable buffer]) + // -> ([writable buffer] -> Reader transform() -> [readable buffer]) + // -> ... + // + // and each of these buffers can buffer requests that were (in readable) or were not (in readable) + // already passed to _transform() method. + // During the retry we have to recreate bigtable stream and discard all data stored in + // the ByteBuffer, and perform a new request with an appropriate resumeToken. + // + // Passing an appropriate resumeToken is crucial to prevent duplicate or lost responses. + // + // So, how to obtain a resumption token? Let's try a few options: + // We cannot take last resumeToken that was seen by ByteBuffer's _transform() method + // - it is possible that there are some unprocessed events in ByteBuffer's writable buffer + // that will be processed at some point. + // The same applies to Reader's _transform(), writeable buffers are still there. + // + // Thus we see that we have to consider events waiting in the buffers and wait until they are + // processed. + this.write(new DrainGuard(callback)); + }; +} diff --git a/handwritten/bigtable/src/execute-query/queryresultrowtransformer.ts b/handwritten/bigtable/src/execute-query/queryresultrowtransformer.ts new file mode 100644 index 00000000000..f2b3cdb256a --- /dev/null +++ b/handwritten/bigtable/src/execute-query/queryresultrowtransformer.ts @@ -0,0 +1,255 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +// eslint-disable-next-line @typescript-eslint/no-var-requires +import {google} from '../../protos/protos'; +import Long = require('long'); + +import { + EncodedKeyMap, + BigtableDate, + ExecuteQueryStreamWithMetadata, + SqlValue, + QueryResultRow, + Struct, + ensureUint8Array, +} from './values'; +import {ResultSetMetadata, Type} from './types'; +import {PreciseDate} from '@google-cloud/precise-date'; +import assert = require('assert'); +import {Transform, TransformCallback, TransformOptions} from 'stream'; +import {MetadataConsumer} from './metadataconsumer'; +import {FieldMapping} from './namedlist'; + +/** + * Class representing a readable stream with ExecuteQuery results + * which also lets the caller get metadata. + */ +export class ExecuteQueryStreamTransformWithMetadata + extends Transform + implements ExecuteQueryStreamWithMetadata +{ + metadataConsumer: MetadataConsumer; + fieldMapping: FieldMapping | null; + hasCallerCancelled: () => boolean; + protoBytesEncoding?: BufferEncoding; + + constructor( + metadataConsumer: MetadataConsumer, + hasCallerCancelled: () => boolean, + protoBytesEncoding?: BufferEncoding, + opts?: TransformOptions, + ) { + super({...opts, objectMode: true, highWaterMark: 0}); + this.fieldMapping = null; + this.metadataConsumer = metadataConsumer; + this.hasCallerCancelled = hasCallerCancelled; + this.protoBytesEncoding = protoBytesEncoding; + } + + valueToJsType(value: google.bigtable.v2.Value, metadata: Type): SqlValue { + if (!value.kind) { + return null; + } + switch (metadata.type) { + case 'bytes': + if (value.kind === 'bytesValue') { + return ensureUint8Array(value.bytesValue!, this.protoBytesEncoding); + } + break; + case 'string': + if (value.kind === 'stringValue') { + return value.stringValue!; + } + break; + case 'int64': + if (value.kind === 'intValue') { + return intValueToBigInt(value.intValue!); + } + break; + case 'bool': + if (value.kind === 'boolValue') { + return value.boolValue!; + } + break; + case 'float32': + case 'float64': + if (value.kind === 'floatValue') { + return value.floatValue!; + } + break; + case 'timestamp': + if (value.kind === 'timestampValue') { + return new PreciseDate({ + seconds: value.timestampValue!.seconds ?? undefined, + nanos: value.timestampValue!.nanos ?? undefined, + }); + } + break; + case 'date': + if (value.kind === 'dateValue') { + return new BigtableDate( + value.dateValue!.year || 0, + value.dateValue!.month || 0, + value.dateValue!.day || 0, + ); + } + break; + case 'array': + return this.valueToJsArray(value, metadata); + case 'struct': + return this.valueToJsStruct(value, metadata); + case 'map': + return this.valueToJsMap(value, metadata); + default: + throw new Error( + `Unexpected type to parse: ${JSON.stringify(metadata)}`, + ); + } + throw new Error(`Metadata and Value not matching. + Metadata:${metadata} + Value:${value}`); + } + + valueToJsArray(value: google.bigtable.v2.Value, metadata: Type): SqlValue { + assert(metadata.type === 'array'); + if ( + value.arrayValue === null || + value.arrayValue === undefined || + value.arrayValue.values === null || + value.arrayValue.values === undefined + ) { + return null; + } + return value.arrayValue.values.map(value => + this.valueToJsType( + value as google.bigtable.v2.Value, + metadata.elementType, + ), + ); + } + + valueToJsStruct(value: google.bigtable.v2.Value, metadata: Type): SqlValue { + assert(metadata.type === 'struct'); + if ( + value.arrayValue === null || + value.arrayValue === undefined || + value.arrayValue.values === null || + value.arrayValue.values === undefined + ) { + return null; + } + if (value.arrayValue.values.length !== metadata.values.length) { + throw new Error( + `Internal error - received Struct with ${value.arrayValue.values.length} values, but metadata has ${metadata.values.length} fields.`, + ); + } + return new Struct( + value.arrayValue.values.map((value, index) => + this.valueToJsType( + value as google.bigtable.v2.Value, + metadata.get(index), + ), + ), + metadata.fieldMapping, + ); + } + + valueToJsMap(value: google.bigtable.v2.Value, metadata: Type): SqlValue { + assert(metadata.type === 'map'); + if ( + value.arrayValue === null || + value.arrayValue === undefined || + value.arrayValue.values === null || + value.arrayValue.values === undefined + ) { + return null; + } + if ( + metadata.keyType.type !== 'int64' && + metadata.keyType.type !== 'string' && + metadata.keyType.type !== 'bytes' + ) { + throw new Error( + `Internal error - unsupported type of key received: ${metadata.keyType.type}`, + ); + } + const values: google.bigtable.v2.Value[] = value.arrayValue + .values as google.bigtable.v2.Value[]; + return new EncodedKeyMap( + values.map(value => { + // Types are ensured by checking metadata.keyType.type earlier. + const pair = value?.arrayValue?.values as google.bigtable.v2.Value[]; + const keyValue = this.valueToJsType(pair[0], metadata.keyType) as + | bigint + | string + | Uint8Array + | null; + return [keyValue, this.valueToJsType(pair[1], metadata.valueType)]; + }), + ); + } + + getFieldMapping(): FieldMapping { + if (this.fieldMapping === null) { + const metadata = this.getMetadata(); + if (metadata === null) { + throw new Error('Metadata was not sent by the server.'); + } + this.fieldMapping = metadata.fieldMapping; + } + return this.fieldMapping; + } + + _transform( + chunk: Array, + _encoding: BufferEncoding, + callback: TransformCallback, + ) { + let error: Error | null = null; + try { + if (!this.hasCallerCancelled()) { + const maybeMetadata = this.metadataConsumer.getMetadata(); + if (maybeMetadata) { + this.push( + new QueryResultRow( + chunk.map((value, index) => + this.valueToJsType(value, maybeMetadata.get(index)), + ), + this.getFieldMapping(), + ), + ); + } else { + throw new Error( + 'Server error - expected to receive metadata by now.', + ); + } + } + } catch (e) { + error = e as Error; + } + callback(error); + } + + getMetadata(): ResultSetMetadata | null { + return this.metadataConsumer.getMetadata(); + } +} + +function intValueToBigInt(intValue: string | number | Long): bigint { + if (intValue instanceof Long) { + return BigInt(intValue.toString()); + } + return BigInt(intValue); +} diff --git a/handwritten/bigtable/src/execute-query/types.ts b/handwritten/bigtable/src/execute-query/types.ts new file mode 100644 index 00000000000..012f7713df3 --- /dev/null +++ b/handwritten/bigtable/src/execute-query/types.ts @@ -0,0 +1,83 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {NamedList} from './namedlist'; + +export type ArrayType = {type: 'array'; elementType: Type}; +export type MapType = {type: 'map'; keyType: Type; valueType: Type}; +export type FieldType = {name: string | null; type: Type}; +export class StructType extends NamedList { + type: 'struct' = 'struct' as const; + + static fromTuples(tuples: [string | null, Type][]): StructType { + return NamedList._fromTuples(StructType, tuples); + } +} + +export type Int64Type = ReturnType; +export type Float64Type = ReturnType; +export type Float32Type = ReturnType; +export type BytesType = ReturnType; +export type StringType = ReturnType; +export type BoolType = ReturnType; +export type TimestampType = ReturnType; +export type DateType = ReturnType; + +/** + * Factory functions are provided instead of constants + * for all types for coherence and for extensibility + * (we need parameters at least for arrays, structs and maps) + */ +export const Int64 = () => ({type: 'int64' as const}); +export const Float64 = () => ({type: 'float64' as const}); +export const Float32 = () => ({type: 'float32' as const}); +export const Bytes = () => ({type: 'bytes' as const}); +export const String = () => ({type: 'string' as const}); +export const Bool = () => ({type: 'bool' as const}); +export const Timestamp = () => ({type: 'timestamp' as const}); +export const Date = () => ({type: 'date' as const}); +export const Struct = (...fields: FieldType[]): StructType => + StructType.fromTuples(fields.map(value => [value.name, value.type])); +export const Array = (elementType: Type): ArrayType => ({ + type: 'array' as const, + elementType, +}); +export const Map = (keyType: Type, valueType: Type): MapType => ({ + type: 'map' as const, + keyType, + valueType, +}); + +export type Type = + | Int64Type + | Float32Type + | Float64Type + | BytesType + | StringType + | BoolType + | TimestampType + | DateType + | ArrayType + | StructType + | MapType; + +export class ResultSetMetadata extends NamedList { + get columns(): Array { + return this.values; + } + + static fromTuples(tuples: [string | null, Type][]): ResultSetMetadata { + return NamedList._fromTuples(ResultSetMetadata, tuples); + } +} diff --git a/handwritten/bigtable/src/execute-query/values.ts b/handwritten/bigtable/src/execute-query/values.ts new file mode 100644 index 00000000000..258a25d1126 --- /dev/null +++ b/handwritten/bigtable/src/execute-query/values.ts @@ -0,0 +1,230 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {Duplex, Readable} from 'stream'; +import * as SqlTypes from './types'; +import {PreciseDate} from '@google-cloud/precise-date'; +import {NamedList} from './namedlist'; + +// fast-crc32c will segfault on import on non-x64 architectures, due to a +// lack of SSE instructions. +const CRC32C = + process.arch === 'x64' + ? require('fast-crc32c') + : require('fast-crc32c/impls/js_crc32c'); + +export type BigtableMap = EncodedKeyMap; + +export type ExecuteQueryParameterValue = + | Uint8Array + | string + | bigint + | number + | boolean + | PreciseDate + | BigtableDate + | Array + | null; + +export type SqlValue = + | ExecuteQueryParameterValue + | Struct + | Array + | BigtableMap; + +/** + * A custom class created to allow setting year, month and date to 0. + */ +export class BigtableDate { + year: number; + month: number; + day: number; + + constructor(year: number, month: number, day: number) { + if (year < 0) { + throw new Error('Invalid year.'); + } + this.year = year; + + if (month < 0 || month > 12) { + throw new Error('Invalid month.'); + } + this.month = month; + + if (day < 0 || day > 31) { + throw new Error('Invalid month.'); + } + this.day = day; + } +} + +export class QueryResultRow extends NamedList {} + +export class Struct extends NamedList { + static fromTuples(tuples: [string | null, SqlValue][]): Struct { + return NamedList._fromTuples(Struct, tuples); + } +} + +export interface ExecuteQueryStreamWithMetadata extends Duplex { + getMetadata: () => SqlTypes.ResultSetMetadata | null; + end: () => this; +} + +export function checksumValid( + buffer: Buffer, + expectedChecksum: number, +): boolean { + return CRC32C.calculate(buffer) === expectedChecksum; +} + +export function ensureUint8Array( + bytes: Uint8Array | string, + encoding?: BufferEncoding, +): Uint8Array { + return bytes instanceof Uint8Array + ? bytes + : Buffer.from(bytes, encoding || 'base64'); +} + +function _parseBufferToMapKey( + key: bigint | string | Uint8Array | null, +): bigint | string | null { + // Uint8Array is always an instance of Buffer, + // but we keep it in the if condition for TS linter's sake + if (key instanceof Buffer || key instanceof Uint8Array) { + const base64Key = key.toString('base64'); + return base64Key; + } else if (key === null) { + return null; + } else { + return key; + } +} + +type MapKey = bigint | string | Uint8Array | null; +// internal representation of the map contains the original key and value tuple +type _MapValue = [MapKey, SqlValue]; + +export class EncodedKeyMap + implements Map +{ + private map_impl: Map; + /** + * Class representing a Map Value returned by ExecuteQuery. Native JS Map + * does not support Buffer comparison - it compares object id and not + * buffer values. This class solves this by encoding Buffer keys as + * base64 strings. + * Please note that an empty string and an empty buffer have the same + * representation, however, we do not ever use mixed key types (all keys are + * always all buffers or all strings) so we don't need to handle this. + */ + constructor( + entries?: ReadonlyArray< + [bigint | string | Uint8Array | null, SqlValue] + > | null, + ) { + if (entries) { + // Process entries to encode Buffer keys as base64 + const processedEntries = entries.map(([key, value]) => { + return [_parseBufferToMapKey(key), [key, value]]; + }) as ReadonlyArray<[bigint | string, _MapValue]>; + this.map_impl = new Map( + processedEntries, + ); + } else { + this.map_impl = new Map(); + } + } + + clear(): void { + this.map_impl.clear(); + } + + delete(key: string | bigint | Uint8Array | null): boolean { + return this.map_impl.delete(_parseBufferToMapKey(key)); + } + + forEach( + callbackfn: ( + value: SqlValue, + key: string | bigint | Uint8Array | null, + map: Map, + ) => void, + thisArg?: any, + ): void { + this.map_impl.forEach((value, key) => { + callbackfn.call(thisArg, value[1], value[0], this.map_impl); + }); + } + + has(key: string | bigint | Uint8Array | null): boolean { + return this.map_impl.has(_parseBufferToMapKey(key)); + } + + get size(): number { + return this.map_impl.size; + } + + entries(): MapIterator<[string | bigint | Uint8Array | null, SqlValue]> { + return this.map_impl.values(); + } + + keys(): MapIterator { + const iterator = this.map_impl.values(); + return { + next: () => { + const result = iterator.next(); + if (result.done) return result; + return {value: result.value[0], done: false}; + }, + [Symbol.iterator]() { + return this; + }, + }; + } + + values(): MapIterator { + const iterator = this.map_impl.values(); + return { + next: () => { + const result = iterator.next(); + if (result.done) return result; + return {value: result.value[1], done: false}; + }, + [Symbol.iterator]() { + return this; + }, + }; + } + + [Symbol.iterator](): MapIterator< + [string | bigint | Uint8Array | null, SqlValue] + > { + return this.entries(); + } + + get [Symbol.toStringTag](): string { + return 'EncodedKeyMap'; + } + + get(key: string | bigint | Uint8Array | null): SqlValue | undefined { + return this.map_impl.get(_parseBufferToMapKey(key))?.[1]; + } + + set(key: string | bigint | Uint8Array | null, value: SqlValue): this { + this.map_impl.set(_parseBufferToMapKey(key), [key, value]); + return this; + } +} diff --git a/handwritten/bigtable/src/family.ts b/handwritten/bigtable/src/family.ts new file mode 100644 index 00000000000..c348c6ef4ab --- /dev/null +++ b/handwritten/bigtable/src/family.ts @@ -0,0 +1,490 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {promisifyAll} from '@google-cloud/promisify'; +import {CallOptions} from 'google-gax'; +import {ServiceError} from 'google-gax'; + +import {Bigtable} from './'; +import {Table} from './table'; +import {google} from '../protos/protos'; + +export type IColumnFamily = google.bigtable.admin.v2.IColumnFamily; +export type IGcRule = google.bigtable.admin.v2.IGcRule; +export type IModification = + google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification; +export type ITable = google.bigtable.admin.v2.ITable; + +export interface RequestCallback { + (err: null | ServiceError, response?: null | R): void; +} + +export interface InstanceCallback { + (err: null | ServiceError, instance?: null | I, response?: null | R): void; +} + +export interface GcRule { + age?: google.protobuf.IDuration | number; + versions?: number; + rule?: GcRule; + union?: boolean; +} + +export interface CreateFamilyOptions { + rule?: GcRule; + gaxOptions?: CallOptions; +} + +export type CreateFamilyResponse = [Family, ITable]; +export type CreateFamilyCallback = InstanceCallback; + +export type DeleteFamilyResponse = [ITable]; +export type DeleteFamilyCallback = RequestCallback; + +export type FamilyExistsResponse = [boolean]; +export type FamilyExistsCallback = RequestCallback; + +export interface GetFamilyOptions { + autoCreate?: boolean; + gaxOptions?: CallOptions; + rule?: GcRule; +} + +export type GetFamilyResponse = [Family, IColumnFamily | ITable]; +export type GetFamilyCallback = InstanceCallback< + Family, + IColumnFamily | ITable +>; + +export type GetFamilyMetadataResponse = [IColumnFamily]; +export type GetFamilyMetadataCallback = RequestCallback; + +export interface SetFamilyMetadataOptions { + rule?: GcRule; +} + +export type SetFamilyMetadataResponse = [IColumnFamily, ITable]; +export type SetFamilyMetadataCallback = InstanceCallback; + +/** + * @private + */ +export class FamilyError extends Error { + code: number; + constructor(name: string) { + super(); + this.name = 'FamilyError'; + this.message = `Column family not found: ${name}.`; + this.code = 404; + } +} + +/** + * Create a Family object to interact with your table column families. + * + * @class + * @param {Table} table + * @param {string} id + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * const table = instance.table('prezzy'); + * const family = table.family('follows'); + * ``` + */ +export class Family { + bigtable: Bigtable; + table: Table; + name: string; + id: string; + metadata?: IColumnFamily; + constructor(table: Table, id: string) { + this.bigtable = table.bigtable; + this.table = table; + + let name: string; + if (id.includes('/')) { + if (id.startsWith(`${table.name}/columnFamilies/`)) { + name = id; + } else { + throw new Error(`Family id '${id}' is not formatted correctly. +Please use the format 'follows' or '${table.name}/columnFamilies/my-family'.`); + } + } else { + name = `${table.name}/columnFamilies/${id}`; + } + + this.name = name; + this.id = name.split('/').pop()!; + } + + /** + * Formats Garbage Collection rule into proto format. + * + * @private + * + * @param {object} ruleObj The rule object. + * @returns {object} + * + * @example + * ``` + * Family.formatRule({ + * age: { + * seconds: 10000, + * nanos: 10000 + * }, + * versions: 2, + * union: true + * }); + * // { + * // union: { + * // rules: [ + * // { + * // maxAge: { + * // seconds: 10000, + * // nanos: 10000 + * // } + * // }, { + * // maxNumVersions: 2 + * // } + * // ] + * // } + * // } + * ``` + */ + static formatRule_(ruleObj: GcRule): IGcRule { + const rules: IGcRule[] = []; + + if (ruleObj.age) { + rules.push({ + maxAge: ruleObj.age as google.protobuf.IDuration, + }); + } + + if (ruleObj.versions) { + rules.push({ + maxNumVersions: ruleObj.versions, + }); + } + + if (ruleObj.rule) { + rules.push(Family.formatRule_(ruleObj.rule)); + } + + if (rules.length === 1) { + if (ruleObj.union) { + throw new Error( + 'A union must have more than one garbage collection rule.', + ); + } + return rules[0]; + } + + if (rules.length === 0) { + throw new Error('No garbage collection rules were specified.'); + } + + const rule = {} as IGcRule; + const ruleType = ruleObj.union ? 'union' : 'intersection'; + + rule[ruleType] = { + rules, + }; + + return rule; + } + + create(options?: CreateFamilyOptions): Promise; + create(options: CreateFamilyOptions, callback: CreateFamilyCallback): void; + create(callback: CreateFamilyCallback): void; + /** + * Create a column family. + * + * @param {object} [options] See {@link Table#createFamily}. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {Family} callback.family The metadata. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_create_family + */ + create( + options?: CreateFamilyOptions | CreateFamilyCallback, + callback?: CreateFamilyCallback, + ): void | Promise { + callback = typeof options === 'function' ? options : callback!; + options = typeof options === 'object' ? options : {}; + + this.table.createFamily(this.id, options, callback); + } + + delete(gaxOptions?: CallOptions): Promise; + delete(gaxOptions: CallOptions, callback: DeleteFamilyCallback): void; + delete(callback: DeleteFamilyCallback): void; + /** + * Delete the column family. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_del_family + */ + delete( + gaxOptions?: CallOptions | DeleteFamilyCallback, + callback?: DeleteFamilyCallback, + ): void | Promise { + callback = typeof gaxOptions === 'function' ? gaxOptions : callback!; + gaxOptions = typeof gaxOptions === 'object' ? gaxOptions : {}; + + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'modifyColumnFamilies', + reqOpts: { + name: this.table.name, + modifications: [ + { + id: this.id, + drop: true, + }, + ], + }, + gaxOpts: gaxOptions, + }, + callback, + ); + } + + exists(gaxOptions?: CallOptions): Promise; + exists(gaxOptions: CallOptions, callback: FamilyExistsCallback): void; + exists(callback: FamilyExistsCallback): void; + /** + * Check if the column family exists. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {boolean} callback.exists Whether the family exists or not. + * + * @example + * region_tag:bigtable_api_exists_family + */ + exists( + opts?: CallOptions | FamilyExistsCallback, + cb?: FamilyExistsCallback, + ): void | Promise { + const callback = typeof opts === 'function' ? opts : cb!; + const gaxOptions = typeof opts === 'object' ? opts : {}; + + this.getMetadata(gaxOptions, err => { + if (err) { + if (err instanceof FamilyError) { + callback(null, false); + return; + } + + callback(err); + return; + } + + callback(null, true); + }); + } + + get(options?: GetFamilyOptions): Promise; + get(options: GetFamilyOptions, callback: GetFamilyCallback): void; + get(callback: GetFamilyCallback): void; + /** + * Get a column family if it exists. + * + * You may optionally use this to "get or create" an object by providing an + * object with `autoCreate` set to `true`. Any extra configuration that is + * normally required for the `create` method must be contained within this + * object as well. + * + * @param {object} [options] Configuration object. + * @param {boolean} [options.autoCreate=false] Automatically create the + * instance if it does not already exist. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {?error} callback.error An error returned while making this request. + * @param {Family} callback.family The Family object. + * @param {object} callback.apiResponse The resource as it exists in the API. + * + * @example + * region_tag:bigtable_api_get_family + */ + get( + opts?: GetFamilyOptions | GetFamilyCallback, + cb?: GetFamilyCallback, + ): void | Promise { + const callback = typeof opts === 'function' ? opts : cb!; + const options = typeof opts === 'object' ? opts : {}; + + const autoCreate = !!options.autoCreate; + const gaxOptions = options.gaxOptions!; + + this.getMetadata(gaxOptions, (err, metadata) => { + if (err) { + if (err instanceof FamilyError && autoCreate) { + this.create({gaxOptions, rule: options.rule}, callback); + return; + } + + callback(err as ServiceError); + return; + } + + callback(null, this, metadata); + }); + } + + getMetadata(gaxOptions?: CallOptions): Promise; + getMetadata( + gaxOptions: CallOptions, + callback: GetFamilyMetadataCallback, + ): void; + getMetadata(callback: GetFamilyMetadataCallback): void; + /** + * Get the column family's metadata. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.metadata The metadata. + * + * @example + * region_tag:bigtable_api_get_family_meta + */ + getMetadata( + opts?: CallOptions | GetFamilyMetadataCallback, + cb?: GetFamilyMetadataCallback, + ): void | Promise { + const callback = typeof opts === 'function' ? opts : cb!; + const gaxOptions = typeof opts === 'object' ? opts : {}; + + this.table.getFamilies(gaxOptions, (err, families) => { + if (err) { + callback(err); + return; + } + + for (let i = 0, l = families!.length; i < l; i++) { + if (families![i].name === this.name) { + this.metadata = families![i].metadata; + callback(null, this.metadata); + return; + } + } + + const error = new FamilyError(this.id); + callback(error as ServiceError); + }); + } + + setMetadata( + metadata: SetFamilyMetadataOptions, + gaxOptions?: CallOptions, + ): Promise; + setMetadata( + metadata: SetFamilyMetadataOptions, + gaxOptions: CallOptions, + callback: SetFamilyMetadataCallback, + ): void; + setMetadata( + metadata: SetFamilyMetadataOptions, + callback: SetFamilyMetadataCallback, + ): void; + /** + * Set the column family's metadata. + * + * See {@link Table#createFamily} for a detailed explanation of the + * arguments. + * + * @see [Garbage Collection Proto Docs]{@link https://github.com/googleapis/googleapis/blob/3592a7339da5a31a3565870989beb86e9235476e/google/bigtable/admin/table/v1/bigtable_table_data.proto#L59} + * + * @param {object} metadata Metadata object. + * @param {object} [metadata.rule] Garbage collection rule. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_set_family_meta + */ + setMetadata( + metadata: SetFamilyMetadataOptions, + opts?: CallOptions | SetFamilyMetadataCallback, + cb?: SetFamilyMetadataCallback, + ): void | Promise { + const callback = typeof opts === 'function' ? opts : cb!; + const gaxOptions = typeof opts === 'object' ? opts : {}; + + const mod: IModification = { + id: this.id, + update: {}, + }; + + if (metadata.rule) { + mod.update!.gcRule = Family.formatRule_(metadata.rule); + } + + const reqOpts = { + name: this.table.name, + modifications: [mod], + }; + + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'modifyColumnFamilies', + reqOpts, + gaxOpts: gaxOptions, + }, + (err, resp) => { + if (err) { + callback(err, null, resp); + return; + } + + this.metadata = resp.columnFamilies[this.id]; + callback(null, this.metadata, resp); + }, + ); + } +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(Family); diff --git a/handwritten/bigtable/src/filter.ts b/handwritten/bigtable/src/filter.ts new file mode 100644 index 00000000000..e698e42e988 --- /dev/null +++ b/handwritten/bigtable/src/filter.ts @@ -0,0 +1,1013 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import arrify = require('arrify'); +import * as escapeStringRegexp from 'escape-string-regexp'; +import * as is from 'is'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const isUtf8 = require('is-utf8'); +import {Mutation} from './mutation'; + +/** + * @private + */ +export class FilterError extends Error { + constructor(filter: string) { + super(); + this.name = 'FilterError'; + this.message = `Unknown filter: ${filter}.`; + } +} + +export interface Column { + name?: string | RegExp; + cellLimit?: number; + start?: BoundData; + end?: {}; + family?: BoundData; +} + +export interface BoundData { + inclusive?: boolean; + value?: {}; +} + +export interface Time { + start: Date | number; + end: Date | number; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type RawFilter = any; + +export interface Condition { + pass: {}; + fail: {}; + test: {}; +} + +export interface Row { + cellLimit?: number; + sample?: string; + cellOffset?: number; + key?: string; +} + +export interface ValueFilter { + value?: string; + start?: BoundData; + end?: BoundData; + strip?: boolean; +} + +/** + * A filter takes a row as input and produces an alternate view of the row based + * on specified rules. For example, a row filter might trim down a row to + * include just the cells from columns matching a given regular expression, or + * might return all the cells of a row but not their values. More complicated + * filters can be composed out of these components to express requests such as, + * "within every column of a particular family, give just the two most recent + * cells which are older than timestamp X." + * + * There are two broad categories of filters (true filters and transformers), + * as well as two ways to compose simple filters into more complex ones + * ({@link Filter#interleave}). They work as follows: + * + * True filters alter the input row by excluding some of its cells wholesale + * from the output row. An example of a true filter is the + * {@link Filter#value} filter, which excludes cells whose values + * don't match the specified pattern. All regex true filters use RE2 syntax + * (https://github.com/google/re2/wiki/Syntax) and are evaluated as full + * matches. An important point to keep in mind is that RE2(.) is equivalent by + * default to RE2([^\n]), meaning that it does not match newlines. When + * attempting to match an arbitrary byte, you should therefore use the escape + * sequence '\C', which may need to be further escaped as '\\C' in your client + * language. + * + * Transformers alter the input row by changing the values of some of its + * cells in the output, without excluding them completely. Currently, the only + * supported transformer is the {@link Filter#value} `strip` filter, + * which replaces every cell's value with the empty string. + * + * The total serialized size of a filter message must not + * exceed 4096 bytes, and filters may not be nested within each other to a depth + * of more than 20. + * + * Use the following table for the various examples found throughout the + * filter documentation. + * + * | Row Key | follows:gwashington | follows:jadams | follows:tjefferson | + * | ----------- |:-------------------:|:--------------:|:------------------:| + * | gwashington | | 1 | | + * | tjefferson | 1 | 1 | | + * | jadams | 1 | | 1 | + * + * @class + */ +export class Filter { + filters_: Array<{[index: string]: {}}> = []; + constructor() { + this.filters_ = []; + } + + /** + * @throws TypeError + * + * Transforms Arrays into a simple regular expression for matching multiple + * values. + * + * @param {regex|string|string[]} regex Either a plain regex, a regex in + * string form or an array of strings. + * + * @returns {string} + * + * @example + * ``` + * const regexString = Filter.convertToRegExpString(['a', 'b', 'c']); + * // => '(a|b|c)' + * ``` + */ + static convertToRegExpString( + regex: + | RegExp + | RegExp[] + | string + | string[] + | Buffer + | Buffer[] + | number + | number[], + ): string | Buffer { + if (is.regexp(regex)) { + return regex.toString().replace(/^\/|\/$/g, ''); + } + + if (Array.isArray(regex)) { + return `(${(regex as string[]) + .map(Filter.convertToRegExpString) + .join('|')})`; + } + + if (typeof regex === 'string') { + return regex; + } + + if (typeof regex === 'number') { + return regex.toString(); + } + + if (Buffer.isBuffer(regex)) { + const encodingToUse = isUtf8(regex) ? 'utf8' : 'binary'; + const regexToEscape = regex.toString(encodingToUse); + const escapedString = escapeStringRegexp(regexToEscape); + return Buffer.from(escapedString, encodingToUse); + } + + throw new TypeError("Can't convert to RegExp String from unknown type."); + } + + /** + * Creates a range object. All bounds default to inclusive. + * + * @param {?object|string} start Lower bound value. + * @param {?object|string} end Upper bound value. + * @param {string} key Key used to create range value keys. + * + * @returns {object} + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const Filter = Bigtable.Filter; + * + * const range = Filter.createRange('value1', 'value2', 'Test'); + * // { + * // startTestInclusive: new Buffer('value1'), + * // endTestExclusive: new Buffer('value2') + * // } + * + * //- + * // It's also possible to pass in objects to specify inclusive/exclusive + * // bounds. + * //- + * const upperBound = { + * value: 'value3', + * inclusive: false + * }; + * + * const range = Filter.createRange(upperBound, null, 'Test2'); + * // => { + * // startTest2Exclusive: 'value3' + * // } + * ``` + */ + static createRange( + start: BoundData | null, + end: BoundData | null, + key: string, + ) { + const range = {}; + + if (start) { + Object.assign(range, createBound('start', start, key)); + } + + if (end) { + Object.assign(range, createBound('end', end, key)); + } + + return range; + + function createBound(boundName: string, boundData: BoundData, key: string) { + const isInclusive = boundData.inclusive !== false; + const boundKey = boundName + key + (isInclusive ? 'Closed' : 'Open'); + const bound = {} as {[index: string]: {}}; + bound[boundKey] = Mutation.convertToBytes(boundData.value || boundData); + return bound; + } + } + + /** + * @throws FilterError + * + * Turns filters into proto friendly format. + * + * @param {object[]} filters The list of filters to be parsed. + * + * @returns {object} + * + * @example + * ``` + * const filter = Filter.parse([ + * { + * family: 'my-family', + * }, { + * column: 'my-column' + * } + * ]); + * // { + * // chain: { + * // filters: [ + * // { + * // familyNameRegexFilter: 'my-family' + * // }, + * // { + * // columnQualifierRegexFilter: 'my-column' + * // } + * // ] + * // } + * // } + * ``` + */ + static parse(filters: RawFilter[] | RawFilter) { + interface Fn { + [index: string]: Function; + } + const filter = new Filter(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + arrify(filters).forEach((filterObj: any) => { + const key = Object.keys(filterObj)[0]; + if (typeof (filter as {} as Fn)[key] !== 'function') { + throw new FilterError(key); + } + (filter as {} as Fn)[key](filterObj[key]); + }); + return filter.toProto(); + } + + /** + * Sets passAllFilter or blockAllFilter + * + * @param {boolean} pass Whether to passAllFilter or blockAllFilter + * + * Assign true for enabling passAllFilter and false for enabling blockAllFilter + * + * @example + * ``` + * //- + * // Matches all cells, regardless of input. Functionally equivalent to + * // leaving `filter` unset, but included for completeness. + * //- + * const filter = { + * all: true + * }; + * + * //- + * // Does not match any cells, regardless of input. Useful for temporarily + * // disabling just part of a filter. + * //- + * const filter = { + * all: false + * }; + * ``` + */ + all(pass: boolean): void { + const filterName = pass ? 'passAllFilter' : 'blockAllFilter'; + this.set(filterName, true); + } + + /** + * Matches only cells from columns whose qualifiers satisfy the given RE2 + * regex. + * @param {?regex|string|object} column Matching Column to filter with + * + * Note that, since column qualifiers can contain arbitrary bytes, the '\C' + * escape sequence must be used if a true wildcard is desired. The '.' + * character will not match the new line character '\n', which may be + * present in a binary qualifier. + * + * @example + * ``` + * //- + * // Using the following filter, we would retrieve the `tjefferson` and + * // `gwashington` columns. + * //- + * const filter = [ + * { + * column: /[a-z]+on$/ + * } + * ]; + * + * //- + * // You can also provide a string (optionally containing regexp characters) + * // for simple column filters. + * //- + * const filter = [ + * { + * column: 'gwashington' + * } + * ]; + * + * //- + * // Or you can provide an array of strings if you wish to match against + * // multiple columns. + * //- + * const filter = [ + * { + * column: [ + * 'gwashington', + * 'tjefferson' + * ] + * } + * ]; + * + * //- + * // If you wish to use additional column filters, consider using the following + * // syntax. + * //- + * const filter = [ + * { + * column: { + * name: 'gwashington' + * } + * } + * ]; + * + * + * //- + * //

Column Cell Limits

+ * // + * // Matches only the most recent number of versions within each column. For + * // example, if the `versions` is set to 2, this filter would only match + * // columns updated at the two most recent timestamps. + * // + * // If duplicate cells are present, as is possible when using an + * // {@link Filter#interleave} filter, each copy of the cell is + * // counted separately. + * //- + * const filter = [ + * { + * column: { + * cellLimit: 2 + * } + * } + * ]; + * + * //- + * //

Column Ranges

+ * // + * // Specifies a contiguous range of columns within a single column family. + * // The range spans from : to + * // :, where both bounds can be either + * // inclusive or exclusive. By default both are inclusive. + * // + * // When the `start` bound is omitted it is interpreted as an empty string. + * // When the `end` bound is omitted it is interpreted as Infinity. + * //- + * const filter = [ + * { + * column: { + * family: 'follows', + * start: 'gwashington', + * end: 'tjefferson' + * } + * } + * ]; + * + * //- + * // By default, both the `start` and `end` bounds are inclusive. You can + * // override these by providing an object explicity stating whether or not it + * // is `inclusive`. + * //- + * const filter = [ + * { + * column: { + * family: 'follows', + * start: { + * value: 'gwashington', + * inclusive: false + * }, + * end: { + * value: 'jadams', + * inclusive: false + * } + * } + * } + * ]; + * ``` + */ + column(column: RegExp | string | {}): void { + let col: Column; + if (!is.object(column)) { + col = { + name: column as string, + }; + } else { + col = column as Column; + } + + if (col.name) { + const name = Mutation.convertToBytes( + Filter.convertToRegExpString(col.name), + ); + this.set('columnQualifierRegexFilter', name); + } + + if (typeof col.cellLimit === 'number') { + this.set('cellsPerColumnLimitFilter', col.cellLimit!); + } + + if (col.start || col.end) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const range: any = Filter.createRange(col.start!, col.end!, 'Qualifier'); + + range.familyName = col.family; + this.set('columnRangeFilter', range); + } + } + + /** + * A filter which evaluates one of two possible filters, depending on + * whether or not a `test` filter outputs any cells from the input row. + * + * IMPORTANT NOTE: The `test` filter does not execute atomically with the + * pass and fail filters, which may lead to inconsistent or unexpected + * results. Additionally, condition filters have poor performance, especially + * when filters are set for the fail condition. + * + * @param {object} condition Condition to filter. + * + * @example + * ``` + * //- + * // In the following example we're creating a filter that will check if + * // `gwashington` follows `tjefferson`. If he does, we'll get all of the + * // `gwashington` data. If he does not, we'll instead return all of the + * // `tjefferson` data. + * //- + * const filter = [ + * { + * condition: { + * // If `test` outputs any cells, then `pass` will be evaluated on the + * // input row. Otherwise `fail` will be evaluated. + * test: [ + * { + * row: 'gwashington' + * }, + * { + * family: 'follows' + * }, + * { + * column: 'tjefferson' + * } + * ], + * + * // If omitted, no results will be returned in the true case. + * pass: [ + * { + * row: 'gwashington' + * } + * ], + * + * // If omitted, no results will be returned in the false case. + * fail: [ + * { + * row: 'tjefferson' + * } + * ] + * } + * } + * ]; + * ``` + */ + condition(condition: Condition) { + this.set('condition', { + predicateFilter: Filter.parse(condition.test), + trueFilter: Filter.parse(condition.pass), + falseFilter: Filter.parse(condition.fail), + }); + } + + /** + * Matches only cells from columns whose families satisfy the given RE2 + * regex. For technical reasons, the regex must not contain the ':' + * character, even if it is not being used as a literal. + * Note that, since column families cannot contain the new line character + * '\n', it is sufficient to use '.' as a full wildcard when matching + * column family names. + * + * @param {regex} family Expression to filter family + * + * @example + * ``` + * const filter = [ + * { + * family: 'follows' + * } + * ]; + * ``` + */ + family( + family: + | RegExp + | string + | number + | Buffer + | RegExp[] + | string[] + | number[] + | Buffer[], + ): void { + const f = Filter.convertToRegExpString(family); + this.set('familyNameRegexFilter', f); + } + + /** + * Applies several filters to the data in parallel and combines the results. + * + * @param {object} filters The elements of "filters" all process a copy of the input row, and the + * results are pooled, sorted, and combined into a single output row. + * If multiple cells are produced with the same column and timestamp, + * they will all appear in the output row in an unspecified mutual order. + * All interleaved filters are executed atomically. + * + * @example + * ``` + * //- + * // In the following example, we're creating a filter that will retrieve + * // results for entries that were either created between December 17th, 2015 + * // and March 22nd, 2016 or entries that have data for `follows:tjefferson`. + * //- + * const filter = [ + * { + * interleave: [ + * [ + * { + * time: { + * start: new Date('December 17, 2015'), + * end: new Date('March 22, 2016') + * } + * } + * ], + * [ + * { + * family: 'follows' + * }, + * { + * column: 'tjefferson' + * } + * ] + * ] + * } + * ]; + * ``` + */ + interleave(filters: RawFilter[]): void { + this.set('interleave', { + filters: filters.map(Filter.parse), + }); + } + + /** + * Applies the given label to all cells in the output row. This allows + * the client to determine which results were produced from which part of + * the filter. + * + * @param {string} label Label to determine filter point + * Values must be at most 15 characters in length, and match the RE2 + * pattern [a-z0-9\\-]+ + * + * Due to a technical limitation, it is not currently possible to apply + * multiple labels to a cell. As a result, a chain filter may have no more than + * one sub-filter which contains a apply label transformer. It is okay for + * an {@link Filter#interleave} to contain multiple apply label + * transformers, as they will be applied to separate copies of the input. This + * may be relaxed in the future. + * + * @example + * ``` + * const filter = { + * label: 'my-label' + * }; + * ``` + */ + label(label: string): void { + this.set('applyLabelTransformer', label); + } + + /** + * Matches only cells from rows whose keys satisfy the given RE2 regex. In + * other words, passes through the entire row when the key matches, and + * otherwise produces an empty row. + * + * @param {?regex|string|string[]} row Row format to Filter + * + * Note that, since row keys can contain arbitrary bytes, the '\C' escape + * sequence must be used if a true wildcard is desired. The '.' character + * will not match the new line character '\n', which may be present in a + * binary key. + * + * @example + * ``` + * //- + * // In the following example we'll use a regular expression to match all + * // row keys ending with the letters "on", which would then yield + * // `gwashington` and `tjefferson`. + * //- + * const filter = [ + * { + * row: /[a-z]+on$/ + * } + * ]; + * + * //- + * // You can also provide a string (optionally containing regexp characters) + * // for simple key filters. + * //- + * const filter = [ + * { + * row: 'gwashington' + * } + * ]; + * + * //- + * // Or you can provide an array of strings if you wish to match against + * // multiple keys. + * //- + * const filter = [ + * { + * row: [ + * 'gwashington', + * 'tjefferson' + * ] + * } + * ]; + * + * //- + * // If you wish to use additional row filters, consider using the following + * // syntax. + * //- + * const filter = [ + * { + * row: { + * key: 'gwashington' + * } + * } + * ]; + * + * //- + * //

Row Samples

+ * // + * // Matches all cells from a row with probability p, and matches no cells + * // from the row with probability 1-p. + * //- + * const filter = [ + * { + * row: { + * sample: 1 + * } + * } + * ]; + * + * //- + * //

Row Cell Offsets

+ * // + * // Skips the first N cells of each row, matching all subsequent cells. + * // If duplicate cells are present, as is possible when using an + * // {@link Filter#interleave}, each copy of the cell is counted + * // separately. + * //- + * const filter = [ + * { + * row: { + * cellOffset: 2 + * } + * } + * ]; + * + * //- + * //

Row Cell Limits

+ * // + * // Matches only the first N cells of each row. + * // If duplicate cells are present, as is possible when using an + * // {@link Filter#interleave}, each copy of the cell is counted + * // separately. + * //- + * const filter = [ + * { + * row: { + * cellLimit: 4 + * } + * } + * ]; + * ``` + */ + row(row: Row | string | RegExp | string[]): void { + let r: Row; + if (!is.object(row)) { + r = { + key: row as string, + }; + } else { + r = row as Row; + } + + if (r.key) { + const key = Mutation.convertToBytes(Filter.convertToRegExpString(r.key)); + this.set('rowKeyRegexFilter', key); + } + + if (r.sample) { + this.set('rowSampleFilter', r.sample); + } + + if (typeof r.cellOffset === 'number') { + this.set('cellsPerRowOffsetFilter', r.cellOffset!); + } + + if (typeof r.cellLimit === 'number') { + this.set('cellsPerRowLimitFilter', r.cellLimit!); + } + } + + /** + * Stores a filter object. + * + * @param {string} key Filter name. + * @param {*} value Filter value. + */ + set(key: string, value: {}): void { + this.filters_.push({ + [key]: value, + }); + } + + /** + * This filter is meant for advanced use only. Hook for introspection into the + * filter. Outputs all cells directly to the output of the read rather than to + * any parent filter. + * Despite being excluded by the qualifier filter, a copy of every cell that + * reaches the sink is present in the final result. + * As with an {@link Filter#interleave} filter, duplicate cells are + * possible, and appear in an unspecified mutual order. + * + * Cannot be used within {@link Filter#condition} filter. + * + * @param {boolean} sink + * + * @example + * ``` + * //- + * // Using the following filter, a copy of every cell that reaches the sink is + * // present in the final result, despite being excluded by the qualifier + * // filter + * //- + * const filter = [ + * { + * family: 'follows' + * }, + * { + * interleave: [ + * [ + * { + * all: true + * } + * ], + * [ + * { + * label: 'prezzy' + * }, + * { + * sink: true + * } + * ] + * ] + * }, + * { + * column: 'gwashington' + * } + * ]; + * + * //- + * // As with an {@link Filter#interleave} filter, duplicate cells + * // are possible, and appear in an unspecified mutual order. In this case we + * // have a duplicates with multiple `gwashington` columns because one copy + * // passed through the {@link Filter#all} filter while the other was + * // passed through the {@link Filter#label} and sink. Note that one + * // copy has label "prezzy" while the other does not. + * //- + * ``` + */ + sink(sink: boolean): void { + this.set('sink', sink); + } + + /** + * Matches only cells with timestamps within the given range. + * + * @param {object} time Start and End time Object + * + * @example + * ``` + * const filter = [ + * { + * time: { + * start: new Date('December 17, 2006 03:24:00'), + * end: new Date() + * } + * } + * ]; + * ``` + */ + time(time: Time): void { + const range = Mutation.createTimeRange(time.start, time.end); + this.set('timestampRangeFilter', range); + } + + /** + * If we detect multiple filters, we'll assume it's a chain filter and the + * execution of the filters will be the order in which they were specified. + */ + toProto(): null | {} { + if (!this.filters_.length) { + return null; + } + + if (this.filters_.length === 1) { + return this.filters_[0]; + } + + return { + chain: { + filters: this.filters_, + }, + }; + } + + /** + * Matches only cells with values that satisfy the given regular expression. + * Note that, since cell values can contain arbitrary bytes, the '\C' escape + * sequence must be used if a true wildcard is desired. The '.' character + * will not match the new line character '\n', which may be present in a + * binary value. + * + * @param {?string|string[]|object} value Value to filter cells + * + * @example + * ``` + * const filter = [ + * { + * value: /[0-9]/ + * } + * ]; + * + * //- + * // You can also provide a string (optionally containing regexp characters) + * // for value filters. + * //- + * const filter = [ + * { + * value: '1' + * } + * ]; + * + * //- + * // You can also provide an array of strings if you wish to match against + * // multiple values. + * //- + * const filter = [ + * { + * value: ['1', '9'] + * } + * ]; + * + * //- + * // Or you can provide a Buffer or an array of Buffers if you wish to match + * // against specfic binary value(s). + * //- + * const userInputedFaces = [Buffer.from('.|.'), Buffer.from(':-)')]; + * const filter = [ + * { + * value: userInputedFaces + * } + * ]; + * + * //- + * //

Value Ranges

+ * // + * // Specifies a contiguous range of values. + * // + * // When the `start` bound is omitted it is interpreted as an empty string. + * // When the `end` bound is omitted it is interpreted as Infinity. + * //- + * const filter = [ + * { + * value: { + * start: '1', + * end: '9' + * } + * } + * ]; + * + * //- + * // By default, both the `start` and `end` bounds are inclusive. You can + * // override these by providing an object explicity stating whether or not it + * // is `inclusive`. + * //- + * const filter = [ + * { + * value: { + * start: { + * value: '1', + * inclusive: false + * }, + * end: { + * value: '9', + * inclusive: false + * } + * } + * } + * ]; + * + * //- + * //

Strip Values

+ * // + * // Replaces each cell's value with an emtpy string. + * //- + * const filter = [ + * { + * value: { + * strip: true + * } + * } + * ]; + * ``` + */ + value(value: string | string[] | ValueFilter): void { + let v: ValueFilter; + if (!is.object(value)) { + v = { + value: value as string, + }; + } else { + v = value as ValueFilter; + } + + if (v.value) { + const valueReg = Mutation.convertToBytes( + Filter.convertToRegExpString(v.value), + ); + this.set('valueRegexFilter', valueReg); + } + + if (v.start || v.end) { + const range = Filter.createRange(v.start!, v.end!, 'Value'); + this.set('valueRangeFilter', range); + } + + if (v.strip) { + this.set('stripValueTransformer', v.strip); + } + } +} diff --git a/handwritten/bigtable/src/index.ts b/handwritten/bigtable/src/index.ts new file mode 100644 index 00000000000..35e8f5d4ad5 --- /dev/null +++ b/handwritten/bigtable/src/index.ts @@ -0,0 +1,1404 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {replaceProjectIdToken} from '@google-cloud/projectify'; +import {promisifyAll} from '@google-cloud/promisify'; +import arrify = require('arrify'); +import * as extend from 'extend'; +import { + GoogleAuth, + CallOptions, + grpc as gaxVendoredGrpc, + ClientOptions, +} from 'google-gax'; +import * as gax from 'google-gax'; +import * as protos from '../protos/protos'; +import * as SqlTypes from './execute-query/types'; + +import {AppProfile} from './app-profile'; +import {Cluster} from './cluster'; +import { + Instance, + InstanceOptions, + CreateInstanceCallback, + CreateInstanceResponse, + IInstance, + ClusterInfo, +} from './instance'; +import {google} from '../protos/protos'; +import {ServiceError} from 'google-gax'; +import * as v2 from './v2'; +import * as admin from './admin'; +import {PassThrough, Duplex} from 'stream'; +import grpcGcpModule = require('grpc-gcp'); +import {ClusterUtils} from './utils/cluster'; +import {ClientSideMetricsConfigManager} from './client-side-metrics/metrics-config-manager'; +import {GCPMetricsHandler} from './client-side-metrics/gcp-metrics-handler'; + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const streamEvents = require('stream-events'); + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const PKG = require('../../package.json'); + +const {grpc} = new gax.GrpcClient(); + +// Enable channel pooling +const grpcGcp = grpcGcpModule(gaxVendoredGrpc); + +export interface GetInstancesCallback { + ( + err: ServiceError | null, + result?: Instance[], + failedLocations?: string[], + response?: google.bigtable.admin.v2.IListInstancesResponse, + ): void; +} +export type GetInstancesResponse = [ + Instance[], + string[], + google.bigtable.admin.v2.IListInstancesResponse, +]; + +export type RequestCallback = (err: ServiceError | null, resp?: T) => void; + +export interface RequestOptions { + client: + | 'BigtableInstanceAdminClient' + | 'BigtableTableAdminClient' + | 'BigtableClient'; + reqOpts?: {}; + retryOpts?: {}; + gaxOpts?: {}; + method?: string; +} + +export interface AbortableDuplex extends Duplex { + abort(): void; +} + +export interface BigtableOptions extends gax.GoogleAuthOptions { + /** + * Override the default API endpoint used to reach Bigtable. This is useful for connecting to your local Bigtable emulator. + */ + apiEndpoint?: string; + + appProfileId?: string; + + /** + * Internal only. + */ + BigtableClient?: gax.ClientOptions; + + /** + * Internal only. + */ + BigtableInstanceAdminClient?: gax.ClientOptions; + + /** + * Internal only. + */ + BigtableTableAdminClient?: gax.ClientOptions; + + metricsEnabled?: boolean; +} + +/** + * Retrieves the universe domain, if configured. + * + * This function checks for a universe domain in the following order: + * 1. The `universeDomain` property within the provided options. + * 2. The `universeDomain` or `universe_domain` property within the `opts` object. + * 3. The `GOOGLE_CLOUD_UNIVERSE_DOMAIN` environment variable. + * + * If a universe domain is found in any of these locations, it is returned. + * Otherwise, the function returns `undefined`. + * + * @param {BigtableOptions} options - The Bigtable client options. + * @param {gax.ClientOptions} [gaxOpts] - Optional gax client options. + * @returns {string | undefined} The universe domain, or `undefined` if not found. + */ +function getUniverseDomainOnly( + options: BigtableOptions, + gaxOpts?: gax.ClientOptions, +): string | undefined { + // From https://github.com/googleapis/nodejs-bigtable/blob/589540475b0b2a055018a1cb6e475800fdd46a37/src/v2/bigtable_client.ts#L120-L128. + // This code for universe domain was taken from the Gapic Layer. + // It is reused here to build the service path. + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + return ( + gaxOpts?.universeDomain ?? + gaxOpts?.universe_domain ?? + options?.universeDomain ?? + universeDomainEnvVar + ); +} + +/** + * Retrieves the universe domain options from the provided options. + * + * This function examines the provided BigtableOptions and an optional + * gax.ClientOptions object to determine the universe domain to be used. + * It prioritizes the `universeDomain` property in the options, then checks + * for `universeDomain` or `universe_domain` in the gax options, and finally + * falls back to the `GOOGLE_CLOUD_UNIVERSE_DOMAIN` environment variable. + * If a universe domain is found, it returns an object containing the + * `universeDomain` property; otherwise, it returns `null`. + * + * @param {BigtableOptions} options - The Bigtable client options. + * @param {gax.ClientOptions} [gaxOpts] - Optional gax client options. + * @returns {{universeDomain: string} | null} An object containing the `universeDomain` property if found, + * otherwise `null`. + */ +function getUniverseDomainOptions( + options: BigtableOptions, + gaxOpts?: gax.ClientOptions, +): {universeDomain: string} | null { + const universeDomainOnly = getUniverseDomainOnly(options, gaxOpts); + return universeDomainOnly ? {universeDomain: universeDomainOnly} : null; +} + +/** + * Retrieves the domain to be used for the service path. + * + * This function retrieves the domain from gax.ClientOptions passed in or via an environment variable. + * It defaults to 'googleapis.com' if none has been set. + * @param {string} [prefix] The prefix for the domain. + * @param {BigtableOptions} [options] The options passed into the Bigtable client. + * @param {gax.ClientOptions} [gaxOpts] The gax client options. + * @returns {string} The universe domain. + */ +function getDomain( + prefix: string, + options: BigtableOptions, + gaxOpts?: gax.ClientOptions, +): string { + const universeDomainOnly = getUniverseDomainOnly(options, gaxOpts); + const suffix = universeDomainOnly ? universeDomainOnly : 'googleapis.com'; + return `${prefix}.${suffix}`; +} + +/** + * @typedef {object} ClientConfig + * @property {string} [apiEndpoint] Override the default API endpoint used + * to reach Bigtable. This is useful for connecting to your local Bigtable + * emulator. + * @property {string} [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://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application + * Application Default Credentials}, your project ID will be detected + * automatically. + * @property {string} [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 above is not necessary. NOTE: .pem and + * .p12 require you to specify the `email` option as well. + * @property {string} [appProfileId] An application profile ID, a configuration + * string value describing how Cloud Bigtable should treat traffic from a + * particular end user application. + * @property {string} [email] Account email address. Required when using a .pem + * or .p12 keyFilename. + * @property {object} [credentials] Credentials object. + * @property {string} [credentials.client_email] + * @property {string} [credentials.private_key] + * @property {boolean} [autoRetry=true] Automatically retry requests if the + * response is related to rate limits or certain intermittent server errors. + * We will exponentially backoff subsequent requests by default. + * @property {number} [maxRetries=3] Maximum number of automatic retries + * attempted before returning the error. + */ + +/** + * @see [Creating a Cloud Bigtable Cluster]{@link https://cloud.google.com/bigtable/docs/creating-instance} + * @see [Cloud Bigtable Concepts Overview]{@link https://cloud.google.com/bigtable/docs/concepts} + * + * @class + * @param {ClientConfig} [options] Configuration options. + * + * @example Create a client that uses Application Default Credentials (ADC): + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * + * ``` + * @example Create a client with explicit credentials: + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable({ + * projectId: 'your-project-id', + * keyFilename: '/path/to/keyfile.json' + * }); + * + * ``` + * @example The Bigtable Emulator + * ``` + * // Make sure you have the {@link https://cloud.google.com/sdk/downloads gcloud SDK installed}, then run: + * $ gcloud beta emulators bigtable start + * + * // Before running your Node.js app, set the environment variables that this + * // library will look for to connect to the emulator: + * + * $ $(gcloud beta emulators bigtable env-init) + * + * ``` + * @example Creating a Bigtable Instance and Cluster + * ``` + * + * // Before you create your table, you first need to create a Bigtable Instance + * // and cluster for the table to be served from. + * + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * + * const callback = (err, instance, operation) => { + * operation + * .on('error', console.log) + * .on('complete', () => { + * // `instance` is your newly created Instance object. + * }); + * }; + * + * const instance = bigtable.instance('my-instance'); + * + * instance.create({ + * clusters: [ + * { + * id: 'my-cluster', + * location: 'us-central1-b', + * nodes: 3 + * } + * ] + * }, callback); + * + * // This can also be done from either the Google Cloud Platform Console or the + * // `gcloud` cli tool. Please refer to the + * // {@link https://cloud.google.com/bigtable/docs/creating-instance official Bigtable documentation} + * // for more information. + * + * ``` + * @example Creating Tables + * ``` + * // After creating your instance and enabling the Bigtable APIs, you are now + * // ready to create your table with {@link Instance#createTable}. + * instance.createTable('prezzy', function(err, table) { + * // `table` is your newly created Table object. + * }); + * + * ``` + * @example Creating Column Families + * ``` + * // Column families are used to group together various pieces of data within + * // your table. You can think of column families as a mechanism to categorize + * // all of your data. + * // + * // We can create a column family with {@link Table#createFamily}. + * const table = instance.table('prezzy'); + * + * table.createFamily('follows', function(err, family) { + * // `family` is your newly created Family object. + * }); + * + * // It is also possible to create your column families when creating a new + * // table. + * const options = { + * families: ['follows'] + * }; + * + * instance.createTable('prezzy', options, function(err, table) {}); + * + * ``` + * @example Creating Rows + * ``` + * // New rows can be created within your table using + * // {@link Table#insert}. You must provide a unique key for each row + * // to be inserted, this key can then be used to retrieve your row at a later + * // time. + * // + * // With Bigtable, all columns have a unique id composed of a column family + * // and a column qualifier. In the example below `follows` is the column + * // family and `tjefferson` is the column qualifier. Together they could be + * // referred to as `follows:tjefferson`. + * const rows = [ + * { + * key: 'wmckinley', + * data: { + * follows: { + * tjefferson: 1 + * } + * } + * } + * ]; + * + * table.insert(rows, err => { + * if (!err) { + * // Your rows were successfully inserted. + * } + * }); + * + * ``` + * @example Retrieving Rows + * ``` + * // If you're anticipating a large number of rows to be returned, we suggest + * // using the {@link Table#getRows} streaming API. + * table.createReadStream() + * .on('error', console.error) + * .on('data', row => { + * // `row` is a Row object. + * }); + * + * // If you're not anticpating a large number of results, a callback mode + * // is also available. + * const callback = (err, rows) => { + * // `rows` is an array of Row objects. + * }; + * + * table.getRows(callback); + * + * // A range of rows can be retrieved by providing `start` and `end` row keys. + * const options = { + * start: 'gwashington', + * end: 'wmckinley' + * }; + * + * table.getRows(options, callback); + * + * // Retrieve an individual row with {@link Row#get}. + * const row = table.row('alincoln'); + * + * row.get(err => { + * // `row.data` is now populated. + * }); + * + * ``` + * @example Accessing Row Data + * ``` + * // When retrieving rows, upon success the `row.data` property will be + * // populated by an object. That object will contain additional objects + * // for each family in your table that the row has data for. + * // + * // By default, when retrieving rows, each column qualifier will provide you + * // with all previous versions of the data. So your `row.data` object could + * // resemble the following. + * { + * follows: { + * wmckinley: [ + * { + * value: 1, + * timestamp: 1466017315951 + * }, { + * value: 2, + * timestamp: 1458619200000 + * } + * ] + * } + * } + * + * // The `timestamp` field can be used to order cells from newest to oldest. + * // If you only wish to retrieve the most recent version of the data, you + * // can specify the number of cells with a {@link Filter} object. + * const filter = [ + * { + * column: { + * cellLimit: 1 + * } + * } + * ]; + * + * table.getRows({ + * filter: filter + * }, callback); + * + * ``` + * @example Deleting Row Data + * ``` + * // We can delete all of an individual row's cells using {@link Row#delete}. + * const callback = err => { + * if (!err) { + * // All cells for this row were deleted successfully. + * } + * }; + * + * row.delete(callback); + * + * // To delete a specific set of cells, we can provide an array of + * // column families and qualifiers. + * const cells = [ + * 'follows:gwashington', + * 'traits' + * ]; + * + * row.delete(cells, callback); + * + * ``` + * @example Deleting Rows + * ``` + * // If you wish to delete multiple rows entirely, we can do so with + * // {@link Table#deleteRows}. You can provide this method with a + * // row key prefix. + * const options = { + * prefix: 'gwash' + * }; + * + * table.deleteRows(options, err => { + * if (!err) { + * // Rows were deleted successfully. + * } + * }); + * + * // If you omit the prefix, you can delete all rows in your table. + * table.deleteRows(err => { + * if (!err) { + * // All rows were deleted successfully. + * } + * }); + * ``` + */ +export class Bigtable { + customEndpoint?: string; + options: BigtableOptions; + api: { + [index: string]: + | v2.BigtableClient + | v2.BigtableInstanceAdminClient + | v2.BigtableTableAdminClient; + }; + auth: GoogleAuth; + projectId: string; + appProfileId?: string; + projectName: string; + shouldReplaceProjectIdToken: boolean; + static AppProfile: AppProfile; + static Instance: Instance; + static Cluster: Cluster; + _metricsConfigManager: ClientSideMetricsConfigManager; + admin: admin.BigtableAdmin; + closed = false; + + constructor(options: BigtableOptions = {}) { + // Determine what scopes are needed. + // It is the union of the scopes on all three clients. + const scopes: string[] = []; + const clientClasses = [ + v2.BigtableClient, + admin.v2.BigtableInstanceAdminClient, + admin.v2.BigtableTableAdminClient, + ]; + for (const clientClass of clientClasses) { + for (const scope of clientClass.scopes) { + if (!scopes.includes(scope)) { + scopes.push(scope); + } + } + } + + const customEndpoint = + options.apiEndpoint || process.env.BIGTABLE_EMULATOR_HOST; + this.customEndpoint = customEndpoint; + + let customEndpointBaseUrl: string | undefined; + let customEndpointPort: number | undefined; + let sslCreds: gaxVendoredGrpc.ChannelCredentials | undefined; + + if (customEndpoint) { + const customEndpointParts = customEndpoint.split(':'); + customEndpointBaseUrl = customEndpointParts[0]; + customEndpointPort = Number(customEndpointParts[1]); + sslCreds = grpc.credentials.createInsecure(); + } + + const baseOptions = Object.assign({ + libName: 'gccl', + libVersion: PKG.version, + port: customEndpointPort || 443, + sslCreds, + scopes, + 'grpc.keepalive_time_ms': 30000, + 'grpc.keepalive_timeout_ms': 10000, + }) as gax.ClientOptions; + + const dataOptions = Object.assign( + {}, + baseOptions, + getUniverseDomainOptions(options, options.BigtableClient), + { + servicePath: + customEndpointBaseUrl || + getDomain('bigtable', options, options.BigtableClient), + 'grpc.callInvocationTransformer': grpcGcp.gcpCallInvocationTransformer, + 'grpc.channelFactoryOverride': grpcGcp.gcpChannelFactoryOverride, + 'grpc.gcpApiConfig': grpcGcp.createGcpApiConfig({ + channelPool: { + minSize: 2, + maxSize: 4, + maxConcurrentStreamsLowWatermark: 10, + debugHeaderIntervalSecs: 600, + }, + }), + }, + options, + ) as gax.ClientOptions; + + const adminOptions = Object.assign( + {}, + baseOptions, + getUniverseDomainOptions(options, options.BigtableTableAdminClient), + { + servicePath: + customEndpointBaseUrl || + getDomain('bigtableadmin', options, options.BigtableTableAdminClient), + }, + options, + ); + const instanceAdminOptions = Object.assign( + {}, + baseOptions, + getUniverseDomainOptions(options, options.BigtableInstanceAdminClient), + { + servicePath: + customEndpointBaseUrl || + getDomain( + 'bigtableadmin', + options, + options.BigtableInstanceAdminClient, + ), + }, + options, + ); + + this.options = { + BigtableClient: dataOptions, + BigtableInstanceAdminClient: instanceAdminOptions, + BigtableTableAdminClient: adminOptions, + }; + this.admin = admin.BigtableAdmin.fromBigtable(this); + + this.api = {}; + this.auth = new GoogleAuth(Object.assign({}, baseOptions, options)); + this.projectId = options.projectId || '{{projectId}}'; + this.appProfileId = options.appProfileId; + this.projectName = `projects/${this.projectId}`; + this.shouldReplaceProjectIdToken = this.projectId === '{{projectId}}'; + + const handlers = !(options.metricsEnabled === false) + ? [new GCPMetricsHandler(Object.assign({}, options) as ClientOptions)] + : []; + this._metricsConfigManager = new ClientSideMetricsConfigManager(handlers); + } + + createInstance( + id: string, + options: InstanceOptions, + ): Promise; + createInstance( + id: string, + options: InstanceOptions, + callback: CreateInstanceCallback, + ): void; + /** + * Create a Cloud Bigtable instance. + * + * @see [Creating a Cloud Bigtable Instance]{@link https://cloud.google.com/bigtable/docs/creating-instance} + * + * @param {string} id The unique id of the instance. + * @param {object} options Instance creation options. + * @param {object[]} options.clusters The clusters to be created within the + * instance. + * @param {string} [options.displayName] The descriptive name for this instance + * as it appears in UIs. + * @param {Object.} [options.labels] Labels are a flexible and + * lightweight mechanism for organizing cloud resources into groups that + * reflect a customer's organizational needs and deployment strategies. + * They can be used to filter resources and aggregate metrics. + * + * * Label keys must be between 1 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. + * * Label values must be between 0 and 63 characters long and must conform + * to the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. + * * No more than 64 labels can be associated with a given resource. + * * Keys and values must both be under 128 bytes. + * @param {string} [options.type] The type of the instance. Options are + * 'production' or 'development'. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Instance} callback.instance The newly created + * instance. + * @param {Operation} callback.operation An operation object that can be used + * to check the status of the request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * + * const callback = function(err, instance, operation, apiResponse) { + * if (err) { + * // Error handling omitted. + * } + * + * operation + * .on('error', console.log) + * .on('complete', () => { + * // The instance was created successfully. + * }); + * }; + * + * const options = { + * displayName: 'my-sweet-instance', + * labels: {env: 'prod'}, + * clusters: [ + * { + * id: 'my-sweet-cluster', + * nodes: 3, + * location: 'us-central1-b', + * storage: 'ssd' + * } + * ] + * }; + * + * bigtable.createInstance('my-instance', options, callback); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * bigtable.createInstance('my-instance', options).then(function(data) { + * const instance = data[0]; + * const operation = data[1]; + * const apiResponse = data[2]; + * }); + * ``` + */ + createInstance( + id: string, + options: InstanceOptions, + callback?: CreateInstanceCallback, + ): void | Promise { + if (typeof options !== 'object') { + throw new Error( + 'A configuration object is required to create an instance.', + ); + } + if (!options.clusters) { + throw new Error( + 'At least one cluster configuration object is required to create an instance.', + ); + } + const reqOpts = { + parent: this.projectName, + instanceId: id, + instance: { + displayName: options.displayName || id, + labels: options.labels, + }, + } as google.bigtable.admin.v2.CreateInstanceRequest; + + if (options.type) { + reqOpts.instance!.type = Instance.getTypeType_(options.type); + } + + reqOpts.clusters = arrify(options.clusters).reduce( + (clusters, cluster) => { + // TOD: Find a way to eliminate all ClusterInfo casts in this file. + if (!(cluster as ClusterInfo).id) { + throw new Error( + 'A cluster was provided without an `id` property defined.', + ); + } + + if ( + typeof (cluster as ClusterInfo).key !== 'undefined' && + typeof (cluster as ClusterInfo).encryption !== 'undefined' + ) { + throw new Error( + 'A cluster was provided with both `encryption` and `key` defined.', + ); + } + ClusterUtils.validateClusterMetadata(cluster as ClusterInfo); + clusters[(cluster as ClusterInfo).id!] = + ClusterUtils.getClusterBaseConfigWithFullLocation( + cluster as ClusterInfo, + this.projectId, + undefined, + ); + Object.assign(clusters[(cluster as ClusterInfo).id!], { + defaultStorageType: Cluster.getStorageType_( + (cluster as ClusterInfo).storage!, + ), + }); + + if ((cluster as ClusterInfo).key) { + clusters[(cluster as ClusterInfo).id!].encryptionConfig = { + kmsKeyName: (cluster as ClusterInfo).key, + }; + } + + if ((cluster as ClusterInfo).encryption) { + clusters[(cluster as ClusterInfo).id!].encryptionConfig = ( + cluster as ClusterInfo + ).encryption; + } + + return clusters; + }, + {} as {[index: string]: google.bigtable.admin.v2.ICluster}, + ); + + this.request( + { + client: 'BigtableInstanceAdminClient', + method: 'createInstance', + reqOpts, + gaxOpts: options.gaxOptions, + }, + (...args) => { + const err = args[0]; + if (!err) { + args.splice(1, 0, this.instance(id)); + } + callback!(...args); + }, + ); + } + + getInstances(gaxOptions?: CallOptions): Promise; + getInstances(callback: GetInstancesCallback): void; + getInstances(gaxOptions: CallOptions, callback: GetInstancesCallback): void; + /** + * @typedef {array} GetInstancesResponse + * @property {Instance[]} 0 Array of {@link Instance} instances. + * @property {string[]} 1 locations from which Instance information could not be retrieved + * @property {object} 2 The full API response. + * Note: 'failedLocations' property may contain locations from which + * Instance information could not be retrieved. + * Values are of the form `projects//locations/` + */ + /** + * @callback GetInstancesCallback + * @param {?Error} err Request error, if any. + * @param {Instance[]} instances Array of {@link Instance} instances. + * @param {string[]} locations from which Instance information could not be retrieved + * @param {object} apiResponse The full API response. + * Note: 'failedLocations' property may contain locations from which + * Instance information could not be retrieved. + * Values are of the form `projects//locations/` + */ + /** + * Get Instance objects for all of your Cloud Bigtable instances. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/classes/CallSettings.html. + * @param {GetInstancesCallback} [callback] The callback function. + * @returns {Promise} + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * + * bigtable.getInstances(function(err, instances, response) { + * if (!err) { + * // `instances` is an array of Instance objects. + * if (response.failedLocations.length > 0) { + * // These locations contain instances which could not be retrieved. + * } + * } + * }); + * + * ``` + * @example If the callback is omitted, we'll return a Promise. + * ``` + * bigtable.getInstances().then(function(data) { + * const instances = data[0]; + * const fullResponse = data[2]; + * + * if (fullResponse.failedLocations.length > 0) { + * // These locations contain instances which could not be retrieved. + * const failedLocations = fullResponse.failedLocations; + * } + * }); + * ``` + */ + getInstances( + gaxOptionsOrCallback?: CallOptions | GetInstancesCallback, + callback?: GetInstancesCallback, + ): void | Promise { + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; + callback = + typeof gaxOptionsOrCallback === 'function' + ? gaxOptionsOrCallback + : callback; + + const reqOpts = { + parent: this.projectName, + }; + + this.request( + { + client: 'BigtableInstanceAdminClient', + method: 'listInstances', + reqOpts, + gaxOpts: gaxOptions, + }, + (err, resp) => { + if (err) { + callback!(err); + return; + } + const instances = resp.instances.map((instanceData: IInstance) => { + const instance = this.instance(instanceData.name!.split('/').pop()!); + instance.metadata = instanceData; + return instance; + }); + callback!(null, instances, resp.failedLocations, resp); + }, + ); + } + + /** + * Get a reference to a Cloud Bigtable instance. + * + * @param {string} id The id of the instance. + * @returns {Instance} + */ + instance(name: string) { + return new Instance(this, name); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars + request(config?: any): AbortableDuplex; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + request(config?: any, callback?: RequestCallback): void; + /** + * Funnel all API requests through this method, to be sure we have a project ID. + * + * @param {object} config Configuration object. + * @param {object} config.gaxOpts GAX options. + * @param {function} config.method The gax method to call. + * @param {object} config.reqOpts Request options. + * @param {function} [callback] Callback function. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + request( + config: RequestOptions, + callback?: (err: ServiceError | null, resp?: T) => void, + ): void | AbortableDuplex { + const isStreamMode = !callback; + + let gaxStream: gax.CancellableStream; + let stream: AbortableDuplex; + + if (this.closed) { + const error = Object.assign( + new Error('The client has already been closed.'), + { + name: 'Closed', + code: grpc.status.ABORTED, + details: 'The client has already been closed.', + metadata: new grpc.Metadata(), + }, + ); + if (isStreamMode) { + stream = streamEvents(new PassThrough({objectMode: true})); + stream.abort = () => {}; + setImmediate(() => stream.destroy(error)); + return stream; + } else { + callback?.(error as ServiceError); + return; + } + } + + const prepareGaxRequest = ( + callback: (err: Error | null, fn?: Function) => void, + ) => { + this.getProjectId_((err, projectId) => { + if (err) { + callback(err); + return; + } + let gaxClient = this.api[config.client]; + if (!gaxClient) { + // Lazily instantiate client. + const clientOptions = this.options[config.client]!; + gaxClient = new v2[config.client](clientOptions); + this.api[config.client] = gaxClient; + } + let reqOpts = extend(true, {}, config.reqOpts); + if (this.shouldReplaceProjectIdToken && projectId !== '{{projectId}}') { + reqOpts = replaceProjectIdToken(reqOpts, projectId!); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const requestFn = (gaxClient as any)[config.method!].bind( + gaxClient, + reqOpts, + config.gaxOpts, + ); + callback(null, requestFn); + }); + }; + + const gapicStreamingMethods = { + listAppProfilesStream: true, + listBackupsStream: true, + listTablesStream: true, + }; + + if (isStreamMode) { + stream = streamEvents(new PassThrough({objectMode: true})); + stream.abort = () => { + if (gaxStream && gaxStream.cancel) { + gaxStream.cancel(); + } + }; + if (config.method! in gapicStreamingMethods) { + stream.once('reading', makeGapicStreamRequest); + } else { + stream.once('reading', makeRequestStream); + } + return stream; + } else { + makeRequestCallback(); + } + + function makeRequestCallback() { + prepareGaxRequest((err, requestFn) => { + if (err) { + callback!(err as ServiceError); + return; + } + requestFn!(callback); + }); + } + + function makeRequestStream() { + const retryRequestOptions = Object.assign( + { + currentRetryAttempt: 0, + noResponseRetries: 0, + objectMode: true, + }, + config.retryOpts, + ); + + config.gaxOpts = Object.assign(config.gaxOpts || {}, { + retryRequestOptions, + }); + prepareGaxRequest((err, requestFn) => { + if (err) { + stream.destroy(err); + return; + } + + gaxStream = requestFn!(); + gaxStream + .on('error', stream.destroy.bind(stream)) + .on('metadata', stream.emit.bind(stream, 'metadata')) + .on('status', stream.emit.bind(stream, 'status')) + .on('request', stream.emit.bind(stream, 'request')) + .pipe(stream); + }); + } + + function makeGapicStreamRequest() { + prepareGaxRequest((err, requestFn) => { + if (err) { + stream.destroy(err); + return; + } + gaxStream = requestFn!(); + gaxStream + .on('error', (err: Error) => { + stream.destroy(err); + }) + .on('metadata', metadata => { + stream.emit('metadata', metadata); + }) + .on('response', response => { + stream.emit('response', response); + }) + .pipe(stream); + }); + } + } + + /** + * Close all bigtable clients. New requests will be rejected but it will not + * kill connections with pending requests. + */ + async close(): Promise { + // Close all of the clients. + const combined = Object.keys(this.api).map(clientType => + this.api[clientType].close(), + ); + const results = await Promise.all(combined); + + // Clear them out of our cache. + Object.keys(this.api).forEach(clientType => { + delete this.api[clientType]; + }); + + // Mark as closed. + this.closed = true; + + return results; + } + + /** + * Determine and localize the project ID. If a user provides an ID, we bypass + * checking with the auth client for an ID. + * + * @private + * + * @param {function} callback Callback function. + * @param {?error} callback.err An error returned from the auth client. + * @param {string} callback.projectId The detected project ID. + */ + getProjectId_(callback: (err: Error | null, projectId?: string) => void) { + const projectIdRequired = + this.projectId === '{{projectId}}' && !this.customEndpoint; + + if (!projectIdRequired) { + setImmediate(callback, null, this.projectId); + return; + } + + this.auth.getProjectId((err, projectId) => { + if (err) { + callback(err); + return; + } + this.projectId = projectId!; + callback(null, this.projectId); + }); + } +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(Bigtable, { + exclude: ['close', 'instance', 'operation', 'request'], +}); + +/** + * {@link AppProfile} class. + * + * @name Bigtable.AppProfile + * @see AppProfile + * @type {Constructor} + */ + +/** + * {@link Cluster} class. + * + * @name Bigtable.Cluster + * @see Cluster + * @type {Constructor} + */ + +/** + * {@link Instance} class. + * + * @name Bigtable.Instance + * @see Instance + * @type {Constructor} + */ + +// Allow creating a `Bigtable` instance without using the `new` keyword. +// eslint-disable-next-line @typescript-eslint/no-explicit-any, no-class-assign +(Bigtable as any) = new Proxy(Bigtable, { + apply(target, thisArg, argumentsList) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return new (target as any)(...argumentsList); + }, +}); +/** + * The default export of the `@google-cloud/bigtable` package is the + * {@link Bigtable} class. + * + * See {@link Bigtable} and {@link ClientConfig} for client methods and + * configuration options. + * + * @module {constructor} @google-cloud/bigtable + * @alias nodejs-bigtable + * + * @example Install the client library with npm: + * ``` + * npm install --save @google-cloud/bigtable + * + * ``` + * @example Import the client library + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * + * ``` + * @example Create a client that uses Application Default Credentials (ADC): + * ``` + * const bigtable = new Bigtable(); + * + * ``` + * @example Create a client with explicit credentials: + * ``` + * const bigtable = new Bigtable({ + * projectId: 'your-project-id', + * keyFilename: '/path/to/keyfile.json' + * }); + * + * ``` + * @example
+ * region_tag:bigtable_quickstart + * Full quickstart example: + */ + +module.exports = Bigtable; +module.exports.admin = admin; +module.exports.v2 = v2; +module.exports.Bigtable = Bigtable; +module.exports.SqlTypes = SqlTypes; + +export {v2}; +export {admin}; +export {protos}; +export { + AppProfile, + AppProfileExistsCallback, + AppProfileExistsResponse, + AppProfileOptions, + CreateAppProfileCallback, + CreateAppProfileResponse, + DeleteAppProfileCallback, + DeleteAppProfileOptions, + DeleteAppProfileResponse, + GetAppProfileCallback, + GetAppProfileMetadataCallback, + GetAppProfileMetadataResponse, + GetAppProfileResponse, + GetAppProfilesCallback, + GetAppProfilesResponse, + SetAppProfileMetadataCallback, + SetAppProfileMetadataResponse, +} from './app-profile'; +export { + Backup, + BackupTimestamp, + DeleteBackupCallback, + DeleteBackupResponse, + GenericBackupCallback, + GetBackupCallback, + GetBackupResponse, + GetBackupsCallback, + GetBackupsOptions, + GetBackupsResponse, + IBackup, + ModifiableBackupFields, + RestoreTableCallback, + RestoreTableResponse, + BackupSetMetadataCallback, + BackupSetMetadataResponse, + BackupGetMetadataCallback, + BackupGetMetadataResponse, +} from './backup'; +export { + Chunk, + ChunkTransformer, + Data, + Qualifier, + RowStateEnum, + TransformErrorProps, + Value, +} from './chunktransformer'; +export { + Cluster, + ICluster, + IOperation, + ApiResponse, + BooleanResponse, + CreateBackupCallback, + CreateBackupResponse, + CreateClusterCallback, + CreateClusterOptions, + CreateClusterResponse, + DeleteClusterCallback, + ExistsClusterCallback, + GenericCallback, + GenericClusterCallback, + GenericOperationCallback, + GetClusterCallback, + GetClusterMetadataCallback, + GetClusterMetadataResponse, + GetClusterResponse, + GetClustersCallback, + GetClustersResponse, + IEmpty, + SetClusterMetadataCallback, + SetClusterMetadataResponse, +} from './cluster'; +export { + CreateFamilyCallback, + CreateFamilyOptions, + FamilyError, + GcRule, + IGcRule, + ITable, + CreateFamilyResponse, + DeleteFamilyCallback, + DeleteFamilyResponse, + Family, + FamilyExistsCallback, + FamilyExistsResponse, + GetFamilyCallback, + GetFamilyMetadataCallback, + GetFamilyMetadataResponse, + GetFamilyOptions, + GetFamilyResponse, + IColumnFamily, + IModification, + InstanceCallback, + SetFamilyMetadataCallback, + SetFamilyMetadataOptions, + SetFamilyMetadataResponse, +} from './family'; +export { + RawFilter, + BoundData, + Column, + Condition, + Filter, + FilterError, + Time, + ValueFilter, +} from './filter'; +export { + ClusterInfo, + CreateInstanceCallback, + Instance, + InstanceOptions, + CreateInstanceResponse, + DeleteInstanceCallback, + DeleteInstanceResponse, + GetInstanceCallback, + GetInstanceMetadataCallback, + GetInstanceMetadataResponse, + GetInstanceResponse, + IInstance, + InstanceExistsCallback, + InstanceExistsResponse, + SetInstanceMetadataCallback, + SetInstanceMetadataResponse, +} from './instance'; +export { + IMutation, + Bytes, + ConvertFromBytesOptions, + ConvertFromBytesUserOptions, + IMutateRowRequest, + ISetCell, + JsonObj, + Mutation, + MutationConstructorObj, + MutationSettingsObj, + ParsedColumn, + SetCellObj, + TimeRange, + ValueObj, +} from './mutation'; +export { + GetRowCallback, + IncrementResponse, + Rule, + CreateRowCallback, + CreateRowOptions, + CreateRowResponse, + CreateRulesCallback, + CreateRulesResponse, + FilterCallback, + FilterConfig, + FilterConfigOption, + FilterResponse, + FormatFamiliesOptions, + GetRowMetadataCallback, + GetRowMetadataResponse, + GetRowOptions, + GetRowResponse, + IncrementCallback, + Row, + RowError, + RowExistsCallback, + RowExistsResponse, +} from './row'; +export { + GetIamPolicyOptions, + GetRowsOptions, + GetTablesOptions, + CheckConsistencyCallback, + CheckConsistencyResponse, + CreateTableCallback, + CreateTableOptions, + CreateTableResponse, + DeleteRowsCallback, + DeleteRowsResponse, + DeleteTableCallback, + DeleteTableResponse, + Entry, + GenerateConsistencyTokenCallback, + GenerateConsistencyTokenResponse, + GetFamiliesCallback, + GetFamiliesResponse, + GetIamPolicyCallback, + GetIamPolicyResponse, + GetMetadataCallback, + GetMetadataOptions, + GetMetadataResponse, + GetReplicationStatesCallback, + GetReplicationStatesResponse, + GetRowsCallback, + GetRowsResponse, + GetTableCallback, + GetTableOptions, + GetTableResponse, + GetTablesCallback, + GetTablesResponse, + InsertRowsCallback, + InsertRowsResponse, + MutateCallback, + MutateOptions, + MutateResponse, + PartialFailureError, + Policy, + PolicyBinding, + PrefixRange, + SampleRowKeysCallback, + SampleRowsKeysResponse, + SetIamPolicyCallback, + SetIamPolicyResponse, + Table, + TableExistsCallback, + TableExistsResponse, + TestIamPermissionsCallback, + TestIamPermissionsResponse, + TruncateCallback, + TruncateResponse, + WaitForReplicationCallback, + WaitForReplicationResponse, +} from './table'; +export {SqlTypes}; diff --git a/handwritten/bigtable/src/instance.ts b/handwritten/bigtable/src/instance.ts new file mode 100644 index 00000000000..93984058c92 --- /dev/null +++ b/handwritten/bigtable/src/instance.ts @@ -0,0 +1,1758 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {promisifyAll} from '@google-cloud/promisify'; +import {Transform} from 'stream'; +import arrify = require('arrify'); +import * as is from 'is'; +import * as extend from 'extend'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const pumpify = require('pumpify'); +const concat = require('concat-stream'); + +import snakeCase = require('lodash.snakecase'); +import { + AppProfile, + AppProfileOptions, + CreateAppProfileCallback, + CreateAppProfileResponse, + GetAppProfilesCallback, + GetAppProfilesResponse, +} from './app-profile'; +import { + GetBackupsCallback, + GetBackupsOptions, + GetBackupsResponse, +} from './backup'; +import { + Cluster, + CreateClusterOptions, + CreateClusterCallback, + CreateClusterResponse, + GetClustersCallback, + GetClustersResponse, + IOperation, + BasicClusterConfig, +} from './cluster'; +import {Family} from './family'; +import { + GetIamPolicyCallback, + GetIamPolicyOptions, + GetIamPolicyResponse, + Policy, + SetIamPolicyCallback, + SetIamPolicyResponse, + Table, + TestIamPermissionsCallback, + TestIamPermissionsResponse, + CreateTableOptions, + CreateTableCallback, + CreateTableResponse, + GetTablesOptions, + GetTablesCallback, + GetTablesResponse, +} from './table'; +import {CallOptions, Operation} from 'google-gax'; +import {ServiceError} from 'google-gax'; +import {Bigtable} from '.'; +import {google} from '../protos/protos'; +import {Backup, RestoreTableCallback, RestoreTableResponse} from './backup'; +import {ClusterUtils} from './utils/cluster'; +import {AuthorizedView} from './authorized-view'; + +import * as SqlTypes from './execute-query/types'; +import { + ExecuteQueryParameterValue, + QueryResultRow, +} from './execute-query/values'; +import {ProtobufReaderTransformer} from './execute-query/protobufreadertransformer'; +import {ExecuteQueryStreamTransformWithMetadata} from './execute-query/queryresultrowtransformer'; +import {ExecuteQueryStreamWithMetadata} from './execute-query/values'; +import { + parseParameters, + parseParameterTypes, +} from './execute-query/parameterparsing'; +import {MetadataConsumer} from './execute-query/metadataconsumer'; +import { + createCallerStream, + ExecuteQueryStateMachine, +} from './execute-query/executequerystatemachine'; +import {PreparedStatement} from './execute-query/preparedstatement'; + +export interface ClusterInfo extends BasicClusterConfig { + id: string; +} + +export interface InstanceOptions { + /** + * The clusters to be created within the instance. + */ + clusters: ClusterInfo[] | ClusterInfo; + + /** + * The descriptive name for this instance as it appears in UIs. + */ + displayName?: string; + + /** + * Labels are a flexible and lightweight mechanism for organizing cloud + * resources into groups that reflect a customer's organizational needs and + * deployment strategies. They can be used to filter resources and + * aggregate metrics. + * + * Label keys must be between 1 and 63 characters long and must conform to + * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. + * Label values must be between 0 and 63 characters long and must conform + * to the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. + * No more than 64 labels can be associated with a given resource. + * Keys and values must both be under 128 bytes. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + labels?: {[index: string]: any}; + + type?: 'production' | 'development'; + + /** + * Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + */ + gaxOptions?: CallOptions; +} + +export type IInstance = google.bigtable.admin.v2.IInstance; +export interface LongRunningResourceCallback { + ( + err: ServiceError | null, + resource?: Resource, + operation?: Operation, + apiResponse?: IOperation, + ): void; +} +export type CreateInstanceCallback = LongRunningResourceCallback; +export type CreateInstanceResponse = [Instance, Operation, IOperation]; +export type DeleteInstanceCallback = ( + err: ServiceError | null, + apiResponse?: google.protobuf.Empty, +) => void; +export type DeleteInstanceResponse = [google.protobuf.Empty]; +export type InstanceExistsCallback = ( + err: ServiceError | null, + exists?: boolean, +) => void; +export type InstanceExistsResponse = [boolean]; +export type GetInstanceCallback = ( + err: ServiceError | null, + instance?: Instance, + apiResponse?: IInstance, +) => void; +export type GetInstanceResponse = [Instance, IInstance]; +export type GetInstanceMetadataCallback = ( + err: ServiceError | null, + metadata?: IInstance, +) => void; +export type GetInstanceMetadataResponse = [IInstance]; +export type SetInstanceMetadataCallback = ( + err: ServiceError | null, + apiResponse?: google.protobuf.Empty, +) => void; +export type SetInstanceMetadataResponse = [google.protobuf.Empty]; + +export interface CreateTableFromBackupConfig { + table: string; + backup: Backup | string; + gaxOptions?: CallOptions; +} + +export type ExecuteQueryCallback = ( + err: Error | null, + rows?: QueryResultRow[], +) => void; + +export interface ExecuteQueryOptions { + preparedStatement: PreparedStatement; + parameters?: {[param: string]: ExecuteQueryParameterValue}; + retryOptions?: CallOptions; + encoding?: BufferEncoding; +} +export type ExecuteQueryResponse = [QueryResultRow[]]; + +export type PrepareStatementCallback = ( + err: Error | null, + preparedStatement?: PreparedStatement, +) => void; + +export interface PrepareStatementOptions { + query: string; + parameterTypes?: {[param: string]: SqlTypes.Type}; + retryOptions?: CallOptions; + encoding?: BufferEncoding; +} +export type PrepareStatementResponse = [PreparedStatement]; + +/** + * Create an Instance object to interact with a Cloud Bigtable instance. + * + * @class + * @param {Bigtable} bigtable The parent {@link Bigtable} object of this + * instance. + * @param {string} id Id of the instance. + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * ``` + */ + +export class Instance { + bigtable: Bigtable; + id: string; + name: string; + metadata?: google.bigtable.admin.v2.IInstance; + constructor(bigtable: Bigtable, id: string) { + this.bigtable = bigtable; + + let name; + if (id.includes('/')) { + if (id.startsWith(`${bigtable.projectName}/instances/`)) { + name = id; + } else { + throw new Error(`Instance id '${id}' is not formatted correctly. +Please use the format 'my-instance' or '${bigtable.projectName}/instances/my-instance'.`); + } + } else { + name = `${bigtable.projectName}/instances/${id}`; + } + + this.id = name.split('/').pop()!; + this.name = name; + } + + /** + * Maps the instance type to the proper integer. + * + * @private + * + * @param {string} type The instance type (production, development). + * @returns {number} + * + * @example + * ``` + * Instance.getTypeType_('production'); + * // 1 + * ``` + */ + static getTypeType_(type?: string): number { + const types = { + unspecified: 0, + production: 1, + development: 2, + } as {[index: string]: number}; + if (typeof type === 'string') { + type = type.toLowerCase(); + } + return types[type!] || types.unspecified; + } + + /** + * Get a reference to a Bigtable App Profile. + * + * @param {string} name The name of the app profile. + * @returns {AppProfile} + */ + appProfile(name: string): AppProfile { + return new AppProfile(this, name); + } + + create(options: InstanceOptions): Promise; + create(options: InstanceOptions, callback: CreateInstanceCallback): void; + /** + * Create an instance. + * + * @param {object} options See {@link Bigtable#createInstance}. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {Instance} callback.instance The newly created + * instance. + * @param {Operation} callback.operation An operation object that can be used + * to check the status of the request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_create_instance + */ + create( + options: InstanceOptions, + callback?: CreateInstanceCallback, + ): void | Promise { + this.bigtable.createInstance(this.id, options, callback!); + } + + createAppProfile( + id: string, + options?: AppProfileOptions, + ): Promise; + createAppProfile( + id: string, + options: AppProfileOptions, + callback: CreateAppProfileCallback, + ): void; + createAppProfile(id: string, callback: CreateAppProfileCallback): void; + /** + * Create an app profile. + * + * @param {string} id The name to be used when referring to the new + * app profile within its instance. + * @param {object} options AppProfile creation options. + * @param {'any'|Cluster} options.routing The routing policy for all + * read/write requests which use this app profile. This can be either the + * string 'any' or a cluster of an instance. This value is required when + * creating the app profile and optional when setting the metadata. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {boolean} [options.allowTransactionalWrites] Whether or not + * CheckAndMutateRow and ReadModifyWriteRow requests are allowed by this + * app profile. It is unsafe to send these requests to the same + * table/row/column in multiple clusters. This is only used when the + * routing value is a cluster. + * @param {string} [options.description] The long form description of the use + * case for this AppProfile. + * @param {string} [options.ignoreWarnings] Whether to ignore safety checks + * when creating the app profile + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Cluster} callback.appProfile The newly created app profile. + * + * @example + * region_tag:bigtable_api_create_app_profile + */ + createAppProfile( + id: string, + optionsOrCallback?: AppProfileOptions | CreateAppProfileCallback, + cb?: CreateAppProfileCallback, + ): void | Promise { + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + if (!options.routing) { + throw new Error('An app profile must contain a routing policy.'); + } + + const appProfile = AppProfile.formatAppProfile_(options); + + const reqOpts = { + parent: this.name, + appProfileId: id, + appProfile, + } as google.bigtable.admin.v2.CreateAppProfileRequest; + + if (is.boolean(options.ignoreWarnings)) { + reqOpts.ignoreWarnings = options.ignoreWarnings!; + } + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'createAppProfile', + reqOpts, + gaxOpts: options.gaxOptions, + }, + (...args) => { + if (args[1]) { + args.splice(1, 0, this.appProfile(id)); + } + + callback(...args); + }, + ); + } + + createCluster( + id: string, + options?: CreateClusterOptions, + ): Promise; + createCluster( + id: string, + options: CreateClusterOptions, + callback: CreateClusterCallback, + ): void; + createCluster(id: string, callback: CreateClusterCallback): void; + /** + * Create a cluster. + * + * @param {string} id The id to be used when referring to the new + * cluster within its instance. + * @param {object} options Cluster creation options. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {object} [options.encryption] CMEK configuration options. + * @param {string} options.encryption.kmsKeyName The KMS key name. + * @param {string} [options.key] Alias for `options.encryption.kmsKeyName`. + * @param {string} options.location The location where this cluster's nodes + * and storage reside. For best performance clients should be located as + * as close as possible to this cluster. Currently only zones are + * supported. + * @param {number} options.nodes The number of nodes allocated to this + * cluster. More nodes enable higher throughput and more consistent + * performance. + * @param {string} [options.storage] The type of storage used by this cluster + * to serve its parent instance's tables. Options are 'hdd' or 'ssd'. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Cluster} callback.cluster The newly created + * cluster. + * @param {Operation} callback.operation An operation object that can be used + * to check the status of the request. + * + * @example + * region_tag:bigtable_api_create_cluster + */ + createCluster( + id: string, + optionsOrCallback?: CreateClusterOptions | CreateClusterCallback, + cb?: CreateClusterCallback, + ): void | Promise { + const options = + typeof optionsOrCallback === 'object' + ? optionsOrCallback + : ({} as CreateClusterOptions); + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + + const reqOpts = { + parent: this.name, + clusterId: id, + } as google.bigtable.admin.v2.CreateClusterRequest; + ClusterUtils.validateClusterMetadata(options); + if (!is.empty(options)) { + reqOpts.cluster = ClusterUtils.getClusterBaseConfigWithFullLocation( + options, + this.bigtable.projectId, + undefined, + ); + } + + if ( + typeof options.key !== 'undefined' && + typeof options.encryption !== 'undefined' + ) { + throw new Error( + 'The cluster cannot have both `encryption` and `key` defined.', + ); + } + + if (options.key) { + reqOpts.cluster!.encryptionConfig = { + kmsKeyName: options.key, + }; + } + + if (options.encryption) { + reqOpts.cluster!.encryptionConfig = options.encryption; + } + + if (options.storage) { + const storageType = Cluster.getStorageType_(options.storage); + reqOpts.cluster!.defaultStorageType = storageType; + } + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'createCluster', + reqOpts, + gaxOpts: options.gaxOptions, + }, + (...args) => { + if (args[1]) { + args.splice(1, 0, this.cluster(id)); + } + + callback(...args); + }, + ); + } + + createTable( + id: string, + options?: CreateTableOptions, + ): Promise; + createTable( + id: string, + options: CreateTableOptions, + callback: CreateTableCallback, + ): void; + createTable(id: string, callback: CreateTableCallback): void; + /** + * Create a table on your Bigtable instance. + * + * @see [Designing Your Schema]{@link https://cloud.google.com/bigtable/docs/schema-design} + * @see [Splitting Keys]{@link https://cloud.google.com/bigtable/docs/managing-tables#splits} + * + * @throws {error} If a id is not provided. + * + * @param {string} id Unique identifier of the table. + * @param {object} [options] Table creation options. + * @param {object|string[]} [options.families] Column families to be created + * within the table. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {string[]} [options.splits] Initial + * {@link https://cloud.google.com/bigtable/docs/managing-tables#splits| split keys}. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Table} callback.table The newly created table. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_create_table + */ + createTable( + id: string, + optionsOrCallback?: CreateTableOptions | CreateTableCallback, + cb?: CreateTableCallback, + ): void | Promise { + if (!id) { + throw new Error('An id is required to create a table.'); + } + + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + + const reqOpts = { + parent: this.name, + tableId: id, + table: { + // The granularity at which timestamps are stored in the table. + // Currently only milliseconds is supported, so it's not + // configurable. + granularity: 0, + }, + } as google.bigtable.admin.v2.CreateTableRequest; + + if (options.splits) { + reqOpts.initialSplits = options.splits.map(key => ({ + key, + })); + } + + if (options.families) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const columnFamilies = (options.families as any[]).reduce( + (families, family) => { + if (typeof family === 'string') { + family = { + name: family, + }; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const columnFamily: any = (families[family.name] = {}); + if (family.rule) { + columnFamily.gcRule = Family.formatRule_(family.rule); + } + return families; + }, + {}, + ); + + reqOpts.table!.columnFamilies = columnFamilies; + } + + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'createTable', + reqOpts, + gaxOpts: options.gaxOptions, + }, + (...args) => { + if (args[1]) { + const table = this.table(args[1].name.split('/').pop()); + table.metadata = args[1]; + args.splice(1, 0, table); + } + + callback(...args); + }, + ); + } + + /** + * Get a reference to a Bigtable Cluster. + * + * @param {string} id The id of the cluster. + * @returns {Cluster} + */ + cluster(id: string): Cluster { + return new Cluster(this, id); + } + + delete(gaxOptions?: CallOptions): Promise; + delete(gaxOptions: CallOptions, callback: DeleteInstanceCallback): void; + delete(callback: DeleteInstanceCallback): void; + /** + * Delete the instance. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_del_instance + */ + delete( + optionsOrCallback?: CallOptions | DeleteInstanceCallback, + cb?: DeleteInstanceCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'deleteInstance', + reqOpts: { + name: this.name, + }, + gaxOpts: gaxOptions, + }, + callback, + ); + } + + exists(options?: CallOptions): Promise; + exists(options: CallOptions, callback: InstanceExistsCallback): void; + exists(callback: InstanceExistsCallback): void; + /** + * Check if an instance exists. + * + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {boolean} callback.exists Whether the instance exists or not. + * + * @example + * region_tag:bigtable_api_exists_instance + */ + exists( + optionsOrCallback?: CallOptions | InstanceExistsCallback, + cb?: InstanceExistsCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + this.getMetadata(gaxOptions, err => { + if (err) { + if (err.code === 5) { + callback(null, false); + return; + } + callback(err); + return; + } + callback(null, true); + }); + } + + get(gaxOptions?: CallOptions): Promise; + get(gaxOptions: CallOptions, callback: GetInstanceCallback): void; + get(callback: GetInstanceCallback): void; + /** + * Get an instance if it exists. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {Instance} callback.instance The Instance object. + * @param {object} callback.apiResponse The resource as it exists in the API. + * + * @example + * region_tag:bigtable_api_get_instance + */ + get( + optionsOrCallback?: CallOptions | GetInstanceCallback, + cb?: GetInstanceCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + this.getMetadata(gaxOptions, (err, metadata) => { + if (err) { + callback(err, undefined, metadata); + } else { + callback(null, this, metadata); + } + }); + } + + getAppProfiles(options?: CallOptions): Promise; + getAppProfiles(options: CallOptions, callback: GetAppProfilesCallback): void; + getAppProfiles(callback: GetAppProfilesCallback): void; + /** + * Get App Profile objects for this instance. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {AppProfile[]} callback.appProfiles List of all AppProfiles. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_get_app_profiles + */ + getAppProfiles( + optionsOrCallback?: CallOptions | GetAppProfilesCallback, + cb?: GetAppProfilesCallback, + ): void | Promise { + const gaxOpts = + typeof optionsOrCallback === 'object' + ? extend(true, {}, optionsOrCallback) + : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + + const reqOpts: google.bigtable.admin.v2.IListAppProfilesRequest = { + parent: this.name, + }; + + if (is.number((gaxOpts as GetBackupsOptions).pageSize)) { + reqOpts.pageSize = (gaxOpts as GetBackupsOptions).pageSize; + } + delete (gaxOpts as GetBackupsOptions).pageSize; + + if ((gaxOpts as GetBackupsOptions).pageToken) { + reqOpts.pageToken = (gaxOpts as GetBackupsOptions).pageToken; + } + delete (gaxOpts as GetBackupsOptions).pageToken; + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'listAppProfiles', + reqOpts, + gaxOpts, + }, + (err, resp) => { + if (err) { + callback(err); + return; + } + const appProfiles = resp!.map(appProfileObj => { + const appProfile = this.appProfile( + appProfileObj.name!.split('/').pop()!, + ); + appProfile.metadata = appProfileObj; + return appProfile; + }); + callback(null, appProfiles, resp); + }, + ); + } + + /** + * Get {@link AppProfile} objects for all the App Profiles in your + * Cloud Bigtable instance as a readable object stream. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * {@link Instance#getAppProfiles} for a complete list of options. + * @returns {stream} + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * + * instance.getAppProfilesStream() + * .on('error', console.error) + * .on('data', function(appProfile) { + * // appProfile is a AppProfile object. + * }) + * .on('end', () => { + * // All appProfiles retrieved. + * }); + * + * //- + * // If you anticipate many results, you can end a stream early to prevent + * // unnecessary processing and API requests. + * //- + * instance.getAppProfilesStream() + * .on('data', function(appProfile) { + * this.end(); + * }); + * ``` + */ + getAppProfilesStream(gaxOptions: CallOptions = {}): NodeJS.ReadableStream { + const reqOpts: google.bigtable.admin.v2.IListAppProfilesRequest = { + parent: this.name, + }; + const gaxOpts = extend(true, {}, gaxOptions); + + if (is.number((gaxOpts as GetBackupsOptions).pageSize)) { + reqOpts.pageSize = (gaxOpts as GetBackupsOptions).pageSize; + } + delete (gaxOpts as GetBackupsOptions).pageSize; + + if ((gaxOpts as GetBackupsOptions).pageToken) { + reqOpts.pageToken = (gaxOpts as GetBackupsOptions).pageToken; + } + delete (gaxOpts as GetBackupsOptions).pageToken; + + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this; + const transformToAppProfile = ( + chunk: google.bigtable.admin.v2.IAppProfile, + enc: string, + callback: Function, + ) => { + const appProfile = self.appProfile(chunk.name!.split('/').pop()!); + appProfile.metadata = chunk; + callback(null, appProfile); + }; + let failedLocations: string[] = []; + const flush = (callback: Function) => { + if (failedLocations.length > 0) { + callback( + new Error( + `Resources from the following locations are currently not available\n${JSON.stringify( + failedLocations, + )}`, + ), + ); + } else { + callback(); + } + }; + const stream = this.bigtable.request({ + client: 'BigtableInstanceAdminClient', + method: 'listAppProfilesStream', + reqOpts, + gaxOpts, + }); + stream.on('response', apiResp => { + if (arrify(apiResp.failedLocations).length > 0) { + failedLocations = failedLocations.concat(apiResp.failedLocations); + } + }); + return pumpify.obj([ + stream, + new Transform({ + objectMode: true, + transform: transformToAppProfile, + flush, + }), + ]); + } + + getBackups(options?: GetBackupsOptions): Promise; + getBackups(options: GetBackupsOptions, callback: GetBackupsCallback): void; + getBackups(callback: GetBackupsCallback): void; + /** + * Get Cloud Bigtable Backup instances within this instance. This returns both + * completed and pending backups. + * + * @param {GetBackupsOptions | GetBackupsCallback} [optionsOrCallback] + * @param {GetBackupsResponse} [callback] The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {Backup[]} callback.backups All matching Backup instances. + * @param {object} callback.apiResponse The full API response. + * @return {void | Promise} + * + * @example + * region_tag:bigtable_api_list_backups + */ + getBackups( + optionsOrCallback?: GetBackupsOptions | GetBackupsCallback, + cb?: GetBackupsCallback, + ): void | Promise { + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + this.cluster('-').getBackups(options, callback); + } + + /** + * Get Cloud Bigtable Backup instances within this instance. This returns both + * completed and pending backups as a readable stream. + * + * @param {GetBackupsOptions} [options] Configuration object. See + * {@link Instance#getBackups} for a complete list of options. + * @returns {ReadableStream} + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * + * instance.getBackupsStream() + * .on('error', console.error) + * .on('data', function(backup) { + * // backup is a Backup object. + * }) + * .on('end', () => { + * // All backups retrieved. + * }); + * + * //- + * // If you anticipate many results, you can end a stream early to prevent + * // unnecessary processing and API requests. + * //- + * instance.getBackupsStream() + * .on('data', function(backup) { + * this.end(); + * }); + * ``` + */ + getBackupsStream(options?: GetBackupsOptions): NodeJS.ReadableStream { + return this.cluster('-').getBackupsStream(options); + } + + getClusters(options?: CallOptions): Promise; + getClusters(options: CallOptions, callback: GetClustersCallback): void; + getClusters(callback: GetClustersCallback): void; + /** + * Get Cluster objects for all of your clusters. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {Cluster[]} callback.clusters List of all + * Clusters. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_get_clusters + */ + getClusters( + optionsOrCallback?: CallOptions | GetClustersCallback, + cb?: GetClustersCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + + const reqOpts = { + parent: this.name, + }; + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'listClusters', + reqOpts, + gaxOpts: gaxOptions, + }, + (err, resp) => { + if (err) { + callback(err); + return; + } + const clusters = resp!.clusters!.map(clusterObj => { + const cluster = this.cluster(clusterObj.name!.split('/').pop()!); + cluster.metadata = clusterObj; + return cluster; + }); + callback(null, clusters, resp); + }, + ); + } + + getIamPolicy(options?: GetIamPolicyOptions): Promise<[Policy]>; + getIamPolicy( + options: GetIamPolicyOptions, + callback: GetIamPolicyCallback, + ): void; + /** + * @param {object} [options] Configuration object. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {number} [options.requestedPolicyVersion] The policy format version + * to be returned. Valid values are 0, 1, and 3. Requests specifying an + * invalid value will be rejected. Requests for policies with any + * conditional bindings must specify version 3. Policies without any + * conditional bindings may specify any valid value or leave the field unset. + * @param {function} [callback] The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {Policy} policy The policy. + * + * @example + * region_tag:bigtable_api_get_instance_Iam_policy + */ + getIamPolicy( + optionsOrCallback?: GetIamPolicyOptions | GetIamPolicyCallback, + callback?: GetIamPolicyCallback, + ): void | Promise { + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : callback!; + + const reqOpts = { + resource: this.name, + } as google.iam.v1.IGetIamPolicyRequest; + + if ( + options.requestedPolicyVersion !== null && + options.requestedPolicyVersion !== undefined + ) { + reqOpts.options = { + requestedPolicyVersion: options.requestedPolicyVersion, + }; + } + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'getIamPolicy', + reqOpts, + gaxOpts: options.gaxOptions, + }, + (err, resp) => { + if (err) { + callback!(err); + return; + } + callback!(null, Table.decodePolicyEtag(resp)); + }, + ); + } + + getMetadata(options?: CallOptions): Promise; + getMetadata( + options: CallOptions, + callback: GetInstanceMetadataCallback, + ): void; + getMetadata(callback: GetInstanceMetadataCallback): void; + /** + * Get the instance metadata. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.metadata The metadata. + * + * @example + * region_tag:bigtable_api_get_instance_metadata + */ + getMetadata( + optionsOrCallback?: CallOptions | GetInstanceMetadataCallback, + cb?: GetInstanceMetadataCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'getInstance', + reqOpts: { + name: this.name, + }, + gaxOpts: gaxOptions, + }, + (...args) => { + if (args[1]) { + this.metadata = args[1]; + } + callback(...args); + }, + ); + } + + getTables(options?: GetTablesOptions): Promise; + getTables(options: GetTablesOptions, callback: GetTablesCallback): void; + getTables(callback: GetTablesCallback): void; + /** + * Get Table objects for all the tables in your Cloud Bigtable instance. + * + * @param {object} [options] Query object. + * @param {boolean} [options.autoPaginate=true] Have pagination handled + * automatically. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {number} [options.maxApiCalls] Maximum number of API calls to make. + * @param {number} [options.maxResults] Maximum number of items to return. + * @param {string} [options.pageToken] A previously-returned page token + * representing part of a larger set of results to view. + * @param {string} [options.view] View over the table's fields. Possible options + * are 'name', 'schema' or 'full'. Default: 'name'. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Table[]} callback.tables List of all Table objects.These objects contains + * only table name & id but is not a complete representation of a table. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_get_tables + */ + getTables( + optionsOrCallback?: GetTablesOptions | GetTablesCallback, + cb?: GetTablesCallback, + ): void | Promise { + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + + const gaxOpts = extend(true, {}, options.gaxOptions); + let reqOpts = Object.assign({}, options, { + parent: this.name, + view: Table.VIEWS[options.view || 'unspecified'], + }); + + // Copy over pageSize and pageToken values from gaxOptions. + // However values set on options take precedence. + if (gaxOpts) { + reqOpts = extend( + {}, + { + pageSize: (gaxOpts as GetBackupsOptions).pageSize, + pageToken: (gaxOpts as GetBackupsOptions).pageToken, + }, + reqOpts, + ); + delete (gaxOpts as GetBackupsOptions).pageSize; + delete (gaxOpts as GetBackupsOptions).pageToken; + } + + delete (reqOpts as GetTablesOptions).gaxOptions; + + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'listTables', + reqOpts, + gaxOpts, + }, + (...args) => { + if (args[1]) { + args[1] = args[1].map(tableObj => { + const table = this.table(tableObj.name!.split('/').pop()!); + table.metadata = tableObj; + return table; + }); + } + + callback(...args); + }, + ); + } + + /** + * Get {@link Table} objects for all the tables in your Cloud Bigtable + * instance as a readable object stream. + * + * @param {object} [options] Query object. See + * {@link Instance#getTables} for a complete list of options. + * @returns {stream} + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * + * instance.getTablesStream() + * .on('error', console.error) + * .on('data', function(table) { + * // table is a Table object. + * }) + * .on('end', () => { + * // All tables retrieved. + * }); + * + * //- + * // If you anticipate many results, you can end a stream early to prevent + * // unnecessary processing and API requests. + * //- + * instance.getTablesStream() + * .on('data', function(table) { + * this.end(); + * }); + * ``` + */ + getTablesStream(options: GetTablesOptions = {}): NodeJS.ReadableStream { + const gaxOpts = extend(true, {}, options.gaxOptions); + let reqOpts = Object.assign({}, options, { + parent: this.name, + view: Table.VIEWS[options.view || 'unspecified'], + }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + delete (reqOpts as any).gaxOptions; + + // Copy over pageSize and pageToken values from gaxOptions. + // However values set on options take precedence. + if (gaxOpts) { + reqOpts = extend( + {}, + { + pageSize: (gaxOpts as GetBackupsOptions).pageSize, + pageToken: (gaxOpts as GetBackupsOptions).pageToken, + }, + reqOpts, + ); + delete (gaxOpts as GetBackupsOptions).pageSize; + delete (gaxOpts as GetBackupsOptions).pageToken; + } + + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this; + const transformToTable = ( + chunk: google.bigtable.admin.v2.ITable, + enc: string, + callback: Function, + ) => { + const table = self.table(chunk.name!.split('/').pop()!); + table.metadata = chunk; + callback(null, table); + }; + return pumpify.obj([ + this.bigtable.request({ + client: 'BigtableTableAdminClient', + method: 'listTablesStream', + reqOpts, + gaxOpts, + }), + new Transform({objectMode: true, transform: transformToTable}), + ]); + } + + createTableFromBackup( + config: CreateTableFromBackupConfig, + ): Promise; + createTableFromBackup( + config: CreateTableFromBackupConfig, + callback: RestoreTableCallback, + ): void; + /** + * Create a new table by restoring from a completed backup. + * + * The new table must be in the same instance as the instance containing + * the backup. The returned table + * {@link google.longrunning.Operation|long-running operation} can be used + * to track the progress of the operation, and to cancel it. + * + * @param {CreateTableFromBackupConfig} config Configuration object. + * @param {Backup | string} config.backup The name of the backup from which to + * restore of the form + * `projects//instances//clusters//backups/`, + * or a Backup instance. + * @param {string} config.table The id of the table to create and restore to. + * @param {CallOptions} [config.gaxOptions] Request configuration options, + * outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {RestoreTableCallback} [cb] + * @return {void | Promise} + * + * @example + * region_tag:bigtable_api_restore_backup + */ + createTableFromBackup( + config: CreateTableFromBackupConfig, + callback?: RestoreTableCallback, + ): void | Promise { + if (!config.table) { + throw new Error('A table id is required to restore from a backup.'); + } + + let backup: Backup; + + if (config.backup instanceof Backup) { + backup = config.backup; + } else { + try { + const clusterId = config.backup.match(/clusters\/([^/]+)/)![1]; + const instanceId = config.backup.match(/instances\/([^/]+)/)![1]; + if (instanceId !== this.id) { + backup = this.bigtable + .instance(instanceId) + .cluster(clusterId) + .backup(config.backup); + } else { + backup = this.cluster(clusterId).backup(config.backup); + } + } catch (e) { + throw new Error( + 'A complete backup name (path) is required or a Backup object.', + ); + } + } + + backup.restoreTo( + {tableId: config.table, instance: this, gaxOptions: config.gaxOptions!}, + callback!, + ); + } + + setIamPolicy( + policy: Policy, + gaxOptions?: CallOptions, + ): Promise; + setIamPolicy( + policy: Policy, + gaxOptions: CallOptions, + callback: SetIamPolicyCallback, + ): void; + setIamPolicy(policy: Policy, callback: SetIamPolicyCallback): void; + /** + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {Policy} policy The policy. + * + * @example + * region_tag:bigtable_api_set_instance_Iam_policy + */ + setIamPolicy( + policy: Policy, + gaxOptionsOrCallback?: CallOptions | SetIamPolicyCallback, + callback?: SetIamPolicyCallback, + ): void | Promise { + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; + callback = + typeof gaxOptionsOrCallback === 'function' + ? gaxOptionsOrCallback + : callback!; + + if (policy.etag !== null && policy.etag !== undefined) { + (policy.etag as {} as Buffer) = Buffer.from(policy.etag as string); + } + const reqOpts = { + resource: this.name, + policy, + }; + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'setIamPolicy', + reqOpts, + gaxOpts: gaxOptions, + }, + (err, resp) => { + if (err) { + callback!(err); + } + callback!(null, Table.decodePolicyEtag(resp)); + }, + ); + } + + setMetadata( + metadata: IInstance, + options?: CallOptions, + ): Promise; + setMetadata( + metadata: IInstance, + options: CallOptions, + callback: SetInstanceMetadataCallback, + ): void; + setMetadata(metadata: IInstance, callback: SetInstanceMetadataCallback): void; + /** + * Set the instance metadata. + * + * @param {object} metadata Metadata object. + * @param {string} metadata.displayName The descriptive name for this + * instance as it appears in UIs. It can be changed at any time, but + * should be kept globally unique to avoid confusion. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_set_meta_data + */ + setMetadata( + metadata: IInstance, + optionsOrCallback?: CallOptions | SetInstanceMetadataCallback, + cb?: SetInstanceMetadataCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const reqOpts = { + instance: Object.assign({name: this.name}, metadata), + updateMask: { + paths: [], + }, + } as google.bigtable.admin.v2.IPartialUpdateInstanceRequest; + const fieldsForMask = ['displayName', 'type', 'labels']; + + fieldsForMask.forEach(field => { + if (field in reqOpts.instance!) { + reqOpts.updateMask!.paths!.push(snakeCase(field)); + } + }); + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'partialUpdateInstance', + reqOpts, + gaxOpts: gaxOptions, + }, + (...args) => { + if (args[1]) { + this.metadata = args[1]; + } + callback(...args); + }, + ); + } + + /** + * Get a reference to a Bigtable table. + * + * @param {string} id Unique identifier of the table. + * @returns {Table} + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * const table = instance.table('presidents'); + * ``` + */ + table(id: string): Table { + return new Table(this, id); + } + + testIamPermissions( + permissions: string | string[], + gaxOptions?: CallOptions, + ): Promise; + testIamPermissions( + permissions: string | string[], + callback: TestIamPermissionsCallback, + ): void; + testIamPermissions( + permissions: string | string[], + gaxOptions: CallOptions, + callback: TestIamPermissionsCallback, + ): void; + /** + * + * @param {string | string[]} permissions The permission(s) to test for. + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {string[]} permissions A subset of permissions that the caller is + * allowed. + * + * @example + * region_tag:bigtable_api_test_instance_Iam_permissions + */ + testIamPermissions( + permissions: string | string[], + gaxOptionsOrCallback?: CallOptions | TestIamPermissionsCallback, + callback?: TestIamPermissionsCallback, + ): void | Promise { + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; + callback = + typeof gaxOptionsOrCallback === 'function' + ? gaxOptionsOrCallback + : callback!; + + const reqOpts = { + resource: this.name, + permissions: arrify(permissions), + }; + + this.bigtable.request( + { + client: 'BigtableInstanceAdminClient', + method: 'testIamPermissions', + reqOpts, + gaxOpts: gaxOptions, + }, + (err, resp) => { + if (err) { + callback!(err); + return; + } + callback!(null, resp.permissions); + }, + ); + } + + /** + * Gets an Authorized View object for making authorized view grpc calls. + * + * @param {string} tableName The name for the Table + * @param {string} viewName The name for the Authorized view + */ + view(tableName: string, viewName: string): AuthorizedView { + return new AuthorizedView(this, tableName, viewName); + } + + prepareStatement( + options: PrepareStatementOptions, + ): Promise; + prepareStatement( + options: PrepareStatementOptions, + callback: PrepareStatementCallback, + ): void; + prepareStatement(query: string): Promise; + prepareStatement(query: string, callback: PrepareStatementCallback): void; + /** + * Prepare an SQL query to be executed on an instance. + * + * @param {?string} [query] PreparedStatement object representing a query + * to execute. + * @param {string} [opts.query] Query string for which we want to construct the preparedStatement object. + * @param {object} [opts.parameterTypes] Object mapping names of parameters to their types. + * Type hints should be constructed using factory functions such as {@link Int64} + * @param {CallOptions} [opts.retryOptions] gax's CallOptions wich are passed straight to gax. + * The same retry options are also used when automatically refreshing the PreparedStatement. + * + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {?PreparedStatement} callback.preparedStatement The preparedStatement object used to perform the executeQuery operation. + * + */ + prepareStatement( + queryOrOpts: string | PrepareStatementOptions, + callback?: PrepareStatementCallback, + ): void | Promise { + const opts: PrepareStatementOptions = + typeof queryOrOpts === 'string' ? {query: queryOrOpts} : queryOrOpts; + + const protoParamTypes = parseParameterTypes(opts.parameterTypes || {}); + const request = { + client: 'BigtableClient', + method: 'prepareQuery', + reqOpts: { + instanceName: this.name, + appProfileId: this.bigtable.appProfileId, + query: opts.query, + paramTypes: protoParamTypes, + }, + gaxOpts: opts.retryOptions, + }; + this.bigtable.request(request, (...args) => { + if (args[0]) { + callback!(args[0]); + } + try { + callback!( + null, + new PreparedStatement( + this.bigtable, + args[1]!, + request, + opts.parameterTypes || {}, + ), + ); + } catch (err) { + callback!(err as any, undefined); + } + }); + } + + executeQuery(options: ExecuteQueryOptions): Promise; + executeQuery( + options: ExecuteQueryOptions, + callback: ExecuteQueryCallback, + ): void; + executeQuery( + preparedStatement: PreparedStatement, + ): Promise; + executeQuery( + preparedStatement: PreparedStatement, + callback: ExecuteQueryCallback, + ): void; + /** + * Execute a SQL query on an instance. + * + * + * @param {?PreparedStatement} [preparedStatement] PreparedStatement object representing a query + * to execute. + * @param {?object} [options] Configuration object. See + * {@link Instance#createExecuteQueryStream} for a complete list of options. + * + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {?QueryResultRow[]} callback.rows List of rows. + * @param {?SqlTypes.ResultSetMetadata} callback.metadata Metadata for the response. + * + * @example + * region_tag:bigtable_api_execute_query + */ + executeQuery( + preparedStatementOrOpts: PreparedStatement | ExecuteQueryOptions, + callback?: ExecuteQueryCallback, + ): void | Promise { + let opts: ExecuteQueryOptions; + if (preparedStatementOrOpts instanceof PreparedStatement) { + opts = {preparedStatement: preparedStatementOrOpts}; + } else { + opts = preparedStatementOrOpts; + } + const stream = this.createExecuteQueryStream(opts); + + stream.on('error', callback!).pipe( + concat((rows: QueryResultRow[]) => { + callback!(null, rows); + }), + ); + } + + /** + * Execute a SQL query on an instance. + * + * @param {PreparedStatement} [preparedStatement] SQL query to execute. Parameters can be specified using @name notation. + * @param {object} [opts] Configuration object. + * @param {object} [opts.parameters] Object mapping names of parameters used in the query to JS values. + * @param {object} [opts.retryOptions] Retry options used for executing the query. Note that the only values + * used are: + * - retryOptions.retry.retryCodes + * - retryOptions.retry.backoffSettings.maxRetries + * - retryOptions.retry.backoffSettings.totalTimeoutMillis + * - retryOptions.retry.backoffSettings.maxRetryDelayMillis + * - retryOptions.retry.backoffSettings.retryDelayMultiplier + * - retryOptions.retry.backoffSettings.initialRetryDelayMillis + * @returns {ExecuteQueryStreamWithMetadata} + * + * @example + * region_tag:bigtable_api_create_query_stream + */ + createExecuteQueryStream( + opts: ExecuteQueryOptions, + ): ExecuteQueryStreamWithMetadata { + /** + * We create the following streams: + * responseStream -> byteBuffer -> readerStream -> resultStream + * + * The last two (readerStream and resultStream) are connected using pumpify + * and returned to the caller. + * + * When a request is made responseStream and byteBuffer are created, + * connected using pumpify and piped to the readerStream. + * + * On retry, the old responseStream-byteBuffer pair is discarded and a + * new pair is crated. + * + * For more info please refer to comments in setupRetries function. + * + */ + const metadataConsumer = new MetadataConsumer(); + + let callerCancelled = false; + const setCallerCancelled = (value: boolean) => { + callerCancelled = value; + }; + const hasCallerCancelled = () => callerCancelled; + + const resultStream = new ExecuteQueryStreamTransformWithMetadata( + metadataConsumer, + hasCallerCancelled, + opts.encoding, + ); + const protoParams: {[k: string]: google.bigtable.v2.IValue} | null = + parseParameters( + opts.parameters || {}, + opts.preparedStatement.getParameterTypes(), + ); + + const readerStream = new ProtobufReaderTransformer(metadataConsumer); + + const reqOpts: google.bigtable.v2.IExecuteQueryRequest = { + instanceName: this.name, + appProfileId: this.bigtable.appProfileId, + params: protoParams, + }; + + // This creates a row stream which is two streams connected in a series. + const callerStream = createCallerStream( + readerStream, + resultStream, + metadataConsumer, + setCallerCancelled, + ); + + const stateMachine = new ExecuteQueryStateMachine( + this.bigtable, + callerStream, + opts.preparedStatement, + reqOpts, + opts.retryOptions?.retry, + opts.encoding, + ); + + // make sure stateMachine is not garbage collected as long as the callerStream. + callerStream._stateMachine = stateMachine; + + return callerStream; + } +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(Instance, { + exclude: [ + 'appProfile', + 'cluster', + 'table', + 'getBackupsStream', + 'getTablesStream', + 'getAppProfilesStream', + 'view', + ], +}); + +/** + * Reference to the {@link Instance} class. + * @name module:@google-cloud/bigtable.Instance + * @see Instance + */ diff --git a/handwritten/bigtable/src/mutation.ts b/handwritten/bigtable/src/mutation.ts new file mode 100644 index 00000000000..7e4865ccdad --- /dev/null +++ b/handwritten/bigtable/src/mutation.ts @@ -0,0 +1,452 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import arrify = require('arrify'); +import * as is from 'is'; +import * as Long from 'long'; + +import {google as btTypes} from '../protos/protos'; + +export type IMutation = btTypes.bigtable.v2.IMutation; +export type IMutateRowRequest = btTypes.bigtable.v2.IMutateRowRequest; +export type ISetCell = btTypes.bigtable.v2.Mutation.ISetCell; + +export type Bytes = string | Buffer; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type Data = any; +/* +The Data type is expected to be in the following format: +{ + columnFamily1: { + column1: Cell, + column2: Cell + }, + columnFamily2: { + otherColumn1: Cell, + otherColumn2: Cell + } +} +Where the Cell data type has the following structure: +Uint8Array | string | { + value: Uint8Array|string, + timestamp: number|Long|string, +} +*/ +export interface JsonObj { + [k: string]: string | JsonObj; +} +export type Value = string | number | boolean; + +export interface ParsedColumn { + family: string | null; + qualifier: string | null | undefined; +} +export interface ConvertFromBytesOptions { + userOptions?: ConvertFromBytesUserOptions; + isPossibleNumber?: boolean; +} +export interface ConvertFromBytesUserOptions { + decode?: boolean; + encoding?: BufferEncoding; +} +export interface MutationConstructorObj { + key: string; + method: string; + data: Data; +} +export interface MutationSettingsObj { + follows?: ValueObj; + column?: string; + time?: {start: Date | number; end: Date | number}; +} +export interface TimeRange { + [k: string]: number | string | undefined; + startTimestampMicros?: number; + endTimestampMicros?: number; +} +export interface SetCellObj { + [k: string]: string | ISetCell | undefined; + setCell?: ISetCell; +} +export interface ValueObj { + [k: string]: Buffer | Value | ValueObj; +} + +/** + * Formats table mutations to be in the expected proto format. + * + * @private + * + * @class + * @param {object} mutation + * + * @example + * ``` + * const mutation = new Mutation({ + * key: 'gwashington', + * method: 'insert', + * data: { + * jadams: 1 + * } + * }); + * ``` + */ +export class Mutation { + key: string; + method: string; + data: Data; + constructor(mutation: MutationConstructorObj) { + this.key = mutation.key; + this.method = mutation.method; + this.data = mutation.data; + } + + /** + * Parses "bytes" returned from proto service. + * + * @param {string} bytes - Base64 encoded string. + * @param {object} [options] Options to device return types + * @param {boolean} [options.isPossibleNumber] Check if byte is number + * @param {object} [options.userOptions] + * @param {boolean} [options.userOptions.decode] Check if decode is required + * @param {boolean} [options.userOptions.encoding] The encoding to use when + * converting the buffer to a string. + * @returns {string|number|buffer} + * @private + */ + static convertFromBytes( + bytes: Buffer | string, + options?: ConvertFromBytesOptions, + ): Buffer | Value | string { + const buf = + bytes instanceof Buffer ? bytes : Buffer.from(bytes as string, 'base64'); + if (options && options.isPossibleNumber && buf.length === 8) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const num = Long.fromBytes(buf as any).toNumber(); + + if (Number.isSafeInteger(num)) { + return num; + } + } + + const userOptions = (options && options.userOptions) || {}; + + if (userOptions.decode === false) { + return buf; + } + + return buf.toString(userOptions.encoding); + } + + /** + * Converts data into a buffer for proto service. + * + * @param {string} data - The data to be sent. + * @returns {buffer} + * @private + */ + static convertToBytes(data: Buffer | Data): Buffer | Data { + if (data instanceof Buffer) { + return data; + } + + if (is.number(data)) { + return Buffer.from(Long.fromNumber(data as number).toBytesBE()); + } + + try { + return Buffer.from(data as string); + } catch (e) { + return data; + } + } + + /** + * Takes date objects and creates a time range. + * + * @param {date} start - The start date. + * @param {date} end - The end date. + * @returns {object} + * @private + */ + static createTimeRange(start: Date | number, end: Date | number): TimeRange { + const range: TimeRange = {}; + + if (is.date(start)) { + range.startTimestampMicros = (start as Date).getTime() * 1000; + } + + if (is.date(end)) { + range.endTimestampMicros = (end as Date).getTime() * 1000; + } + + return range; + } + + /** + * Formats an `insert` mutation to what the proto service expects. + * + * @param {object} data - The entity data. + * @returns {object[]} + * + * @example + * ``` + * Mutation.encodeSetCell({ + * follows: { + * gwashington: 1, + * alincoln: 1 + * } + * }); + * // [ + * // { + * // setCell: { + * // familyName: 'follows', + * // columnQualifier: 'gwashington', // as buffer + * // timestampMicros: -1, // -1 means to use the server time + * // value: 1 // as buffer + * // } + * // }, { + * // setCell: { + * // familyName: 'follows', + * // columnQualifier: 'alincoln', // as buffer + * // timestampMicros: new Date(), // uses the client's current time + * // value: 1 // as buffer + * // } + * // } + * // ] + * ``` + * @private + */ + static encodeSetCell(data: Data): SetCellObj[] { + const mutations: SetCellObj[] = []; + + Object.keys(data).forEach(familyName => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const family = (data as any)[familyName]; + + Object.keys(family).forEach(cellName => { + let cell = family[cellName]; + + if (!is.object(cell) || cell instanceof Buffer) { + cell = { + value: cell, + }; + } + + let timestamp = cell.timestamp || new Date(); + + if (is.date(timestamp)) { + timestamp = timestamp.getTime() * 1000; + } + + const setCell = { + familyName, + columnQualifier: Mutation.convertToBytes(cellName), + timestampMicros: timestamp, + value: Mutation.convertToBytes(cell.value), + } as ISetCell; + + mutations.push({setCell}); + }); + }); + + return mutations; + } + + /** + * Formats a `delete` mutation to what the proto service expects. Depending + * on what data is supplied to this method, it will return an object that can + * will do one of the following: + * + * * Delete specific cells from a column. + * * Delete all cells contained with a specific family. + * * Delete all cells from an entire rows. + * + * @param {object} data - The entry data. + * @returns {object} + * + * @example + * ``` + * Mutation.encodeDelete([ + * 'follows:gwashington' + * ]); + * // { + * // deleteFromColumn: { + * // familyName: 'follows', + * // columnQualifier: 'gwashington', // as buffer + * // timeRange: null // optional + * // } + * // } + * + * Mutation.encodeDelete([ + * 'follows' + * ]); + * // { + * // deleteFromFamily: { + * // familyName: 'follows' + * // } + * // } + * + * Mutation.encodeDelete(); + * // { + * // deleteFromRow: {} + * // } + * + * // It's also possible to specify a time range when deleting specific + * // columns. + * + * Mutation.encodeDelete([ + * { + * column: 'follows:gwashington', + * time: { + * start: new Date('March 21, 2000'), + * end: new Date('March 21, 2001') + * } + * } + * ]); + * ``` + * @private + */ + static encodeDelete(data?: Data | Data[]): IMutation[] { + if (!data) { + return [ + { + deleteFromRow: {}, + }, + ]; + } + + return (arrify(data) as Data[]).map(mutation => { + if (is.string(mutation)) { + mutation = { + column: mutation, + } as MutationSettingsObj; + } + + const column = Mutation.parseColumnName( + (mutation as MutationSettingsObj).column!, + ); + + if (!column.qualifier) { + return { + deleteFromFamily: { + familyName: column.family, + }, + }; + } + + let timeRange: TimeRange | undefined; + + if ((mutation as MutationSettingsObj).time) { + timeRange = Mutation.createTimeRange( + (mutation as MutationSettingsObj).time!.start as Date, + (mutation as MutationSettingsObj).time!.end as Date, + ); + } + + return { + deleteFromColumn: { + familyName: column.family!, + columnQualifier: Mutation.convertToBytes( + column.qualifier, + ) as Uint8Array, + timeRange, + }, + }; + }); + } + + /** + * Creates a new Mutation object and returns the proto JSON form. + * + * @param {object} mutation - The entity data. + * @returns {object} + * @private + */ + static parse(mutation: Mutation): IMutateRowRequest { + if (!(mutation instanceof Mutation)) { + mutation = new Mutation(mutation); + } + + return mutation.toProto(); + } + + /** + * Parses a column name into an object. + * + * @param {string} column - The column name. + * @returns {object} + * + * @example + * ``` + * Mutation.parseColumnName('follows:gwashington'); + * // { + * // family: 'follows', + * // qualifier: 'gwashington' + * // } + * ``` + * @private + */ + static parseColumnName(columnName: string): ParsedColumn { + const colonIdx = columnName.indexOf(':'); + + if (colonIdx === -1) { + // columnName does not contain ':' + return { + family: columnName, + qualifier: undefined, + }; + } + + return { + family: columnName.slice(0, colonIdx), + qualifier: columnName.slice(colonIdx + 1), + }; + } + + /** + * Converts the mutation object into proto friendly JSON. + * + * @returns {object} + * @private + */ + toProto(): IMutateRowRequest { + const mutation: IMutateRowRequest = {}; + + if (this.key) { + mutation.rowKey = Mutation.convertToBytes(this.key) as Uint8Array; + } + + if (this.method === Mutation.methods.INSERT) { + mutation.mutations = Mutation.encodeSetCell(this.data); + } else if (this.method === Mutation.methods.DELETE) { + mutation.mutations = Mutation.encodeDelete(this.data); + } + + return mutation; + } + + /** + * Mutation methods + * + * @private + * + * INSERT => setCell + * DELETE => deleteFrom* + */ + static methods = { + INSERT: 'insert', + DELETE: 'delete', + }; +} diff --git a/handwritten/bigtable/src/row-data-utils.ts b/handwritten/bigtable/src/row-data-utils.ts new file mode 100644 index 00000000000..65191057dc3 --- /dev/null +++ b/handwritten/bigtable/src/row-data-utils.ts @@ -0,0 +1,302 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {OperationMetricsCollector} from './client-side-metrics/operation-metrics-collector'; + +const dotProp = require('dot-prop'); +import {Filter, RawFilter} from './filter'; +import { + CreateRulesCallback, + FilterCallback, + FilterConfig, + FilterConfigOption, + FormatFamiliesOptions, + IncrementCallback, + Rule, +} from './row'; +import {Family} from './chunktransformer'; +import {Bytes, Mutation} from './mutation'; +import {google} from '../protos/protos'; +import {TabularApiSurface} from './tabular-api-surface'; +import arrify = require('arrify'); +import {Bigtable} from './index'; +import {CallOptions} from 'google-gax'; +import { + MethodName, + StreamingState, +} from './client-side-metrics/client-side-metrics-attributes'; +import {createMetricsUnaryInterceptorProvider} from './client-side-metrics/metric-interceptor'; + +interface TabularApiSurfaceRequest { + tableName?: string; + authorizedViewName?: string; +} + +export interface RowProperties { + requestData: { + data?: {[index: string]: Family}; + id: string; + table: TabularApiSurface; + bigtable: Bigtable; + }; + reqOpts: TabularApiSurfaceRequest; +} + +/** + * RowDataUtils is a class containing functionality needed by the Row and + * AuthorizedView classes. Its static methods need to be contained in a class + * so that they can be mocked out using the sinon library as is conventional + * throughout the rest of the client library. + */ +class RowDataUtils { + /** + * Called by `filter` methods for fulfilling table and authorized view requests. + * + * @param {Filter} filter Filter to be applied to the contents of the row. + * @param {RowProperties} properties Properties containing data for the request. + * @param {object} configOrCallback Configuration object. + * @param {function} cb The callback function. + * + */ + static filterUtil( + filter: RawFilter, + properties: RowProperties, + configOrCallback?: FilterConfig | FilterCallback, + cb?: FilterCallback, + ) { + const config = typeof configOrCallback === 'object' ? configOrCallback : {}; + const callback = + typeof configOrCallback === 'function' ? configOrCallback : cb!; + const reqOpts = Object.assign( + { + appProfileId: properties.requestData.bigtable.appProfileId, + rowKey: Mutation.convertToBytes(properties.requestData.id), + predicateFilter: Filter.parse(filter), + trueMutations: createFlatMutationsList(config.onMatch!), + falseMutations: createFlatMutationsList(config.onNoMatch!), + }, + properties.reqOpts, + ); + properties.requestData.data = {}; + // 1. Create a metrics collector. + const metricsCollector = new OperationMetricsCollector( + properties.requestData.table, + MethodName.CHECK_AND_MUTATE_ROW, + StreamingState.UNARY, + ( + properties.requestData.table as any + ).bigtable._metricsConfigManager!.metricsHandlers, + ); + // 2. Tell the metrics collector an attempt has been started. + metricsCollector.onOperationStart(); + // 3. Make a unary call with gax options that include interceptors. The + // interceptors are built from a method that hooks them up to the + // metrics collector + properties.requestData.bigtable.request( + { + client: 'BigtableClient', + method: 'checkAndMutateRow', + reqOpts, + gaxOpts: createMetricsUnaryInterceptorProvider( + config.gaxOptions ?? {}, + metricsCollector, + ), + }, + (err, apiResponse) => { + metricsCollector.onOperationComplete(err ? err.code : 0); + if (err) { + callback(err, null, apiResponse); + return; + } + + callback(null, apiResponse!.predicateMatched, apiResponse); + }, + ); + + function createFlatMutationsList(entries: FilterConfigOption[]) { + const e2 = arrify(entries).map( + entry => Mutation.parse(entry as Mutation).mutations!, + ); + return e2.reduce((a, b) => a.concat(b), []); + } + } + + static formatFamilies_Util( + families: google.bigtable.v2.IFamily[], + options?: FormatFamiliesOptions, + ) { + const data = {} as {[index: string]: {}}; + options = options || {}; + families.forEach(family => { + const familyData = (data[family.name!] = {}) as { + [index: string]: {}; + }; + family.columns!.forEach(column => { + const qualifier = Mutation.convertFromBytes( + column.qualifier as string, + ) as string; + familyData[qualifier] = column.cells!.map(cell => { + let value = cell.value; + if (options!.decode !== false) { + value = Mutation.convertFromBytes(value as Bytes, { + isPossibleNumber: true, + }) as string; + } + return { + value, + timestamp: cell.timestampMicros, + labels: cell.labels, + }; + }); + }); + }); + return data; + } + + /** + * Called by `createRules` methods for fulfilling table and authorized + * view requests. + * + * @param {object|object[]} rules The rules to apply to this row. + * @param {RowProperties} properties Properties containing data for the request. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * + */ + static createRulesUtil( + rules: Rule | Rule[], + properties: RowProperties, + optionsOrCallback?: CallOptions | CreateRulesCallback, + cb?: CreateRulesCallback, + ) { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + + if (!rules || (rules as Rule[]).length === 0) { + throw new Error('At least one rule must be provided.'); + } + + rules = arrify(rules).map(rule => { + const column = Mutation.parseColumnName((rule as Rule).column); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const ruleData: any = { + familyName: column.family, + columnQualifier: Mutation.convertToBytes(column.qualifier!), + }; + + if ((rule as Rule).append) { + ruleData.appendValue = Mutation.convertToBytes((rule as Rule).append); + } + + if ((rule as Rule).increment) { + ruleData.incrementAmount = (rule as Rule).increment; + } + + return ruleData; + }); + + const reqOpts = Object.assign( + { + appProfileId: properties.requestData.bigtable.appProfileId, + rowKey: Mutation.convertToBytes(properties.requestData.id), + rules, + }, + properties.reqOpts, + ); + properties.requestData.data = {}; + // 1. Create a metrics collector. + const metricsCollector = new OperationMetricsCollector( + properties.requestData.table, + MethodName.READ_MODIFY_WRITE_ROW, + StreamingState.UNARY, + ( + properties.requestData.table as any + ).bigtable._metricsConfigManager!.metricsHandlers, + ); + // 2. Tell the metrics collector an attempt has been started. + metricsCollector.onOperationStart(); + // 3. Make a unary call with gax options that include interceptors. The + // interceptors are built from a method that hooks them up to the + // metrics collector + properties.requestData.bigtable.request( + { + client: 'BigtableClient', + method: 'readModifyWriteRow', + reqOpts, + gaxOpts: createMetricsUnaryInterceptorProvider( + gaxOptions, + metricsCollector, + ), + }, + (err, ...args) => { + metricsCollector.onOperationComplete(err ? err.code : 0); + callback(err, ...args); + }, + ); + } + + /** + * @param {string} column The column we are incrementing a value in. + * @param {RowProperties} properties Properties containing data for the request. + * @param {number} [valueOrOptionsOrCallback] The amount to increment by, defaults to 1. + * @param {object} [optionsOrCallback] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} cb The callback function. + */ + static incrementUtils( + column: string, + properties: RowProperties, + valueOrOptionsOrCallback?: number | CallOptions | IncrementCallback, + optionsOrCallback?: CallOptions | IncrementCallback, + cb?: IncrementCallback, + ) { + const value = + typeof valueOrOptionsOrCallback === 'number' + ? valueOrOptionsOrCallback + : 1; + const gaxOptions = + typeof valueOrOptionsOrCallback === 'object' + ? valueOrOptionsOrCallback + : typeof optionsOrCallback === 'object' + ? optionsOrCallback + : {}; + const callback = + typeof valueOrOptionsOrCallback === 'function' + ? valueOrOptionsOrCallback + : typeof optionsOrCallback === 'function' + ? optionsOrCallback + : cb!; + + const reqOpts = { + column, + increment: value, + } as Rule; + + this.createRulesUtil(reqOpts, properties, gaxOptions, (err, resp) => { + if (err) { + callback(err, null, resp); + return; + } + const data = this.formatFamilies_Util(resp!.row!.families!); + const value = dotProp.get(data, column.replace(':', '.'))[0].value; + + callback(null, value, resp); + }); + } +} + +export {RowDataUtils}; diff --git a/handwritten/bigtable/src/row.ts b/handwritten/bigtable/src/row.ts new file mode 100644 index 00000000000..b9717711033 --- /dev/null +++ b/handwritten/bigtable/src/row.ts @@ -0,0 +1,856 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {promisifyAll} from '@google-cloud/promisify'; +import arrify = require('arrify'); +import {RawFilter} from './filter'; +import {Mutation, ConvertFromBytesUserOptions, Bytes, Data} from './mutation'; +import {Bigtable} from '.'; +import { + Table, + Entry, + MutateCallback, + MutateResponse, + MutateOptions, + PartialFailureError, +} from './table'; +import {Chunk} from './chunktransformer'; +import {CallOptions} from 'google-gax'; +import {ServiceError} from 'google-gax'; +import {google} from '../protos/protos'; +import {RowDataUtils, RowProperties} from './row-data-utils'; +import {GetRowsOptions, TabularApiSurface} from './tabular-api-surface'; +import {getRowsInternal} from './utils/getRowsInternal'; +import { + MethodName, + StreamingState, +} from './client-side-metrics/client-side-metrics-attributes'; +import {mutateInternal} from './utils/mutateInternal'; + +export interface Rule { + column: string; + append?: string; // append is optional since `increment` doesn't supply it for instance. + increment?: number; +} +export interface CreateRowOptions { + gaxOptions?: CallOptions; + entry?: Entry; +} +export interface FormatFamiliesOptions { + decode?: boolean; +} +export interface Family { + name: string; + columns: Array<{ + qualifier?: Bytes; + cells: Array<{ + value?: Bytes; + timestampMicros?: number; + labels?: string[]; + }>; + }>; +} +export interface FilterConfigOption { + method?: string; + data?: Data; + key?: string; +} +export interface FilterConfig { + gaxOptions?: CallOptions; + onMatch?: FilterConfigOption[]; + onNoMatch?: FilterConfigOption[]; +} +export interface GetRowOptions { + /** + * If set to `false` it will not decode Buffer values returned from Bigtable. + */ + decode?: boolean; + /** + * Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + */ + gaxOptions?: CallOptions; + + filter?: {}; +} +export type RowExistsCallback = ( + err: ServiceError | null, + exists?: boolean, +) => void; +export type RowExistsResponse = [boolean]; +export type CreateRulesCallback = ( + err: ServiceError | null, + apiResponse?: google.bigtable.v2.IReadModifyWriteRowResponse, +) => void; +export type CreateRulesResponse = [ + google.bigtable.v2.IReadModifyWriteRowResponse, +]; +export type CreateRowCallback = ( + err: ServiceError | PartialFailureError | null, + row?: Row | null, + apiResponse?: google.protobuf.Empty, +) => void; +export type CreateRowResponse = [Row, google.protobuf.Empty]; +export type GetRowMetadataCallback = ( + err: RowError | null, + apiResponse?: google.bigtable.v2.ReadRowsResponse, +) => void; +export type GetRowMetadataResponse = [google.bigtable.v2.ReadRowsResponse]; +export type GetRowCallback = ( + err: RowError | null, + row?: T, + apiResponse?: {}, +) => void; +export type GetRowResponse = [T, {}]; +export type FilterCallback = ( + err: ServiceError | null, + matched?: boolean | null, + apiResponse?: google.bigtable.v2.ICheckAndMutateRowResponse, +) => void; +export type FilterResponse = [ + boolean | null, + google.bigtable.v2.ICheckAndMutateRowResponse, +]; +export type IncrementCallback = ( + err: ServiceError | null, + value?: number | null, + apiResponse?: google.bigtable.v2.IReadModifyWriteRowResponse, +) => void; +export type IncrementResponse = [ + number | null, + google.bigtable.v2.IReadModifyWriteRowResponse, +]; + +/** + * @private + */ +export class RowError extends Error { + code: number; + constructor(row: string) { + super(); + this.name = 'RowError'; + this.message = `Unknown row: ${row}.`; + this.code = 404; + } +} + +/** + * getProperties returns the properties needed to make a request for a table. + * + * @param {Row} row The row to make a request for. + */ +function getProperties(row: Row): RowProperties { + return { + reqOpts: {tableName: row.table.name}, + requestData: row, + }; +} + +/** + * Create a Row object to interact with your table rows. + * + * @class + * @param {Table} table The row's parent Table instance. + * @param {string} key The key for this row. + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * const table = instance.table('prezzy'); + * const row = table.row('gwashington'); + * ``` + */ +export class Row { + bigtable: Bigtable; + table: TabularApiSurface; + id: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + data: any; + key?: string; + metadata?: {}; + constructor(table: TabularApiSurface, key: string) { + this.bigtable = table.bigtable; + this.table = table; + this.id = key; + this.data = {}; + } + + /** + * Formats the row chunks into friendly format. Chunks contain 3 properties: + * + * `rowContents` The row contents, this essentially is all data pertaining + * to a single family. + * + * `commitRow` This is a boolean telling us the all previous chunks for this + * row are ok to consume. + * + * `resetRow` This is a boolean telling us that all the previous chunks are to + * be discarded. + * + * @private + * + * @param {chunk[]} chunks The list of chunks. + * @param {object} [options] Formatting options. + * + * @example + * ``` + * Row.formatChunks_(chunks); + * // { + * // follows: { + * // gwashington: [ + * // { + * // value: 2 + * // } + * // ] + * // } + * // } + * ``` + */ + static formatChunks_(chunks: Chunk[], options?: ConvertFromBytesUserOptions) { + const rows: Row[] = []; + let familyName: string | null; + let qualifierName: string | null; + + options = options || {}; + + chunks.reduce((row, chunk) => { + let family: {[index: string]: []}; + let qualifier: Array<{}>; + + row.data = row.data || {}; + + if (chunk.rowKey) { + row.key = Mutation.convertFromBytes(chunk.rowKey, { + userOptions: options, + }) as string; + } + + if (chunk.familyName) { + familyName = chunk.familyName.value; + } + + if (familyName) { + family = row.data[familyName] = row.data[familyName] || {}; + } + + if (chunk.qualifier) { + qualifierName = Mutation.convertFromBytes( + chunk.qualifier.value as string, + { + userOptions: options, + }, + ) as string; + } + + if (family! && qualifierName) { + qualifier = family![qualifierName] = family![qualifierName] || []; + } + + if (qualifier! && chunk.value) { + qualifier!.push({ + value: Mutation.convertFromBytes(chunk.value, {userOptions: options}), + labels: chunk.labels, + timestamp: chunk.timestampMicros, + size: chunk.valueSize, + }); + } + + if (chunk.commitRow) { + rows.push(row); + } + + if (chunk.commitRow || chunk.resetRow) { + familyName = qualifierName = null; + return {}; + } + + return row; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }, {} as any); + + return rows; + } + + /** + * Formats a rowContents object into friendly format. + * + * @private + * + * @param {object[]} families The row families. + * @param {object} [options] Formatting options. + * + * @example + * ``` + * const families = [ + * { + * name: 'follows', + * columns: [ + * { + * qualifier: 'gwashington', + * cells: [ + * { + * value: 2 + * } + * ] + * } + * ] + * } + * ]; + * + * Row.formatFamilies_(families); + * // { + * // follows: { + * // gwashington: [ + * // { + * // value: 2 + * // } + * // ] + * // } + * // } + * ``` + */ + static formatFamilies_( + families: google.bigtable.v2.IFamily[], + options?: FormatFamiliesOptions, + ) { + return RowDataUtils.formatFamilies_Util(families, options); + } + + create(options?: CreateRowOptions): Promise; + create(options: CreateRowOptions, callback: CreateRowCallback): void; + create(callback: CreateRowCallback): void; + /** + * Create a new row in your table. + * + * @param {object} [options] Configuration object. + * @param {object} [options.entry] An entry. See {@link Table#insert}. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {Row} callback.row The newly created row object. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_create_row + */ + create( + optionsOrCallback?: CreateRowOptions | CreateRowCallback, + cb?: CreateRowCallback, + ): void | Promise { + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const entry = { + key: this.id, + data: options.entry, + method: Mutation.methods.INSERT, + } as {} as Entry; + this.data = {}; + this.table.mutate( + entry, + options.gaxOptions as MutateOptions, + (err, apiResponse) => { + if (err) { + callback(err, null, apiResponse); + return; + } + callback(null, this, apiResponse); + }, + ); + } + + createRules( + rules: Rule | Rule[], + options?: CallOptions, + ): Promise; + createRules( + rules: Rule | Rule[], + options: CallOptions, + callback: CreateRulesCallback, + ): void; + createRules(rules: Rule | Rule[], callback: CreateRulesCallback): void; + /** + * Update a row with rules specifying how the row's contents are to be + * transformed into writes. Rules are applied in order, meaning that earlier + * rules will affect the results of later ones. + * + * @throws {error} If no rules are provided. + * + * @param {object|object[]} rules The rules to apply to this row. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_create_rules + */ + createRules( + rules: Rule | Rule[], + optionsOrCallback?: CallOptions | CreateRulesCallback, + cb?: CreateRulesCallback, + ): void | Promise { + RowDataUtils.createRulesUtil( + rules, + getProperties(this), + optionsOrCallback, + cb, + ); + } + + delete(options?: CallOptions): Promise; + delete(options: CallOptions, callback: MutateCallback): void; + delete(callback: MutateCallback): void; + /** + * Deletes all cells in the row. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_delete_all_cells + */ + delete( + optionsOrCallback?: CallOptions | MutateCallback, + cb?: MutateCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const mutation = { + key: this.id, + method: Mutation.methods.DELETE, + } as {} as Entry; + this.data = {}; + this.table.mutate(mutation, gaxOptions as {} as MutateOptions, callback); + } + + deleteCells( + columns: string[], + options?: CallOptions, + ): Promise; + deleteCells( + columns: string[], + options: CallOptions, + callback: MutateCallback, + ): void; + deleteCells(columns: string[], callback: MutateCallback): void; + /** + * Delete specified cells from the row. See {@link Table#mutate}. + * + * @param {string[]} columns Column names for the cells to be deleted. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_delete_particular_cells + */ + deleteCells( + columns: string[], + optionsOrCallback?: CallOptions | MutateCallback, + cb?: MutateCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const mutation = { + key: this.id, + data: arrify(columns), + method: Mutation.methods.DELETE, + } as {} as Entry; + this.data = {}; + this.table.mutate(mutation, gaxOptions as MutateOptions, callback); + } + + exists(options?: CallOptions): Promise; + exists(options: CallOptions, callback: RowExistsCallback): void; + exists(callback: RowExistsCallback): void; + /** + * Check if the table row exists. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {boolean} callback.exists Whether the row exists or not. + * + * @example + * region_tag:bigtable_api_row_exists + */ + exists( + optionsOrCallback?: CallOptions | RowExistsCallback, + cb?: RowExistsCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const options = Object.assign( + { + filter: [ + { + row: { + cellLimit: 1, + }, + }, + { + value: { + strip: true, + }, + }, + ], + }, + gaxOptions, + ); + this.getMetadata(options as GetRowOptions, err => { + if (err) { + if (err instanceof RowError) { + callback(null, false); + return; + } + callback(err); + return; + } + callback(null, true); + }); + } + + filter(filter: RawFilter, config?: FilterConfig): Promise; + filter( + filter: RawFilter, + config: FilterConfig, + callback: FilterCallback, + ): void; + filter(filter: RawFilter, callback: FilterCallback): void; + /** + * Mutates a row atomically based on the output of a filter. Depending on + * whether or not any results are yielded, either the `onMatch` or `onNoMatch` + * callback will be executed. + * + * @param {Filter} filter Filter to be applied to the contents of the row. + * @param {object} config Configuration object. + * @param {?object[]} config.onMatch A list of entries to be ran if a match is + * found. + * @param {object[]} [config.onNoMatch] A list of entries to be ran if no + * matches are found. + * @param {object} [config.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {boolean} callback.matched Whether a match was found or not. + * + * @example + * region_tag:bigtable_api_row_filter + */ + filter( + filter: RawFilter, + configOrCallback?: FilterConfig | FilterCallback, + cb?: FilterCallback, + ): void | Promise { + RowDataUtils.filterUtil(filter, getProperties(this), configOrCallback, cb); + } + + get(options?: GetRowOptions): Promise>; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + get( + columns: string[], + options?: GetRowOptions, + ): Promise>; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + get( + columns: string[], + options: GetRowOptions, + callback: GetRowCallback, + ): void; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + get(columns: string[], callback: GetRowCallback): void; + get(callback: GetRowCallback): void; + get(options: GetRowOptions, callback: GetRowCallback): void; + /** + * Get the row data. See {@link Table#getRows}. + * + * @param {string[]} [columns] List of specific columns to retrieve. + * @param {object} [options] Configuration object. + * @param {boolean} [options.decode=true] If set to `false` it will not decode Buffer + * values returned from Bigtable. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {Row} callback.row The updated Row object. + * + * @example + * region_tag:bigtable_api_get_row + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + get( + columnsOrOptionsOrCallback?: string[] | GetRowOptions | GetRowCallback, + optionsOrCallback?: GetRowOptions | GetRowCallback, + cb?: GetRowCallback, + ): void | Promise { + let columns = Array.isArray(columnsOrOptionsOrCallback) + ? columnsOrOptionsOrCallback + : []; + const options = + typeof columnsOrOptionsOrCallback === 'object' && + !Array.isArray(columnsOrOptionsOrCallback) + ? columnsOrOptionsOrCallback + : typeof optionsOrCallback === 'object' + ? optionsOrCallback + : {}; + const callback = + typeof columnsOrOptionsOrCallback === 'function' + ? columnsOrOptionsOrCallback + : typeof optionsOrCallback === 'function' + ? optionsOrCallback + : cb!; + + let filter; + columns = arrify(columns); + + // if there is column filter + if (columns.length) { + const filters = columns.map(Mutation.parseColumnName).map(column => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const colmFilters: any = [{family: column.family}]; + if (column.qualifier) { + colmFilters.push({column: column.qualifier}); + } + return colmFilters; + }); + + // if there is more then one filter, make it type inteleave filter + if (filters.length > 1) { + filter = [ + { + interleave: filters, + }, + ]; + } else { + filter = filters[0]; + } + } + + // if there is also a second option.filter append to filter array + if (options.filter) { + filter = arrify(filter).concat(options.filter); + } + + const getRowsOptions: GetRowsOptions = Object.assign({}, options, { + keys: [this.id], + filter, + limit: 1, + }); + + const metricsCollector = + this.table.bigtable._metricsConfigManager.createOperation( + MethodName.READ_ROW, + StreamingState.UNARY, + this.table, + ); + void getRowsInternal( + this.table, + metricsCollector, + getRowsOptions, + (err, rows) => { + if (err) { + callback(err); + return; + } + + const row = rows![0]; + + if (!row) { + const e = new RowError(this.id); + callback(e); + return; + } + + this.data = row.data; + + // If the user specifies column names, we'll return back the row data + // we received. Otherwise, we'll return the row "this" in a typical + // GrpcServiceObject#get fashion. + if (columns.length > 0) { + callback(null, row.data); + } else { + (callback as {} as GetRowCallback)(null, this); + } + }, + ); + } + + getMetadata(options?: GetRowOptions): Promise; + getMetadata(options: GetRowOptions, callback: GetRowMetadataCallback): void; + getMetadata(callback: GetRowMetadataCallback): void; + /** + * Get the row's metadata. + * + * @param {object} [options] Configuration object. + * @param {boolean} [options.decode=true] If set to `false` it will not decode + * Buffer values returned from Bigtable. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.metadata The row's metadata. + * + * @example + * region_tag:bigtable_api_get_row_meta + */ + getMetadata( + optionsOrCallback?: GetRowOptions | GetRowMetadataCallback, + cb?: GetRowMetadataCallback, + ): void | Promise { + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + this.get(options, (err, row) => { + if (err) { + callback(err); + return; + } + callback(null, row!.metadata as google.bigtable.v2.ReadRowsResponse); + }); + } + + increment(column: string, value?: number): Promise; + increment( + column: string, + value: number, + options?: CallOptions, + ): Promise; + increment(column: string, options?: CallOptions): Promise; + increment( + column: string, + value: number, + options: CallOptions, + callback: IncrementCallback, + ): void; + increment(column: string, value: number, callback: IncrementCallback): void; + increment( + column: string, + options: CallOptions, + callback: IncrementCallback, + ): void; + increment(column: string, callback: IncrementCallback): void; + /** + * Increment a specific column within the row. If the column does not + * exist, it is automatically initialized to 0 before being incremented. + * + * @param {string} column The column we are incrementing a value in. + * @param {number} [value] The amount to increment by, defaults to 1. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {number} callback.value The updated value of the column. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_row_increment + */ + increment( + column: string, + valueOrOptionsOrCallback?: number | CallOptions | IncrementCallback, + optionsOrCallback?: CallOptions | IncrementCallback, + cb?: IncrementCallback, + ): void | Promise { + RowDataUtils.incrementUtils( + column, + getProperties(this), + valueOrOptionsOrCallback, + optionsOrCallback, + cb, + ); + } + + save(entry: Entry, options?: CallOptions): Promise; + save(entry: Entry, options: CallOptions, callback: MutateCallback): void; + save(entry: Entry, callback: MutateCallback): void; + /** + * Update the row cells. + * + * @param {object} key An entry object to be inserted into the row. See + * {@link Table#insert}. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_row_save + */ + save( + entry: Entry, + optionsOrCallback?: CallOptions | MutateCallback, + cb?: MutateCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const mutation = { + key: this.id, + data: entry, + method: Mutation.methods.INSERT, + } as {} as Entry; + this.data = {}; + const metricsCollector = + this.bigtable._metricsConfigManager.createOperation( + MethodName.MUTATE_ROW, + StreamingState.UNARY, + this.table, + ); + mutateInternal( + this.table, + metricsCollector, + mutation, + gaxOptions as {} as MutateOptions, + callback, + ); + } +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(Row); diff --git a/handwritten/bigtable/src/table.ts b/handwritten/bigtable/src/table.ts new file mode 100644 index 00000000000..640d8d467ff --- /dev/null +++ b/handwritten/bigtable/src/table.ts @@ -0,0 +1,1319 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {promisifyAll} from '@google-cloud/promisify'; +import arrify = require('arrify'); +import {ServiceError} from 'google-gax'; + +import { + Family, + CreateFamilyOptions, + CreateFamilyCallback, + CreateFamilyResponse, + IColumnFamily, +} from './family'; +import {Mutation} from './mutation'; +import {CallOptions} from 'google-gax'; +import {Instance} from './instance'; +import {ModifiableBackupFields} from './backup'; +import {CreateBackupCallback, CreateBackupResponse} from './cluster'; +import {google} from '../protos/protos'; +import {TableUtils} from './utils/table'; +import * as is from 'is'; +import { + TabularApiSurface, + InsertRowsCallback, + InsertRowsResponse, + MutateCallback, + MutateResponse, + PartialFailureError, + PrefixRange, + GetRowsOptions, + GetRowsCallback, + GetRowsResponse, +} from './tabular-api-surface'; + +export { + InsertRowsCallback, + InsertRowsResponse, + MutateCallback, + MutateResponse, + PartialFailureError, + PrefixRange, + GetRowsOptions, + GetRowsCallback, + GetRowsResponse, +}; + +/** + * @typedef {object} Policy + * @property {number} [version] Specifies the format of the policy. + * Valid values are 0, 1, and 3. Requests specifying an invalid value will + * be rejected. + * + * Operations affecting conditional bindings must specify version 3. This + * can be either setting a conditional policy, modifying a conditional + * binding, or removing a binding (conditional or unconditional) from the + * stored conditional policy. + * Operations on non-conditional policies may specify any valid value or + * leave the field unset. + * + * If no etag is provided in the call to `setIamPolicy`, version compliance + * checks against the stored policy is skipped. + * @property {array} [policy.bindings] Bindings associate members with roles. + * @property {string} [policy.etag] `etag` is used for optimistic concurrency + * control as a way to help prevent simultaneous updates of a policy from + * overwriting each other. It is strongly suggested that systems make use + * of the `etag` in the read-modify-write cycle to perform policy updates + * in order to avoid raceconditions. + */ +export interface Policy { + version?: number; + bindings?: PolicyBinding[]; + etag?: Buffer | string; +} + +/** + * @typedef {object} PolicyBinding + * @property {array} [PolicyBinding.role] Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * @property {string} [PolicyBinding.members] Identities requesting access. + * The full list of accepted values is outlined here + * https://googleapis.dev/nodejs/bigtable/latest/google.iam.v1.html#.Binding + * @property {Expr} [PolicyBinding.condition] The condition that is associated + * with this binding. + * NOTE: An unsatisfied condition will not allow user access via current + * binding. Different bindings, including their conditions, are examined + * independently. + */ +export interface PolicyBinding { + role?: string; + members?: string[]; + condition?: Expr | null; +} + +/** + * @typedef {object} Expr + * @property {string} [Expr.expression] The application context of the containing + * message determines which well-known feature set of Common Expression Language + * is supported. + * @property {string} [Expr.title] An optional title for the expression, i.e. a + * short string describing its purpose. This can be used e.g. in UIs which + * allow to enter the expression. + * @property {string} [Expr.description] An optional description of the + * expression. This is a longer text which describes the expression, + * e.g. when hovered over it in a UI. + * @property {string} [Expr.location] An optional string indicating the location + * of the expression for error reporting, e.g. a file name and a position + * in the file. + */ +interface Expr { + expression?: string; + title?: string; + description?: string; + location?: string; +} + +/** + * @callback GetIamPolicyCallback + * @param {?Error} err Request error, if any. + * @param {object} policy The policy. + */ +export interface GetIamPolicyCallback { + (err?: Error | null, policy?: Policy): void; +} + +/** + * @typedef {array} GetIamPolicyResponse + * @property {object} 0 The policy. + */ +export type GetIamPolicyResponse = [Policy]; + +export interface GetIamPolicyOptions { + gaxOptions?: CallOptions; + requestedPolicyVersion?: 0 | 1 | 3; +} + +export type SetIamPolicyCallback = GetIamPolicyCallback; +export type SetIamPolicyResponse = GetIamPolicyResponse; + +/** + * @callback TestIamPermissionsCallback + * @param {?Error} err Request error, if any. + * @param {string[]} permissions A subset of permissions that the caller is + * allowed. + */ +export interface TestIamPermissionsCallback { + (err?: Error | null, permissions?: string[]): void; +} + +/** + * @typedef {array} TestIamPermissionsResponse + * @property {string[]} 0 A subset of permissions that the caller is allowed. + */ +export type TestIamPermissionsResponse = [string[]]; + +export interface CreateTableOptions { + families?: {} | string[]; + gaxOptions?: CallOptions; + splits?: string[]; +} +export type CreateTableCallback = ( + err: ServiceError | null, + table?: Table, + apiResponse?: google.bigtable.admin.v2.Table, +) => void; +export type CreateTableResponse = [Table, google.bigtable.admin.v2.Table]; + +export type TableExistsCallback = ( + err: ServiceError | null, + exists?: boolean, +) => void; +export type TableExistsResponse = [boolean]; + +export interface GetTablesOptions { + gaxOptions?: CallOptions; + /** + * View over the table's fields. Possible options are 'name', 'schema' or + * 'full'. Default: 'name'. + */ + view?: 'name' | 'schema' | 'full'; + pageSize?: number; + pageToken?: string; +} + +export interface GetMetadataOptions { + /** + * Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + */ + gaxOptions?: CallOptions; + + /** + * The view to be applied to the table fields. + */ + view?: string; +} + +export interface GetTableOptions { + /** + * Automatically create the instance if it does not already exist. + */ + autoCreate?: boolean; + + /** + * Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + */ + gaxOptions?: CallOptions; +} + +export interface MutateOptions { + /** + * Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + */ + gaxOptions?: CallOptions; + /** + * If set to `true` will treat entriesmas a raw Mutation object. See {@link Mutation#parse}. + */ + rawMutation?: boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type Entry = any; +/* +The Entry type is expected to be in the following format: +{ + key?: Uint8Array|string, + data?: Data, // The Data type is described in the Mutation class. + method?: typeof mutation.methods +} +*/ + +export type DeleteTableCallback = ( + err: ServiceError | null, + apiResponse?: google.protobuf.Empty, +) => void; +export type DeleteTableResponse = [google.protobuf.Empty]; +export type CheckConsistencyCallback = ( + err: ServiceError | null, + consistent?: boolean, +) => void; +export type CheckConsistencyResponse = [boolean]; +export type GenerateConsistencyTokenCallback = ( + err: ServiceError | null, + token?: string, +) => void; +export type GenerateConsistencyTokenResponse = [string]; +export type WaitForReplicationCallback = ( + err: ServiceError | null, + wait?: boolean, +) => void; +export type WaitForReplicationResponse = [boolean]; +export type TruncateCallback = ( + err: ServiceError | null, + apiResponse?: google.protobuf.Empty, +) => void; +export type TruncateResponse = [google.protobuf.Empty]; +export type SampleRowKeysCallback = ( + err: ServiceError | null, + keys?: string[], +) => void; +export type SampleRowsKeysResponse = [{key: Uint8Array; offset: string}[]]; +export type DeleteRowsCallback = ( + err: ServiceError | null, + apiResponse?: google.protobuf.Empty, +) => void; +export type DeleteRowsResponse = [google.protobuf.Empty]; +export type GetMetadataCallback = ( + err: ServiceError | null, + apiResponse: google.bigtable.admin.v2.ITable, +) => void; +export type GetMetadataResponse = [google.bigtable.admin.v2.Table]; +export type GetTableCallback = ( + err: ServiceError | null, + table?: Table, + apiResponse?: google.bigtable.admin.v2.ITable, +) => void; +export type GetTableResponse = [Table, google.bigtable.admin.v2.Table]; +export type GetTablesCallback = ( + err: ServiceError | null, + tables?: Table[], + apiResponse?: google.bigtable.admin.v2.ITable[], +) => void; +export type GetTablesResponse = [Table[], google.bigtable.admin.v2.Table[]]; +export type GetFamiliesCallback = ( + err: ServiceError | null, + families?: Family[], + apiResponse?: IColumnFamily, +) => void; +export type GetFamiliesResponse = [Family[], IColumnFamily]; +export type GetReplicationStatesCallback = ( + err: ServiceError | null, + clusterStates?: Map, + apiResponse?: {}, +) => void; +export type GetReplicationStatesResponse = [ + Map, + google.bigtable.admin.v2.ITable, +]; + +export interface CreateBackupConfig extends ModifiableBackupFields { + gaxOptions?: CallOptions; +} + +/** + * Create a Table object to interact with a Cloud Bigtable table. + * + * @class + * @param {Instance} instance Instance Object. + * @param {string} id Unique identifier of the table. + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * const table = instance.table('prezzy'); + * ``` + */ +export class Table extends TabularApiSurface { + constructor(instance: Instance, id: string) { + super(instance, id); + } + + /** + * Formats the decodes policy etag value to string. + * + * @private + * + * @param {object} policy + */ + static decodePolicyEtag(policy: Policy): Policy { + policy.etag = policy.etag!.toString('ascii'); + return policy; + } + + /** + * Formats the table name to include the Bigtable cluster. + * + * @private + * + * @param {string} instanceName The formatted instance name. + * @param {string} name The table name. + * + * @example + * ``` + * Table.formatName_( + * 'projects/my-project/zones/my-zone/instances/my-instance', + * 'my-table' + * ); + * // + * 'projects/my-project/zones/my-zone/instances/my-instance/tables/my-table' + * ``` + */ + static formatName_(instanceName: string, id: string) { + if (id.includes('/')) { + return id; + } + return `${instanceName}/tables/${id}`; + } + + /** + * Creates a range based off of a key prefix. + * + * @private + * + * @param {string} start The key prefix/starting bound. + * @returns {object} range + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * const table = instance.table('prezzy'); + * table.createPrefixRange('start'); + * // => { + * // start: 'start', + * // end: { + * // value: 'staru', + * // inclusive: false + * // } + * // } + * ``` + */ + static createPrefixRange(start: string): PrefixRange { + return TableUtils.createPrefixRange(start); + } + + create(options?: CreateTableOptions): Promise; + create(options: CreateTableOptions, callback: CreateTableCallback): void; + create(callback: CreateTableCallback): void; + /** + * Create a table. + * + * @param {object} [options] See {@link Instance#createTable}. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Table} callback.table The newly created table. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_create_table + */ + create( + optionsOrCallback?: CreateTableOptions | CreateTableCallback, + cb?: CreateTableCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + this.instance.createTable(this.id, options, callback); + } + + createBackup( + id: string, + config: CreateBackupConfig, + ): Promise; + createBackup( + id: string, + config: CreateBackupConfig, + callback: CreateBackupCallback, + ): void; + createBackup( + id: string, + config: CreateBackupConfig, + callback: CreateBackupCallback, + ): void; + /** + * Backup a table with cluster auto selection. + * + * Backups of tables originate from a specific cluster. This is a helper + * around `Cluster.createBackup` that automatically selects the first ready + * cluster from which a backup can be performed. + * + * NOTE: This will make two API requests to first determine the most + * appropriate cluster, then create the backup. This could lead to a race + * condition if other requests are simultaneously sent or if the cluster + * availability state changes between each call. + * + * @param {string} id A unique ID for the backup. + * @param {CreateBackupConfig} config Metadata to set on the Backup. + * @param {BackupTimestamp} config.expireTime When the backup will be + * automatically deleted. + * @param {CallOptions} [config.gaxOptions] Request configuration options, + * outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {CreateBackupCallback} [callback] The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Backup} callback.backup The newly created Backup. + * @param {Operation} callback.operation An operation object that can be used + * to check the status of the request. + * @param {object} callback.apiResponse The full API response. + * @return {void | Promise} + */ + createBackup( + id: string, + config: CreateBackupConfig, + callback?: CreateBackupCallback, + ): void | Promise { + if (!id) { + throw new TypeError('An id is required to create a backup.'); + } + + if (!config) { + throw new TypeError('A configuration object is required.'); + } + + this.getReplicationStates(config.gaxOptions!, (err, stateMap) => { + if (err) { + callback!(err); + return; + } + + const [clusterId] = + [...stateMap!.entries()].find(([, clusterState]) => { + return ( + clusterState.replicationState === 'READY' || + clusterState.replicationState === 'READY_OPTIMIZING' + ); + }) || []; + + if (!clusterId) { + callback!(new Error('No ready clusters eligible for backup.')); + return; + } + + this.instance.cluster(clusterId).createBackup( + id, + { + table: this.name, + ...config, + }, + callback!, + ); + }); + } + + createFamily( + id: string, + options?: CreateFamilyOptions, + ): Promise; + createFamily( + id: string, + options: CreateFamilyOptions, + callback: CreateFamilyCallback, + ): void; + createFamily(id: string, callback: CreateFamilyCallback): void; + /** + * Create a column family. + * + * Optionally you can send garbage collection rules and when creating a + * family. Garbage collection executes opportunistically in the background, so + * it's possible for reads to return a cell even if it matches the active + * expression for its family. + * + * @see [Garbage Collection Proto Docs]{@link https://github.com/googleapis/googleapis/blob/3b236df084cf9222c529a2890f90e3a4ff0f2dfd/google/bigtable/admin/v2/table.proto#L184} + * + * @throws {error} If a name is not provided. + * + * @param {string} id The unique identifier of column family. + * @param {object} [options] Configuration object. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {object} [options.rule] Garbage collection rule + * @param {object} [options.rule.age] Delete cells in a column older than the + * given age. Values must be at least 1 millisecond. + * @param {number} [options.rule.versions] Maximum number of versions to delete + * cells in a column, except for the most recent. + * @param {boolean} [options.rule.intersect] Cells to delete should match all + * rules. + * @param {boolean} [options.rule.union] Cells to delete should match any of the + * rules. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Family} callback.family The newly created Family. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_create_family + */ + createFamily( + id: string, + optionsOrCallback?: CreateFamilyOptions | CreateFamilyCallback, + cb?: CreateFamilyCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + + if (!id) { + throw new Error('An id is required to create a family.'); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const mod: any = { + id, + create: {}, + }; + + if (options.rule) { + mod.create.gcRule = Family.formatRule_(options.rule); + } + + const reqOpts = { + name: this.name, + modifications: [mod], + }; + + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'modifyColumnFamilies', + reqOpts, + gaxOpts: options.gaxOptions, + }, + (err, resp) => { + if (err) { + callback(err, null, resp); + return; + } + const family = this.family(id); + family.metadata = resp; + callback(null, family, resp); + }, + ); + } + + delete(gaxOptions?: CallOptions): Promise; + delete(gaxOptions: CallOptions, callback: DeleteTableCallback): void; + delete(callback: DeleteTableCallback): void; + /** + * Delete the table. + * + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_del_table + */ + delete( + optionsOrCallback?: CallOptions | DeleteTableCallback, + cb?: DeleteTableCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'deleteTable', + reqOpts: { + name: this.name, + }, + gaxOpts: gaxOptions, + }, + callback, + ); + } + + deleteRows( + prefix: string, + gaxOptions?: CallOptions, + ): Promise; + deleteRows( + prefix: string, + gaxOptions: CallOptions, + callback: DeleteRowsCallback, + ): void; + deleteRows(prefix: string, callback: DeleteRowsCallback): void; + /** + * Delete all rows in the table, optionally corresponding to a particular + * prefix. + * + * @throws {error} If a prefix is not provided. + * + * @param {string} prefix Row key prefix. + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_del_rows + */ + deleteRows( + prefix: string, + optionsOrCallback?: CallOptions | DeleteRowsCallback, + cb?: DeleteRowsCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + if (!prefix || is.fn(prefix)) { + throw new Error('A prefix is required for deleteRows.'); + } + const reqOpts = { + name: this.name, + rowKeyPrefix: Mutation.convertToBytes(prefix), + }; + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'dropRowRange', + reqOpts, + gaxOpts: gaxOptions, + }, + callback, + ); + } + + exists(gaxOptions?: CallOptions): Promise; + exists(gaxOptions: CallOptions, callback: TableExistsCallback): void; + exists(callback: TableExistsCallback): void; + /** + * Check if a table exists. + * + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {boolean} callback.exists Whether the table exists or not. + * + * @example + * region_tag:bigtable_api_exists_table + */ + exists( + optionsOrCallback?: CallOptions | TableExistsCallback, + cb?: TableExistsCallback, + ): void | Promise { + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const reqOpts = { + view: 'name', + gaxOptions, + }; + this.getMetadata(reqOpts, err => { + if (err) { + if (err.code === 5) { + callback(null, false); + return; + } + callback(err); + return; + } + callback(null, true); + }); + } + + /** + * Get a reference to a Table Family. + * + * @throws {error} If a name is not provided. + * + * @param {string} id The family unique identifier. + * @returns {Family} + * + * @example + * ``` + * const family = table.family('my-family'); + * ``` + */ + family(id: string): Family { + if (!id) { + throw new Error('A family id must be provided.'); + } + return new Family(this, id); + } + + get(options?: GetTableOptions): Promise; + get(options: GetTableOptions, callback: GetTableCallback): void; + get(callback: GetTableCallback): void; + /** + * Get a table if it exists. + * + * You may optionally use this to "get or create" an object by providing an + * object with `autoCreate` set to `true`. Any extra configuration that is + * normally required for the `create` method must be contained within this + * object as well. + * + * @param {object} [options] Configuration object. + * @param {boolean} [options.autoCreate=false] Automatically create the + * instance if it does not already exist. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {?error} callback.error An error returned while making this request. + * @param {Table} callback.table The Table object. + * @param {object} callback.apiResponse The resource as it exists in the API. + * + * @example + * region_tag:bigtable_api_get_table + */ + get( + optionsOrCallback?: GetTableOptions | GetTableCallback, + cb?: GetTableCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const autoCreate = !!options.autoCreate; + const gaxOptions = options.gaxOptions; + + this.getMetadata({gaxOptions}, (err, metadata) => { + if (err) { + if (err.code === 5 && autoCreate) { + this.create({gaxOptions}, callback); + return; + } + + callback(err); + return; + } + + callback(null, this, metadata); + }); + } + + getIamPolicy(options?: GetIamPolicyOptions): Promise<[Policy]>; + getIamPolicy( + options: GetIamPolicyOptions, + callback: GetIamPolicyCallback, + ): void; + /** + * @param {object} [options] Configuration object. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {number} [options.requestedPolicyVersion] The policy format version + * to be returned. Valid values are 0, 1, and 3. Requests specifying an + * invalid value will be rejected. Requests for policies with any + * conditional bindings must specify version 3. Policies without any + * conditional bindings may specify any valid value or leave the field unset. + * @param {function} [callback] The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {Policy} policy The policy. + * + * @example + * region_tag:bigtable_api_get_table_Iam_policy + */ + getIamPolicy( + optionsOrCallback?: GetIamPolicyOptions | GetIamPolicyCallback, + callback?: GetIamPolicyCallback, + ): void | Promise { + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : callback!; + + const reqOpts = { + resource: this.name, + } as google.iam.v1.GetIamPolicyRequest; + + if ( + options.requestedPolicyVersion !== null && + options.requestedPolicyVersion !== undefined + ) { + reqOpts.options = { + requestedPolicyVersion: options.requestedPolicyVersion, + }; + } + + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'getIamPolicy', + reqOpts, + gaxOpts: options.gaxOptions, + }, + (err, resp) => { + if (err) { + callback!(err); + return; + } + callback!(null, Table.decodePolicyEtag(resp)); + }, + ); + } + + getFamilies(gaxOptions?: CallOptions): Promise; + getFamilies(gaxOptions: CallOptions, callback: GetFamiliesCallback): void; + getFamilies(callback: GetFamiliesCallback): void; + /** + * Get Family objects for all the column families in your table. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Family[]} callback.families The list of families. + * @param {object} callback.apiResponse The full API response. + * + * @example + * region_tag:bigtable_api_get_families + */ + getFamilies( + optionsOrCallback?: CallOptions | GetFamiliesCallback, + cb?: GetFamiliesCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + this.getMetadata({gaxOptions}, (err, metadata) => { + if (err) { + callback(err); + return; + } + const families = Object.keys(metadata.columnFamilies!).map(familyId => { + const family = this.family(familyId); + family.metadata = metadata.columnFamilies![familyId]; + return family; + }); + callback(null, families, metadata.columnFamilies!); + }); + } + + getReplicationStates( + gaxOptions?: CallOptions, + ): Promise; + getReplicationStates( + gaxOptions: CallOptions, + callback: GetReplicationStatesCallback, + ): void; + getReplicationStates(callback: GetReplicationStatesCallback): void; + /** + * Get replication states of the clusters for this table. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Family[]} callback.clusterStates The map of clusterId and its replication state. + * @param {object} callback.apiResponse The full API response. + * + * @example + * ``` + * const {Bigtable} = require('@google-cloud/bigtable'); + * const bigtable = new Bigtable(); + * const instance = bigtable.instance('my-instance'); + * const table = instance.table('prezzy'); + * + * table.getReplicationStates(function(err, clusterStates, apiResponse) { + * // `clusterStates` is an map of clusterId and its replication state. + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * table.getReplicationStates().then(function(data) { + * const clusterStates = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + getReplicationStates( + optionsOrCallback?: CallOptions | GetReplicationStatesCallback, + cb?: GetReplicationStatesCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const reqOpts = { + view: 'replication', + gaxOptions, + }; + this.getMetadata(reqOpts, (err, metadata) => { + if (err) { + callback(err); + return; + } + const clusterStates = new Map< + string, + google.bigtable.admin.v2.Table.IClusterState + >(); + Object.keys(metadata.clusterStates!).map(clusterId => + clusterStates.set(clusterId, metadata.clusterStates![clusterId]), + ); + callback(null, clusterStates, metadata); + }); + } + + getMetadata(options?: GetMetadataOptions): Promise; + getMetadata(options: GetMetadataOptions, callback: GetMetadataCallback): void; + getMetadata(callback: GetMetadataCallback): void; + /** + * Get the table's metadata. + * + * @param {object} [options] Table request options. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {string} [options.view] The view to be applied to the table fields. + * @param {function} [callback] The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.metadata The table's metadata. + * + * @example + * region_tag:bigtable_api_get_table_meta + */ + getMetadata( + optionsOrCallback?: GetMetadataOptions | GetMetadataCallback, + cb?: GetMetadataCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const reqOpts = { + name: this.name, + view: Table.VIEWS[options.view || 'unspecified'], + }; + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'getTable', + reqOpts, + gaxOpts: options.gaxOptions, + }, + (...args) => { + if (args[1]) { + this.metadata = args[1]; + } + callback(...args); + }, + ); + } + + setIamPolicy( + policy: Policy, + gaxOptions?: CallOptions, + ): Promise; + setIamPolicy(policy: Policy, callback: SetIamPolicyCallback): void; + setIamPolicy( + policy: Policy, + gaxOptions: CallOptions, + callback: SetIamPolicyCallback, + ): void; + /** + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {Policy} policy The policy. + * + * @example + * region_tag:bigtable_api_set_table_Iam_policy + */ + setIamPolicy( + policy: Policy, + gaxOptionsOrCallback?: CallOptions | SetIamPolicyCallback, + callback?: SetIamPolicyCallback, + ): void | Promise { + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; + callback = + typeof gaxOptionsOrCallback === 'function' + ? gaxOptionsOrCallback + : callback!; + + if (policy.etag !== null && policy.etag !== undefined) { + (policy.etag as {} as Buffer) = Buffer.from(policy.etag as string); + } + const reqOpts = { + resource: this.name, + policy, + }; + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'setIamPolicy', + reqOpts, + gaxOpts: gaxOptions, + }, + (err, resp) => { + if (err) { + callback!(err); + } + callback!(null, Table.decodePolicyEtag(resp)); + }, + ); + } + + testIamPermissions( + permissions: string | string[], + gaxOptions?: CallOptions, + ): Promise; + testIamPermissions( + permissions: string | string[], + callback: TestIamPermissionsCallback, + ): void; + testIamPermissions( + permissions: string | string[], + gaxOptions: CallOptions, + callback: TestIamPermissionsCallback, + ): void; + /** + * + * @param {string | string[]} permissions The permission(s) to test for. + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {string[]} permissions A subset of permissions that the caller is + * allowed. + * + * @example + * region_tag:bigtable_api_test_table_Iam_permissions + */ + testIamPermissions( + permissions: string | string[], + gaxOptionsOrCallback?: CallOptions | TestIamPermissionsCallback, + callback?: TestIamPermissionsCallback, + ): void | Promise { + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; + callback = + typeof gaxOptionsOrCallback === 'function' + ? gaxOptionsOrCallback + : callback!; + + const reqOpts = { + resource: this.name, + permissions: arrify(permissions), + }; + + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'testIamPermissions', + reqOpts, + gaxOpts: gaxOptions, + }, + (err, resp) => { + if (err) { + callback!(err); + return; + } + callback!(null, resp.permissions); + }, + ); + } + + truncate(gaxOptions?: CallOptions): Promise; + truncate(gaxOptions: CallOptions, callback: TruncateCallback): void; + truncate(callback: TruncateCallback): void; + /** + * Truncate the table. + * + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {object} callback.apiResponse The full API response. + * + * @example + * ``` + * table.truncate(function(err, apiResponse) {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * table.truncate().then(function(data) { + * const apiResponse = data[0]; + * }); + * ``` + */ + truncate( + optionsOrCallback?: CallOptions | TruncateCallback, + cb?: TruncateCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const reqOpts = { + name: this.name, + deleteAllDataFromTable: true, + }; + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'dropRowRange', + reqOpts, + gaxOpts: gaxOptions, + }, + callback, + ); + } + + waitForReplication(): Promise; + waitForReplication(callback: WaitForReplicationCallback): void; + /** + * Generates Consistency-Token and check consistency for generated token + * In-case consistency check returns false, retrial is done in interval + * of 5 seconds till 10 minutes, after that it returns false. + * + * @param {function(?error, ?boolean)} callback The callback function. + * @param {?Error} callback.err An error returned while making this request. + * @param {?Boolean} callback.resp Boolean value. + */ + waitForReplication( + callback?: WaitForReplicationCallback, + ): void | Promise { + // handler for generated consistency-token + const tokenHandler: GenerateConsistencyTokenCallback = (err, token) => { + if (err) { + return callback!(err); + } + + // set timeout for 10 minutes + const timeoutAfterTenMinutes = setTimeout( + () => { + callback!(null, false); + }, + 10 * 60 * 1000, + ); + + // method checks if retrial is required & init retrial with 5 sec + // delay + const retryIfNecessary: CheckConsistencyCallback = (err, res) => { + if (err) { + clearTimeout(timeoutAfterTenMinutes); + return callback!(err); + } + + if (res === true) { + clearTimeout(timeoutAfterTenMinutes); + return callback!(null, true); + } + + setTimeout(launchCheck, 5000); + }; + + // method to launch token consistency check + const launchCheck = () => { + this.checkConsistency(token!, retryIfNecessary); + }; + + launchCheck(); + }; + + // generate consistency-token + this.generateConsistencyToken(tokenHandler); + } + + generateConsistencyToken(): Promise; + generateConsistencyToken(callback: GenerateConsistencyTokenCallback): void; + /** + * Generates Consistency-Token + * @param {function(?error, ?boolean)} callback The callback function. + * @param {?Error} callback.err An error returned while making this request. + * @param {?String} callback.token The generated consistency token. + */ + generateConsistencyToken( + callback?: GenerateConsistencyTokenCallback, + ): void | Promise { + const reqOpts = { + name: this.name, + }; + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'generateConsistencyToken', + reqOpts, + }, + (err, res) => { + if (err) { + callback!(err); + return; + } + callback!(null, res.consistencyToken); + }, + ); + } + + checkConsistency(token: string): Promise; + checkConsistency(token: string, callback: CheckConsistencyCallback): void; + /** + * Checks consistency for given ConsistencyToken + * @param {string} token consistency token + * @param {function(?error, ?boolean)} callback The callback function. + * @param {?Error} callback.err An error returned while making this request. + * @param {?Boolean} callback.consistent Boolean value. + */ + checkConsistency( + token: string, + callback?: CheckConsistencyCallback, + ): void | Promise { + const reqOpts = { + name: this.name, + consistencyToken: token, + }; + this.bigtable.request( + { + client: 'BigtableTableAdminClient', + method: 'checkConsistency', + reqOpts, + }, + (err, res) => { + if (err) { + callback!(err); + return; + } + callback!(null, res.consistent); + }, + ); + } + /** + * The view to be applied to the returned table's fields. + * Defaults to schema if unspecified. + * + * @private + */ + static VIEWS = { + unspecified: 0, + name: 1, + schema: 2, + replication: 3, + full: 4, + } as {[index: string]: number}; +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(Table, { + exclude: ['family', 'row'], +}); + +export interface GoogleInnerError { + reason?: string; + message?: string; +} diff --git a/handwritten/bigtable/src/tabular-api-surface.ts b/handwritten/bigtable/src/tabular-api-surface.ts new file mode 100644 index 00000000000..7e2abd907a4 --- /dev/null +++ b/handwritten/bigtable/src/tabular-api-surface.ts @@ -0,0 +1,546 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {promisifyAll} from '@google-cloud/promisify'; +import arrify = require('arrify'); +import {Instance} from './instance'; +import {Mutation} from './mutation'; +import { + Bigtable, + Entry, + MutateOptions, + SampleRowKeysCallback, + SampleRowsKeysResponse, +} from './index'; +import {BoundData, RawFilter} from './filter'; +import {Row} from './row'; +import {BackoffSettings} from 'google-gax/build/src/gax'; +import {google} from '../protos/protos'; +import {CallOptions, grpc, ServiceError} from 'google-gax'; +import {Transform} from 'stream'; +import {GoogleInnerError} from './table'; +import {createReadStreamInternal} from './utils/createReadStreamInternal'; +import {getRowsInternal} from './utils/getRowsInternal'; +import { + MethodName, + StreamingState, +} from './client-side-metrics/client-side-metrics-attributes'; +import {mutateInternal} from './utils/mutateInternal'; + +// See protos/google/rpc/code.proto +// (4=DEADLINE_EXCEEDED, 8=RESOURCE_EXHAUSTED, 10=ABORTED, 14=UNAVAILABLE) +export const RETRYABLE_STATUS_CODES = new Set([4, 8, 10, 14]); +// (1=CANCELLED) +export const IGNORED_STATUS_CODES = new Set([1]); + +export const DEFAULT_BACKOFF_SETTINGS: BackoffSettings = { + initialRetryDelayMillis: 10, + retryDelayMultiplier: 2, + maxRetryDelayMillis: 60000, +}; + +export type InsertRowsCallback = ( + err: ServiceError | PartialFailureError | null, + apiResponse?: google.protobuf.Empty, +) => void; +export type InsertRowsResponse = [google.protobuf.Empty]; +export type MutateCallback = ( + err: ServiceError | PartialFailureError | null, + apiResponse?: google.protobuf.Empty, +) => void; +export type MutateResponse = [google.protobuf.Empty]; + +export interface GetRowsOptions { + /** + * If set to `false` it will not decode Buffer values returned from Bigtable. + */ + decode?: boolean; + + /** + * The encoding to use when converting Buffer values to a string. + */ + encoding?: string; + + /** + * End value for key range. + */ + end?: string; + + /** + * Row filters allow you to both make advanced queries and format how the data is returned. + */ + filter?: RawFilter; + + /** + * Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + */ + gaxOptions?: CallOptions; + + /** + * A list of row keys. + */ + keys?: string[]; + + /** + * Maximum number of rows to be returned. + */ + limit?: number; + + /** + * Prefix that the row key must match. + */ + prefix?: string; + + /** + * List of prefixes that a row key must match. + */ + prefixes?: string[]; + + /** + * A list of key ranges. + */ + ranges?: PrefixRange[]; + + /** + * Start value for key range. + */ + start?: string; +} + +export type GetRowsCallback = ( + err: ServiceError | null, + rows?: Row[], + apiResponse?: google.bigtable.v2.ReadRowsResponse, +) => void; +export type GetRowsResponse = [Row[], google.bigtable.v2.ReadRowsResponse]; + +export interface PrefixRange { + start?: BoundData | string; + end?: BoundData | string; +} + +export interface PrefixRange { + start?: BoundData | string; + end?: BoundData | string; +} + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const concat = require('concat-stream'); +// eslint-disable-next-line @typescript-eslint/no-var-requires +const pumpify = require('pumpify'); + +/** + * The TabularApiSurface class is a class that contains methods we want to + * expose on both tables and authorized views. It also contains data that will + * be used by both Authorized views and Tables for these shared methods. + * + * @class + * @param {Instance} instance Instance Object. + * @param {string} id Unique identifier of the table. + * + */ +export class TabularApiSurface { + bigtable: Bigtable; + instance: Instance; + name: string; + id: string; + metadata?: google.bigtable.admin.v2.ITable; + maxRetries?: number; + // We need viewName to be public because now we need it in Row class + // We need it in Row class because now we use getRowsInternal instead of getRows + viewName?: string; + + protected constructor(instance: Instance, id: string, viewName?: string) { + this.bigtable = instance.bigtable; + this.instance = instance; + this.viewName = viewName; + + let name; + + if (id.includes('/')) { + if (id.startsWith(`${instance.name}/tables/`)) { + name = id; + } else { + throw new Error(`Table id '${id}' is not formatted correctly. +Please use the format 'prezzy' or '${instance.name}/tables/prezzy'.`); + } + } else { + name = `${instance.name}/tables/${id}`; + } + + this.name = name; + this.id = name.split('/').pop()!; + } + + /** + * Get {@link Row} objects for the rows currently in your table as a + * readable object stream. + * + * @param {boolean} [options.decode=true] If set to `false` it will not decode + * Buffer values returned from Bigtable. + * @param {boolean} [options.encoding] The encoding to use when converting + * Buffer values to a string. + * @param {string} [options.end] End value for key range. + * @param {Filter} [options.filter] Row filters allow you to + * both make advanced queries and format how the data is returned. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {string[]} [options.keys] A list of row keys. + * @param {number} [options.limit] Maximum number of rows to be returned. + * @param {string} [options.prefix] Prefix that the row key must match. + * @param {string[]} [options.prefixes] List of prefixes that a row key must + * match. + * @param {object[]} [options.ranges] A list of key ranges. + * @param {string} [options.start] Start value for key range. + * @returns {stream} + * + * @example + * region_tag:bigtable_api_table_readstream + * @param opts + */ + createReadStream(opts?: GetRowsOptions) { + const metricsCollector = + this.bigtable._metricsConfigManager.createOperation( + MethodName.READ_ROWS, + StreamingState.STREAMING, + this, + ); + return createReadStreamInternal(this, metricsCollector, opts); + } + + getRows(options?: GetRowsOptions): Promise; + getRows(options: GetRowsOptions, callback: GetRowsCallback): void; + getRows(callback: GetRowsCallback): void; + /** + * Get {@link Row} objects for the rows currently in your table. + * + * This method is not recommended for large datasets as it will buffer all rows + * before returning the results. Instead we recommend using the streaming API + * via {@link Table#createReadStream}. + * + * {@link Table#createReadStream} for a complete list of options. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {?error} callback.err An error returned while making this request. + * @param {Row[]} callback.rows List of Row objects. + * + * @example + * region_tag:bigtable_api_get_rows + * @param optionsOrCallback + * @param cb + */ + getRows( + optionsOrCallback?: GetRowsOptions | GetRowsCallback, + cb?: GetRowsCallback, + ): void | Promise { + const metricsCollector = + this.bigtable._metricsConfigManager.createOperation( + MethodName.READ_ROWS, + StreamingState.STREAMING, + this, + ); + return getRowsInternal(this, metricsCollector, optionsOrCallback, cb); + } + + insert( + entries: Entry | Entry[], + gaxOptions?: CallOptions, + ): Promise; + insert( + entries: Entry | Entry[], + gaxOptions: CallOptions, + callback: InsertRowsCallback, + ): void; + insert(entries: Entry | Entry[], callback: InsertRowsCallback): void; + /** + * Insert or update rows in your table. It should be noted that gRPC only allows + * you to send payloads that are less than or equal to 4MB. If you're inserting + * more than that you may need to send smaller individual requests. + * + * @param {object|object[]} entries List of entries to be inserted. + * See {@link Table#mutate}. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {object[]} callback.err.errors If present, these represent partial + * failures. It's possible for part of your request to be completed + * successfully, while the other part was not. + * + * @example + * region_tag:bigtable_api_insert_rows + */ + insert( + entries: Entry | Entry[], + optionsOrCallback?: CallOptions | InsertRowsCallback, + cb?: InsertRowsCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + entries = arrify(entries).map((entry: Entry) => { + entry.method = Mutation.methods.INSERT; + return entry; + }); + return this.mutate(entries, {gaxOptions}, callback); + } + + mutate( + entries: Entry | Entry[], + options?: MutateOptions, + ): Promise; + mutate( + entries: Entry | Entry[], + options: MutateOptions, + callback: MutateCallback, + ): void; + mutate(entries: Entry | Entry[], callback: MutateCallback): void; + /** + * Apply a set of changes to be atomically applied to the specified row(s). + * Mutations are applied in order, meaning that earlier mutations can be masked + * by later ones. + * + * @param {object|object[]} entries List of entities to be inserted or + * deleted. + * @param {object} [options] Configuration object. + * @param {object} [options.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {boolean} [options.rawMutation] If set to `true` will treat entries + * as a raw Mutation object. See {@link Mutation#parse}. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {object[]} callback.err.errors If present, these represent partial + * failures. It's possible for part of your request to be completed + * successfully, while the other part was not. + * + * @example + * region_tag:bigtable_api_mutate_rows + */ + mutate( + entriesRaw: Entry | Entry[], + optionsOrCallback?: MutateOptions | MutateCallback, + cb?: MutateCallback, + ): void | Promise { + const metricsCollector = + this.bigtable._metricsConfigManager.createOperation( + MethodName.MUTATE_ROWS, + StreamingState.STREAMING, + this, + ); + mutateInternal(this, metricsCollector, entriesRaw, optionsOrCallback, cb); + } + + /** + * Get a reference to a table row. + * + * @throws {error} If a key is not provided. + * + * @param {string} key The row key. + * @returns {Row} + * + * @example + * ``` + * const row = table.row('lincoln'); + * ``` + */ + row(key: string): Row { + if (!key) { + throw new Error('A row key must be provided.'); + } + return new Row(this, key); + } + + sampleRowKeys(gaxOptions?: CallOptions): Promise; + sampleRowKeys(gaxOptions: CallOptions, callback: SampleRowKeysCallback): void; + sampleRowKeys(callback?: SampleRowKeysCallback): void; + /** + * Returns a sample of row keys in the table. The returned row keys will delimit + * contiguous sections of the table of approximately equal size, which can be + * used to break up the data for distributed tasks like mapreduces. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {object[]} callback.keys The list of keys. + * + * @example + * region_tag:bigtable_api_sample_row_keys + */ + sampleRowKeys( + optionsOrCallback?: CallOptions | SampleRowKeysCallback, + cb?: SampleRowKeysCallback, + ): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const gaxOptions = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + + /* + The following line of code sets the timeout if it was provided while + creating the client. This will be used to determine if the client should + retry on DEADLINE_EXCEEDED errors. Eventually, this will be handled + downstream in google-gax. + */ + const timeout = gaxOptions?.timeout; + const callTimeMillis = new Date().getTime(); + + this.sampleRowKeysStream(gaxOptions) + .on('error', (error: grpc.ServiceError) => { + if (timeout && timeout > new Date().getTime() - callTimeMillis) { + error.code = grpc.status.DEADLINE_EXCEEDED; + } + callback(error); + }) + .pipe( + concat((keys: string[]) => { + callback(null, keys); + }), + ); + } + + /** + * Returns a sample of row keys in the table as a readable object stream. + * + * See {@link Table#sampleRowKeys} for more details. + * + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @returns {stream} + * + * @example + * ``` + * table.sampleRowKeysStream() + * .on('error', console.error) + * .on('data', function(key) { + * // Do something with the `key` object. + * }); + * + * //- + * // If you anticipate many results, you can end a stream early to prevent + * // unnecessary processing. + * //- + * table.sampleRowKeysStream() + * .on('data', function(key) { + * this.end(); + * }); + * ``` + */ + sampleRowKeysStream(gaxOptions?: CallOptions) { + // If the viewName is provided then request will be made for an + // authorized view. Otherwise, the request is made for a table. + const reqOpts = ( + this.viewName + ? { + authorizedViewName: `${this.name}/authorizedViews/${this.viewName}`, + appProfileId: this.bigtable.appProfileId, + } + : { + tableName: this.name, + appProfileId: this.bigtable.appProfileId, + } + ) as google.bigtable.v2.IReadRowsRequest; + + const rowKeysStream = new Transform({ + transform(key, enc, next) { + next(null, { + key: key.rowKey, + offset: key.offsetBytes, + }); + }, + objectMode: true, + }); + const metricsCollector = + this.bigtable._metricsConfigManager.createOperation( + MethodName.SAMPLE_ROW_KEYS, + StreamingState.STREAMING, + this, + ); + metricsCollector.onOperationStart(); + metricsCollector.onAttemptStart(); + const requestStream = this.bigtable.request({ + client: 'BigtableClient', + method: 'sampleRowKeys', + reqOpts, + gaxOpts: Object.assign({}, gaxOptions), + }); + if (!requestStream) { + throw new Error( + 'Failed to create request stream -- is the client already closed?', + ); + } + metricsCollector.wrapRequest(requestStream); + const stream = pumpify.obj([requestStream, rowKeysStream]); + stream.on('end', () => { + metricsCollector.onOperationComplete(0); + }); + stream.on('error', (err: ServiceError) => { + metricsCollector.onOperationComplete(err.code); + }); + return stream; + } +} + +export function getNextDelay( + numConsecutiveErrors: number, + config: BackoffSettings, +) { + // 0 - 100 ms jitter + const jitter = Math.floor(Math.random() * 100); + const calculatedNextRetryDelay = + config.initialRetryDelayMillis * + Math.pow(config.retryDelayMultiplier, numConsecutiveErrors) + + jitter; + + return Math.min(calculatedNextRetryDelay, config.maxRetryDelayMillis); +} + +export function populateAttemptHeader(attempt: number, gaxOpts?: CallOptions) { + gaxOpts = gaxOpts || {}; + gaxOpts.otherArgs = gaxOpts.otherArgs || {}; + gaxOpts.otherArgs.headers = gaxOpts.otherArgs.headers || {}; + gaxOpts.otherArgs.headers['bigtable-attempt'] = attempt; + return gaxOpts; +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(TabularApiSurface, { + exclude: ['family', 'row'], +}); + +export class PartialFailureError extends Error { + errors?: GoogleInnerError[]; + constructor(errors: GoogleInnerError[], rpcError?: ServiceError | null) { + super(); + this.errors = errors; + this.name = 'PartialFailureError'; + let messages = errors.map(e => e.message); + if (messages.length > 1) { + messages = messages.map((message, i) => ` ${i + 1}. ${message}`); + messages.unshift( + 'Multiple errors occurred during the request. Please see the `errors` array for complete details.\n', + ); + messages.push('\n'); + } + this.message = messages.join('\n'); + if (rpcError) { + this.message += 'Request failed with: ' + rpcError.message; + } + } +} diff --git a/handwritten/bigtable/src/timed-stream.ts b/handwritten/bigtable/src/timed-stream.ts new file mode 100644 index 00000000000..b7398bc9401 --- /dev/null +++ b/handwritten/bigtable/src/timed-stream.ts @@ -0,0 +1,118 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {PassThrough, TransformCallback, TransformOptions} from 'stream'; +const {hrtime} = require('node:process'); + +/** + * This interface is the usual options that can be passed into a Transform plus + * a hook for injecting code into the stream's transform function. This hook is + * useful for code running code that normally runs in the transform method if that + * code is different for each method that makes use of a stream. + */ +type TimedStreamOptions = TransformOptions & { + transformHook?: ( + event: any, + _encoding: BufferEncoding, + callback: TransformCallback, + ) => void; +}; + +/** + * StreamTimer is a utility class for measuring the elapsed time of stream + * operations. It provides methods to start and stop the timer, as well as + * retrieve the total duration in milliseconds. + */ +class StreamTimer { + private startTime; + private totalDuration; + + constructor() { + this.startTime = 0n; + this.totalDuration = 0n; + } + + getTotalDurationMs() { + return Number(this.totalDuration / 1_000_000n); + } + + start() { + this.startTime = hrtime.bigint(); + } + + stop() { + const endTime = hrtime.bigint(); + const duration = endTime - this.startTime; + this.totalDuration += duration; + } +} + +/** + * The TimedStream class is used for measuring the time the user spends + * processing data from the stream. We need to measure this time for use cases + * like measuring the application latencies for client side metrics. + */ +export class TimedStream extends PassThrough { + private readTimer = new StreamTimer(); + private transformTimer = new StreamTimer(); + constructor(options?: TimedStreamOptions) { + super({ + ...options, + objectMode: true, + readableHighWaterMark: 0, // We need to disable readside buffering to allow for acceptable behavior when the end user cancels the stream early. + writableHighWaterMark: 0, // We need to disable writeside buffering because in nodejs 14 the call to _transform happens after write buffering. This creates problems for tracking the last seen row key. + transform: (event, _encoding, callback) => { + /* When we iterate through a stream, time spent waiting for the user's + application is added to totalDurationTransform. When we use handlers, + time spent waiting for the user's application is added to + totalDurationTransform. We need two different timers to measure total + application blocking latencies because the streams behave differently + depending on whether the user is iterating through a stream or using + timers. + */ + this.transformTimer.start(); + if (options?.transformHook) { + options?.transformHook(event, _encoding, callback); + } + this.transformTimer.stop(); + }, + }); + } + + /** + * read code is called when a row is consumed. + */ + read(size: number) { + // calculate the time spent between iterations of read (i.e. processing the stream in a for loop) + const chunk = super.read(size); + if (chunk) { + this.readTimer.start(); + // Defer the after call to the next tick of the event loop + process.nextTick(() => { + this.readTimer.stop(); + }); + } + return chunk; + } + + /** + * Returns the total amount of time the user code spends handling data. + */ + getTotalDurationMs() { + return ( + this.readTimer.getTotalDurationMs() + + this.transformTimer.getTotalDurationMs() + ); + } +} diff --git a/handwritten/bigtable/src/util/mock-servers/mock-server.ts b/handwritten/bigtable/src/util/mock-servers/mock-server.ts new file mode 100644 index 00000000000..c3ce62ced6f --- /dev/null +++ b/handwritten/bigtable/src/util/mock-servers/mock-server.ts @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {grpc} from 'google-gax'; + +const DEFAULT_PORT = 1234; + +export class MockServer { + port: string; + services: Set = new Set(); + server: grpc.Server; + + constructor( + callback?: (port: string) => void, + port?: string | number | undefined, + ) { + const portString = Number(port ? port : DEFAULT_PORT).toString(); + this.port = portString; + const server = new grpc.Server(); + this.server = server; + server.bindAsync( + `localhost:${this.port}`, + grpc.ServerCredentials.createInsecure(), + () => { + callback ? callback(portString) : undefined; + }, + ); + } + + setService( + service: grpc.ServiceDefinition, + implementation: grpc.UntypedServiceImplementation, + ) { + if (this.services.has(service)) { + this.server.removeService(service); + } else { + this.services.add(service); + } + this.server.addService(service, implementation); + } + + shutdown(callback: (err?: Error) => void) { + this.server.tryShutdown((err?: Error) => { + callback(err); + }); + } +} diff --git a/handwritten/bigtable/src/util/mock-servers/mock-service.ts b/handwritten/bigtable/src/util/mock-servers/mock-service.ts new file mode 100644 index 00000000000..37c25d43386 --- /dev/null +++ b/handwritten/bigtable/src/util/mock-servers/mock-service.ts @@ -0,0 +1,34 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {grpc} from 'google-gax'; + +import {MockServer} from './mock-server'; + +export abstract class MockService { + abstract service: grpc.ServiceDefinition; + server: MockServer; + + constructor(server: MockServer) { + this.server = server; + } + + setService(implementation: grpc.UntypedServiceImplementation) { + this.server.setService(this.service, implementation); + } +} diff --git a/handwritten/bigtable/src/util/mock-servers/service-implementations/bigtable-client-mock-service.ts b/handwritten/bigtable/src/util/mock-servers/service-implementations/bigtable-client-mock-service.ts new file mode 100644 index 00000000000..e1a8a9cb370 --- /dev/null +++ b/handwritten/bigtable/src/util/mock-servers/service-implementations/bigtable-client-mock-service.ts @@ -0,0 +1,45 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import grpc = require('@grpc/grpc-js'); +import jsonProtos = require('../../../../protos/protos.json'); +import protoLoader = require('@grpc/proto-loader'); +import {MockService} from '../mock-service'; + +const packageDefinition = protoLoader.fromJSON(jsonProtos, { + keepCase: true, + longs: String, + enums: String, + defaults: true, + oneofs: true, +}); +const proto = grpc.loadPackageDefinition(packageDefinition); + +export class BigtableClientMockService extends MockService { + service = + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + proto.google.bigtable.v2.Bigtable.service; +} + +export class BigtableAdminClientMockService extends MockService { + service = + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + proto.google.bigtable.admin.v2.BigtableInstanceAdmin.service; +} diff --git a/handwritten/bigtable/src/utils/cluster.ts b/handwritten/bigtable/src/utils/cluster.ts new file mode 100644 index 00000000000..31097770849 --- /dev/null +++ b/handwritten/bigtable/src/utils/cluster.ts @@ -0,0 +1,174 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as protos from '../../protos/protos'; +import { + BasicClusterConfig, + Cluster, + ICluster, + SetClusterMetadataOptions, +} from '../cluster'; +import {google} from '../../protos/protos'; +import {ModifiableBackupFields} from '../backup'; +import {PreciseDate} from '@google-cloud/precise-date'; + +export class ClusterUtils { + static noConfigError = + 'Must specify either serve_nodes or all of the autoscaling configurations (min_serve_nodes, max_serve_nodes, and cpu_utilization_percent).'; + static allConfigError = + 'Cannot specify both serve_nodes and autoscaling configurations (min_serve_nodes, max_serve_nodes, and cpu_utilization_percent).'; + static incompleteConfigError = + 'All of autoscaling configurations must be specified at the same time (min_serve_nodes, max_serve_nodes, and cpu_utilization_percent).'; + + static validateClusterMetadata(metadata: SetClusterMetadataOptions): void { + if (metadata.nodes) { + if ( + metadata.minServeNodes || + metadata.maxServeNodes || + metadata.cpuUtilizationPercent + ) { + throw new Error(this.allConfigError); + } + } else { + if ( + metadata.minServeNodes || + metadata.maxServeNodes || + metadata.cpuUtilizationPercent + ) { + if ( + !( + metadata.minServeNodes && + metadata.maxServeNodes && + metadata.cpuUtilizationPercent + ) + ) { + throw new Error(this.incompleteConfigError); + } + } else { + throw new Error(this.noConfigError); + } + } + } + + static getUpdateMask(metadata: SetClusterMetadataOptions): string[] { + const updateMask: string[] = []; + if (metadata.nodes) { + updateMask.push('serve_nodes'); + if ( + !( + metadata.minServeNodes || + metadata.maxServeNodes || + metadata.cpuUtilizationPercent + ) + ) { + updateMask.push('cluster_config.cluster_autoscaling_config'); + } + } + if (metadata.minServeNodes) { + updateMask.push( + 'cluster_config.cluster_autoscaling_config.autoscaling_limits.min_serve_nodes', + ); + } + if (metadata.maxServeNodes) { + updateMask.push( + 'cluster_config.cluster_autoscaling_config.autoscaling_limits.max_serve_nodes', + ); + } + if (metadata.cpuUtilizationPercent) { + updateMask.push( + 'cluster_config.cluster_autoscaling_config.autoscaling_targets.cpu_utilization_percent', + ); + } + return updateMask; + } + + static getClusterBaseConfigWithFullLocation( + metadata: BasicClusterConfig, + projectId: string, + name: string | undefined, + ): google.bigtable.admin.v2.ICluster { + const metadataClone = Object.assign({}, metadata); + if (metadataClone.location) { + metadataClone.location = Cluster.getLocation_( + projectId, + metadataClone.location, + ); + } + return ClusterUtils.getClusterBaseConfig(metadataClone, name); + } + + static getClusterBaseConfig( + metadata: SetClusterMetadataOptions, + name: string | undefined, + ): google.bigtable.admin.v2.ICluster { + let clusterConfig; + if ( + metadata.cpuUtilizationPercent || + metadata.minServeNodes || + metadata.maxServeNodes + ) { + clusterConfig = { + clusterAutoscalingConfig: { + autoscalingTargets: { + cpuUtilizationPercent: metadata.cpuUtilizationPercent, + }, + autoscalingLimits: { + minServeNodes: metadata.minServeNodes, + maxServeNodes: metadata.maxServeNodes, + }, + }, + }; + } + const location = metadata?.location; + return Object.assign( + {}, + name ? {name} : null, + location ? {location} : null, + clusterConfig ? {clusterConfig} : null, + metadata.nodes ? {serveNodes: metadata.nodes} : null, + ); + } + + static getClusterFromMetadata( + metadata: SetClusterMetadataOptions, + name: string, + ): google.bigtable.admin.v2.ICluster { + const cluster: ICluster | SetClusterMetadataOptions = Object.assign( + {}, + this.getClusterBaseConfig(metadata, name), + metadata, + ); + delete (cluster as SetClusterMetadataOptions).nodes; + delete (cluster as SetClusterMetadataOptions).minServeNodes; + delete (cluster as SetClusterMetadataOptions).maxServeNodes; + delete (cluster as SetClusterMetadataOptions).cpuUtilizationPercent; + return cluster as ICluster; + } + + static getRequestFromMetadata( + metadata: SetClusterMetadataOptions, + name: string, + ): protos.google.bigtable.admin.v2.IPartialUpdateClusterRequest { + return { + cluster: this.getClusterFromMetadata(metadata, name), + updateMask: {paths: this.getUpdateMask(metadata)}, + }; + } + + static formatBackupExpiryTime(backup: ModifiableBackupFields) { + if (backup.expireTime instanceof Date) { + backup.expireTime = new PreciseDate(backup.expireTime).toStruct(); + } + } +} diff --git a/handwritten/bigtable/src/utils/createReadStreamInternal.ts b/handwritten/bigtable/src/utils/createReadStreamInternal.ts new file mode 100644 index 00000000000..15f3b168af9 --- /dev/null +++ b/handwritten/bigtable/src/utils/createReadStreamInternal.ts @@ -0,0 +1,446 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {GetRowsOptions} from '../table'; +import {Row} from '../row'; +import * as is from 'is'; +import {Filter, BoundData} from '../filter'; +import {Mutation} from '../mutation'; +import {AbortableDuplex} from '../index'; +import { + ChunkPushData, + ChunkPushLastScannedRowData, + ChunkTransformer, + DataEvent, +} from '../chunktransformer'; +import {TableUtils} from './table'; +import {Duplex, PassThrough, Transform} from 'stream'; +import {google} from '../../protos/protos'; +const pumpify = require('pumpify'); +import {grpc, ServiceError} from 'google-gax'; +import { + DEFAULT_BACKOFF_SETTINGS, + getNextDelay, + IGNORED_STATUS_CODES, + populateAttemptHeader, + RETRYABLE_STATUS_CODES, + TabularApiSurface, +} from '../tabular-api-surface'; +import {OperationMetricsCollector} from '../client-side-metrics/operation-metrics-collector'; +import {TimedStream} from '../timed-stream'; + +/** + * Creates a readable stream of rows from a Bigtable table or authorized view. + * + * This internal method handles the core logic for streaming rows from a Bigtable + * table. It supports various filtering, limiting, and retry mechanisms. It can + * be used to create a stream for either a whole table or an authorized view. + * + * @param {Table} table The Table instance to read rows from. + * @param metricsCollector + * @param {GetRowsOptions} [opts] Optional configuration for the read operation. + * @param {boolean} [opts.decode=true] If set to `false` it will not decode + * Buffer values returned from Bigtable. + * @param {boolean} [opts.encoding] The encoding to use when converting + * Buffer values to a string. + * @param {string} [opts.end] End value for key range. + * @param {Filter} [opts.filter] Row filters allow you to + * both make advanced queries and format how the data is returned. + * @param {object} [opts.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {string[]} [opts.keys] A list of row keys. + * @param {number} [opts.limit] Maximum number of rows to be returned. + * @param {string} [opts.prefix] Prefix that the row key must match. + * @param {string[]} [opts.prefixes] List of prefixes that a row key must + * match. + * @param {object[]} [opts.ranges] A list of key ranges. + * @param {string} [opts.start] Start value for key range. + * @returns {stream} A readable stream of {@link Row} objects. + * + */ +export function createReadStreamInternal( + table: TabularApiSurface, + metricsCollector: OperationMetricsCollector, + opts?: GetRowsOptions, +) { + const options = opts || {}; + const maxRetries = is.number(table.maxRetries) ? table.maxRetries! : 10; + let activeRequestStream: AbortableDuplex | null; + let rowKeys: string[]; + let filter: {} | null; + const rowsLimit = options.limit || 0; + const hasLimit = rowsLimit !== 0; + + const viewName = table.viewName; + + let numConsecutiveErrors = 0; + let numRequestsMade = 0; + let retryTimer: NodeJS.Timeout | null; + + rowKeys = options.keys || []; + + /* + The following line of code sets the timeout if it was provided while + creating the client. This will be used to determine if the client should + retry on DEADLINE_EXCEEDED errors. Eventually, this will be handled + downstream in google-gax. + */ + const timeout = + opts?.gaxOptions?.timeout || + (table?.bigtable?.options?.BigtableClient?.clientConfig?.interfaces && + table?.bigtable?.options?.BigtableClient?.clientConfig?.interfaces[ + 'google.bigtable.v2.Bigtable' + ]?.methods['ReadRows']?.timeout_millis); + const callTimeMillis = new Date().getTime(); + + const ranges = TableUtils.getRanges(options); + + // If rowKeys and ranges are both empty, the request is a full table scan. + // Add an empty range to simplify the resumption logic. + if (rowKeys.length === 0 && ranges.length === 0) { + ranges.push({}); + } + + if (options.filter) { + filter = Filter.parse(options.filter); + } + + let chunkTransformer: ChunkTransformer; + let rowStream: Duplex; + + let userCanceled = false; + // The key of the last row that was emitted by the per attempt pipeline + // Note: this must be updated from the operation level userStream to avoid referencing buffered rows that will be + // discarded in the per attempt subpipeline (rowStream) + let lastRowKey = ''; + let rowsRead = 0; + const userStream = new TimedStream({ + transformHook(event, _encoding, callback) { + if (userCanceled) { + callback(); + return; + } + if (event.eventType === DataEvent.LAST_ROW_KEY_UPDATE) { + /** + * This code will run when receiving an event containing + * lastScannedRowKey data that the chunk transformer sent. When the + * chunk transformer gets lastScannedRowKey data, this code + * updates the lastRowKey to ensure row ids with the lastScannedRowKey + * aren't re-requested in retries. The lastRowKey needs to be updated + * here and not in the chunk transformer to ensure the update is + * queued behind all events that deliver data to the user stream + * first. + */ + lastRowKey = event.lastScannedRowKey; + callback(); + return; + } + const row = event; + if (TableUtils.lessThanOrEqualTo(row.id, lastRowKey)) { + /* + Sometimes duplicate rows reach this point. To avoid delivering + duplicate rows to the user, rows are thrown away if they don't exceed + the last row key. We can expect each row to reach this point and rows + are delivered in order so if the last row key equals or exceeds the + row id then we know data for this row has already reached this point + and been delivered to the user. In this case we want to throw the row + away and we do not want to deliver this row to the user again. + */ + callback(); + return; + } + lastRowKey = row.id; + rowsRead++; + callback(null, row); + }, + }); + + // The caller should be able to call userStream.end() to stop receiving + // more rows and cancel the stream prematurely. But also, the 'end' event + // will be emitted if the stream ended normally. To tell these two + // situations apart, we'll save the "original" end() function, and + // will call it on rowStream.on('end'). + const originalEnd = userStream.end.bind(userStream); + + // Taking care of this extra listener when piping and unpiping userStream: + const rowStreamPipe = (rowStream: Duplex, userStream: PassThrough) => { + rowStream.pipe(userStream, {end: false}); + rowStream.on('end', originalEnd); + }; + const rowStreamUnpipe = (rowStream: Duplex, userStream: PassThrough) => { + rowStream?.unpipe(userStream); + rowStream?.removeListener('end', originalEnd); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + userStream.end = (chunk?: any, encoding?: any, cb?: () => void) => { + rowStreamUnpipe(rowStream, userStream); + userCanceled = true; + if (activeRequestStream) { + activeRequestStream.abort(); + } + if (retryTimer) { + clearTimeout(retryTimer); + } + return originalEnd(chunk, encoding, cb); + }; + metricsCollector.onOperationStart(); + const makeNewRequest = () => { + metricsCollector.onAttemptStart(); + + // Avoid cancelling an expired timer if user + // cancelled the stream in the middle of a retry + retryTimer = null; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + chunkTransformer = new ChunkTransformer({ + decode: options.decode, + } as any); + + // If the viewName is provided then request will be made for an + // authorized view. Otherwise, the request is made for a table. + const reqOpts = ( + viewName + ? { + authorizedViewName: `${table.name}/authorizedViews/${viewName}`, + appProfileId: table.bigtable.appProfileId, + } + : { + tableName: table.name, + appProfileId: table.bigtable.appProfileId, + } + ) as google.bigtable.v2.IReadRowsRequest; + + const retryOpts = { + currentRetryAttempt: 0, // was numConsecutiveErrors + // Handling retries in this client. Specify the retry options to + // make sure nothing is retried in retry-request. + noResponseRetries: 0, + shouldRetryFn: (_: any) => { + return false; + }, + }; + + if (lastRowKey) { + // Readjust and/or remove ranges based on previous valid row reads. + // Iterate backward since items may need to be removed. + for (let index = ranges.length - 1; index >= 0; index--) { + const range = ranges[index]; + const startValue = is.object(range.start) + ? (range.start as BoundData).value + : range.start; + const endValue = is.object(range.end) + ? (range.end as BoundData).value + : range.end; + const startKeyIsRead = + !startValue || + TableUtils.lessThanOrEqualTo( + startValue as string, + lastRowKey as string, + ); + const endKeyIsNotRead = + !endValue || + (endValue as Buffer).length === 0 || + TableUtils.lessThan(lastRowKey as string, endValue as string); + if (startKeyIsRead) { + if (endKeyIsNotRead) { + // EndKey is not read, reset the range to start from lastRowKey open + range.start = { + value: lastRowKey, + inclusive: false, + }; + } else { + // EndKey is read, remove this range + ranges.splice(index, 1); + } + } + } + + // Remove rowKeys already read. + rowKeys = rowKeys.filter(rowKey => + TableUtils.greaterThan(rowKey, lastRowKey as string), + ); + + // If there was a row limit in the original request and + // we've already read all the rows, end the stream and + // do not retry. + if (hasLimit && rowsLimit === rowsRead) { + userStream.end(); + return; + } + // If all the row keys and ranges are read, end the stream + // and do not retry. + if (rowKeys.length === 0 && ranges.length === 0) { + userStream.end(); + return; + } + } + + // Create the new reqOpts + reqOpts.rows = {}; + + // TODO: preprocess all the keys and ranges to Bytes + reqOpts.rows.rowKeys = rowKeys.map( + Mutation.convertToBytes, + ) as {} as Uint8Array[]; + + reqOpts.rows.rowRanges = ranges.map(range => + Filter.createRange( + range.start as BoundData, + range.end as BoundData, + 'Key', + ), + ); + + if (filter) { + reqOpts.filter = filter; + } + + if (hasLimit) { + reqOpts.rowsLimit = rowsLimit - rowsRead; + } + + const gaxOpts = populateAttemptHeader(numRequestsMade, options.gaxOptions); + + const requestStream = table.bigtable.request({ + client: 'BigtableClient', + method: 'readRows', + reqOpts, + gaxOpts, + retryOpts, + }); + requestStream.on('data', () => { + // This handler is necessary for recording firstResponseLatencies. + metricsCollector.onResponse(); + }); + + activeRequestStream = requestStream!; + + const toRowStream = new Transform({ + transform: (rowData: ChunkPushData, _, next) => { + if ( + userCanceled || + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (userStream as any)._writableState.ended + ) { + return next(); + } + if ( + (rowData as ChunkPushLastScannedRowData).eventType === + DataEvent.LAST_ROW_KEY_UPDATE + ) { + /** + * If the data is the chunk transformer communicating that the + * lastScannedRow was received then this message is passed along + * to the user stream to update the lastRowKey. + */ + next(null, rowData); + } else { + /** + * If the data is just regular rows being pushed from the + * chunk transformer then the rows are encoded so that they + * can be consumed by the user stream. + */ + const row = table.row((rowData as Row).key as string); + row.data = (rowData as Row).data; + next(null, row); + } + }, + objectMode: true, + }); + + rowStream = pumpify.obj([requestStream, chunkTransformer, toRowStream]); + + metricsCollector.wrapRequest(requestStream); + rowStream + .on('error', (error: ServiceError) => { + rowStreamUnpipe(rowStream, userStream); + activeRequestStream = null; + if (IGNORED_STATUS_CODES.has(error.code)) { + // We ignore the `cancelled` "error", since we are the ones who cause + // it when the user calls `.abort()`. + userStream.end(); + metricsCollector.onOperationComplete( + error.code, + userStream.getTotalDurationMs(), + ); + return; + } + numConsecutiveErrors++; + numRequestsMade++; + if ( + numConsecutiveErrors <= maxRetries && + (RETRYABLE_STATUS_CODES.has(error.code) || isRstStreamError(error)) && + !(timeout && timeout < new Date().getTime() - callTimeMillis) + ) { + const backOffSettings = + options.gaxOptions?.retry?.backoffSettings || + DEFAULT_BACKOFF_SETTINGS; + const nextRetryDelay = getNextDelay( + numConsecutiveErrors, + backOffSettings, + ); + metricsCollector.onAttemptComplete(error.code); + retryTimer = setTimeout(makeNewRequest, nextRetryDelay); + } else { + if ( + !error.code && + error.message === 'The client has already been closed.' + ) { + // + // The TestReadRows_Generic_CloseClient conformance test requires + // a grpc code to be present when the client is closed. The + // appropriate code for a closed client is CANCELLED since the + // user actually cancelled the call by closing the client. + // + error.code = grpc.status.CANCELLED; + } + metricsCollector.onOperationComplete( + error.code, + userStream.getTotalDurationMs(), + ); + userStream.emit('error', error); + } + }) + .on('data', _ => { + // Reset error count after a successful read so the backoff + // time won't keep increasing when as stream had multiple errors + numConsecutiveErrors = 0; + }) + .on('end', () => { + activeRequestStream = null; + metricsCollector.onOperationComplete( + grpc.status.OK, + userStream.getTotalDurationMs(), + ); + }); + rowStreamPipe(rowStream, userStream); + }; + + makeNewRequest(); + return userStream; +} + +// Retry on "received rst stream" errors +export function isRstStreamError(error: ServiceError): boolean { + if (error.code === 13 && error.message) { + const error_message = (error.message || '').toLowerCase(); + return ( + error.code === 13 && + (error_message.includes('rst_stream') || + error_message.includes('rst stream')) + ); + } + return false; +} diff --git a/handwritten/bigtable/src/utils/getRowsInternal.ts b/handwritten/bigtable/src/utils/getRowsInternal.ts new file mode 100644 index 00000000000..d106b6de9f4 --- /dev/null +++ b/handwritten/bigtable/src/utils/getRowsInternal.ts @@ -0,0 +1,66 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import { + GetRowsCallback, + GetRowsOptions, + GetRowsResponse, + TabularApiSurface, +} from '../tabular-api-surface'; +import {createReadStreamInternal} from './createReadStreamInternal'; +import {Row} from '../row'; +import {OperationMetricsCollector} from '../client-side-metrics/operation-metrics-collector'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const concat = require('concat-stream'); + +/** + * Get {@link Row} objects for the rows currently in your table. + * + * This method is not recommended for large datasets as it will buffer all rows + * before returning the results. Instead we recommend using the streaming API + * via {@link Table#createReadStream}. + * + * @param {TabularApiSurface} table The table instance to get rows from. + * @param metricsCollector + * @param {object} [optionsOrCallback] Configuration object. See + * {@link Table#createReadStream} for a complete list of options. + * @param {object} [optionsOrCallback.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/CallSettings.html. + * @param {function} cb The callback function. + * @param {?error} cb.err An error returned while making this request. + * @param {Row[]} cb.rows List of Row objects. + * + * @returns {Promise|void} Returns a promise that resolves with the rows if no callback is provided, otherwise calls the callback with the rows. + * + * @example + * region_tag:bigtable_api_get_rows + */ +export function getRowsInternal( + table: TabularApiSurface, + metricsCollector: OperationMetricsCollector, + optionsOrCallback?: GetRowsOptions | GetRowsCallback, + cb?: GetRowsCallback, +): void | Promise { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + createReadStreamInternal(table, metricsCollector, options) + .on('error', callback) + .pipe( + concat((rows: Row[]) => { + callback(null, rows); + }), + ); +} diff --git a/handwritten/bigtable/src/utils/mutateInternal.ts b/handwritten/bigtable/src/utils/mutateInternal.ts new file mode 100644 index 00000000000..f068543cfe9 --- /dev/null +++ b/handwritten/bigtable/src/utils/mutateInternal.ts @@ -0,0 +1,239 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import { + Entry, + MutateCallback, + MutateOptions, + PartialFailureError, +} from '../table'; +import {OperationMetricsCollector} from '../client-side-metrics/operation-metrics-collector'; +import { + DEFAULT_BACKOFF_SETTINGS, + getNextDelay, + populateAttemptHeader, + RETRYABLE_STATUS_CODES, + TabularApiSurface, +} from '../tabular-api-surface'; +import {ServiceError} from 'google-gax'; +import {google} from '../../protos/protos'; +import * as is from 'is'; +import {Mutation} from '../mutation'; +import arrify = require('arrify'); + +export function mutateInternal( + table: TabularApiSurface, + metricsCollector: OperationMetricsCollector, + entriesRaw: Entry | Entry[], + optionsOrCallback?: MutateOptions | MutateCallback, + cb?: MutateCallback, +) { + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const entries: Entry[] = (arrify(entriesRaw) as Entry[]).reduce( + (a, b) => a.concat(b), + [], + ); + const collectMetricsCallback = ( + originalError: ServiceError | null, + err: ServiceError | PartialFailureError | null, + apiResponse?: google.protobuf.Empty, + ) => { + // originalError is the error that was sent from the gapic layer. The + // compiler guarantees that it contains a code which needs to be + // provided when an operation is marked complete. + // + // err is the error we intend to send back to the user. Often it is the + // same as originalError, but in one case we construct a + // PartialFailureError and send that back to the user instead. In this + // case, we still need to pass the originalError into the method + // because the PartialFailureError doesn't have a code, but we need to + // communicate a code to the metrics collector. + // + const code = originalError ? originalError.code : 0; + metricsCollector.onOperationComplete(code); + callback(err, apiResponse); + }; + + /* + The following line of code sets the timeout if it was provided while + creating the client. This will be used to determine if the client should + retry on errors. Eventually, this will be handled downstream in google-gax. + */ + const timeout = + options?.gaxOptions?.timeout || + (table?.bigtable?.options?.BigtableClient?.clientConfig?.interfaces && + table?.bigtable?.options?.BigtableClient?.clientConfig?.interfaces[ + 'google.bigtable.v2.Bigtable' + ]?.methods['MutateRows']?.timeout_millis); + const callTimeMillis = new Date().getTime(); + + let numRequestsMade = 0; + + const maxRetries = is.number(table.maxRetries) ? table.maxRetries! : 3; + const pendingEntryIndices = new Set( + entries.map((entry: Entry, index: number) => index), + ); + const entryToIndex = new Map( + entries.map((entry: Entry, index: number) => [entry, index]), + ); + const mutationErrorsByEntryIndex = new Map(); + + const isRetryable = (err: ServiceError | null, timeoutExceeded: boolean) => { + if (timeoutExceeded) { + // If the timeout has been exceeded then do not retry. + return false; + } + // Don't retry if there are no more entries or retry attempts + if (pendingEntryIndices.size === 0 || numRequestsMade >= maxRetries + 1) { + return false; + } + // If the error is empty but there are still outstanding mutations, + // it means that there are retryable errors in the mutate response + // even when the RPC succeeded + return !err || RETRYABLE_STATUS_CODES.has(err.code); + }; + + const onBatchResponse = (err: ServiceError | null) => { + // Return if the error happened before a request was made + if (numRequestsMade === 0) { + collectMetricsCallback(err, err); + return; + } + + const timeoutExceeded = !!( + timeout && timeout < new Date().getTime() - callTimeMillis + ); + if (isRetryable(err, timeoutExceeded)) { + // If the timeout or max retries is exceeded or if there are no + // pending indices left then the client doesn't retry. + // Otherwise, the client will retry if there is no error or if the + // error has a retryable status code. + const backOffSettings = + options.gaxOptions?.retry?.backoffSettings || DEFAULT_BACKOFF_SETTINGS; + const nextDelay = getNextDelay(numRequestsMade, backOffSettings); + metricsCollector.onAttemptComplete(err ? err.code : 0); + setTimeout(makeNextBatchRequest, nextDelay); + return; + } + + // If there's no more pending mutations, set the error + // to null + if (pendingEntryIndices.size === 0) { + err = null; + } + + const mutationErrors = Array.from(mutationErrorsByEntryIndex.values()); + if (mutationErrorsByEntryIndex.size !== 0) { + collectMetricsCallback(err, new PartialFailureError(mutationErrors, err)); + return; + } + if (err) { + /* If there's an RPC level failure and the mutation entries don't have + a status code, the RPC level failure error code will be used as the + entry failure code. + */ + (err as ServiceError & {errors?: ServiceError[]}).errors = + mutationErrors.concat( + [...pendingEntryIndices] + .filter(index => !mutationErrorsByEntryIndex.has(index)) + .map(() => err), + ); + collectMetricsCallback(err, err); + return; + } + collectMetricsCallback(null, null); + }; + + metricsCollector.onOperationStart(); + const makeNextBatchRequest = () => { + metricsCollector.onAttemptStart(); + const entryBatch = entries.filter((entry: Entry, index: number) => { + return pendingEntryIndices.has(index); + }); + + // If the viewName is provided then request will be made for an + // authorized view. Otherwise, the request is made for a table. + const baseReqOpts = ( + table.viewName + ? { + authorizedViewName: `${table.name}/authorizedViews/${table.viewName}`, + } + : { + tableName: table.name, + } + ) as google.bigtable.v2.IReadRowsRequest; + const reqOpts = Object.assign(baseReqOpts, { + appProfileId: table.bigtable.appProfileId, + entries: options.rawMutation + ? entryBatch + : entryBatch.map(Mutation.parse), + }); + + const retryOpts = { + currentRetryAttempt: numRequestsMade, + // Handling retries in this client. Specify the retry options to + // make sure nothing is retried in retry-request. + noResponseRetries: 0, + shouldRetryFn: (_: any) => { + return false; + }, + }; + + options.gaxOptions = populateAttemptHeader( + numRequestsMade, + options.gaxOptions, + ); + + const requestStream = + table.bigtable.request({ + client: 'BigtableClient', + method: 'mutateRows', + reqOpts, + gaxOpts: options.gaxOptions, + retryOpts, + }); + metricsCollector.wrapRequest(requestStream); + requestStream + .on('error', (err: ServiceError) => { + onBatchResponse(err); + }) + .on('data', (obj: google.bigtable.v2.IMutateRowsResponse) => { + obj.entries!.forEach(entry => { + const originalEntry = entryBatch[entry.index as number]; + const originalEntriesIndex = entryToIndex.get(originalEntry)!; + + // Mutation was successful. + if (entry.status!.code === 0) { + pendingEntryIndices.delete(originalEntriesIndex); + mutationErrorsByEntryIndex.delete(originalEntriesIndex); + return; + } + if (!RETRYABLE_STATUS_CODES.has(entry.status!.code!)) { + pendingEntryIndices.delete(originalEntriesIndex); + } + const errorDetails = entry.status; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (errorDetails as any).entry = originalEntry; + mutationErrorsByEntryIndex.set(originalEntriesIndex, errorDetails); + }); + }) + .on('end', onBatchResponse); + numRequestsMade++; + }; + + makeNextBatchRequest(); +} diff --git a/handwritten/bigtable/src/utils/retry-options.ts b/handwritten/bigtable/src/utils/retry-options.ts new file mode 100644 index 00000000000..7fbb7fcbda8 --- /dev/null +++ b/handwritten/bigtable/src/utils/retry-options.ts @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {BackoffSettings} from 'google-gax/build/src/gax'; +import {GoogleError, grpc, ServiceError} from 'google-gax'; + +export const RETRYABLE_STATUS_CODES = new Set([ + grpc.status.DEADLINE_EXCEEDED.valueOf(), + grpc.status.UNAVAILABLE.valueOf(), +]); +export const DEFAULT_RETRY_COUNT = 10; +export const IGNORED_STATUS_CODES = new Set([grpc.status.CANCELLED.valueOf()]); + +interface Violation { + type: string; + description: string; +} + +interface ViolationsList { + violations?: Violation[]; +} + +function containsPreparedQueryExpired(violations: ViolationsList[]): boolean { + if (!Array.isArray(violations) || violations.length === 0) { + return false; + } + + for (const obj of violations) { + if (obj.violations && Array.isArray(obj.violations)) { + for (const violation of obj.violations) { + if (violation.type === 'PREPARED_QUERY_EXPIRED') { + return true; + } + } + } + } + + return false; +} + +/** + * Checks if the error is an "expired query plan" error. + * For more info refer to the ExecuteQueryStateMachine + * @param error + */ +export const isExpiredQueryError = ( + error: GoogleError | ServiceError, +): boolean => { + if ( + error.code === grpc.status.FAILED_PRECONDITION && + Object.prototype.hasOwnProperty.call(error, 'statusDetails') + ) { + const statusDetails = (error as GoogleError) + .statusDetails as ViolationsList[]; + return containsPreparedQueryExpired(statusDetails); + } + return false; +}; + +/** + * Checks if the error is a cancel error - caused by aborting the stream. + * @param error + */ +export function isCancelError(error: ServiceError) { + return error.code === grpc.status.CANCELLED.valueOf(); +} diff --git a/handwritten/bigtable/src/utils/table.ts b/handwritten/bigtable/src/utils/table.ts new file mode 100644 index 00000000000..9d9d48df791 --- /dev/null +++ b/handwritten/bigtable/src/utils/table.ts @@ -0,0 +1,87 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {GetRowsOptions, PrefixRange} from '../tabular-api-surface'; +import {Mutation} from '../mutation'; + +export class TableUtils { + static getRanges(options: GetRowsOptions) { + const ranges = options.ranges || []; + if (options.start || options.end) { + if (options.ranges || options.prefix || options.prefixes) { + throw new Error( + 'start/end should be used exclusively to ranges/prefix/prefixes.', + ); + } + ranges.push({ + start: options.start!, + end: options.end!, + }); + } + if (options.prefix) { + if (options.ranges || options.start || options.end || options.prefixes) { + throw new Error( + 'prefix should be used exclusively to ranges/start/end/prefixes.', + ); + } + ranges.push(this.createPrefixRange(options.prefix)); + } + if (options.prefixes) { + if (options.ranges || options.start || options.end || options.prefix) { + throw new Error( + 'prefixes should be used exclusively to ranges/start/end/prefix.', + ); + } + options.prefixes.forEach(prefix => { + ranges.push(this.createPrefixRange(prefix)); + }); + } + return ranges; + } + + // TODO: lhs and rhs type shouldn't be string, it could be + // string, number, Uint8Array, boolean. Fix the type + // and clean up the casting. + static lessThan(lhs: string, rhs: string) { + const lhsBytes = Mutation.convertToBytes(lhs); + const rhsBytes = Mutation.convertToBytes(rhs); + return (lhsBytes as Buffer).compare(rhsBytes as Uint8Array) === -1; + } + + static greaterThan(lhs: string, rhs: string) { + return this.lessThan(rhs, lhs); + } + + static lessThanOrEqualTo(lhs: string, rhs: string) { + return !this.greaterThan(lhs, rhs); + } + + static createPrefixRange(start: string): PrefixRange { + const prefix = start.replace(new RegExp('[\xff]+$'), ''); + let endKey = ''; + if (prefix) { + const position = prefix.length - 1; + const charCode = prefix.charCodeAt(position); + const nextChar = String.fromCharCode(charCode + 1); + endKey = prefix.substring(0, position) + nextChar; + } + return { + start, + end: { + value: endKey, + inclusive: !endKey, + }, + }; + } +} diff --git a/handwritten/bigtable/src/v2/bigtable_client.ts b/handwritten/bigtable/src/v2/bigtable_client.ts new file mode 100644 index 00000000000..1782b4f9e3f --- /dev/null +++ b/handwritten/bigtable/src/v2/bigtable_client.ts @@ -0,0 +1,2153 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/bigtable_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './bigtable_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for reading from and writing to existing Bigtable tables. + * @class + * @memberof v2 + */ +export class BigtableClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('bigtable'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + bigtableStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BigtableClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new BigtableClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof BigtableClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'bigtable.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + authorizedViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}', + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}', + ), + materializedViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/materializedViews/{materialized_view}', + ), + tablePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/tables/{table}', + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + readRows: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + sampleRowKeys: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + mutateRows: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + generateInitialChangeStreamPartitions: + new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + readChangeStream: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + executeQuery: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.bigtable.v2.Bigtable', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')}, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.bigtableStub) { + return this.bigtableStub; + } + + // Put together the "service stub" for + // google.bigtable.v2.Bigtable. + this.bigtableStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.bigtable.v2.Bigtable', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.bigtable.v2.Bigtable, + this._opts, + this._providedCustomServicePath, + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const bigtableStubMethods = [ + 'readRows', + 'sampleRowKeys', + 'mutateRow', + 'mutateRows', + 'checkAndMutateRow', + 'pingAndWarm', + 'readModifyWriteRow', + 'generateInitialChangeStreamPartitions', + 'readChangeStream', + 'prepareQuery', + 'executeQuery', + ]; + for (const methodName of bigtableStubMethods) { + const callPromise = this.bigtableStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit( + 'error', + new this._gaxModule.GoogleError( + 'The client has already been closed.', + ), + ); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = this.descriptors.stream[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.bigtableStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigtable.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigtable.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/bigtable.data', + 'https://www.googleapis.com/auth/bigtable.data.readonly', + 'https://www.googleapis.com/auth/cloud-bigtable.data', + 'https://www.googleapis.com/auth/cloud-bigtable.data.readonly', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Mutates a row atomically. Cells already present in the row are left + * unchanged unless explicitly changed by `mutation`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.tableName] + * Optional. The unique name of the table to which the mutation should be + * applied. + * + * Values are of the form + * `projects//instances//tables/
include:samples/generated/v2/bigtable_instance_admin.get_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.list_instances.jsinclude:samples/generated/v2/bigtable_instance_admin.update_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.delete_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.get_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.list_clusters.jsinclude:samples/generated/v2/bigtable_instance_admin.delete_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.create_app_profile.jsinclude:samples/generated/v2/bigtable_instance_admin.get_app_profile.jsinclude:samples/generated/v2/bigtable_instance_admin.delete_app_profile.jsinclude:samples/generated/v2/bigtable_instance_admin.get_iam_policy.jsinclude:samples/generated/v2/bigtable_instance_admin.set_iam_policy.jsinclude:samples/generated/v2/bigtable_instance_admin.test_iam_permissions.jsinclude:samples/generated/v2/bigtable_instance_admin.get_logical_view.jsinclude:samples/generated/v2/bigtable_instance_admin.delete_logical_view.jsinclude:samples/generated/v2/bigtable_instance_admin.get_materialized_view.jsinclude:samples/generated/v2/bigtable_instance_admin.delete_materialized_view.jsinclude:samples/generated/v2/bigtable_instance_admin.create_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.create_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.partial_update_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.partial_update_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.create_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.create_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.update_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.update_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.partial_update_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.partial_update_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.update_app_profile.jsinclude:samples/generated/v2/bigtable_instance_admin.update_app_profile.jsinclude:samples/generated/v2/bigtable_instance_admin.create_logical_view.jsinclude:samples/generated/v2/bigtable_instance_admin.create_logical_view.jsinclude:samples/generated/v2/bigtable_instance_admin.update_logical_view.jsinclude:samples/generated/v2/bigtable_instance_admin.update_logical_view.jsinclude:samples/generated/v2/bigtable_instance_admin.create_materialized_view.jsinclude:samples/generated/v2/bigtable_instance_admin.create_materialized_view.jsinclude:samples/generated/v2/bigtable_instance_admin.update_materialized_view.jsinclude:samples/generated/v2/bigtable_instance_admin.update_materialized_view.jsinclude:samples/generated/v2/bigtable_instance_admin.list_app_profiles.jsinclude:samples/generated/v2/bigtable_instance_admin.list_hot_tablets.jsinclude:samples/generated/v2/bigtable_instance_admin.list_logical_views.jsinclude:samples/generated/v2/bigtable_instance_admin.list_materialized_views.jsinclude:samples/generated/v2/bigtable_table_admin.create_table.jsinclude:samples/generated/v2/bigtable_table_admin.get_table.jsinclude:samples/generated/v2/bigtable_table_admin.delete_table.jsinclude:samples/generated/v2/bigtable_table_admin.get_authorized_view.jsinclude:samples/generated/v2/bigtable_table_admin.delete_authorized_view.jsinclude:samples/generated/v2/bigtable_table_admin.modify_column_families.jsinclude:samples/generated/v2/bigtable_table_admin.drop_row_range.jsinclude:samples/generated/v2/bigtable_table_admin.generate_consistency_token.jsinclude:samples/generated/v2/bigtable_table_admin.check_consistency.jsinclude:samples/generated/v2/bigtable_table_admin.get_snapshot.jsinclude:samples/generated/v2/bigtable_table_admin.delete_snapshot.jsinclude:samples/generated/v2/bigtable_table_admin.get_backup.jsinclude:samples/generated/v2/bigtable_table_admin.update_backup.jsinclude:samples/generated/v2/bigtable_table_admin.delete_backup.jsinclude:samples/generated/v2/bigtable_table_admin.get_iam_policy.jsinclude:samples/generated/v2/bigtable_table_admin.set_iam_policy.jsinclude:samples/generated/v2/bigtable_table_admin.test_iam_permissions.jsinclude:samples/generated/v2/bigtable_table_admin.get_schema_bundle.jsinclude:samples/generated/v2/bigtable_table_admin.delete_schema_bundle.jsinclude:samples/generated/v2/bigtable_table_admin.create_table_from_snapshot.jsinclude:samples/generated/v2/bigtable_table_admin.create_table_from_snapshot.jsinclude:samples/generated/v2/bigtable_table_admin.update_table.jsinclude:samples/generated/v2/bigtable_table_admin.update_table.jsinclude:samples/generated/v2/bigtable_table_admin.undelete_table.jsinclude:samples/generated/v2/bigtable_table_admin.undelete_table.jsinclude:samples/generated/v2/bigtable_table_admin.create_authorized_view.jsinclude:samples/generated/v2/bigtable_table_admin.create_authorized_view.jsinclude:samples/generated/v2/bigtable_table_admin.update_authorized_view.jsinclude:samples/generated/v2/bigtable_table_admin.update_authorized_view.jsinclude:samples/generated/v2/bigtable_table_admin.snapshot_table.jsinclude:samples/generated/v2/bigtable_table_admin.snapshot_table.jsinclude:samples/generated/v2/bigtable_table_admin.create_backup.jsinclude:samples/generated/v2/bigtable_table_admin.create_backup.jsinclude:samples/generated/v2/bigtable_table_admin.restore_table.jsinclude:samples/generated/v2/bigtable_table_admin.restore_table.jsinclude:samples/generated/v2/bigtable_table_admin.copy_backup.jsinclude:samples/generated/v2/bigtable_table_admin.copy_backup.jsinclude:samples/generated/v2/bigtable_table_admin.create_schema_bundle.jsinclude:samples/generated/v2/bigtable_table_admin.create_schema_bundle.jsinclude:samples/generated/v2/bigtable_table_admin.update_schema_bundle.jsinclude:samples/generated/v2/bigtable_table_admin.update_schema_bundle.jsinclude:samples/generated/v2/bigtable_table_admin.list_tables.jsinclude:samples/generated/v2/bigtable_table_admin.list_authorized_views.jsinclude:samples/generated/v2/bigtable_table_admin.list_snapshots.jsinclude:samples/generated/v2/bigtable_table_admin.list_backups.jsinclude:samples/generated/v2/bigtable_table_admin.list_schema_bundles.jsinclude:samples/api-reference-doc-snippets/app-profile.jsinclude:samples/api-reference-doc-snippets/app-profile.jsinclude:samples/api-reference-doc-snippets/app-profile.jsinclude:samples/api-reference-doc-snippets/app-profile.jsinclude:samples/api-reference-doc-snippets/app-profile.jsinclude:samples/api-reference-doc-snippets/app-profile.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/backups.create.jsinclude:samples/api-reference-doc-snippets/backups.delete.jsinclude:samples/api-reference-doc-snippets/backups.get.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/backups.get.jsinclude:samples/api-reference-doc-snippets/backups.restore.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/backups.update.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/cluster.jsinclude:samples/api-reference-doc-snippets/backups.create.jsinclude:samples/api-reference-doc-snippets/cluster.jsinclude:samples/api-reference-doc-snippets/cluster.jsinclude:samples/api-reference-doc-snippets/cluster.jsinclude:samples/api-reference-doc-snippets/backups.list.jsinclude:samples/api-reference-doc-snippets/cluster.jsinclude:samples/api-reference-doc-snippets/cluster.jsinclude:samples/api-reference-doc-snippets/family.jsinclude:samples/api-reference-doc-snippets/family.jsinclude:samples/api-reference-doc-snippets/family.jsinclude:samples/api-reference-doc-snippets/family.jsinclude:samples/api-reference-doc-snippets/family.jsinclude:samples/api-reference-doc-snippets/family.jsinclude:samples/quickstart.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/backups.list.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/backups.restore.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/row.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/instance.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/table.jsinclude:samples/api-reference-doc-snippets/table.js
`. + * @param {string} [request.authorizedViewName] + * Optional. The unique name of the AuthorizedView to which the mutation + * should be applied. + * + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * @param {string} request.appProfileId + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @param {Buffer} request.rowKey + * Required. The key of the row to which the mutation should be applied. + * @param {number[]} request.mutations + * Required. Changes to be atomically applied to the specified row. Entries + * are applied in order, meaning that earlier mutations can be masked by later + * ones. Must contain at least one entry and at most 100000. + * @param {google.bigtable.v2.Idempotency} request.idempotency + * If set consistently across retries, prevents this mutation from being + * double applied to aggregate column families within a 15m window. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.bigtable.v2.MutateRowResponse|MutateRowResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + mutateRow( + request?: protos.google.bigtable.v2.IMutateRowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.v2.IMutateRowResponse, + protos.google.bigtable.v2.IMutateRowRequest | undefined, + {} | undefined, + ] + >; + mutateRow( + request: protos.google.bigtable.v2.IMutateRowRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.v2.IMutateRowResponse, + protos.google.bigtable.v2.IMutateRowRequest | null | undefined, + {} | null | undefined + >, + ): void; + mutateRow( + request: protos.google.bigtable.v2.IMutateRowRequest, + callback: Callback< + protos.google.bigtable.v2.IMutateRowResponse, + protos.google.bigtable.v2.IMutateRowRequest | null | undefined, + {} | null | undefined + >, + ): void; + mutateRow( + request?: protos.google.bigtable.v2.IMutateRowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.v2.IMutateRowResponse, + protos.google.bigtable.v2.IMutateRowRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.v2.IMutateRowResponse, + protos.google.bigtable.v2.IMutateRowRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.v2.IMutateRowResponse, + protos.google.bigtable.v2.IMutateRowRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.tableName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match( + RegExp( + '(?projects/[^/]+/instances/[^/]+/tables/[^/]+)', + ), + ); + if (match) { + const parameterValue = match.groups?.['table_name'] ?? fieldValue; + Object.assign(routingParameter, {table_name: parameterValue}); + } + } + } + { + const fieldValue = request.appProfileId; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?.*)')); + if (match) { + const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; + Object.assign(routingParameter, {app_profile_id: parameterValue}); + } + } + } + { + const fieldValue = request.authorizedViewName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match( + RegExp( + '(?projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?', + ), + ); + if (match) { + const parameterValue = match.groups?.['table_name'] ?? fieldValue; + Object.assign(routingParameter, {table_name: parameterValue}); + } + } + } + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams(routingParameter); + this.initialize().catch(err => { + throw err; + }); + this._log.info('mutateRow request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.v2.IMutateRowResponse, + protos.google.bigtable.v2.IMutateRowRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('mutateRow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .mutateRow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.v2.IMutateRowResponse, + protos.google.bigtable.v2.IMutateRowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('mutateRow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Mutates a row atomically based on the output of a predicate Reader filter. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.tableName] + * Optional. The unique name of the table to which the conditional mutation + * should be applied. + * + * Values are of the form + * `projects//instances//tables/
`. + * @param {string} [request.authorizedViewName] + * Optional. The unique name of the AuthorizedView to which the conditional + * mutation should be applied. + * + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * @param {string} request.appProfileId + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @param {Buffer} request.rowKey + * Required. The key of the row to which the conditional mutation should be + * applied. + * @param {google.bigtable.v2.RowFilter} request.predicateFilter + * The filter to be applied to the contents of the specified row. Depending + * on whether or not any results are yielded, either `true_mutations` or + * `false_mutations` will be executed. If unset, checks that the row contains + * any values at all. + * @param {number[]} request.trueMutations + * Changes to be atomically applied to the specified row if `predicate_filter` + * yields at least one cell when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `false_mutations` is empty, and at most + * 100000. + * @param {number[]} request.falseMutations + * Changes to be atomically applied to the specified row if `predicate_filter` + * does not yield any cells when applied to `row_key`. Entries are applied in + * order, meaning that earlier mutations can be masked by later ones. + * Must contain at least one entry if `true_mutations` is empty, and at most + * 100000. + * @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 {@link protos.google.bigtable.v2.CheckAndMutateRowResponse|CheckAndMutateRowResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + checkAndMutateRow( + request?: protos.google.bigtable.v2.ICheckAndMutateRowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.v2.ICheckAndMutateRowResponse, + protos.google.bigtable.v2.ICheckAndMutateRowRequest | undefined, + {} | undefined, + ] + >; + checkAndMutateRow( + request: protos.google.bigtable.v2.ICheckAndMutateRowRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.v2.ICheckAndMutateRowResponse, + protos.google.bigtable.v2.ICheckAndMutateRowRequest | null | undefined, + {} | null | undefined + >, + ): void; + checkAndMutateRow( + request: protos.google.bigtable.v2.ICheckAndMutateRowRequest, + callback: Callback< + protos.google.bigtable.v2.ICheckAndMutateRowResponse, + protos.google.bigtable.v2.ICheckAndMutateRowRequest | null | undefined, + {} | null | undefined + >, + ): void; + checkAndMutateRow( + request?: protos.google.bigtable.v2.ICheckAndMutateRowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.v2.ICheckAndMutateRowResponse, + | protos.google.bigtable.v2.ICheckAndMutateRowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.v2.ICheckAndMutateRowResponse, + protos.google.bigtable.v2.ICheckAndMutateRowRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.v2.ICheckAndMutateRowResponse, + protos.google.bigtable.v2.ICheckAndMutateRowRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.tableName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match( + RegExp( + '(?projects/[^/]+/instances/[^/]+/tables/[^/]+)', + ), + ); + if (match) { + const parameterValue = match.groups?.['table_name'] ?? fieldValue; + Object.assign(routingParameter, {table_name: parameterValue}); + } + } + } + { + const fieldValue = request.appProfileId; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?.*)')); + if (match) { + const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; + Object.assign(routingParameter, {app_profile_id: parameterValue}); + } + } + } + { + const fieldValue = request.authorizedViewName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match( + RegExp( + '(?projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?', + ), + ); + if (match) { + const parameterValue = match.groups?.['table_name'] ?? fieldValue; + Object.assign(routingParameter, {table_name: parameterValue}); + } + } + } + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams(routingParameter); + this.initialize().catch(err => { + throw err; + }); + this._log.info('checkAndMutateRow request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.v2.ICheckAndMutateRowResponse, + | protos.google.bigtable.v2.ICheckAndMutateRowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('checkAndMutateRow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .checkAndMutateRow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.v2.ICheckAndMutateRowResponse, + protos.google.bigtable.v2.ICheckAndMutateRowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('checkAndMutateRow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Warm up associated instance metadata for this connection. + * This call is not required but may be useful for connection keep-alive. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique name of the instance to check permissions for as well + * as respond. Values are of the form + * `projects//instances/`. + * @param {string} request.appProfileId + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @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 {@link protos.google.bigtable.v2.PingAndWarmResponse|PingAndWarmResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + pingAndWarm( + request?: protos.google.bigtable.v2.IPingAndWarmRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.v2.IPingAndWarmResponse, + protos.google.bigtable.v2.IPingAndWarmRequest | undefined, + {} | undefined, + ] + >; + pingAndWarm( + request: protos.google.bigtable.v2.IPingAndWarmRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.v2.IPingAndWarmResponse, + protos.google.bigtable.v2.IPingAndWarmRequest | null | undefined, + {} | null | undefined + >, + ): void; + pingAndWarm( + request: protos.google.bigtable.v2.IPingAndWarmRequest, + callback: Callback< + protos.google.bigtable.v2.IPingAndWarmResponse, + protos.google.bigtable.v2.IPingAndWarmRequest | null | undefined, + {} | null | undefined + >, + ): void; + pingAndWarm( + request?: protos.google.bigtable.v2.IPingAndWarmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.v2.IPingAndWarmResponse, + protos.google.bigtable.v2.IPingAndWarmRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.v2.IPingAndWarmResponse, + protos.google.bigtable.v2.IPingAndWarmRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.v2.IPingAndWarmResponse, + protos.google.bigtable.v2.IPingAndWarmRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?projects/[^/]+/instances/[^/]+)')); + if (match) { + const parameterValue = match.groups?.['name'] ?? fieldValue; + Object.assign(routingParameter, {name: parameterValue}); + } + } + } + { + const fieldValue = request.appProfileId; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?.*)')); + if (match) { + const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; + Object.assign(routingParameter, {app_profile_id: parameterValue}); + } + } + } + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams(routingParameter); + this.initialize().catch(err => { + throw err; + }); + this._log.info('pingAndWarm request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.v2.IPingAndWarmResponse, + protos.google.bigtable.v2.IPingAndWarmRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('pingAndWarm response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .pingAndWarm(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.v2.IPingAndWarmResponse, + protos.google.bigtable.v2.IPingAndWarmRequest | undefined, + {} | undefined, + ]) => { + this._log.info('pingAndWarm response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Modifies a row atomically on the server. The method reads the latest + * existing timestamp and value from the specified columns and writes a new + * entry based on pre-defined read/modify/write rules. The new value for the + * timestamp is the greater of the existing timestamp or the current server + * time. The method returns the new contents of all modified cells. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.tableName] + * Optional. The unique name of the table to which the read/modify/write rules + * should be applied. + * + * Values are of the form + * `projects//instances//tables/
`. + * @param {string} [request.authorizedViewName] + * Optional. The unique name of the AuthorizedView to which the + * read/modify/write rules should be applied. + * + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * @param {string} request.appProfileId + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @param {Buffer} request.rowKey + * Required. The key of the row to which the read/modify/write rules should be + * applied. + * @param {number[]} request.rules + * Required. Rules specifying how the specified row's contents are to be + * transformed into writes. Entries are applied in order, meaning that earlier + * rules will affect the results of later ones. At least one entry must be + * specified, and there can be at most 100000 rules. + * @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 {@link protos.google.bigtable.v2.ReadModifyWriteRowResponse|ReadModifyWriteRowResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + readModifyWriteRow( + request?: protos.google.bigtable.v2.IReadModifyWriteRowRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.v2.IReadModifyWriteRowResponse, + protos.google.bigtable.v2.IReadModifyWriteRowRequest | undefined, + {} | undefined, + ] + >; + readModifyWriteRow( + request: protos.google.bigtable.v2.IReadModifyWriteRowRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.v2.IReadModifyWriteRowResponse, + protos.google.bigtable.v2.IReadModifyWriteRowRequest | null | undefined, + {} | null | undefined + >, + ): void; + readModifyWriteRow( + request: protos.google.bigtable.v2.IReadModifyWriteRowRequest, + callback: Callback< + protos.google.bigtable.v2.IReadModifyWriteRowResponse, + protos.google.bigtable.v2.IReadModifyWriteRowRequest | null | undefined, + {} | null | undefined + >, + ): void; + readModifyWriteRow( + request?: protos.google.bigtable.v2.IReadModifyWriteRowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.v2.IReadModifyWriteRowResponse, + | protos.google.bigtable.v2.IReadModifyWriteRowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.v2.IReadModifyWriteRowResponse, + protos.google.bigtable.v2.IReadModifyWriteRowRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.v2.IReadModifyWriteRowResponse, + protos.google.bigtable.v2.IReadModifyWriteRowRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.tableName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match( + RegExp( + '(?projects/[^/]+/instances/[^/]+/tables/[^/]+)', + ), + ); + if (match) { + const parameterValue = match.groups?.['table_name'] ?? fieldValue; + Object.assign(routingParameter, {table_name: parameterValue}); + } + } + } + { + const fieldValue = request.appProfileId; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?.*)')); + if (match) { + const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; + Object.assign(routingParameter, {app_profile_id: parameterValue}); + } + } + } + { + const fieldValue = request.authorizedViewName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match( + RegExp( + '(?projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?', + ), + ); + if (match) { + const parameterValue = match.groups?.['table_name'] ?? fieldValue; + Object.assign(routingParameter, {table_name: parameterValue}); + } + } + } + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams(routingParameter); + this.initialize().catch(err => { + throw err; + }); + this._log.info('readModifyWriteRow request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.v2.IReadModifyWriteRowResponse, + | protos.google.bigtable.v2.IReadModifyWriteRowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('readModifyWriteRow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .readModifyWriteRow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.v2.IReadModifyWriteRowResponse, + protos.google.bigtable.v2.IReadModifyWriteRowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('readModifyWriteRow response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Prepares a GoogleSQL query for execution on a particular Bigtable instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceName + * Required. The unique name of the instance against which the query should be + * executed. + * Values are of the form `projects//instances/` + * @param {string} [request.appProfileId] + * Optional. This value specifies routing for preparing the query. Note that + * this `app_profile_id` is only used for preparing the query. The actual + * query execution will use the app profile specified in the + * `ExecuteQueryRequest`. If not specified, the `default` application profile + * will be used. + * @param {string} request.query + * Required. The query string. + * @param {google.bigtable.v2.ProtoFormat} request.protoFormat + * Protocol buffer format as described by ProtoSchema and ProtoRows + * messages. + * @param {number[]} request.paramTypes + * Required. `param_types` is a map of parameter identifier strings to their + * `Type`s. + * + * In query string, a parameter placeholder consists of the + * `@` character followed by the parameter name (for example, `@firstName`) in + * the query string. + * + * For example, if param_types["firstName"] = Bytes then @firstName will be a + * query parameter of type Bytes. The specific `Value` to be used for the + * query execution must be sent in `ExecuteQueryRequest` in the `params` map. + * @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 {@link protos.google.bigtable.v2.PrepareQueryResponse|PrepareQueryResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + prepareQuery( + request?: protos.google.bigtable.v2.IPrepareQueryRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.bigtable.v2.IPrepareQueryResponse, + protos.google.bigtable.v2.IPrepareQueryRequest | undefined, + {} | undefined, + ] + >; + prepareQuery( + request: protos.google.bigtable.v2.IPrepareQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.bigtable.v2.IPrepareQueryResponse, + protos.google.bigtable.v2.IPrepareQueryRequest | null | undefined, + {} | null | undefined + >, + ): void; + prepareQuery( + request: protos.google.bigtable.v2.IPrepareQueryRequest, + callback: Callback< + protos.google.bigtable.v2.IPrepareQueryResponse, + protos.google.bigtable.v2.IPrepareQueryRequest | null | undefined, + {} | null | undefined + >, + ): void; + prepareQuery( + request?: protos.google.bigtable.v2.IPrepareQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.v2.IPrepareQueryResponse, + protos.google.bigtable.v2.IPrepareQueryRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.v2.IPrepareQueryResponse, + protos.google.bigtable.v2.IPrepareQueryRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.bigtable.v2.IPrepareQueryResponse, + protos.google.bigtable.v2.IPrepareQueryRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.instanceName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?projects/[^/]+/instances/[^/]+)')); + if (match) { + const parameterValue = match.groups?.['name'] ?? fieldValue; + Object.assign(routingParameter, {name: parameterValue}); + } + } + } + { + const fieldValue = request.appProfileId; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?.*)')); + if (match) { + const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; + Object.assign(routingParameter, {app_profile_id: parameterValue}); + } + } + } + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams(routingParameter); + this.initialize().catch(err => { + throw err; + }); + this._log.info('prepareQuery request %j', request); + const wrappedCallback: + | Callback< + protos.google.bigtable.v2.IPrepareQueryResponse, + protos.google.bigtable.v2.IPrepareQueryRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('prepareQuery response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .prepareQuery(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.bigtable.v2.IPrepareQueryResponse, + protos.google.bigtable.v2.IPrepareQueryRequest | undefined, + {} | undefined, + ]) => { + this._log.info('prepareQuery response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Streams back the contents of all requested rows in key order, optionally + * applying the same Reader filter to each. Depending on their size, + * rows and cells may be broken up across multiple responses, but + * atomicity of each row will still be preserved. See the + * ReadRowsResponse documentation for details. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.tableName] + * Optional. The unique name of the table from which to read. + * + * Values are of the form + * `projects//instances//tables/
`. + * @param {string} [request.authorizedViewName] + * Optional. The unique name of the AuthorizedView from which to read. + * + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * @param {string} [request.materializedViewName] + * Optional. The unique name of the MaterializedView from which to read. + * + * Values are of the form + * `projects//instances//materializedViews/`. + * @param {string} request.appProfileId + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @param {google.bigtable.v2.RowSet} request.rows + * The row keys and/or ranges to read sequentially. If not specified, reads + * from all rows. + * @param {google.bigtable.v2.RowFilter} request.filter + * The filter to apply to the contents of the specified row(s). If unset, + * reads the entirety of each row. + * @param {number} request.rowsLimit + * The read will stop after committing to N rows' worth of results. The + * default (zero) is to return all results. + * @param {google.bigtable.v2.ReadRowsRequest.RequestStatsView} request.requestStatsView + * The view into RequestStats, as described above. + * @param {boolean} request.reversed + * Experimental API - Please note that this API is currently experimental + * and can change in the future. + * + * Return rows in lexiographical descending order of the row keys. The row + * contents will not be affected by this flag. + * + * Example result set: + * + * [ + * {key: "k2", "f:col1": "v1", "f:col2": "v1"}, + * {key: "k1", "f:col1": "v2", "f:col2": "v2"} + * ] + * @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 {@link protos.google.bigtable.v2.ReadRowsResponse|ReadRowsResponse} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + */ + readRows( + request?: protos.google.bigtable.v2.IReadRowsRequest, + options?: CallOptions, + ): gax.CancellableStream { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.tableName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match( + RegExp( + '(?projects/[^/]+/instances/[^/]+/tables/[^/]+)', + ), + ); + if (match) { + const parameterValue = match.groups?.['table_name'] ?? fieldValue; + Object.assign(routingParameter, {table_name: parameterValue}); + } + } + } + { + const fieldValue = request.appProfileId; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?.*)')); + if (match) { + const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; + Object.assign(routingParameter, {app_profile_id: parameterValue}); + } + } + } + { + const fieldValue = request.authorizedViewName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match( + RegExp( + '(?projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?', + ), + ); + if (match) { + const parameterValue = match.groups?.['table_name'] ?? fieldValue; + Object.assign(routingParameter, {table_name: parameterValue}); + } + } + } + { + const fieldValue = request.materializedViewName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?projects/[^/]+/instances/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['name'] ?? fieldValue; + Object.assign(routingParameter, {name: parameterValue}); + } + } + } + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams(routingParameter); + this.initialize().catch(err => { + throw err; + }); + this._log.info('readRows stream %j', options); + return this.innerApiCalls.readRows(request, options); + } + + /** + * Returns a sample of row keys in the table. The returned row keys will + * delimit contiguous sections of the table of approximately equal size, + * which can be used to break up the data for distributed tasks like + * mapreduces. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.tableName] + * Optional. The unique name of the table from which to sample row keys. + * + * Values are of the form + * `projects//instances//tables/
`. + * @param {string} [request.authorizedViewName] + * Optional. The unique name of the AuthorizedView from which to sample row + * keys. + * + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * @param {string} [request.materializedViewName] + * Optional. The unique name of the MaterializedView from which to read. + * + * Values are of the form + * `projects//instances//materializedViews/`. + * @param {string} request.appProfileId + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @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 {@link protos.google.bigtable.v2.SampleRowKeysResponse|SampleRowKeysResponse} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + */ + sampleRowKeys( + request?: protos.google.bigtable.v2.ISampleRowKeysRequest, + options?: CallOptions, + ): gax.CancellableStream { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.tableName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match( + RegExp( + '(?projects/[^/]+/instances/[^/]+/tables/[^/]+)', + ), + ); + if (match) { + const parameterValue = match.groups?.['table_name'] ?? fieldValue; + Object.assign(routingParameter, {table_name: parameterValue}); + } + } + } + { + const fieldValue = request.appProfileId; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?.*)')); + if (match) { + const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; + Object.assign(routingParameter, {app_profile_id: parameterValue}); + } + } + } + { + const fieldValue = request.authorizedViewName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match( + RegExp( + '(?projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?', + ), + ); + if (match) { + const parameterValue = match.groups?.['table_name'] ?? fieldValue; + Object.assign(routingParameter, {table_name: parameterValue}); + } + } + } + { + const fieldValue = request.materializedViewName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?projects/[^/]+/instances/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['name'] ?? fieldValue; + Object.assign(routingParameter, {name: parameterValue}); + } + } + } + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams(routingParameter); + this.initialize().catch(err => { + throw err; + }); + this._log.info('sampleRowKeys stream %j', options); + return this.innerApiCalls.sampleRowKeys(request, options); + } + + /** + * Mutates multiple rows in a batch. Each individual row is mutated + * atomically as in MutateRow, but the entire batch is not executed + * atomically. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.tableName] + * Optional. The unique name of the table to which the mutations should be + * applied. + * + * Values are of the form + * `projects//instances//tables/
`. + * @param {string} [request.authorizedViewName] + * Optional. The unique name of the AuthorizedView to which the mutations + * should be applied. + * + * Values are of the form + * `projects//instances//tables/
/authorizedViews/`. + * @param {string} request.appProfileId + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @param {number[]} request.entries + * Required. The row keys and corresponding mutations to be applied in bulk. + * Each entry is applied as an atomic mutation, but the entries may be + * applied in arbitrary order (even between entries for the same row). + * At least one entry must be specified, and in total the entries can + * contain at most 100000 mutations. + * @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 {@link protos.google.bigtable.v2.MutateRowsResponse|MutateRowsResponse} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + */ + mutateRows( + request?: protos.google.bigtable.v2.IMutateRowsRequest, + options?: CallOptions, + ): gax.CancellableStream { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.tableName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match( + RegExp( + '(?projects/[^/]+/instances/[^/]+/tables/[^/]+)', + ), + ); + if (match) { + const parameterValue = match.groups?.['table_name'] ?? fieldValue; + Object.assign(routingParameter, {table_name: parameterValue}); + } + } + } + { + const fieldValue = request.appProfileId; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?.*)')); + if (match) { + const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; + Object.assign(routingParameter, {app_profile_id: parameterValue}); + } + } + } + { + const fieldValue = request.authorizedViewName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match( + RegExp( + '(?projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?', + ), + ); + if (match) { + const parameterValue = match.groups?.['table_name'] ?? fieldValue; + Object.assign(routingParameter, {table_name: parameterValue}); + } + } + } + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams(routingParameter); + this.initialize().catch(err => { + throw err; + }); + this._log.info('mutateRows stream %j', options); + return this.innerApiCalls.mutateRows(request, options); + } + + /** + * Returns the current list of partitions that make up the table's + * change stream. The union of partitions will cover the entire keyspace. + * Partitions can be read with `ReadChangeStream`. + * NOTE: This API is only intended to be used by Apache Beam BigtableIO. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tableName + * Required. The unique name of the table from which to get change stream + * partitions. Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. + * @param {string} request.appProfileId + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * Single cluster routing must be configured on the profile. + * @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 {@link protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse|GenerateInitialChangeStreamPartitionsResponse} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + */ + generateInitialChangeStreamPartitions( + request?: protos.google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest, + options?: CallOptions, + ): gax.CancellableStream { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + table_name: request.tableName ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('generateInitialChangeStreamPartitions stream %j', options); + return this.innerApiCalls.generateInitialChangeStreamPartitions( + request, + options, + ); + } + + /** + * Reads changes from a table's change stream. Changes will + * reflect both user-initiated mutations and mutations that are caused by + * garbage collection. + * NOTE: This API is only intended to be used by Apache Beam BigtableIO. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tableName + * Required. The unique name of the table from which to read a change stream. + * Values are of the form + * `projects//instances//tables/
`. + * Change streaming must be enabled on the table. + * @param {string} request.appProfileId + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * Single cluster routing must be configured on the profile. + * @param {google.bigtable.v2.StreamPartition} request.partition + * The partition to read changes from. + * @param {google.protobuf.Timestamp} request.startTime + * Start reading the stream at the specified timestamp. This timestamp must + * be within the change stream retention period, less than or equal to the + * current time, and after change stream creation, whichever is greater. + * This value is inclusive and will be truncated to microsecond granularity. + * @param {google.bigtable.v2.StreamContinuationTokens} request.continuationTokens + * Tokens that describe how to resume reading a stream where reading + * previously left off. If specified, changes will be read starting at the + * the position. Tokens are delivered on the stream as part of `Heartbeat` + * and `CloseStream` messages. + * + * If a single token is provided, the token's partition must exactly match + * the request's partition. If multiple tokens are provided, as in the case + * of a partition merge, the union of the token partitions must exactly + * cover the request's partition. Otherwise, INVALID_ARGUMENT will be + * returned. + * @param {google.protobuf.Timestamp} request.endTime + * If specified, OK will be returned when the stream advances beyond + * this time. Otherwise, changes will be continuously delivered on the stream. + * This value is inclusive and will be truncated to microsecond granularity. + * @param {google.protobuf.Duration} request.heartbeatDuration + * If specified, the duration between `Heartbeat` messages on the stream. + * Otherwise, defaults to 5 seconds. + * @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 {@link protos.google.bigtable.v2.ReadChangeStreamResponse|ReadChangeStreamResponse} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + */ + readChangeStream( + request?: protos.google.bigtable.v2.IReadChangeStreamRequest, + options?: CallOptions, + ): gax.CancellableStream { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + table_name: request.tableName ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('readChangeStream stream %j', options); + return this.innerApiCalls.readChangeStream(request, options); + } + + /** + * Executes a SQL query against a particular Bigtable instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceName + * Required. The unique name of the instance against which the query should be + * executed. + * Values are of the form `projects//instances/` + * @param {string} [request.appProfileId] + * Optional. This value specifies routing for replication. If not specified, + * the `default` application profile will be used. + * @param {string} request.query + * Required. The query string. + * + * Exactly one of `query` and `prepared_query` is required. Setting both + * or neither is an `INVALID_ARGUMENT`. + * @param {Buffer} request.preparedQuery + * A prepared query that was returned from `PrepareQueryResponse`. + * + * Exactly one of `query` and `prepared_query` is required. Setting both + * or neither is an `INVALID_ARGUMENT`. + * + * Setting this field also places restrictions on several other fields: + * - `data_format` must be empty. + * - `validate_only` must be false. + * - `params` must match the `param_types` set in the `PrepareQueryRequest`. + * @param {google.bigtable.v2.ProtoFormat} request.protoFormat + * Protocol buffer format as described by ProtoSchema and ProtoRows + * messages. + * @param {Buffer} [request.resumeToken] + * Optional. If this request is resuming a previously interrupted query + * execution, `resume_token` should be copied from the last + * PartialResultSet yielded before the interruption. Doing this + * enables the query execution to resume where the last one left + * off. + * The rest of the request parameters must exactly match the + * request that yielded this token. Otherwise the request will fail. + * @param {number[]} request.params + * Required. params contains string type keys and Bigtable type values that + * bind to placeholders in the query string. In query string, a parameter + * placeholder consists of the + * `@` character followed by the parameter name (for example, `@firstName`) in + * the query string. + * + * For example, if + * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}` + * then `@firstName` will be replaced with googlesql bytes value "foo" in the + * query string during query evaluation. + * + * If `Value.kind` is not set, the value is treated as a NULL value of the + * given type. For example, if + * `params["firstName"] = type {string_type {}}` + * then `@firstName` will be replaced with googlesql null string. + * + * If `query` is set, any empty `Value.type` in the map will be rejected with + * `INVALID_ARGUMENT`. + * + * If `prepared_query` is set, any empty `Value.type` in the map will be + * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty + * `Value.type` must match the corresponding `param_types` entry, or be + * rejected with `INVALID_ARGUMENT`. + * @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 {@link protos.google.bigtable.v2.ExecuteQueryResponse|ExecuteQueryResponse} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + */ + executeQuery( + request?: protos.google.bigtable.v2.IExecuteQueryRequest, + options?: CallOptions, + ): gax.CancellableStream { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.instanceName; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?projects/[^/]+/instances/[^/]+)')); + if (match) { + const parameterValue = match.groups?.['name'] ?? fieldValue; + Object.assign(routingParameter, {name: parameterValue}); + } + } + } + { + const fieldValue = request.appProfileId; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('(?.*)')); + if (match) { + const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; + Object.assign(routingParameter, {app_profile_id: parameterValue}); + } + } + } + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams(routingParameter); + this.initialize().catch(err => { + throw err; + }); + this._log.info('executeQuery stream %j', options); + return this.innerApiCalls.executeQuery(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified authorizedView resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} table + * @param {string} authorized_view + * @returns {string} Resource name string. + */ + authorizedViewPath( + project: string, + instance: string, + table: string, + authorizedView: string, + ) { + return this.pathTemplates.authorizedViewPathTemplate.render({ + project: project, + instance: instance, + table: table, + authorized_view: authorizedView, + }); + } + + /** + * Parse the project from AuthorizedView resource. + * + * @param {string} authorizedViewName + * A fully-qualified path representing AuthorizedView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthorizedViewName(authorizedViewName: string) { + return this.pathTemplates.authorizedViewPathTemplate.match( + authorizedViewName, + ).project; + } + + /** + * Parse the instance from AuthorizedView resource. + * + * @param {string} authorizedViewName + * A fully-qualified path representing AuthorizedView resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromAuthorizedViewName(authorizedViewName: string) { + return this.pathTemplates.authorizedViewPathTemplate.match( + authorizedViewName, + ).instance; + } + + /** + * Parse the table from AuthorizedView resource. + * + * @param {string} authorizedViewName + * A fully-qualified path representing AuthorizedView resource. + * @returns {string} A string representing the table. + */ + matchTableFromAuthorizedViewName(authorizedViewName: string) { + return this.pathTemplates.authorizedViewPathTemplate.match( + authorizedViewName, + ).table; + } + + /** + * Parse the authorized_view from AuthorizedView resource. + * + * @param {string} authorizedViewName + * A fully-qualified path representing AuthorizedView resource. + * @returns {string} A string representing the authorized_view. + */ + matchAuthorizedViewFromAuthorizedViewName(authorizedViewName: string) { + return this.pathTemplates.authorizedViewPathTemplate.match( + authorizedViewName, + ).authorized_view; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project: string, instance: string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified materializedView resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} materialized_view + * @returns {string} Resource name string. + */ + materializedViewPath( + project: string, + instance: string, + materializedView: string, + ) { + return this.pathTemplates.materializedViewPathTemplate.render({ + project: project, + instance: instance, + materialized_view: materializedView, + }); + } + + /** + * Parse the project from MaterializedView resource. + * + * @param {string} materializedViewName + * A fully-qualified path representing MaterializedView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMaterializedViewName(materializedViewName: string) { + return this.pathTemplates.materializedViewPathTemplate.match( + materializedViewName, + ).project; + } + + /** + * Parse the instance from MaterializedView resource. + * + * @param {string} materializedViewName + * A fully-qualified path representing MaterializedView resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromMaterializedViewName(materializedViewName: string) { + return this.pathTemplates.materializedViewPathTemplate.match( + materializedViewName, + ).instance; + } + + /** + * Parse the materialized_view from MaterializedView resource. + * + * @param {string} materializedViewName + * A fully-qualified path representing MaterializedView resource. + * @returns {string} A string representing the materialized_view. + */ + matchMaterializedViewFromMaterializedViewName(materializedViewName: string) { + return this.pathTemplates.materializedViewPathTemplate.match( + materializedViewName, + ).materialized_view; + } + + /** + * Return a fully-qualified table resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} table + * @returns {string} Resource name string. + */ + tablePath(project: string, instance: string, table: string) { + return this.pathTemplates.tablePathTemplate.render({ + project: project, + instance: instance, + table: table, + }); + } + + /** + * Parse the project from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).project; + } + + /** + * Parse the instance from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).instance; + } + + /** + * Parse the table from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the table. + */ + matchTableFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).table; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.bigtableStub && !this._terminated) { + return this.bigtableStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/handwritten/bigtable/src/v2/bigtable_client_config.json b/handwritten/bigtable/src/v2/bigtable_client_config.json new file mode 100644 index 00000000000..381964239e3 --- /dev/null +++ b/handwritten/bigtable/src/v2/bigtable_client_config.json @@ -0,0 +1,88 @@ +{ + "interfaces": { + "google.bigtable.v2.Bigtable": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "5af39a0f6db447f61c4f695240caeccb74f78362": { + "initial_retry_delay_millis": 10, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ReadRows": { + "timeout_millis": 43200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SampleRowKeys": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MutateRow": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "5af39a0f6db447f61c4f695240caeccb74f78362" + }, + "MutateRows": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CheckAndMutateRow": { + "timeout_millis": 20000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PingAndWarm": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadModifyWriteRow": { + "timeout_millis": 20000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GenerateInitialChangeStreamPartitions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadChangeStream": { + "timeout_millis": 43200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PrepareQuery": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExecuteQuery": { + "timeout_millis": 43200000, + "retry_codes_name": "idempotent", + "retry_params_name": "5af39a0f6db447f61c4f695240caeccb74f78362" + } + } + } + } +} diff --git a/handwritten/bigtable/src/v2/bigtable_instance_admin_client.ts b/handwritten/bigtable/src/v2/bigtable_instance_admin_client.ts new file mode 100644 index 00000000000..33f7b8d9c62 --- /dev/null +++ b/handwritten/bigtable/src/v2/bigtable_instance_admin_client.ts @@ -0,0 +1,21 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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. ** + +// This is a shim to be removed later, in case anyone was importing +// it directly from this spot. +export * from '../admin/v2/bigtable_instance_admin_client'; diff --git a/handwritten/bigtable/src/v2/bigtable_proto_list.json b/handwritten/bigtable/src/v2/bigtable_proto_list.json new file mode 100644 index 00000000000..da64d9b04ca --- /dev/null +++ b/handwritten/bigtable/src/v2/bigtable_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/bigtable/v2/bigtable.proto", + "../../protos/google/bigtable/v2/data.proto", + "../../protos/google/bigtable/v2/feature_flags.proto", + "../../protos/google/bigtable/v2/peer_info.proto", + "../../protos/google/bigtable/v2/request_stats.proto", + "../../protos/google/bigtable/v2/response_params.proto", + "../../protos/google/bigtable/v2/types.proto" +] diff --git a/handwritten/bigtable/src/v2/bigtable_table_admin_client.ts b/handwritten/bigtable/src/v2/bigtable_table_admin_client.ts new file mode 100644 index 00000000000..6589ecd1f20 --- /dev/null +++ b/handwritten/bigtable/src/v2/bigtable_table_admin_client.ts @@ -0,0 +1,21 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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. ** + +// This is a shim to be removed later, in case anyone was importing +// it directly from this spot. +export * from '../admin/v2/bigtable_table_admin_client'; diff --git a/handwritten/bigtable/src/v2/gapic_metadata.json b/handwritten/bigtable/src/v2/gapic_metadata.json new file mode 100644 index 00000000000..84052e03ada --- /dev/null +++ b/handwritten/bigtable/src/v2/gapic_metadata.json @@ -0,0 +1,103 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.bigtable.v2", + "libraryPackage": "@google-cloud/bigtable", + "services": { + "Bigtable": { + "clients": { + "grpc": { + "libraryClient": "BigtableClient", + "rpcs": { + "MutateRow": { + "methods": [ + "mutateRow" + ] + }, + "CheckAndMutateRow": { + "methods": [ + "checkAndMutateRow" + ] + }, + "PingAndWarm": { + "methods": [ + "pingAndWarm" + ] + }, + "ReadModifyWriteRow": { + "methods": [ + "readModifyWriteRow" + ] + }, + "PrepareQuery": { + "methods": [ + "prepareQuery" + ] + }, + "ReadRows": { + "methods": [ + "readRows" + ] + }, + "SampleRowKeys": { + "methods": [ + "sampleRowKeys" + ] + }, + "MutateRows": { + "methods": [ + "mutateRows" + ] + }, + "GenerateInitialChangeStreamPartitions": { + "methods": [ + "generateInitialChangeStreamPartitions" + ] + }, + "ReadChangeStream": { + "methods": [ + "readChangeStream" + ] + }, + "ExecuteQuery": { + "methods": [ + "executeQuery" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BigtableClient", + "rpcs": { + "MutateRow": { + "methods": [ + "mutateRow" + ] + }, + "CheckAndMutateRow": { + "methods": [ + "checkAndMutateRow" + ] + }, + "PingAndWarm": { + "methods": [ + "pingAndWarm" + ] + }, + "ReadModifyWriteRow": { + "methods": [ + "readModifyWriteRow" + ] + }, + "PrepareQuery": { + "methods": [ + "prepareQuery" + ] + } + } + } + } + } + } +} diff --git a/handwritten/bigtable/src/v2/index.ts b/handwritten/bigtable/src/v2/index.ts new file mode 100644 index 00000000000..693dfacef7a --- /dev/null +++ b/handwritten/bigtable/src/v2/index.ts @@ -0,0 +1,21 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {BigtableInstanceAdminClient} from '../admin/v2/bigtable_instance_admin_client'; +export {BigtableTableAdminClient} from '../admin/v2/bigtable_table_admin_client'; +export {BigtableClient} from './bigtable_client'; diff --git a/handwritten/bigtable/system-test/app-profile.ts b/handwritten/bigtable/system-test/app-profile.ts new file mode 100644 index 00000000000..6c328649719 --- /dev/null +++ b/handwritten/bigtable/system-test/app-profile.ts @@ -0,0 +1,145 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {describe, it, before, after} from 'mocha'; +import {generateId} from './common'; +import {AppProfileOptions, Bigtable, Instance} from '../src'; +import {AppProfile} from '../src'; +import assert = require('assert'); + +describe('📦 App Profile', () => { + const bigtable = new Bigtable(); + + describe('📦 Create a profile', () => { + let instance: Instance; + let clusterIds: string[]; + + // Creates an app profile and returns information containing the app profile response. + async function createProfile( + instance: Instance, + options: AppProfileOptions, + ): Promise { + const appProfileId = generateId('app-profile'); + await instance.createAppProfile(appProfileId, options); + const appProfile = instance.appProfile(appProfileId); + const getAppProfileResponse = await appProfile.get(); + return getAppProfileResponse[0]; + } + + before(async () => { + // Creates an instance with clusters + const instanceClusters = [ + 'us-east1-c', + 'us-central2-b', + 'us-west1-b', + ].map(location => { + return { + id: generateId('cluster'), + location, + }; + }); + clusterIds = instanceClusters.map(cluster => cluster.id); + const instanceId = generateId('instance'); + instance = bigtable.instance(instanceId); + const [, operation] = await instance.create({ + clusters: instanceClusters.map(cluster => { + return { + ...cluster, + nodes: 1, + }; + }), + labels: { + time_created: Date.now(), + }, + }); + await operation.promise(); + }); + + after(async () => { + await instance.delete(); + }); + + it('should create a profile with a single cluster', async () => { + const options = { + routing: instance.cluster(clusterIds[1]), + }; + const appProfile = await createProfile(instance, options); + assert.deepStrictEqual( + appProfile.metadata?.singleClusterRouting?.clusterId, + options.routing.id, + ); + }); + + it('should create a profile with multiple clusters', async () => { + const options = { + routing: new Set([ + instance.cluster(clusterIds[1]), + instance.cluster(clusterIds[2]), + ]), + }; + const appProfile = await createProfile(instance, options); + assert.deepStrictEqual( + new Set(appProfile.metadata?.multiClusterRoutingUseAny?.clusterIds), + new Set([...options.routing].map(cluster => cluster.id)), + ); + }); + + it('should create a profile with multiple clusters using strings', async () => { + const options = { + routing: new Set([clusterIds[1], clusterIds[2]]), + }; + const appProfile = await createProfile(instance, options); + assert.deepStrictEqual( + new Set(appProfile.metadata?.multiClusterRoutingUseAny?.clusterIds), + new Set([...options.routing]), + ); + }); + + it('should create a profile with no clusters', async () => { + const options: {routing: 'any'} = { + routing: 'any', + }; + const appProfile = await createProfile(instance, options); + assert.deepStrictEqual( + appProfile.metadata?.multiClusterRoutingUseAny?.clusterIds, + [], + ); + }); + + it('should ensure clusters match an updated profile', async () => { + const options = { + routing: instance.cluster(clusterIds[1]), + }; + const appProfile = await createProfile(instance, options); + assert.deepStrictEqual( + appProfile.metadata?.singleClusterRouting?.clusterId, + clusterIds[1], + ); + const newOptions = { + routing: new Set([ + instance.cluster(clusterIds[1]), + instance.cluster(clusterIds[2]), + ]), + }; + await appProfile.setMetadata(newOptions); + const appProfileAfterUpdate = (await appProfile.get())[0]; + assert.deepStrictEqual( + new Set( + appProfileAfterUpdate.metadata?.multiClusterRoutingUseAny?.clusterIds, + ), + new Set([...newOptions.routing].map(cluster => cluster.id)), + ); + }); + }); +}); diff --git a/handwritten/bigtable/system-test/bigtable.ts b/handwritten/bigtable/system-test/bigtable.ts new file mode 100644 index 00000000000..e83489adbc7 --- /dev/null +++ b/handwritten/bigtable/system-test/bigtable.ts @@ -0,0 +1,2665 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {replaceProjectIdToken} from '@google-cloud/projectify'; +import {PreciseDate} from '@google-cloud/precise-date'; +import * as assert from 'assert'; +import {beforeEach, afterEach, describe, it, before, after} from 'mocha'; + +import { + Backup, + BackupTimestamp, + Bigtable, + Entry, + Instance, + InstanceOptions, + MutateOptions, + SqlTypes, +} from '../src'; +import {Mutation} from '../src/mutation'; +import {AppProfile} from '../src/app-profile.js'; +import {CopyBackupConfig} from '../src/backup.js'; +import {Cluster} from '../src/cluster.js'; +import {Family} from '../src/family.js'; +import {Row} from '../src/row.js'; +import {Table} from '../src/table.js'; +import {RawFilter} from '../src/filter'; +import {generateId, PREFIX} from './common'; +import {BigtableTableAdminClient} from '../src/v2'; +import {ServiceError} from 'google-gax'; +import {BigtableDate, QueryResultRow} from '../src/execute-query/values'; +import {google} from '../protos/protos'; + +type IBackup = google.bigtable.admin.v2.IBackup; + +describe('Bigtable', () => { + const bigtable = new Bigtable(); + const INSTANCE = bigtable.instance(generateId('instance')); + const DIFF_INSTANCE = bigtable.instance(generateId('d-inst')); + const CMEK_INSTANCE = bigtable.instance(generateId('cmek')); + const INSTANCE_HDD = bigtable.instance(generateId('inst-hdd')); + const TABLE = INSTANCE.table(generateId('table')); + const TABLE_HDD = INSTANCE_HDD.table(generateId('table-hdd')); + const APP_PROFILE_ID = generateId('appProfile'); + const APP_PROFILE = INSTANCE.appProfile(APP_PROFILE_ID); + const CLUSTER_ID = generateId('cluster'); + const CLUSTER_ID_HDD = generateId('cluster'); + + async function reapBackups(instance: Instance) { + try { + const [backups] = await instance.getBackups(); + for (const backup of backups) { + try { + await backup.delete({timeout: 50 * 1000}); + } catch (e) { + console.log(`Error deleting backup: ${backup.id}: ${e}`); + } + } + } catch (e) { + console.error(`Error listing backups from ${instance.name}: ${e}`); + } + } + + async function reapInstances() { + const [instances] = await bigtable.getInstances(); + const testInstances = instances + .filter(i => i.id.match(PREFIX)) + .filter(i => { + const timeCreated = i.metadata!.labels!.time_created as {} as Date; + // Only delete stale resources. + const oneHourAgo = new Date(Date.now() - 3600000); + return !timeCreated || timeCreated <= oneHourAgo; + }); + // need to delete backups first due to instance deletion precondition + const deleteBackupPromises = testInstances.map(instance => + reapBackups(instance), + ); + for (const backupPromise of deleteBackupPromises) { + await backupPromise; + } + for (const instance of testInstances) { + try { + await instance.delete(); + } catch (e) { + console.log(`Error deleting instance: ${instance.id}`); + } + } + } + + before(async () => { + await reapInstances(); + const [, operation] = await INSTANCE.create({ + clusters: [ + { + id: CLUSTER_ID, + location: 'us-central2-c', + nodes: 3, + storage: 'ssd', + }, + ], + labels: { + time_created: Date.now(), + }, + }); + const [, operationHDD] = await INSTANCE_HDD.create({ + clusters: [ + { + id: CLUSTER_ID_HDD, + location: 'us-central2-c', + nodes: 3, + storage: 'hdd', + }, + ], + labels: { + time_created: Date.now(), + }, + }); + + await Promise.all([operation.promise(), operationHDD.promise()]); + await TABLE.create({ + families: ['follows', 'traits'], + }); + await TABLE_HDD.create({ + families: ['follows', 'traits'], + }); + await INSTANCE.createAppProfile(APP_PROFILE_ID, { + routing: 'any', + ignoreWarnings: true, + }); + }); + + after(async () => { + const q = []; + const instances = [INSTANCE, DIFF_INSTANCE, CMEK_INSTANCE, INSTANCE_HDD]; + + // need to delete backups first due to instance deletion precondition + await Promise.all(instances.map(instance => reapBackups(instance))); + await Promise.all( + instances.map(instance => { + q.push(async () => { + try { + await instance.delete(); + } catch (e) { + console.log(`Error deleting instance: ${instance.id}`); + } + }); + }), + ); + }); + + describe('instances', () => { + it('should get a list of instances', async () => { + const [instances, failedLocations] = await bigtable.getInstances(); + assert(instances.length > 0); + assert(Array.isArray(failedLocations)); + }); + + it('should check if an instance exists', async () => { + const [exists] = await INSTANCE.exists(); + assert.strictEqual(exists, true); + }); + + it('should check if an instance does not exist', async () => { + const instance = bigtable.instance('fake-instance'); + const [exists] = await instance.exists(); + assert.strictEqual(exists, false); + }); + + it('should get a single instance', async () => { + await INSTANCE.get(); + }); + + it('should update an instance', async () => { + const metadata = { + displayName: 'metadata-test', + }; + await INSTANCE.setMetadata(metadata); + const [metadata_] = await INSTANCE.getMetadata(); + assert.strictEqual(metadata.displayName, metadata_.displayName); + }); + + it('should get an Iam Policy for the instance', async () => { + const policyProperties = ['version', 'bindings', 'etag']; + const [policy] = await INSTANCE.getIamPolicy(); + policyProperties.forEach(property => { + assert(property in policy); + }); + }); + + it('should test Iam permissions for the instance', async () => { + const permissions = ['bigtable.tables.get', 'bigtable.tables.readRows']; + const [grantedPermissions] = + await INSTANCE.testIamPermissions(permissions); + assert.strictEqual(grantedPermissions.length, permissions.length); + permissions.forEach(permission => { + assert.strictEqual(grantedPermissions.includes(permission), true); + }); + }); + + it('should set Iam Policy on the instance', async () => { + const instance = bigtable.instance(generateId('instance')); + const clusteId = generateId('cluster'); + const [, operation] = await instance.create({ + clusters: [ + { + id: clusteId, + location: 'us-central2-c', + nodes: 3, + }, + ], + labels: { + time_created: Date.now(), + }, + }); + await operation.promise(); + + const [policy] = await instance.getIamPolicy(); + const [updatedPolicy] = await instance.setIamPolicy(policy); + Object.keys(policy).forEach(key => assert(key in updatedPolicy)); + + await instance.delete(); + }); + }); + + describe('CMEK', () => { + let kmsKeyName: string; + + const CMEK_CLUSTER = CMEK_INSTANCE.cluster(generateId('cluster')); + + const cryptoKeyId = generateId('key'); + const keyRingId = generateId('key-ring'); + let keyRingsBaseUrl: string; + let cryptoKeyVersionName: string; + + before(async () => { + const projectId = await bigtable.auth.getProjectId(); + kmsKeyName = `projects/${projectId}/locations/us-central2/keyRings/${keyRingId}/cryptoKeys/${cryptoKeyId}`; + keyRingsBaseUrl = `https://cloudkms.googleapis.com/v1/projects/${projectId}/locations/us-central2/keyRings`; + + await bigtable.auth.request({ + method: 'POST', + url: keyRingsBaseUrl, + params: {keyRingId}, + }); + + const resp = await bigtable.auth.request({ + method: 'POST', + url: `${keyRingsBaseUrl}/${keyRingId}/cryptoKeys`, + params: {cryptoKeyId}, + data: {purpose: 'ENCRYPT_DECRYPT'}, + }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cryptoKeyVersionName = (resp.data as any).primary.name; + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const [_, operation] = await CMEK_INSTANCE.create({ + clusters: [ + { + id: CMEK_CLUSTER.id, + location: 'us-central2-a', + nodes: 3, + key: kmsKeyName, + }, + ], + labels: { + time_created: Date.now(), + }, + }); + await operation.promise(); + }); + + after(async () => { + await bigtable.auth.request({ + method: 'POST', + url: `${keyRingsBaseUrl}/${keyRingId}/cryptoKeys/${cryptoKeyId}/cryptoKeyVersions/${cryptoKeyVersionName + .split('/') + .pop()}:destroy`, + params: {name: cryptoKeyVersionName}, + }); + }); + + it('should have created an instance', async () => { + const [metadata] = await CMEK_CLUSTER.getMetadata(); + assert.deepStrictEqual(metadata.encryptionConfig, {kmsKeyName}); + }); + + it('should create a cluster', async () => { + const cluster = CMEK_INSTANCE.cluster(generateId('cluster')); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const [_, operation] = await cluster.create({ + location: 'us-central2-b', + nodes: 3, + key: kmsKeyName, + }); + await operation.promise(); + + const [metadata] = await cluster.getMetadata(); + assert.deepStrictEqual(metadata.encryptionConfig, {kmsKeyName}); + }); + + it('should fail if key not provided', async () => { + const cluster = CMEK_INSTANCE.cluster(generateId('cluster')); + + try { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const [_, operation] = await cluster.create({ + location: 'us-central2-b', + nodes: 3, + }); + await operation.promise(); + throw new Error('Cluster creation should not have succeeded'); + } catch (e) { + assert( + (e as Error).message.includes( + 'default keys and CMEKs are not allowed', + ), + ); + } + }); + }); + + describe('appProfiles', () => { + it('should retrieve a list of app profiles', async () => { + const [appProfiles] = await INSTANCE.getAppProfiles(); + assert(appProfiles[0] instanceof AppProfile); + assert(appProfiles.length > 0); + }); + + it('should retrieve a list of app profiles in stream mode', done => { + const appProfiles: AppProfile[] = []; + INSTANCE.getAppProfilesStream() + .on('error', done) + .on('data', appProfile => { + assert(appProfile instanceof AppProfile); + appProfiles.push(appProfile); + }) + .on('end', () => { + assert(appProfiles.length > 0); + done(); + }); + }); + + it('should check if an app profile exists', async () => { + const [exists] = await APP_PROFILE.exists(); + assert.strictEqual(exists, true); + }); + + it('should check if an app profile does not exist', async () => { + const appProfile = INSTANCE.appProfile('should-not-exist'); + const [exists] = await appProfile.exists(); + assert.strictEqual(exists, false); + }); + + it('should get an app profile', async () => { + await APP_PROFILE.get(); + }); + + it('should delete an app profile', async () => { + const appProfile = INSTANCE.appProfile(generateId('app-profile')); + await appProfile.create({ + routing: 'any', + ignoreWarnings: true, + }); + await appProfile.delete({ignoreWarnings: true}); + }); + + it('should get the app profiles metadata', async () => { + const [metadata] = await APP_PROFILE.getMetadata(); + assert.strictEqual( + metadata.name, + APP_PROFILE.name.replace('{{projectId}}', bigtable.projectId), + ); + }); + + it('should update an app profile', async () => { + const cluster = INSTANCE.cluster(CLUSTER_ID); + const options = { + routing: cluster, + allowTransactionalWrites: true, + description: 'My Updated App Profile', + }; + await APP_PROFILE.setMetadata(options); + const [updatedAppProfile] = await APP_PROFILE.get(); + assert.strictEqual( + updatedAppProfile.metadata!.description, + options.description, + ); + assert.deepStrictEqual(updatedAppProfile.metadata!.singleClusterRouting, { + clusterId: CLUSTER_ID, + allowTransactionalWrites: true, + }); + }); + }); + + describe('clusters', () => { + let CLUSTER: Cluster; + + beforeEach(() => { + CLUSTER = INSTANCE.cluster(CLUSTER_ID); + }); + + it('should retrieve a list of clusters', async () => { + const [clusters] = await INSTANCE.getClusters(); + assert(clusters[0] instanceof Cluster); + }); + + it('should check if a cluster exists', async () => { + const [exists] = await CLUSTER.exists(); + assert.strictEqual(exists, true); + }); + + it('should check if a cluster does not exist', async () => { + const cluster = INSTANCE.cluster('fake-cluster'); + const [exists] = await cluster.exists(); + assert.strictEqual(exists, false); + }); + + it('should get a cluster', async () => { + await CLUSTER.get(); + }); + + it('should update a cluster', async () => { + const metadata = { + nodes: 4, + }; + const [operation] = await CLUSTER.setMetadata(metadata); + await operation.promise(); + const [_metadata] = await CLUSTER.getMetadata(); + assert.strictEqual(metadata.nodes, _metadata.serveNodes); + }); + }); + + describe('tables', () => { + it('should retrieve a list of tables', async () => { + const [tables] = await INSTANCE.getTables(); + assert(tables[0] instanceof Table); + }); + + it('should retrieve a list of tables in stream mode', done => { + const tables: Table[] = []; + INSTANCE.getTablesStream() + .on('error', done) + .on('data', table => { + assert(table instanceof Table); + tables.push(table); + }) + .on('end', () => { + assert(tables.length > 0); + done(); + }); + }); + + it('should check if a table exists', async () => { + const [exists] = await TABLE.exists(); + assert.strictEqual(exists, true); + }); + + it('should check if a table does not exist', async () => { + const table = INSTANCE.table('should-not-exist'); + const [exists] = await table.exists(); + assert.strictEqual(exists, false); + }); + + it('should get a table', async () => { + await TABLE.get(); + }); + + it('should get an Iam Policy for the table', async () => { + const policyProperties = ['version', 'bindings', 'etag']; + const [policy] = await TABLE.getIamPolicy(); + policyProperties.forEach(property => { + assert(property in policy); + }); + }); + + it('should test Iam permissions for the table', async () => { + const permissions = ['bigtable.tables.get', 'bigtable.tables.readRows']; + const [grantedPermissions] = await TABLE.testIamPermissions(permissions); + assert.strictEqual(grantedPermissions.length, permissions.length); + permissions.forEach(permission => { + assert.strictEqual(grantedPermissions.includes(permission), true); + }); + }); + + it('should set Iam Policy on the table', async () => { + const table = INSTANCE.table(generateId('table')); + await table.create(); + + const [policy] = await table.getIamPolicy(); + const [updatedPolicy] = await table.setIamPolicy(policy); + Object.keys(policy).forEach(key => assert(key in updatedPolicy)); + + await table.delete(); + }); + + it('should delete a table', async () => { + const table = INSTANCE.table(generateId('table')); + await table.create(); + await table.delete(); + }); + + it('should get the tables metadata', async () => { + const [metadata] = await TABLE.getMetadata(); + assert.strictEqual( + metadata.name, + TABLE.name.replace('{{projectId}}', bigtable.projectId), + ); + }); + + it('should create a table with column family data', async () => { + const name = generateId('table'); + const options = { + families: ['test'], + }; + const [table] = await INSTANCE.createTable(name, options); + assert(table.metadata!.columnFamilies!.test); + }); + + it('should create a table if autoCreate is true', async () => { + const table = INSTANCE.table(generateId('table')); + await table.get({autoCreate: true}); + await table.delete(); + }); + }); + + describe('consistency tokens', () => { + it('should generate consistency token', async () => { + const [token] = await TABLE.generateConsistencyToken(); + assert.strictEqual(typeof token, 'string'); + }); + + it('should return error for checkConsistency of invalid token', done => { + TABLE.checkConsistency('dummy-token', err => { + assert.strictEqual(err!.code, 3); + done(); + }); + }); + + it('should return boolean for checkConsistency of token', async () => { + const [token] = await TABLE.generateConsistencyToken(); + const [res] = await TABLE.checkConsistency(token); + assert.strictEqual(typeof res, 'boolean'); + }); + + it('should return boolean for waitForReplication', async () => { + const [res] = await TABLE.waitForReplication(); + assert.strictEqual(typeof res, 'boolean'); + }); + }); + + describe('consistency tokens with gapic', () => { + // We want to work with the gapic admin class for this version. + const tableAdmin = bigtable.admin.getTableAdminClient(); + + it('should wait for consistency without an existing token', async () => { + await tableAdmin.waitForConsistency( + replaceProjectIdToken(TABLE.name, bigtable.projectId), + ); + }); + + it('should wait for consistency with an existing token', async () => { + const [token] = await tableAdmin.generateConsistencyToken({ + name: replaceProjectIdToken(TABLE.name, bigtable.projectId), + }); + await tableAdmin.waitForConsistency( + replaceProjectIdToken(TABLE.name, bigtable.projectId), + token.consistencyToken!, + ); + }); + }); + + describe('replication states', () => { + it('should get a map of clusterId and state', async () => { + const [clusterStates] = await TABLE.getReplicationStates(); + assert(clusterStates instanceof Map); + assert(clusterStates.has(CLUSTER_ID)); + }); + }); + + describe('column families', () => { + const FAMILY_ID = 'presidents'; + let FAMILY: Family; + + before(async () => { + FAMILY = TABLE.family(FAMILY_ID); + await FAMILY.create(); + }); + + it('should get a list of families', async () => { + const [families] = await TABLE.getFamilies(); + assert.strictEqual(families.length, 3); + assert(families[0] instanceof Family); + assert.notStrictEqual(-1, families.map(f => f.id).indexOf(FAMILY.id)); + }); + + it('should get a family', async () => { + const family = TABLE.family(FAMILY_ID); + await family.get(); + assert(family instanceof Family); + assert.strictEqual(family.name, FAMILY.name); + assert.strictEqual(family.id, FAMILY.id); + }); + + it('should check if a family exists', async () => { + const [exists] = await FAMILY.exists(); + assert.strictEqual(exists, true); + }); + + it('should check if a family does not exist', async () => { + const family = TABLE.family('prezzies'); + const [exists] = await family.exists(); + assert.strictEqual(exists, false); + }); + + it('should create a family if autoCreate is true', async () => { + const family = TABLE.family('prezzies'); + await family.get({autoCreate: true}); + await family.delete(); + }); + + it('should create a family with nested gc rules', async () => { + const family = TABLE.family('prezzies'); + const options = { + rule: { + union: true, + versions: 10, + rule: { + versions: 2, + age: {seconds: 60 * 60 * 24 * 30}, + }, + }, + }; + await family.create(options); + const [metadata] = await family.getMetadata(); + assert.deepStrictEqual(metadata.gcRule, { + union: { + rules: [ + { + maxNumVersions: 10, + rule: 'maxNumVersions', + }, + { + intersection: { + rules: [ + { + maxAge: { + seconds: '2592000', + nanos: 0, + }, + rule: 'maxAge', + }, + { + maxNumVersions: 2, + rule: 'maxNumVersions', + }, + ], + }, + rule: 'intersection', + }, + ], + }, + rule: 'union', + }); + await family.delete(); + }); + + it('should get the column family metadata', async () => { + const [metadata] = await FAMILY.getMetadata(); + assert.strictEqual(FAMILY.metadata, metadata); + }); + + it('should update a column family', async () => { + const rule = { + age: { + seconds: 10000, + nanos: 10000, + }, + }; + const [metadata] = await FAMILY.setMetadata({rule}); + const maxAge = metadata.gcRule!.maxAge; + assert.strictEqual(maxAge!.seconds, rule.age.seconds.toString()); + assert.strictEqual(maxAge!.nanos, rule.age.nanos); + }); + + it('should delete a column family', async () => { + await FAMILY.delete(); + }); + }); + + describe('rows', () => { + describe('.exists()', () => { + const row = TABLE.row('alincoln'); + + beforeEach(async () => { + await row.create({ + entry: { + follows: { + gwashington: 1, + jadams: 1, + tjefferson: 1, + }, + }, + }); + }); + + afterEach(async () => row.delete()); + + it('should check if a row exists', async () => { + const [exists] = await row.exists(); + assert.strictEqual(exists, true); + }); + + it('should check if a row does not exist', async () => { + const row = TABLE.row('gwashington'); + const [exists] = await row.exists(); + assert.strictEqual(exists, false); + }); + }); + + describe('inserting data', () => { + it('should insert rows', async () => { + const rows = [ + { + key: 'gwashington', + data: { + follows: { + jadams: 1, + }, + }, + }, + { + key: 'tjefferson', + data: { + follows: { + gwashington: 1, + jadams: 1, + }, + }, + }, + { + key: 'jadams', + data: { + follows: { + gwashington: 1, + tjefferson: 1, + }, + }, + }, + ]; + await TABLE.insert(rows); + }); + + it('should insert a large row', async () => { + await TABLE.insert({ + key: 'gwashington', + data: { + follows: { + jadams: Buffer.alloc(5000000), + }, + }, + }); + }); + + it('should create an individual row', async () => { + const row = TABLE.row('alincoln'); + const rowData = { + follows: { + gwashington: 1, + jadams: 1, + tjefferson: 1, + }, + }; + await row.create({entry: rowData}); + }); + + it('should insert individual cells', async () => { + const row = TABLE.row('gwashington'); + const rowData = { + follows: { + jadams: 1, + }, + }; + await row.save(rowData); + }); + + it('should allow for user specified timestamps', async () => { + const row = TABLE.row('gwashington'); + const rowData = { + follows: { + jadams: { + value: 1, + timestamp: new Date('March 22, 1986'), + }, + }, + }; + await row.save(rowData); + }); + + it('should increment a column value', async () => { + const row = TABLE.row('gwashington'); + const increment = 5; + const [value] = await row.increment('follows:increment', increment); + assert.strictEqual(value, increment); + }); + + it('should apply read/modify/write rules to a row', async () => { + const row = TABLE.row('gwashington'); + const rule = { + column: 'traits:teeth', + append: '-wood', + }; + await row.save({ + traits: { + teeth: 'shiny', + }, + }); + await row.createRules(rule); + const [data] = await row.get(['traits:teeth']); + assert.strictEqual(data.traits.teeth[0].value, 'shiny-wood'); + }); + + it('should check and mutate a row', async () => { + const row = TABLE.row('gwashington'); + const filter: RawFilter = { + family: 'follows', + value: 'alincoln', + }; + const mutations = [ + { + method: 'delete', + data: ['follows:alincoln'], + }, + ]; + const [matched] = await row.filter(filter, {onMatch: mutations}); + assert(matched); + }); + }); + + describe('fetching data', () => { + it('should execute a query', async () => { + const [preparedStatement] = await INSTANCE.prepareStatement({ + query: + 'SELECT @stringParam AS strCol, @bytesParam as bytesCol, @int64Param AS intCol, @doubleParam AS doubleCol,\n' + + '@floatParam AS floatCol, @boolParam AS boolCol, @tsParam AS tsCol, @dateParam AS dateCol,\n' + + '@byteArrayParam AS byteArrayCol, @stringArrayParam AS stringArrayCol, @intArrayParam AS intArrayCol,\n' + + '@floatArrayParam AS floatArrayCol, @doubleArrayParam AS doubleArrayCol, @boolArrayParam AS boolArrayCol,\n' + + '@tsArrayParam AS tsArrayCol, @dateArrayParam AS dateArrayCol', + parameterTypes: { + bytesParam: SqlTypes.Bytes(), + intArrayParam: SqlTypes.Array(SqlTypes.Int64()), + dateArrayParam: SqlTypes.Array(SqlTypes.Date()), + stringParam: SqlTypes.String(), + byteArrayParam: SqlTypes.Array(SqlTypes.Bytes()), + doubleArrayParam: SqlTypes.Array(SqlTypes.Float64()), + boolArrayParam: SqlTypes.Array(SqlTypes.Bool()), + doubleParam: SqlTypes.Float64(), + floatParam: SqlTypes.Float32(), + dateParam: SqlTypes.Date(), + floatArrayParam: SqlTypes.Array(SqlTypes.Float32()), + tsArrayParam: SqlTypes.Array(SqlTypes.Timestamp()), + int64Param: SqlTypes.Int64(), + boolParam: SqlTypes.Bool(), + tsParam: SqlTypes.Timestamp(), + stringArrayParam: SqlTypes.Array(SqlTypes.String()), + }, + }); + const params = { + bytesParam: Buffer.from('test'), + intArrayParam: [BigInt(1), BigInt(2), BigInt(3)], + dateArrayParam: [ + new BigtableDate(2025, 5, 14), + new BigtableDate(2025, 5, 13), + ], + stringParam: 'test', + byteArrayParam: [Buffer.from('test')], + doubleArrayParam: [1.0, 2.0, 3.0], + boolArrayParam: [true, false], + doubleParam: 1.0, + floatParam: 1.0, + dateParam: new BigtableDate(2025, 5, 14), + floatArrayParam: [1.0, 2.0, 3.0], + tsArrayParam: [ + new PreciseDate(Date.now()), + new PreciseDate(Date.now()), + ], + int64Param: BigInt(123), + boolParam: true, + tsParam: new PreciseDate(Date.now()), + stringArrayParam: ['test', 'test'], + }; + const [rows] = (await INSTANCE.executeQuery({ + preparedStatement, + parameters: params, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + })) as any as [Row[]]; + assert(rows[0] instanceof QueryResultRow); + assert.deepStrictEqual(rows[0].get('strCol'), params.stringParam); + assert.deepStrictEqual(rows[0].get('bytesCol'), params.bytesParam); + assert.deepStrictEqual(rows[0].get('intCol'), params.int64Param); + assert.deepStrictEqual(rows[0].get('doubleCol'), params.doubleParam); + assert.deepStrictEqual(rows[0].get('floatCol'), params.floatParam); + assert.deepStrictEqual(rows[0].get('boolCol'), params.boolParam); + assert.deepStrictEqual(rows[0].get('tsCol'), params.tsParam); + assert.deepStrictEqual(rows[0].get('dateCol'), params.dateParam); + assert.deepStrictEqual( + rows[0].get('byteArrayCol'), + params.byteArrayParam, + ); + assert.deepStrictEqual( + rows[0].get('stringArrayCol'), + params.stringArrayParam, + ); + assert.deepStrictEqual( + rows[0].get('intArrayCol'), + params.intArrayParam, + ); + assert.deepStrictEqual( + rows[0].get('floatArrayCol'), + params.floatArrayParam, + ); + assert.deepStrictEqual( + rows[0].get('doubleArrayCol'), + params.doubleArrayParam, + ); + assert.deepStrictEqual( + rows[0].get('boolArrayCol'), + params.boolArrayParam, + ); + assert.deepStrictEqual(rows[0].get('tsArrayCol'), params.tsArrayParam); + assert.deepStrictEqual( + rows[0].get('dateArrayCol'), + params.dateArrayParam, + ); + }); + it('should get rows', async () => { + const [rows] = await TABLE.getRows(); + assert.strictEqual(rows.length, 4); + assert(rows[0] instanceof Row); + }); + + it('should get rows via stream', done => { + const rows: Row[] = []; + TABLE.createReadStream() + .on('error', done) + .on('data', row => { + assert(row instanceof Row); + rows.push(row); + }) + .on('end', () => { + assert.strictEqual(rows.length, 4); + done(); + }); + }); + + it('should should cancel request if stream ended early', done => { + const rows: Row[] = []; + const stream = TABLE.createReadStream() + .on('error', done) + .on('data', row => { + stream.end(); + rows.push(row); + }) + .on('end', () => { + assert.strictEqual(rows.length, 1); + done(); + }); + }); + + it('should fetch an individual row', async () => { + const row = TABLE.row('alincoln'); + const [row_] = await row.get(); + assert.strictEqual(row, row_); + }); + + it('should limit the number of rows', async () => { + const [rows] = await TABLE.getRows({ + limit: 1, + }); + assert.strictEqual(rows.length, 1); + }); + + it('should fetch a range of rows', async () => { + const options = { + start: 'alincoln', + end: 'jadams', + }; + const [rows] = await TABLE.getRows(options); + assert.strictEqual(rows.length, 3); + }); + + it('should fetch a range of rows via prefix', async () => { + const options = { + prefix: 'g', + }; + const [rows] = await TABLE.getRows(options); + assert.strictEqual(rows.length, 1); + assert.strictEqual(rows[0].id, 'gwashington'); + }); + + it('should fetch individual cells of a row', async () => { + const row = TABLE.row('alincoln'); + const [data] = await row.get(['follows:gwashington']); + assert.strictEqual(data.follows.gwashington[0].value, 1); + }); + + it('should not decode the values', async () => { + const row = TABLE.row('gwashington'); + const options = { + decode: false, + }; + await row.get(options); + const teeth = row.data.traits.teeth; + const value = teeth[0].value; + assert(value instanceof Buffer); + assert.strictEqual(value.toString(), 'shiny-wood'); + }); + + it('should get sample row keys', async () => { + const [keys] = await TABLE.sampleRowKeys(); + assert(keys.length > 0); + }); + + it('should get sample row keys via stream', done => { + const keys: string[] = []; + TABLE.sampleRowKeysStream() + .on('error', done) + .on('data', (rowKey: string) => { + keys.push(rowKey); + }) + .on('end', () => { + assert(keys.length > 0); + done(); + }); + }); + + it('should end stream early', async () => { + const entries = [ + { + key: 'gwashington', + data: { + follows: { + jadams: 1, + }, + }, + }, + { + key: 'tjefferson', + data: { + follows: { + gwashington: 1, + jadams: 1, + }, + }, + }, + { + key: 'jadams', + data: { + follows: { + gwashington: 1, + tjefferson: 1, + }, + }, + }, + ]; + await TABLE.insert(entries); + const rows: Row[] = []; + await new Promise((resolve, reject) => { + const stream = TABLE.createReadStream() + .on('error', reject) + .on('data', row => { + rows.push(row); + stream.end(); + }) + .on('end', () => { + assert.strictEqual(rows.length, 1); + resolve(); + }); + }); + }); + + describe('filters', () => { + it('should get rows via column data', async () => { + const filter = { + column: 'gwashington', + }; + const [rows] = await TABLE.getRows({filter}); + assert.strictEqual(rows.length, 3); + const keys = rows.map(row => row.id).sort(); + assert.deepStrictEqual(keys, ['alincoln', 'jadams', 'tjefferson']); + }); + + it('should get rows that satisfy the cell limit', async () => { + const entry = { + key: 'alincoln', + data: { + follows: { + tjefferson: 1, + }, + }, + }; + const filter = [ + { + row: 'alincoln', + }, + { + column: { + name: 'tjefferson', + cellLimit: 1, + }, + }, + ]; + await TABLE.insert(entry); + const [rows] = await TABLE.getRows({filter}); + const rowData = rows[0].data; + assert.strictEqual(rowData.follows.tjefferson.length, 1); + }); + + it('should get a range of columns', async () => { + const filter = [ + { + row: 'tjefferson', + }, + { + column: { + family: 'follows', + start: 'gwashington', + end: 'jadams', + }, + }, + ]; + + const [rows] = await TABLE.getRows({filter}); + rows.forEach(row => { + const keys = Object.keys(row.data.follows).sort(); + assert.deepStrictEqual(keys, ['gwashington', 'jadams']); + }); + }); + + it('should run a conditional filter', async () => { + const filter = { + condition: { + test: [ + { + row: 'gwashington', + }, + { + family: 'follows', + }, + { + column: 'tjefferson', + }, + ], + pass: { + row: 'gwashington', + }, + fail: { + row: 'tjefferson', + }, + }, + }; + const [rows] = await TABLE.getRows({filter}); + assert.strictEqual(rows.length, 1); + assert.strictEqual(rows[0].id, 'tjefferson'); + }); + + it('should run a conditional filter with pass only', async () => { + const filter = { + condition: { + test: [ + { + row: 'gwashington', + }, + ], + pass: [ + { + all: true, + }, + ], + }, + }; + const [rows] = await TABLE.getRows({filter}); + assert(rows.length > 0); + }); + + it('should only get cells for a specific family', async () => { + const entries = [ + { + key: 'gwashington', + data: { + traits: { + teeth: 'wood', + }, + }, + }, + ]; + await TABLE.insert(entries); + const filter = { + family: 'traits', + }; + const [rows] = await TABLE.getRows({filter}); + assert(rows.length > 0); + const families = Object.keys(rows[0].data); + assert.deepStrictEqual(families, ['traits']); + }); + + it('should interleave filters', async () => { + const filter = [ + { + interleave: [ + [ + { + row: 'gwashington', + }, + ], + [ + { + row: 'tjefferson', + }, + ], + ], + }, + ]; + const [rows] = await TABLE.getRows({filter}); + assert.strictEqual(rows.length, 2); + const ids = rows.map(row => row.id).sort(); + assert.deepStrictEqual(ids, ['gwashington', 'tjefferson']); + }); + + it('should apply labels to the results', async () => { + const filter = { + label: 'test-label', + }; + const [rows] = await TABLE.getRows({filter}); + rows.forEach(row => { + const follows = row.data.follows; + Object.keys(follows).forEach(column => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + follows[column].forEach((cell: any) => { + assert.deepStrictEqual(cell.labels, [filter.label]); + }); + }); + }); + }); + + it('should run a regex against the row id', async () => { + const filter = { + row: /[a-z]+on$/, + }; + const [rows] = await TABLE.getRows({filter}); + const keys = rows.map(row => row.id).sort(); + assert.deepStrictEqual(keys, ['gwashington', 'tjefferson']); + }); + + it('should run a sink filter', async () => { + const filter = [ + { + row: 'alincoln', + }, + { + family: 'follows', + }, + { + interleave: [ + [ + { + all: true, + }, + ], + [ + { + label: 'prezzy', + }, + { + sink: true, + }, + ], + ], + }, + { + column: 'gwashington', + }, + ]; + const [rows] = await TABLE.getRows({filter}); + const columns = Object.keys(rows[0].data.follows).sort(); + assert.deepStrictEqual(columns, [ + 'gwashington', + 'jadams', + 'tjefferson', + ]); + }); + }); + + it('should accept a date range', async () => { + const filter = { + time: { + start: new Date('March 21, 1986'), + end: new Date('March 23, 1986'), + }, + }; + const [rows] = await TABLE.getRows({filter}); + assert(rows.length > 0); + }); + }); + }); + + describe('deleting rows', () => { + it('should delete specific cells', async () => { + const row = TABLE.row('alincoln'); + await row.deleteCells(['follows:gwashington']); + }); + + it('should delete a family', async () => { + const row = TABLE.row('gwashington'); + await row.deleteCells(['traits']); + }); + + it('should delete all the cells', async () => { + const row = TABLE.row('alincoln'); + await row.delete(); + }); + }); + + describe('.deleteRows()', () => { + const table = INSTANCE.table(generateId('table')); + beforeEach(async () => { + const tableOptions = { + families: ['cf1'], + }; + const data = { + cf1: { + foo: 1, + }, + }; + const rows = [ + { + key: 'aaa', + data, + }, + { + key: 'abc', + data, + }, + { + key: 'def', + data, + }, + ]; + await table.create(tableOptions); + await table.insert(rows); + }); + + afterEach(async () => { + await table.delete(); + }); + + it('should delete the prefixes', async () => { + await table.deleteRows('a'); + const [rows] = await table.getRows(); + assert.strictEqual(rows.length, 1); + }); + }); + + describe('.truncate()', () => { + const table = INSTANCE.table(generateId('table')); + beforeEach(async () => { + const tableOptions = { + families: ['follows'], + }; + const rows = [ + { + key: 'gwashington', + data: { + follows: { + jadams: 1, + }, + }, + }, + ]; + await table.create(tableOptions); + await table.insert(rows); + }); + + afterEach(async () => { + await table.delete(); + }); + + it('should truncate a table', async () => { + await table.truncate(); + const [rows] = await table.getRows(); + assert.strictEqual(rows.length, 0); + }); + }); + + describe('backups', () => { + const CLUSTER = INSTANCE.cluster(CLUSTER_ID); + let BACKUP: Backup; + + // For these tests, two backups are needed. The backups are labeled for what + // they are intended to originate/interact from/with, but this is just for + // testing and the naming convention used here does not actually influence + // the real functionality - it is just a way to keep things organized! + const backupIdFromCluster = generateId('backup'); + let backupNameFromCluster: string; + const restoreTableIdFromCluster = generateId('table'); + + const backupIdFromTable = generateId('backup'); + let backupNameFromTable: string; + + // The minimum backup expiry time is 6 hours. The times here each have a 2 + // hour padding to tolerate latency and clock drift. Also, while the time + // implementation for backups in this client accepts any of a Timestamp + // Struct, Date, or PreciseDate, to keep things easy this uses PreciseDate. + const expireTime = new PreciseDate(PreciseDate.now() + 8 * 60 * 60 * 1000); + const updateExpireTime = new PreciseDate( + expireTime.getTime() + 2 + 60 * 60 * 1000, + ); + + before(async () => { + const [backup, op] = await CLUSTER.createBackup(backupIdFromCluster, { + table: TABLE, + expireTime, + }); + BACKUP = backup; + await op.promise(); + backupNameFromCluster = replaceProjectIdToken( + `${CLUSTER.name}/backups/${backupIdFromCluster}`, + bigtable.projectId, + ); + backupNameFromTable = replaceProjectIdToken( + `${CLUSTER.name}/backups/${backupIdFromTable}`, + bigtable.projectId, + ); + }); + + it('should create backup of a table (from cluster)', async () => { + await BACKUP.getMetadata(); + + assert.strictEqual(BACKUP.metadata!.name, backupNameFromCluster); + + assert.deepStrictEqual(BACKUP.expireDate, expireTime); + }); + + it('should create backup of a table (from table)', async () => { + const [backup, op] = await TABLE.createBackup(backupIdFromTable, { + expireTime, + }); + await op.promise(); + await backup.getMetadata(); + + assert.strictEqual(backup.metadata!.name, backupNameFromTable); + + assert.deepStrictEqual(backup.expireDate, expireTime); + }); + + it('should get a specific backup (cluster)', async () => { + const [backup] = await CLUSTER.backup(backupIdFromCluster).get(); + assert.strictEqual(backup.metadata!.name, backupNameFromCluster); + assert.strictEqual(backup.metadata!.state, 'READY'); + }); + + it('should get backups in an instance', async () => { + const [backups] = await INSTANCE.getBackups(); + assert(Array.isArray(backups)); + assert(backups.length > 0); + assert(backups.some(backup => backup.id === BACKUP.id)); + }); + + it('should get backups in an instance as a stream', done => { + const backups: Backup[] = []; + + INSTANCE.getBackupsStream() + .on('error', done) + .on('data', backup => { + backups.push(backup); + }) + .on('end', () => { + assert(backups.length > 0); + done(); + }); + }); + + it('should get backups in a cluster', async () => { + const [backups] = await CLUSTER.getBackups(); + assert(Array.isArray(backups)); + assert(backups.length > 0); + assert(backups.some(backup => backup.id === BACKUP.id)); + }); + + it('should get backups in a cluster as a stream', done => { + const backups: Backup[] = []; + + CLUSTER.getBackupsStream() + .on('error', done) + .on('data', backup => { + backups.push(backup); + }) + .on('end', () => { + assert(backups.length > 0); + done(); + }); + }); + + it('should restore a backup (cluster)', async () => { + const backup = CLUSTER.backup(backupIdFromCluster); + const [table, op] = await backup.restore(restoreTableIdFromCluster); + await op.promise(); + + const restoredTableId = table.name?.split('/').pop(); + assert.strictEqual(restoredTableId, restoreTableIdFromCluster); + }); + + it('should restore a backup to a different instance', async () => { + const [, operation] = await DIFF_INSTANCE.create( + createInstanceConfig( + generateId('d-clust'), + 'us-east1-c', + 3, + Date.now(), + ), + ); + await operation.promise(); + const [iExists] = await DIFF_INSTANCE.exists(); + assert.strictEqual(iExists, true); + + const backup = CLUSTER.backup(backupIdFromCluster); + const [table, op] = await backup.restoreTo({ + tableId: restoreTableIdFromCluster, + instance: DIFF_INSTANCE, + }); + await op.promise(); + const [tExists] = await table.exists(); + assert.strictEqual(tExists, true); + assert.strictEqual(table.id, restoreTableIdFromCluster); + }); + + it('should update a backup (cluster)', async () => { + const backup = CLUSTER.backup(backupIdFromCluster); + const [metadata] = await backup.setMetadata({ + expireTime: updateExpireTime, + }); + + assert.strictEqual(metadata.name, backupNameFromCluster); + assert.deepStrictEqual(backup.expireDate, updateExpireTime); + }); + + it('should get an Iam Policy for the backup', async () => { + const policyProperties = ['version', 'bindings', 'etag']; + const [policy] = await BACKUP.getIamPolicy(); + + policyProperties.forEach(property => { + assert(property in policy); + }); + }); + + it('should test Iam permissions for the backup', async () => { + const permissions = ['bigtable.backups.get', 'bigtable.backups.delete']; + const [grantedPermissions] = await BACKUP.testIamPermissions(permissions); + assert.strictEqual(grantedPermissions.length, permissions.length); + permissions.forEach(permission => { + assert.strictEqual(grantedPermissions.includes(permission), true); + }); + }); + + it('should set Iam Policy on the backup', async () => { + const backup = CLUSTER.backup(backupIdFromCluster); + + const [policy] = await backup.getIamPolicy(); + const [updatedPolicy] = await backup.setIamPolicy(policy); + + Object.keys(policy).forEach(key => assert(key in updatedPolicy)); + }); + describe('copying backups', () => { + // The server requires the copy backup time to be sufficiently ahead of + // the create backup time to avoid an error. + // Set it to 308 hours ahead + const sourceExpireTimeMilliseconds = + PreciseDate.now() + (8 + 300) * 60 * 60 * 1000; + const sourceExpireTime = new PreciseDate(sourceExpireTimeMilliseconds); + // 608 hours ahead of now, 300 hours ahead of sourceExpireTimeMilliseconds + const copyExpireTimeMilliseconds = + PreciseDate.now() + (8 + 600) * 60 * 60 * 1000; + const copyExpireTime = new PreciseDate(copyExpireTimeMilliseconds); + + beforeEach(async () => { + // Sleep here for just over a minute so that the system tests don't + // experience quota issues due to too many requests per minute. + await new Promise(resolve => { + setTimeout(resolve, 60001); + }); + }); + /* + This function checks that when a backup is copied using the provided + config that a new backup is created on the instance. + */ + async function testCopyBackup( + backup: Backup, + config: CopyBackupConfig, + instance: Instance, + ) { + // Get a list of backup ids before the copy + const [backupsBeforeCopy] = await instance.getBackups(); + const backupIdsBeforeCopy = backupsBeforeCopy.map(backup => backup.id); + // Copy the backup + const [newBackup, operation] = await backup.copy(config); + try { + assert.strictEqual(config.id, newBackup.id); + await operation.promise(); + const id = config.id; + const backupPath = `${config.cluster.name}/backups/${id}`; + { + // Ensure that the backup specified by the config and id match the backup name for the operation returned by the server. + // the split/map/join functions replace the project name with the {{projectId}} string + assert(operation); + assert(operation.metadata); + assert.strictEqual( + operation.metadata.name + .split('/') + .map((item, index) => (index === 1 ? '{{projectId}}' : item)) + .join('/'), + backupPath + .split('/') + .map((item, index) => (index === 1 ? '{{projectId}}' : item)) + .join('/'), + ); + } + // Check that there is now one more backup + const [backupsAfterCopy] = await instance.getBackups(); + const newBackups = backupsAfterCopy.filter( + backup => !backupIdsBeforeCopy.includes(backup.id), + ); + assert.strictEqual(newBackups.length, 1); + const [fetchedNewBackup] = newBackups; + // Ensure the fetched backup matches the config + assert.strictEqual(fetchedNewBackup.id, id); + assert.strictEqual(fetchedNewBackup.name, backupPath); + // Delete the copied backup + } finally { + await config.cluster.backup(newBackup.id).delete(); + } + } + + describe('should create backup of a table and copy it in the same cluster', async () => { + async function testWithExpiryTimes( + sourceTestExpireTime: BackupTimestamp, + copyTestExpireTime: BackupTimestamp, + ) { + const [backup, op] = await TABLE.createBackup(generateId('backup'), { + expireTime: sourceTestExpireTime, + }); + try { + { + await op.promise(); + // Check expiry time for running operation. + await backup.getMetadata(); + assert.deepStrictEqual(backup.expireDate, sourceExpireTime); + } + await testCopyBackup( + backup, + { + cluster: backup.cluster, + id: generateId('backup'), + expireTime: copyTestExpireTime, + }, + INSTANCE, + ); + } finally { + await backup.delete(); + } + } + it('should copy to the same cluster with precise date expiry times', async () => { + await testWithExpiryTimes(sourceExpireTime, copyExpireTime); + }); + it('should copy to the same cluster with timestamp expiry times', async () => { + // Calling toStruct converts times to a timestamp object. + // For example: sourceExpireTime.toStruct() = {seconds: 1706659851, nanos: 981000000} + await testWithExpiryTimes( + sourceExpireTime.toStruct(), + copyExpireTime.toStruct(), + ); + }); + it('should copy to the same cluster with date expiry times', async () => { + await testWithExpiryTimes( + new Date(sourceExpireTimeMilliseconds), + new Date(copyExpireTimeMilliseconds), + ); + }); + }); + it('should create backup of a table and copy it on another cluster of another instance', async () => { + const [backup, op] = await TABLE.createBackup(generateId('backup'), { + expireTime: sourceExpireTime, + }); + try { + { + await op.promise(); + // Check the expiry time. + await backup.getMetadata(); + assert.deepStrictEqual(backup.expireDate, sourceExpireTime); + } + // Create another instance + const instance = bigtable.instance(generateId('instance')); + const destinationClusterId = generateId('cluster'); + { + // Create production instance with given options + const instanceOptions: InstanceOptions = { + clusters: [ + { + id: destinationClusterId, + nodes: 3, + location: 'us-central2-d', + storage: 'ssd', + }, + ], + labels: {'prod-label': 'prod-label'}, + type: 'production', + }; + const [, operation] = await instance.create(instanceOptions); + await operation.promise(); + } + // Create the copy and test the copied backup + await testCopyBackup( + backup, + { + cluster: new Cluster(instance, destinationClusterId), + id: generateId('backup'), + expireTime: copyExpireTime, + }, + instance, + ); + await instance.delete(); + } finally { + await backup.delete(); + } + }); + it('should create backup of a table and copy it on another cluster of the same instance', async () => { + const [backup, op] = await TABLE.createBackup(generateId('backup'), { + expireTime: sourceExpireTime, + }); + try { + { + await op.promise(); + // Check the expiry time. + await backup.getMetadata(); + assert.deepStrictEqual(backup.expireDate, sourceExpireTime); + } + const destinationClusterId = generateId('cluster'); + { + // Create destination cluster with given options + const [, operation] = await INSTANCE.cluster( + destinationClusterId, + ).create({ + location: 'us-central2-b', + nodes: 3, + }); + await operation.promise(); + } + // Create the copy and test the copied backup + await testCopyBackup( + backup, + { + cluster: new Cluster(INSTANCE, destinationClusterId), + id: generateId('backup'), + expireTime: copyExpireTime, + }, + INSTANCE, + ); + } finally { + await backup.delete(); + } + }); + it('should create backup of a table and copy it on another project', async () => { + const [backup, op] = await TABLE.createBackup(generateId('backup'), { + expireTime: sourceExpireTime, + }); + try { + { + await op.promise(); + // Check the expiry time. + await backup.getMetadata(); + assert.deepStrictEqual(backup.expireDate, sourceExpireTime); + } + // Create client, instance, cluster for second project + const bigtableSecondaryProject = new Bigtable( + process.env.GCLOUD_PROJECT2 + ? {projectId: process.env.GCLOUD_PROJECT2} + : {}, + ); + const secondInstance = bigtableSecondaryProject.instance( + generateId('instance'), + ); + const destinationClusterId = generateId('cluster'); + { + // Create production instance with given options + const instanceOptions: InstanceOptions = { + clusters: [ + { + id: destinationClusterId, + nodes: 3, + location: 'us-central2-d', + storage: 'ssd', + }, + ], + labels: {'prod-label': 'prod-label'}, + type: 'production', + }; + const [, operation] = await secondInstance.create(instanceOptions); + await operation.promise(); + } + // Create the copy and test the copied backup + await testCopyBackup( + backup, + { + cluster: new Cluster(secondInstance, destinationClusterId), + id: generateId('backup'), + expireTime: copyExpireTime, + }, + secondInstance, + ); + await secondInstance.delete(); + } finally { + await backup.delete(); + } + }); + it('should restore a copied backup', async () => { + const backupId = generateId('backup'); + const table = INSTANCE.table('old-table'); + { + // Create a table and insert data into it. + await table.create(); + await table.createFamily('follows'); + await table.insert([ + { + key: 'some-data-to-copy-key', + data: { + follows: { + copyData: 'data-to-copy', + }, + }, + }, + ]); + } + // Create the backup + const [backup, createBackupOperation] = await table.createBackup( + backupId, + { + expireTime: sourceExpireTime, + }, + ); + try { + await createBackupOperation.promise(); + // Copy the backup + const config = { + cluster: backup.cluster, + id: generateId('backup'), + expireTime: copyExpireTime, + }; + const [newBackup, copyOperation] = await backup.copy(config); + await copyOperation.promise(); + // Restore a table from the copied backup + const [newTable, restoreOperation] = + await newBackup.restore('new-table'); + await restoreOperation.promise(); + const rows = await newTable.getRows(); + assert.deepStrictEqual(rows[0][0].id, 'some-data-to-copy-key'); + } finally { + await backup.delete(); + } + }); + }); + }); + + describe('backups with gapic', () => { + // This only needs to test the handwritten pieces for optimizing, so a lot + // of the above from the veneer tests isn't covered; also I've not converted + // everything to gapic, just the pieces to be tested. + const tableAdmin = bigtable.admin.getTableAdminClient(); + + let backupSSD: IBackup, backupHDD: IBackup; + + const targetTableIdSSD = generateId('ttbl'), + targetTableIdHDD = generateId('ttbl'); + + // We just test from table here. + const backupIdFromTableSSD = generateId('backup'), + backupIdFromTableHDD = generateId('backup'); + let backupNameFromTableSSD: string, backupNameFromTableHDD: string; + + // The minimum backup expiry time is 6 hours. The times here each have a 2 + // hour padding to tolerate latency and clock drift. Also, while the time + // implementation for backups in this client accepts any of a Timestamp + // Struct, Date, or PreciseDate, to keep things easy this uses PreciseDate. + const expireTime = { + seconds: Date.now() / 1000 + 8 * 60 * 60, + nanos: 0, + }; + + beforeEach(async () => { + // This is not ideal, but we are running into quota issues for admin API access. + await new Promise(r => setTimeout(r, 60 * 1000)); + }); + + before(async () => { + const [backupOpSSD] = await tableAdmin.createBackup({ + parent: replaceProjectIdToken( + INSTANCE.cluster(CLUSTER_ID).name, + bigtable.projectId, + ), + backupId: backupIdFromTableSSD, + backup: { + expireTime, + sourceTable: replaceProjectIdToken(TABLE.name, bigtable.projectId), + }, + }); + const [backupOpHDD] = await tableAdmin.createBackup({ + parent: replaceProjectIdToken( + INSTANCE_HDD.cluster(CLUSTER_ID_HDD).name, + bigtable.projectId, + ), + backupId: backupIdFromTableHDD, + backup: { + expireTime, + sourceTable: replaceProjectIdToken( + TABLE_HDD.name, + bigtable.projectId, + ), + }, + }); + const [resSSD, resHDD] = await Promise.all([ + backupOpSSD.promise(), + backupOpHDD.promise(), + ]); + + backupNameFromTableSSD = replaceProjectIdToken( + `${INSTANCE.cluster(CLUSTER_ID).name}/backups/${backupIdFromTableSSD}`, + bigtable.projectId, + ); + backupNameFromTableHDD = replaceProjectIdToken( + `${INSTANCE_HDD.cluster(CLUSTER_ID_HDD).name}/backups/${backupIdFromTableHDD}`, + bigtable.projectId, + ); + console.log(backupNameFromTableSSD, backupNameFromTableHDD); + + backupSSD = resSSD[0]; + backupHDD = resHDD[0]; + }); + + // This is here just to make sure that we are, in fact, getting a usable backup. + it('should create backup of a table (from table)', async () => { + assert.strictEqual(backupSSD.name, backupNameFromTableSSD); + assert.strictEqual( + new Number(backupSSD.expireTime?.seconds).valueOf(), + Math.floor(expireTime.seconds), + ); + + assert.strictEqual(backupHDD.name, backupNameFromTableHDD); + assert.strictEqual( + new Number(backupHDD.expireTime?.seconds).valueOf(), + Math.floor(expireTime.seconds), + ); + }); + + it('should not optimize when restoring from the same backing type', async () => { + // HDD -> HDD and SSD -> SSD should both not trigger an optimize pass. + const [restoreOp] = await tableAdmin.restoreTable({ + parent: replaceProjectIdToken(INSTANCE_HDD.name, bigtable.projectId), + tableId: targetTableIdHDD, + backup: backupHDD.name!, + }); + const [, metadata] = await restoreOp.promise(); + assert.ok(!metadata.optimizeTableOperationName); + }); + + it('should optimize when restoring from a different backing type', async () => { + // HDD -> SSD should trigger an optimize. + const [restoreOp] = await tableAdmin.restoreTable({ + parent: replaceProjectIdToken(INSTANCE.name, bigtable.projectId), + tableId: targetTableIdSSD, + backup: backupHDD.name!, + }); + const [, metadata] = await restoreOp.promise(); + assert.ok(metadata.optimizeTableOperationName); + + const optimizeOp = await tableAdmin.checkOptimizeRestoredTableProgress( + metadata.optimizeTableOperationName, + ); + await optimizeOp.promise(); + }); + }); + + describe('AuthorizedViews', () => { + const tableId = generateId('table'); + const familyName = generateId('column-family-name'); + const rowId = generateId('row-id'); + const otherRowId = generateId('row-id'); + const authorizedViewId = generateId('authorized-view-id'); + const columnIdInView = generateId('column-id'); + const columnIdNotInView = generateId('column-id'); + const cellValueInView = generateId('cell-value'); + const cellValueInView2 = generateId('cell-value'); + const cellValueNotInView = generateId('cell-value'); + const newCellValue = generateId('cell-value'); + const authorizedViewTable = INSTANCE.table(tableId); + const authorizedView = INSTANCE.view(tableId, authorizedViewId); + const columnIdInViewData = { + value: cellValueInView, + labels: [], + timestamp: '77000', + }; + const columnIdInViewData2 = { + value: cellValueInView2, + labels: [], + timestamp: '77000', + }; + const columnIdNotInViewData = { + value: cellValueNotInView, + labels: [], + timestamp: '77000', + }; + const newCellValueData = { + value: newCellValue, + labels: [], + timestamp: '77000', + }; + let authorizedViewTableFullName: string; + let authorizedViewFullName: string; + + /** + * getErrorMessage gets the error message that the test would expect + * for a particular authorizedViewFullName. + * + * @param authorizedViewFullName The full name of the authorized view. + * This method should only be called after authorizedViewFullName has + * been initialized. + */ + function getErrorMessage(authorizedViewFullName: string) { + return `Cannot mutate from ${authorizedViewFullName} because the mutation contains cells outside the Authorized View.`; + } + + /** + * Resets the table to a stable state after running a test. + * + */ + async function resetTable() { + // Change the cell value back to what it was: + await authorizedViewTable.deleteRows(rowId); + const firstMutation = { + key: rowId, + data: { + [familyName]: { + [columnIdInView]: columnIdInViewData, + [columnIdNotInView]: columnIdNotInViewData, + }, + }, + } as {} as Entry; + await authorizedViewTable.insert(firstMutation, {}); + } + + /** + * Creates the table used for the tests. + */ + async function createTable() { + { + // Create a table with just one row. + await authorizedViewTable.create({}); + await authorizedViewTable.createFamily(familyName); + await authorizedViewTable.insert([ + { + key: rowId, + data: { + [familyName]: { + [columnIdInView]: columnIdInViewData, + [columnIdNotInView]: columnIdNotInViewData, + }, + }, + }, + { + key: otherRowId, + data: { + [familyName]: { + [columnIdInView]: columnIdInViewData, + }, + }, + }, + ]); + // The following operations must be performed after table.insert because bigtable.projectId needs to be assigned. + authorizedViewTableFullName = authorizedViewTable.name.replace( + '{{projectId}}', + bigtable.projectId, + ); + authorizedViewFullName = `${authorizedViewTableFullName}/authorizedViews/${authorizedViewId}`; + } + { + // Create an authorized view that the integration tests can use. + // The view should only see the columnIdInView column. + const bigtableClient = bigtable.api[ + 'BigtableTableAdminClient' + ] as BigtableTableAdminClient; + await bigtableClient.createAuthorizedView({ + parent: authorizedViewTableFullName, + authorizedViewId, + authorizedView: { + etag: `${authorizedViewId}-etag`, + deletionProtection: false, + subsetView: { + rowPrefixes: [Buffer.from(rowId)], + familySubsets: { + [familyName]: { + qualifiers: [Buffer.from(columnIdInView)], + }, + }, + }, + }, + }); + } + } + + before(async () => { + await createTable(); + }); + + afterEach(async () => { + // Add an after hook to ensure that none of the tests change the table. + const rows = (await authorizedViewTable.getRows())[0]; + assert.strictEqual(rows.length, 2); + assert.strictEqual(rows[0].id, rowId); + assert.deepStrictEqual(rows[0].data, { + [familyName]: { + [columnIdInView]: [columnIdInViewData], + [columnIdNotInView]: [columnIdNotInViewData], + }, + }); + assert.strictEqual(rows[1].id, otherRowId); + assert.deepStrictEqual(rows[1].data, { + [familyName]: { + [columnIdInView]: [columnIdInViewData], + }, + }); + }); + + describe('ReadRows grpc calls', () => { + it('should call getRows for the authorized view', async () => { + const rows = (await authorizedView.getRows())[0]; + // The getRows call will only get one of the rows and only display + // one of the columns visible in the view. + assert.strictEqual(rows[0].id, rowId); + assert.deepStrictEqual(rows[0].data, { + [familyName]: { + [columnIdInView]: [columnIdInViewData], + }, + }); + }); + it('should call createReadStream for the authorized view', done => { + (async () => { + try { + const stream = await authorizedView.createReadStream(); + let receivedDataCount = 0; + stream.on('data', row => { + assert.strictEqual(row.id, rowId); + assert.deepStrictEqual(row.data, { + [familyName]: { + [columnIdInView]: [columnIdInViewData], + }, + }); + receivedDataCount = receivedDataCount + 1; + }); + stream.on('error', () => { + done('An error should not have occurred'); + }); + stream.on('end', () => { + assert.strictEqual(receivedDataCount, 1); + done(); + }); + } catch (e: unknown) { + done(e); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('MutateRows grpc calls', () => { + describe('For erroneous calls', () => { + it('should fail when writing to a row not in the authorized view', async () => { + const mutation = { + key: otherRowId, + data: { + [familyName]: { + [columnIdInView]: newCellValue, + }, + }, + method: Mutation.methods.INSERT, + } as {} as Entry; + try { + await authorizedView.mutate(mutation, {} as MutateOptions); + assert.fail('The mutate call should have failed'); + } catch (e: unknown) { + assert.strictEqual( + (e as ServiceError).message, + getErrorMessage(authorizedViewFullName), + ); + } + }); + it('should fail when writing to a column not in the authorized view', async () => { + const mutation = { + key: rowId, + data: { + [familyName]: { + [columnIdNotInView]: newCellValue, + }, + }, + method: Mutation.methods.INSERT, + } as {} as Entry; + try { + await authorizedView.mutate(mutation, {} as MutateOptions); + assert.fail('The mutate call should have failed'); + } catch (e: unknown) { + assert.strictEqual( + (e as ServiceError).message, + getErrorMessage(authorizedViewFullName), + ); + } + }); + }); + it('should mutate a row for a row/column in view', async () => { + // Change the cell in view to a new value. + const firstMutation = { + key: rowId, + data: { + [familyName]: { + [columnIdInView]: newCellValueData, + }, + }, + method: Mutation.methods.INSERT, + } as {} as Entry; + await authorizedView.mutate(firstMutation, {} as MutateOptions); + // Ensure the new cell value change took place + const rows = (await authorizedView.getRows())[0]; + assert.strictEqual(rows[0].id, rowId); + assert.deepStrictEqual(rows[0].data, { + [familyName]: { + [columnIdInView]: [newCellValueData], + }, + }); + // Change the cell value back to what it was before + const secondMutation = { + key: rowId, + data: { + [familyName]: { + [columnIdInView]: columnIdInViewData, + }, + }, + method: Mutation.methods.INSERT, + } as {} as Entry; + await authorizedView.mutate(secondMutation, {} as MutateOptions); + }); + it('should insert a row for a row/column in view', async () => { + // Change the cell in view to a new value. + const firstMutation = { + key: rowId, + data: { + [familyName]: { + [columnIdInView]: newCellValueData, + }, + }, + } as {} as Entry; + await authorizedView.insert(firstMutation, {}); + // Ensure the new cell value change took place + const rows = (await authorizedView.getRows())[0]; + assert.strictEqual(rows[0].id, rowId); + assert.deepStrictEqual(rows[0].data, { + [familyName]: { + [columnIdInView]: [newCellValueData], + }, + }); + // Change the cell value back to what it was before + const secondMutation = { + key: rowId, + data: { + [familyName]: { + [columnIdInView]: columnIdInViewData, + }, + }, + method: Mutation.methods.INSERT, + } as {} as Entry; + await authorizedView.insert(secondMutation, {}); + }); + }); + describe('SampleRowKeys grpc calls', () => { + /** + * This function is for converting a buffer to an integer equal to the + * total value of the buffer. It is useful for comparing the sampleRowKeys + * return value to the row identifier since the difference between the + * total value of these buffers is expected to be exactly 1. + * + * @param buffer The buffer being mapped to be used for comparisons. + */ + function convertBufferToInt(buffer: Uint8Array) { + return buffer + .reverse() + .reduce( + (accumulator, currentValue, index) => + accumulator + Math.pow(currentValue, index), + 0, + ); + } + + it('should get a sample of row keys', async () => { + const rowKeys = await authorizedView.sampleRowKeys(); + assert.strictEqual(rowKeys.length, 1); + assert.strictEqual(rowKeys[0].length, 1); + assert.deepStrictEqual( + convertBufferToInt(rowKeys[0][0].key), + convertBufferToInt(Buffer.from(rowId)) + 1, + ); + }); + it('should call sampleRowKeysStream for the authorized view', done => { + (async () => { + try { + const stream = await authorizedView.sampleRowKeysStream(); + let receivedDataCount = 0; + stream.on('data', (row: {key: Uint8Array; offset: string}) => { + assert.deepStrictEqual( + convertBufferToInt(row.key), + convertBufferToInt(Buffer.from(rowId)) + 1, + ); + receivedDataCount = receivedDataCount + 1; + }); + stream.on('error', () => { + done('An error should not have occurred'); + }); + stream.on('end', () => { + assert.strictEqual(receivedDataCount, 1); + done(); + }); + } catch (e: unknown) { + done(e); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('CheckAndMutate grpc calls', () => { + it('should error when the request is made for the row key not in a view', done => { + (async () => { + try { + try { + await authorizedView.filter( + { + rowId: 'some-row-key', + filter: { + column: columnIdInView, + }, + }, + { + onMatch: [ + { + key: rowId, + method: 'delete', + }, + ], + }, + ); + done('The call to filter should have failed.'); + } catch (e: unknown) { + assert.strictEqual( + (e as ServiceError).details, + getErrorMessage(authorizedViewFullName), + ); + done(); + } + } catch (e: unknown) { + // Will reach this point if there is an assertion error. + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should call filter for the authorized view', done => { + (async () => { + try { + // Add the row so that the cell offset filter takes effect: + await authorizedViewTable.insert([ + { + key: rowId, + data: { + [familyName]: { + [columnIdInView]: [columnIdInViewData, columnIdInViewData2], + }, + }, + }, + ]); + const rowsAfterAddition = (await authorizedViewTable.getRows())[0]; + assert.strictEqual(rowsAfterAddition.length, 2); + assert.strictEqual(rowsAfterAddition[0].id, rowId); + assert.deepStrictEqual( + rowsAfterAddition[0].data[familyName][columnIdNotInView].length, + 1, + ); + assert.deepStrictEqual( + rowsAfterAddition[0].data[familyName][columnIdInView].length, + 2, + ); + assert.strictEqual(rowsAfterAddition[1].id, otherRowId); + assert.deepStrictEqual(rowsAfterAddition[1].data, { + [familyName]: { + [columnIdInView]: [columnIdInViewData], + }, + }); + // Call filter to conduct a checkAndMutate operation. + const mutations = [ + { + method: 'delete', + data: [`${familyName}:${columnIdInView}`], + }, + ]; + await authorizedView.filter( + { + rowId: rowId, + filter: { + row: { + cellOffset: 1, + }, + }, + }, + { + onMatch: mutations, + }, + ); + // Check the rows to ensure the row was deleted by calling `filter`. + const rows = (await authorizedViewTable.getRows())[0]; + assert.strictEqual(rows.length, 2); + assert.strictEqual(rows[0].id, rowId); + assert.deepStrictEqual(rows[0].data, { + [familyName]: { + [columnIdNotInView]: [columnIdNotInViewData], + // [columnIdInView] is deleted by checkAndMutate + }, + }); + assert.strictEqual(rows[1].id, otherRowId); + assert.deepStrictEqual(rows[1].data, { + [familyName]: { + [columnIdInView]: [columnIdInViewData], + }, + }); + // Add the row that was deleted back: + await authorizedViewTable.insert([ + { + key: rowId, + data: { + [familyName]: { + [columnIdInView]: { + value: cellValueInView, + labels: [], + timestamp: 77000, + }, + }, + }, + }, + ]); + done(); + } catch (e: unknown) { + done(e); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('ReadModifyWriteRow grpc calls', () => { + it('should apply read/modify/write rules to a row', async () => { + // Append a value to the table: + const rule = { + column: `${familyName}:${columnIdInView}`, + append: '-appended-value', + }; + await authorizedView.createRules({ + rowId, + rules: rule, + }); + // Check that the operation was performed correctly: + const rows = (await authorizedView.getRows())[0]; + rows[0].data[familyName][columnIdInView][0].timestamp = '77000'; + assert.strictEqual(rows.length, 1); + assert.strictEqual(rows[0].id, rowId); + assert.deepStrictEqual(rows[0].data, { + [familyName]: { + [columnIdInView]: [ + { + value: `${cellValueInView}-appended-value`, + labels: [], + timestamp: '77000', + }, + columnIdInViewData, + ], + }, + }); + await resetTable(); + }); + it('should apply increment to a row', async () => { + // First set the row in view cell value to a numeric value: + const originalValue = Math.floor(Math.random() * 1000000000); + await authorizedViewTable.deleteRows(rowId); + const firstMutation = { + key: rowId, + data: { + [familyName]: { + [columnIdInView]: { + value: originalValue, + labels: [], + timestamp: '77000', + }, + [columnIdNotInView]: columnIdNotInViewData, + }, + }, + } as {} as Entry; + await authorizedViewTable.insert(firstMutation, {}); + // Next, increment the value: + await authorizedView.increment( + { + rowId, + column: `${familyName}:${columnIdInView}`, + }, + 1, + ); + const rows = (await authorizedView.getRows())[0]; + rows[0].data[familyName][columnIdInView][0].timestamp = '77000'; + assert.deepStrictEqual(rows[0].data, { + [familyName]: { + [columnIdInView]: [ + { + value: originalValue + 1, + labels: [], + timestamp: '77000', + }, + { + value: originalValue, + labels: [], + timestamp: '77000', + }, + ], + }, + }); + await resetTable(); + }); + }); + }); + + describe('mutateRows entries tests', () => { + const table = INSTANCE.table(generateId('table')); + + afterEach(async () => { + await table.delete(); + }); + + it('should only insert one row in the table with mutate', async () => { + // Create table + const tableOptions = { + families: ['columnFamily'], + }; + await table.create(tableOptions); + // Add entries + const entry = { + columnFamily: { + column: 1, + }, + }; + const mutation = { + key: 'rowKey', + data: entry, + method: Mutation.methods.INSERT, + }; + const gaxOptions = {maxRetries: 4}; + await table.mutate(mutation, {gaxOptions}); + // Get rows and compare + const [rows] = await table.getRows(); + assert.strictEqual(rows.length, 1); + }); + + it('should insert one row in the table using mutate in a similar way to how the documentation says to use insert', async () => { + // Create table + const tableOptions = { + families: ['columnFamily'], + }; + await table.create(tableOptions); + // Add entries + const mutation = { + key: 'rowKey', + data: { + columnFamily: { + column: 1, + }, + }, + method: Mutation.methods.INSERT, + }; + const gaxOptions = {maxRetries: 4}; + await table.mutate(mutation, {gaxOptions}); + // Get rows and compare + const [rows] = await table.getRows(); + assert.strictEqual(rows.length, 1); + }); + + it('should only insert one row in the table with insert as described by the GCP documentation', async () => { + // Create table + const tableOptions = { + families: ['follows'], + }; + await table.create(tableOptions); + // Add entries + const greetings = ['Hello World!', 'Hello Bigtable!', 'Hello Node!']; + const rowsToInsert = greetings.map((greeting, index) => ({ + key: `greeting${index}`, + data: { + follows: { + // 'follows' is the column family + someColumn: { + // Setting the timestamp allows the client to perform retries. If + // server-side time is used, retries may cause multiple cells to + // be generated. + timestamp: new Date(), + value: greeting, + }, + }, + }, + })); + await table.insert(rowsToInsert); + // Get rows and compare + const [rows] = await table.getRows(); + assert.strictEqual(rows.length, 3); + }); + }); +}); + +function createInstanceConfig( + clusterId: string, + location: string, + nodes: number, + time_created: number, + storage?: 'ssd' | 'hdd', +) { + return { + clusters: [ + { + id: clusterId, + location, + nodes, + storage, + }, + ], + labels: { + time_created, + }, + }; +} diff --git a/handwritten/bigtable/system-test/client-side-metrics-all-methods.ts b/handwritten/bigtable/system-test/client-side-metrics-all-methods.ts new file mode 100644 index 00000000000..b0104383333 --- /dev/null +++ b/handwritten/bigtable/system-test/client-side-metrics-all-methods.ts @@ -0,0 +1,1939 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {after, before, describe, it} from 'mocha'; +import * as mocha from 'mocha'; +import { + CloudMonitoringExporter, + ExportResult, +} from '../src/client-side-metrics/exporter'; +import {ResourceMetrics} from '@opentelemetry/sdk-metrics'; +import * as assert from 'assert'; +import {GCPMetricsHandler} from '../src/client-side-metrics/gcp-metrics-handler'; +import * as proxyquire from 'proxyquire'; +import {Bigtable, RawFilter} from '../src'; +import {Mutation} from '../src/mutation'; +import {Row} from '../src/row'; +import { + setupBigtableWithInsert, + setupBigtable, +} from './client-side-metrics-setup-table'; +import {TestMetricsHandler} from '../test-common/test-metrics-handler'; +import { + OnAttemptCompleteData, + OnOperationCompleteData, +} from '../src/client-side-metrics/metrics-handler'; +import {ClientOptions} from 'google-gax'; +import {ClientSideMetricsConfigManager} from '../src/client-side-metrics/metrics-config-manager'; +import {MetricServiceClient} from '@google-cloud/monitoring'; +import {MethodName} from '../src/client-side-metrics/client-side-metrics-attributes'; +import {generateId} from './common'; + +const SECOND_PROJECT_ID = 'cfdb-sdk-node-tests'; +const instanceId1 = generateId('instance'); +const instanceId2 = generateId('instance'); +const tableId1 = 'my-table'; +const tableId2 = 'my-table2'; +const columnFamilyId = 'cf1'; + +function getFakeBigtable( + projectId: string, + metricsHandlerClass: typeof GCPMetricsHandler | typeof TestMetricsHandler, + apiEndpoint?: string, +) { + const metricHandler = new metricsHandlerClass({ + apiEndpoint, + } as unknown as ClientOptions & {value: string}); + const newClient = new Bigtable({ + projectId, + apiEndpoint, + }); + newClient._metricsConfigManager = new ClientSideMetricsConfigManager([ + metricHandler, + ]); + return newClient; +} + +function getHandlerFromExporter(Exporter: typeof CloudMonitoringExporter) { + return proxyquire('../src/client-side-metrics/gcp-metrics-handler.js', { + './exporter': { + CloudMonitoringExporter: Exporter, + }, + }).GCPMetricsHandler; +} + +function checkFirstResponseLatency(requestHandled: OnOperationCompleteData) { + assert( + Object.prototype.hasOwnProperty.call( + requestHandled, + 'firstResponseLatency', + ), + ); + if ( + requestHandled.metricsCollectorData.method === MethodName.READ_ROWS || + requestHandled.metricsCollectorData.method === MethodName.READ_ROW + ) { + assert(requestHandled.firstResponseLatency); + assert(requestHandled.firstResponseLatency > 0); + } else { + assert.strictEqual(requestHandled.firstResponseLatency, 0); + } + delete requestHandled.firstResponseLatency; +} + +function readRowsAssertionCheck( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], + method: string, + streaming: string, +) { + assert.strictEqual(requestsHandled.length, 4); + const firstRequest = requestsHandled[0] as any; + // We would expect these parameters to be different every time so delete + // them from the comparison after checking they exist. + assert(firstRequest.attemptLatency); + assert(firstRequest.serverLatency); + delete firstRequest.attemptLatency; + delete firstRequest.serverLatency; + delete firstRequest.metricsCollectorData.appProfileId; + assert.deepStrictEqual(firstRequest, { + connectivityErrorCount: 0, + streaming, + status: 'OK', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method, + projectId, + }, + }); + const secondRequest = requestsHandled[1] as any; + // We would expect these parameters to be different every time so delete + // them from the comparison after checking they exist. + checkFirstResponseLatency(secondRequest); + assert(secondRequest.operationLatency); + delete secondRequest.operationLatency; + assert(secondRequest.applicationLatency < 10); + delete secondRequest.applicationLatency; + delete secondRequest.metricsCollectorData.appProfileId; + assert.deepStrictEqual(secondRequest, { + status: 'OK', + streaming, + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method, + table: 'my-table', + projectId, + }, + retryCount: 0, + }); + // We would expect these parameters to be different every time so delete + // them from the comparison after checking they exist. + const thirdRequest = requestsHandled[2] as any; + assert(thirdRequest.attemptLatency); + assert(thirdRequest.serverLatency); + delete thirdRequest.attemptLatency; + delete thirdRequest.serverLatency; + delete thirdRequest.metricsCollectorData.appProfileId; + assert.deepStrictEqual(thirdRequest, { + connectivityErrorCount: 0, + streaming, + status: 'OK', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table2', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method, + projectId, + }, + }); + const fourthRequest = requestsHandled[3] as any; + // We would expect these parameters to be different every time so delete + // them from the comparison after checking they exist. + checkFirstResponseLatency(fourthRequest); + assert(fourthRequest.operationLatency); + assert(fourthRequest.applicationLatency < 10); + delete fourthRequest.operationLatency; + delete fourthRequest.applicationLatency; + delete fourthRequest.metricsCollectorData.appProfileId; + assert.deepStrictEqual(fourthRequest, { + status: 'OK', + streaming, + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method, + table: 'my-table2', + projectId, + }, + retryCount: 0, + }); +} + +function checkCheckAndMutateCall( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], +) { + readRowsAssertionCheck( + projectId, + requestsHandled, + 'Bigtable.CheckAndMutateRow', + 'false', + ); +} + +function checkMultiRowCall( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], +) { + readRowsAssertionCheck( + projectId, + requestsHandled, + 'Bigtable.ReadRows', + 'true', + ); +} + +function checkMutateRowsCall( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], +) { + readRowsAssertionCheck( + projectId, + requestsHandled, + 'Bigtable.MutateRows', + 'true', + ); +} + +function checkSampleRowKeysCall( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], +) { + readRowsAssertionCheck( + projectId, + requestsHandled, + 'Bigtable.SampleRowKeys', + 'true', + ); +} + +function checkMutateRowCall( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], +) { + readRowsAssertionCheck( + projectId, + requestsHandled, + 'Bigtable.MutateRow', + 'false', + ); +} + +function checkSingleRowCall( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], +) { + readRowsAssertionCheck( + projectId, + requestsHandled, + 'Bigtable.ReadRow', + 'false', + ); +} + +function checkReadModifyWriteRowCall( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], +) { + readRowsAssertionCheck( + projectId, + requestsHandled, + 'Bigtable.ReadModifyWriteRow', + 'false', + ); +} + +const entry = { + cf1: { + column: 1, + }, +}; + +const mutation = { + key: 'rowId', + data: entry, + method: Mutation.methods.INSERT, +}; + +const filter: RawFilter = { + family: 'cf1', + value: 'alincoln', +}; + +const mutations = [ + { + method: 'delete', + data: ['cf1:alincoln'], + }, +]; + +const rules = [ + { + column: 'cf1:column', + append: 'c', + }, +]; + +/** + * Checks if metrics have been published to Google Cloud Monitoring. + * + * This asynchronous function queries Google Cloud Monitoring to verify + * that the expected metrics from the Bigtable client library have been + * successfully published. It constructs a `MetricServiceClient` to + * interact with the Cloud Monitoring API and retrieves time series data + * for a predefined set of metrics. The test passes if time series data + * is found for each of the specified metrics within a defined time + * interval. + * + * @param {string} projectId The Google Cloud project ID where metrics are + * expected to be published. + * @throws {Error} If no time series data is found for any of the specified + * metrics, indicating that the metrics were not successfully published to + * Cloud Monitoring. + */ +async function checkForPublishedMetrics(projectId: string) { + const monitoringClient = new MetricServiceClient(); // Correct instantiation + const now = Math.floor(Date.now() / 1000); + const filters = [ + 'metric.type="bigtable.googleapis.com/client/attempt_latencies"', + 'metric.type="bigtable.googleapis.com/client/operation_latencies"', + 'metric.type="bigtable.googleapis.com/client/retry_count"', + 'metric.type="bigtable.googleapis.com/client/server_latencies"', + 'metric.type="bigtable.googleapis.com/client/first_response_latencies"', + ]; + for (let i = 0; i < filters.length; i++) { + const filter = filters[i]; + const [series] = await monitoringClient.listTimeSeries({ + name: `projects/${projectId}`, + interval: { + endTime: { + seconds: now, + nanos: 0, + }, + startTime: { + seconds: now - 1000 * 60 * 60 * 24, + nanos: 0, + }, + }, + filter, + }); + assert(series.length > 0); + } +} + +describe('Bigtable/ClientSideMetricsAllMethods', () => { + let defaultProjectId: string; + + before(async () => { + /* + For both the default project and the secondary project we need to create + instances with some data in them so that the tests can collect all the + metrics they would normally collect in a typical situation and compare + those metrics against expected results. + + We need tests like "should send the metrics to Google Cloud Monitoring for a + ReadRows call with a second project" that work with a second project because + we want to ensure that when a user specifies a second project that the + metrics actually get written for that other project instead of the default + project. + */ + for (const bigtable of [ + new Bigtable(), + new Bigtable({projectId: SECOND_PROJECT_ID}), + ]) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert(bigtable, columnFamilyId, instanceId, [ + tableId1, + tableId2, + ]); + } + defaultProjectId = await new Promise((resolve, reject) => { + bigtable.getProjectId_((err: Error | null, projectId?: string) => { + if (err) { + reject(err); + } else { + resolve(projectId as string); + } + }); + }); + } + }); + + after(async () => { + for (const bigtable of [ + new Bigtable(), + new Bigtable({projectId: SECOND_PROJECT_ID}), + ]) { + try { + // If the instance has been deleted already by another source, we don't + // want this after hook to block the continuous integration pipeline. + const instance = bigtable.instance(instanceId1); + await instance.delete({}); + } catch (e) { + console.warn('The instance has been deleted already'); + } + try { + // If the instance has been deleted already by another source, we don't + // want this after hook to block the continuous integration pipeline. + const instance = bigtable.instance(instanceId2); + await instance.delete({}); + } catch (e) { + console.warn('The instance has been deleted already'); + } + } + }); + + describe('Bigtable/ClientSideMetricsToGCM', () => { + // This test suite ensures that for each test all the export calls are + // successful even when multiple instances and tables are created. + async function mockBigtable( + projectId: string, + done: mocha.Done, + apiEndpoint?: string, + ) { + /* + The exporter is called every x seconds, but we only want to test the value + it receives once. Since done cannot be called multiple times in mocha, + exported variable ensures we only test the value export receives one time. + */ + let exported = false; + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. + */ + const timeout = setTimeout(() => { + if (!exported) { + done( + new Error( + 'The exporters have not completed yet and the timeout is over', + ), + ); + } + }, 120000); + + class TestExporter extends CloudMonitoringExporter { + constructor(options: ClientOptions) { + super(options); + } + + async export( + metrics: ResourceMetrics, + resultCallback: (result: ExportResult) => void, + ): Promise { + try { + await super.export(metrics, (result: ExportResult) => { + if (!exported) { + exported = true; + try { + clearTimeout(timeout); + // The test passes when the code is 0 because that means the + // result from calling export was successful. + assert.strictEqual(result.code, 0); + resultCallback({code: 0}); + void checkForPublishedMetrics(projectId).then(() => { + done(); + }); + } catch (error) { + // The code here isn't 0 so we report the original error to the mocha test runner. + done(result); + done(error); + } + } else { + resultCallback({code: 0}); + } + }); + } catch (error) { + done(error); + } + } + } + + return getFakeBigtable( + projectId, + getHandlerFromExporter(TestExporter), + apiEndpoint, + ); + } + + describe('SampleRowKeys', () => { + it('should send the metrics to Google Cloud Monitoring for a SampleRowKeys call', done => { + (async () => { + try { + const bigtable = await mockBigtable(defaultProjectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.sampleRowKeys(); + const table2 = instance.table(tableId2); + await table2.sampleRowKeys(); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a custom endpoint', done => { + (async () => { + try { + const bigtable = await mockBigtable( + defaultProjectId, + done, + 'bogus-endpoint', + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + try { + // This call will fail because we are trying to hit a bogus endpoint. + // The idea here is that we just want to record at least one metric + // so that the exporter gets executed. + await table.sampleRowKeys(); + } catch (e: unknown) { + // Try blocks just need a catch/finally block. + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a SampleRowKeys call with a second project', done => { + (async () => { + try { + // This is the second project the test is configured to work with: + const projectId = SECOND_PROJECT_ID; + const bigtable = await mockBigtable(projectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.sampleRowKeys(); + const table2 = instance.table(tableId2); + await table2.sampleRowKeys(); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('ReadRows', () => { + it('should send the metrics to Google Cloud Monitoring for a ReadRows call', done => { + (async () => { + try { + const bigtable = await mockBigtable(defaultProjectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.getRows(); + const table2 = instance.table(tableId2); + await table2.getRows(); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a custom endpoint', done => { + (async () => { + try { + const bigtable = await mockBigtable( + defaultProjectId, + done, + 'bogus-endpoint', + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + try { + // This call will fail because we are trying to hit a bogus endpoint. + // The idea here is that we just want to record at least one metric + // so that the exporter gets executed. + await table.getRows(); + } catch (e: unknown) { + // Try blocks just need a catch/finally block. + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a ReadRows call with a second project', done => { + (async () => { + try { + // This is the second project the test is configured to work with: + const projectId = SECOND_PROJECT_ID; + const bigtable = await mockBigtable(projectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.getRows(); + const table2 = instance.table(tableId2); + await table2.getRows(); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('ReadModifyWriteRow', () => { + it('should send the metrics to Google Cloud Monitoring for a ReadModifyWriteRow call', done => { + (async () => { + try { + const bigtable = await mockBigtable(defaultProjectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + const row = table.row(columnFamilyId); + await row.createRules(rules); + const table2 = instance.table(tableId2); + const row2 = table2.row(columnFamilyId); + await row2.createRules(rules); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a custom endpoint', done => { + (async () => { + try { + const bigtable = await mockBigtable( + defaultProjectId, + done, + 'bogus-endpoint', + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + try { + // This call will fail because we are trying to hit a bogus endpoint. + // The idea here is that we just want to record at least one metric + // so that the exporter gets executed. + const row = table.row(columnFamilyId); + await row.createRules(rules); + } catch (e: unknown) { + // Try blocks just need a catch/finally block. + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a ReadModifyWriteRow call with a second project', done => { + (async () => { + try { + // This is the second project the test is configured to work with: + const projectId = SECOND_PROJECT_ID; + const bigtable = await mockBigtable(projectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + const row = table.row(columnFamilyId); + await row.createRules(rules); + const table2 = instance.table(tableId2); + const row2 = table2.row(columnFamilyId); + await row2.createRules(rules); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('MutateRows', () => { + it('should send the metrics to Google Cloud Monitoring for a MutateRows call', done => { + (async () => { + try { + const bigtable = await mockBigtable(defaultProjectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.mutate(mutation); + const table2 = instance.table(tableId2); + await table2.mutate(mutation); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a custom endpoint', done => { + (async () => { + try { + const bigtable = await mockBigtable( + defaultProjectId, + done, + 'bogus-endpoint', + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + try { + // This call will fail because we are trying to hit a bogus endpoint. + // The idea here is that we just want to record at least one metric + // so that the exporter gets executed. + await table.mutate(mutation); + } catch (e: unknown) { + // Try blocks just need a catch/finally block. + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a MutateRows call with a second project', done => { + (async () => { + try { + // This is the second project the test is configured to work with: + const projectId = SECOND_PROJECT_ID; + const bigtable = await mockBigtable(projectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.mutate(mutation); + const table2 = instance.table(tableId2); + await table2.mutate(mutation); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('MutateRow', () => { + it('should send the metrics to Google Cloud Monitoring for a single point MutateRows call', done => { + (async () => { + try { + const bigtable = await mockBigtable(defaultProjectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + const row = table.row('gwashington'); + await row.save(entry); + const table2 = instance.table(tableId2); + const row2 = table2.row('gwashington'); + await row2.save(entry); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a custom endpoint', done => { + (async () => { + try { + const bigtable = await mockBigtable( + defaultProjectId, + done, + 'bogus-endpoint', + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + try { + // This call will fail because we are trying to hit a bogus endpoint. + // The idea here is that we just want to record at least one metric + // so that the exporter gets executed. + const row = table.row('gwashington'); + await row.save(entry); + } catch (e: unknown) { + // Try blocks just need a catch/finally block. + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a MutateRow call with a second project and a single point', done => { + (async () => { + try { + // This is the second project the test is configured to work with: + const projectId = SECOND_PROJECT_ID; + const bigtable = await mockBigtable(projectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + const row = table.row('gwashington'); + await row.save(entry); + const table2 = instance.table(tableId2); + const row2 = table2.row('gwashington'); + await row2.save(entry); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('CheckAndMutateRow', () => { + it('should send the metrics to Google Cloud Monitoring for a CheckAndMutateRow call', done => { + (async () => { + try { + const bigtable = await mockBigtable(defaultProjectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + const row = table.row(columnFamilyId); + await row.filter(filter, {onMatch: mutations}); + const table2 = instance.table(tableId2); + const row2 = table2.row(columnFamilyId); + await row2.filter(filter, {onMatch: mutations}); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a custom endpoint', done => { + (async () => { + try { + const bigtable = await mockBigtable( + defaultProjectId, + done, + 'bogus-endpoint', + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + try { + // This call will fail because we are trying to hit a bogus endpoint. + // The idea here is that we just want to record at least one metric + // so that the exporter gets executed. + const row = table.row(columnFamilyId); + await row.filter(filter, {onMatch: mutations}); + } catch (e: unknown) { + // Try blocks just need a catch/finally block. + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a CheckAndMutateRow call with a second project', done => { + (async () => { + try { + // This is the second project the test is configured to work with: + const projectId = SECOND_PROJECT_ID; + const bigtable = await mockBigtable(projectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + const row = table.row(columnFamilyId); + await row.filter(filter, {onMatch: mutations}); + const table2 = instance.table(tableId2); + const row2 = table2.row(columnFamilyId); + await row2.filter(filter, {onMatch: mutations}); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + }); + }); + describe('Bigtable/ClientSideMetricsToGCMTimeout', () => { + // This test suite simulates a situation where the user creates multiple + // clients and ensures that the exporter doesn't produce any errors even + // when multiple clients are attempting an export. + async function mockBigtable( + projectId: string, + done: mocha.Done, + onExportSuccess?: () => void, + ) { + class TestExporter extends CloudMonitoringExporter { + constructor(options: ClientOptions) { + super(options); + } + + async export( + metrics: ResourceMetrics, + resultCallback: (result: ExportResult) => void, + ): Promise { + try { + await super.export(metrics, async (result: ExportResult) => { + try { + // The code is expected to be 0 because the + // result from calling export was successful. + assert.strictEqual(result.code, 0); + resultCallback({code: 0}); + if (onExportSuccess) { + onExportSuccess(); + } + } catch (error) { + // The code here isn't 0 so we report the original error to the + // mocha test runner. + // The test fails here because it means that an export was + // unsuccessful. + done(result); + done(error); + resultCallback({code: 0}); + } + }); + } catch (error) { + done(error); + resultCallback({code: 0}); + } + } + } + + /* + Below we mock out the table so that it sends the metrics to a test exporter + that will still send the metrics to Google Cloud Monitoring, but then also + ensure the export was successful and pass the test with code 0 if it is + successful. + */ + return getFakeBigtable(projectId, getHandlerFromExporter(TestExporter)); + } + + describe('SampleRowKeys', () => { + it('should send the metrics to Google Cloud Monitoring for a SampleRowKeys call', done => { + let testFinished = false; + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + setTimeout(() => { + testFinished = true; + done(); + }, 120000); + (async () => { + try { + const bigtable1 = await mockBigtable(defaultProjectId, done); + const bigtable2 = await mockBigtable(defaultProjectId, done); + for (const bigtable of [bigtable1, bigtable2]) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.sampleRowKeys(); + const table2 = instance.table(tableId2); + await table2.sampleRowKeys(); + } + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a SampleRowKeys call with thirty clients', done => { + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + const testTimeout = setTimeout(() => { + done(new Error('The test timed out')); + }, 480000); + let testComplete = false; + const numClients = 30; + (async () => { + try { + const bigtableList = []; + const completedSet = new Set(); + for ( + let bigtableCount = 0; + bigtableCount < numClients; + bigtableCount++ + ) { + const currentCount = bigtableCount; + const onExportSuccess = () => { + completedSet.add(currentCount); + if (completedSet.size === numClients) { + // If every client has completed the export then pass the test. + clearTimeout(testTimeout); + if (!testComplete) { + testComplete = true; + done(); + } + } + }; + bigtableList.push( + await mockBigtable(defaultProjectId, done, onExportSuccess), + ); + } + for (const bigtable of bigtableList) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.sampleRowKeys(); + const table2 = instance.table(tableId2); + await table2.sampleRowKeys(); + } + } + } catch (e) { + done(e); + done(new Error('An error occurred while running the script')); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('ReadRows', () => { + it('should send the metrics to Google Cloud Monitoring for a ReadRows call', done => { + let testFinished = false; + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + setTimeout(() => { + testFinished = true; + done(); + }, 120000); + (async () => { + try { + const bigtable1 = await mockBigtable(defaultProjectId, done); + const bigtable2 = await mockBigtable(defaultProjectId, done); + for (const bigtable of [bigtable1, bigtable2]) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.getRows(); + const table2 = instance.table(tableId2); + await table2.getRows(); + } + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a ReadRows call with thirty clients', done => { + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + const testTimeout = setTimeout(() => { + done(new Error('The test timed out')); + }, 480000); + let testComplete = false; + const numClients = 30; + (async () => { + try { + const bigtableList = []; + const completedSet = new Set(); + for ( + let bigtableCount = 0; + bigtableCount < numClients; + bigtableCount++ + ) { + const currentCount = bigtableCount; + const onExportSuccess = () => { + completedSet.add(currentCount); + if (completedSet.size === numClients) { + // If every client has completed the export then pass the test. + clearTimeout(testTimeout); + if (!testComplete) { + testComplete = true; + done(); + } + } + }; + bigtableList.push( + await mockBigtable(defaultProjectId, done, onExportSuccess), + ); + } + for (const bigtable of bigtableList) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.getRows(); + const table2 = instance.table(tableId2); + await table2.getRows(); + } + } + } catch (e) { + done(e); + done(new Error('An error occurred while running the script')); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('ReadModifyWriteRow', () => { + it('should send the metrics to Google Cloud Monitoring for a ReadModifyWriteRow call', done => { + let testFinished = false; + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + setTimeout(() => { + testFinished = true; + done(); + }, 120000); + (async () => { + try { + const bigtable1 = await mockBigtable(defaultProjectId, done); + const bigtable2 = await mockBigtable(defaultProjectId, done); + for (const bigtable of [bigtable1, bigtable2]) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + const row = table.row(columnFamilyId); + await row.createRules(rules); + const table2 = instance.table(tableId2); + const row2 = table2.row(columnFamilyId); + await row2.createRules(rules); + } + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a ReadModifyWriteRow call with thirty clients', done => { + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + const testTimeout = setTimeout(() => { + done(new Error('The test timed out')); + }, 480000); + let testComplete = false; + const numClients = 30; + (async () => { + try { + const bigtableList = []; + const completedSet = new Set(); + for ( + let bigtableCount = 0; + bigtableCount < numClients; + bigtableCount++ + ) { + const currentCount = bigtableCount; + const onExportSuccess = () => { + completedSet.add(currentCount); + if (completedSet.size === numClients) { + // If every client has completed the export then pass the test. + clearTimeout(testTimeout); + if (!testComplete) { + testComplete = true; + done(); + } + } + }; + bigtableList.push( + await mockBigtable(defaultProjectId, done, onExportSuccess), + ); + } + for (const bigtable of bigtableList) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + const row = table.row(columnFamilyId); + await row.createRules(rules); + const table2 = instance.table(tableId2); + const row2 = table2.row(columnFamilyId); + await row2.createRules(rules); + } + } + } catch (e) { + done(e); + done(new Error('An error occurred while running the script')); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('MutateRows', () => { + it('should send the metrics to Google Cloud Monitoring for a MutateRows call', done => { + let testFinished = false; + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + setTimeout(() => { + testFinished = true; + done(); + }, 120000); + (async () => { + try { + const bigtable1 = await mockBigtable(defaultProjectId, done); + const bigtable2 = await mockBigtable(defaultProjectId, done); + for (const bigtable of [bigtable1, bigtable2]) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.mutate(mutation); + const table2 = instance.table(tableId2); + await table2.mutate(mutation); + } + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a MutateRows call with thirty clients', done => { + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + const testTimeout = setTimeout(() => { + done(new Error('The test timed out')); + }, 480000); + let testComplete = false; + const numClients = 30; + (async () => { + try { + const bigtableList = []; + const completedSet = new Set(); + for ( + let bigtableCount = 0; + bigtableCount < numClients; + bigtableCount++ + ) { + const currentCount = bigtableCount; + const onExportSuccess = () => { + completedSet.add(currentCount); + if (completedSet.size === numClients) { + // If every client has completed the export then pass the test. + clearTimeout(testTimeout); + if (!testComplete) { + testComplete = true; + done(); + } + } + }; + bigtableList.push( + await mockBigtable(defaultProjectId, done, onExportSuccess), + ); + } + for (const bigtable of bigtableList) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.mutate(mutation); + const table2 = instance.table(tableId2); + await table2.mutate(mutation); + } + } + } catch (e) { + done(e); + done(new Error('An error occurred while running the script')); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('MutateRow', () => { + it('should send the metrics to Google Cloud Monitoring for a MutateRows call for a single point', done => { + let testFinished = false; + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + setTimeout(() => { + testFinished = true; + done(); + }, 120000); + (async () => { + try { + const bigtable1 = await mockBigtable(defaultProjectId, done); + const bigtable2 = await mockBigtable(defaultProjectId, done); + for (const bigtable of [bigtable1, bigtable2]) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + const row = table.row('gwashington'); + await row.save(entry); + const table2 = instance.table(tableId2); + const row2 = table2.row('gwashington'); + await row2.save(entry); + } + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a single MutateRow call with thirty clients', done => { + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + const testTimeout = setTimeout(() => { + done(new Error('The test timed out')); + }, 480000); + let testComplete = false; + const numClients = 30; + (async () => { + try { + const bigtableList = []; + const completedSet = new Set(); + for ( + let bigtableCount = 0; + bigtableCount < numClients; + bigtableCount++ + ) { + const currentCount = bigtableCount; + const onExportSuccess = () => { + completedSet.add(currentCount); + if (completedSet.size === numClients) { + // If every client has completed the export then pass the test. + clearTimeout(testTimeout); + if (!testComplete) { + testComplete = true; + done(); + } + } + }; + bigtableList.push( + await mockBigtable(defaultProjectId, done, onExportSuccess), + ); + } + for (const bigtable of bigtableList) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + const row = table.row('gwashington'); + await row.save(entry); + const table2 = instance.table(tableId2); + const row2 = table2.row('gwashington'); + await row2.save(entry); + } + } + } catch (e) { + done(e); + done(new Error('An error occurred while running the script')); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('CheckAndMutateRow', () => { + it('should send the metrics to Google Cloud Monitoring for a CheckAndMutateRow call', done => { + let testFinished = false; + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + setTimeout(() => { + testFinished = true; + done(); + }, 120000); + (async () => { + try { + const bigtable1 = await mockBigtable(defaultProjectId, done); + const bigtable2 = await mockBigtable(defaultProjectId, done); + for (const bigtable of [bigtable1, bigtable2]) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + const row = table.row(columnFamilyId); + await row.filter(filter, {onMatch: mutations}); + const table2 = instance.table(tableId2); + const row2 = table2.row(columnFamilyId); + await row2.filter(filter, {onMatch: mutations}); + } + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a single CheckAndMutateRow call with thirty clients', done => { + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + const testTimeout = setTimeout(() => { + done(new Error('The test timed out')); + }, 480000); + let testComplete = false; + const numClients = 30; + (async () => { + try { + const bigtableList = []; + const completedSet = new Set(); + for ( + let bigtableCount = 0; + bigtableCount < numClients; + bigtableCount++ + ) { + const currentCount = bigtableCount; + const onExportSuccess = () => { + completedSet.add(currentCount); + if (completedSet.size === numClients) { + // If every client has completed the export then pass the test. + clearTimeout(testTimeout); + if (!testComplete) { + testComplete = true; + done(); + } + } + }; + bigtableList.push( + await mockBigtable(defaultProjectId, done, onExportSuccess), + ); + } + for (const bigtable of bigtableList) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert( + bigtable, + columnFamilyId, + instanceId, + [tableId1, tableId2], + ); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + const row = table.row(columnFamilyId); + await row.filter(filter, {onMatch: mutations}); + const table2 = instance.table(tableId2); + const row2 = table2.row(columnFamilyId); + await row2.filter(filter, {onMatch: mutations}); + } + } + } catch (e) { + done(e); + done(new Error('An error occurred while running the script')); + } + })().catch(err => { + throw err; + }); + }); + }); + }); + describe('Bigtable/ClientSideMetricsToMetricsHandler', () => { + async function getFakeBigtableWithHandler( + projectId: string, + done: mocha.Done, + checkFn: ( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[], + ) => void, + ) { + let handlerRequestCount = 0; + class TestGCPMetricsHandler extends TestMetricsHandler { + projectId = projectId; + onOperationComplete(data: OnOperationCompleteData) { + handlerRequestCount++; + try { + super.onOperationComplete(data); + if (handlerRequestCount > 1) { + checkFn(projectId, this.requestsHandled); + done(); + } + } catch (e) { + done(e); + } + } + } + return getFakeBigtable(projectId, TestGCPMetricsHandler); + } + + /** + * Returns a bigtable client with a test metrics handler that will check + * the metrics it receives and pass/fail the test if we get the right + * metrics. This method doesn't insert data so that extra mutateRows calls + * don't get made because those extra calls will produce different metrics. + * + * @param projectId + * @param done + * @param checkFn + */ + async function mockBigtableWithNoInserts( + projectId: string, + done: mocha.Done, + checkFn: ( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[], + ) => void, + ) { + const bigtable = await getFakeBigtableWithHandler( + projectId, + done, + checkFn, + ); + await setupBigtable(bigtable, columnFamilyId, instanceId1, [ + tableId1, + tableId2, + ]); + return bigtable; + } + describe('SampleRowKeys', () => { + it('should send the metrics to the metrics handler for a SampleRowKeys call', done => { + (async () => { + const bigtable = await mockBigtableWithNoInserts( + defaultProjectId, + done, + checkSampleRowKeysCall, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + await table.sampleRowKeys(); + const table2 = instance.table(tableId2); + await table2.sampleRowKeys(); + })().catch(err => { + throw err; + }); + }); + it('should pass the projectId to the metrics handler properly', done => { + (async () => { + const bigtable = await mockBigtableWithNoInserts( + defaultProjectId, + done, + checkSampleRowKeysCall, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + await table.sampleRowKeys(); + const table2 = instance.table(tableId2); + await table2.sampleRowKeys(); + })().catch(err => { + throw err; + }); + }); + }); + describe('ReadRows', () => { + it('should send the metrics to the metrics handler for a ReadRows call', done => { + (async () => { + const bigtable = await mockBigtableWithNoInserts( + defaultProjectId, + done, + checkMultiRowCall, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + await table.getRows(); + const table2 = instance.table(tableId2); + await table2.getRows(); + })().catch(err => { + throw err; + }); + }); + it('should pass the projectId to the metrics handler properly', done => { + (async () => { + const bigtable = await mockBigtableWithNoInserts( + defaultProjectId, + done, + checkMultiRowCall, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + await table.getRows(); + const table2 = instance.table(tableId2); + await table2.getRows(); + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to the metrics handler for a single row read', done => { + (async () => { + try { + const projectId = SECOND_PROJECT_ID; + const bigtable = await mockBigtableWithNoInserts( + projectId, + done, + checkSingleRowCall, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + const row = new Row(table, 'rowId'); + await row.get(); + const table2 = instance.table(tableId2); + const row2 = new Row(table2, 'rowId'); + await row2.get(); + } catch (e) { + done(e); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('ReadModifyWriteRow', () => { + it('should send the metrics to the metrics handler for a ReadModifyWriteRow call', done => { + (async () => { + const bigtable = await mockBigtableWithNoInserts( + defaultProjectId, + done, + checkReadModifyWriteRowCall, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + const row = table.row(columnFamilyId); + await row.createRules(rules); + const table2 = instance.table(tableId2); + const row2 = table2.row(columnFamilyId); + await row2.createRules(rules); + })().catch(err => { + throw err; + }); + }); + it('should pass the projectId to the metrics handler properly', done => { + (async () => { + const bigtable = await mockBigtableWithNoInserts( + defaultProjectId, + done, + checkReadModifyWriteRowCall, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + const row = table.row(columnFamilyId); + await row.createRules(rules); + const table2 = instance.table(tableId2); + const row2 = table2.row(columnFamilyId); + await row2.createRules(rules); + })().catch(err => { + throw err; + }); + }); + }); + describe('MutateRows', () => { + it('should send the metrics to the metrics handler for a MutateRows call', done => { + (async () => { + const bigtable = await mockBigtableWithNoInserts( + defaultProjectId, + done, + checkMutateRowsCall, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + await table.mutate(mutation); + const table2 = instance.table(tableId2); + await table2.mutate(mutation); + })().catch(err => { + throw err; + }); + }); + it('should pass the projectId to the metrics handler properly', done => { + (async () => { + const bigtable = await mockBigtableWithNoInserts( + defaultProjectId, + done, + checkMutateRowsCall, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + await table.mutate(mutation); + const table2 = instance.table(tableId2); + await table2.mutate(mutation); + })().catch(err => { + throw err; + }); + }); + }); + describe('MutateRow', () => { + it('should send the metrics to the metrics handler for a MutateRows call for a single point', done => { + (async () => { + const bigtable = await mockBigtableWithNoInserts( + defaultProjectId, + done, + checkMutateRowCall, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + const row = table.row('gwashington'); + await row.save(entry); + const table2 = instance.table(tableId2); + const row2 = table2.row('gwashington'); + await row2.save(entry); + })().catch(err => { + throw err; + }); + }); + it('should pass the projectId to the metrics handler properly for a single mutateRow point', done => { + (async () => { + const bigtable = await mockBigtableWithNoInserts( + defaultProjectId, + done, + checkMutateRowCall, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + const row = table.row('gwashington'); + await row.save(entry); + const table2 = instance.table(tableId2); + const row2 = table2.row('gwashington'); + await row2.save(entry); + })().catch(err => { + throw err; + }); + }); + }); + describe('CheckAndMutateRow', () => { + it('should send the metrics to the metrics handler for a CheckAndMutateRow call for a single point', done => { + (async () => { + const bigtable = await mockBigtableWithNoInserts( + defaultProjectId, + done, + checkCheckAndMutateCall, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + const row = table.row(columnFamilyId); + await row.filter(filter, {onMatch: mutations}); + const table2 = instance.table(tableId2); + const row2 = table2.row(columnFamilyId); + await row2.filter(filter, {onMatch: mutations}); + })().catch(err => { + throw err; + }); + }); + }); + }); +}); diff --git a/handwritten/bigtable/system-test/client-side-metrics-setup-table.ts b/handwritten/bigtable/system-test/client-side-metrics-setup-table.ts new file mode 100644 index 00000000000..4bac03e49a9 --- /dev/null +++ b/handwritten/bigtable/system-test/client-side-metrics-setup-table.ts @@ -0,0 +1,84 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 {Bigtable} from '../src'; +export async function setupBigtable( + bigtable: Bigtable, + columnFamilyId: string, + instanceId: string, + tableIds: string[], +) { + const instance = bigtable.instance(instanceId); + const [instanceInfo] = await instance.exists(); + while (!instanceInfo) { + const [, operation] = await instance.create({ + clusters: { + id: 'fake-cluster3', + location: 'us-west1-c', + nodes: 1, + }, + }); + await operation.promise(); + /** + * For whatever reason, even after waiting for an operation.promise() + * call to complete, the instance still doesn't seem to be ready yet so + * we do another check to ensure the instance is ready. + */ + const [instanceInfoAgain] = await instance.exists(); + if (instanceInfoAgain) { + break; + } + } + const tables = tableIds.map(tableId => instance.table(tableId)); + for (const currentTable of tables) { + const [tableExists] = await currentTable.exists(); + if (!tableExists) { + await currentTable.create({families: [columnFamilyId]}); // Create column family + } else { + // Check if column family exists and create it if not. + const [families] = await currentTable.getFamilies(); + + if ( + !families.some((family: {id: string}) => family.id === columnFamilyId) + ) { + await currentTable.createFamily(columnFamilyId); + } + } + // Add some data so that a firstResponseLatency is recorded. + } +} + +export async function setupBigtableWithInsert( + bigtable: Bigtable, + columnFamilyId: string, + instanceId: string, + tableIds: string[], +) { + await setupBigtable(bigtable, columnFamilyId, instanceId, tableIds); + const instance = bigtable.instance(instanceId); + const tables = tableIds.map(tableId => instance.table(tableId)); + for (const currentTable of tables) { + await currentTable.insert([ + { + key: 'rowId', + data: { + [columnFamilyId]: { + gwashington: 1, + tjefferson: 1, + }, + }, + }, + ]); + } +} diff --git a/handwritten/bigtable/system-test/client-side-metrics.ts b/handwritten/bigtable/system-test/client-side-metrics.ts new file mode 100644 index 00000000000..f9baa3ef859 --- /dev/null +++ b/handwritten/bigtable/system-test/client-side-metrics.ts @@ -0,0 +1,1201 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {after, before, describe, it} from 'mocha'; +import * as mocha from 'mocha'; +import { + CloudMonitoringExporter, + ExportResult, +} from '../src/client-side-metrics/exporter'; +import {ResourceMetrics} from '@opentelemetry/sdk-metrics'; +import * as assert from 'assert'; +import {GCPMetricsHandler} from '../src/client-side-metrics/gcp-metrics-handler'; +import * as proxyquire from 'proxyquire'; +import {Bigtable, BigtableOptions} from '../src'; +import {Row} from '../src/row'; +import { + setupBigtable, + setupBigtableWithInsert, +} from './client-side-metrics-setup-table'; +import {TestMetricsHandler} from '../test-common/test-metrics-handler'; +import { + OnAttemptCompleteData, + OnOperationCompleteData, +} from '../src/client-side-metrics/metrics-handler'; +import {ClientOptions} from 'google-gax'; +import {PassThrough} from 'stream'; +import {generateChunksFromRequest} from '../test-common/utils/readRowsImpl'; +import {TabularApiSurface} from '../src/tabular-api-surface'; +import {MetricServiceClient} from '@google-cloud/monitoring'; +import {generateId} from './common'; + +const SECOND_PROJECT_ID = 'cfdb-sdk-node-tests'; +const instanceId1 = generateId('instance'); +const instanceId2 = generateId('instance'); +const tableId1 = 'my-table'; +const tableId2 = 'my-table2'; +const columnFamilyId = 'cf1'; + +class FakeHRTime { + startTime = BigInt(0); + + bigint() { + this.startTime += BigInt(1000000000); + return this.startTime; + } +} + +/** + * Retrieves a mocked Bigtable client without a metrics handler attached. + * + * This function is used for testing purposes to create a Bigtable client + * with mocked dependencies, allowing for controlled simulation of stream + * behavior and time measurements. It does not include any metrics + * handling. + * + * @param {BigtableOptions} options Options to configure the Bigtable client. + * @param {FakeHRTime} hrtime An instance of FakeHRTime to control time. + * @returns {Bigtable} A mocked Bigtable client. + */ +function getFakeBigtableWithoutHandler( + options: BigtableOptions, + hrtime: FakeHRTime, +) { + const FakeTimedStream = proxyquire('../src/timed-stream.js', { + 'node:process': { + hrtime, + }, + }).TimedStream; + const FakeCreateReadStreamInternal = proxyquire( + '../src/utils/createReadStreamInternal.js', + { + '../timed-stream.js': { + TimedStream: FakeTimedStream, + }, + }, + ).createReadStreamInternal; + const FakeTabularApiSurface = proxyquire('../src/tabular-api-surface.js', { + './utils/createReadStreamInternal.js': { + createReadStreamInternal: FakeCreateReadStreamInternal, + }, + }).TabularApiSurface; + const FakeTable: TabularApiSurface = proxyquire('../src/table.js', { + './tabular-api-surface.js': {TabularApiSurface: FakeTabularApiSurface}, + }).Table; + const FakeInstance = proxyquire('../src/instance.js', { + './table.js': {Table: FakeTable}, + }).Instance; + const FakeBigtable = proxyquire('../src/index.js', { + './instance.js': {Instance: FakeInstance}, + }).Bigtable; + return new FakeBigtable(options); +} + +/** + * This method retrieves a bigtable client that sends metrics to the metrics + * handler class. The client also uses metrics collectors that have + * deterministic timestamps associated with the various latency metrics so that + * they can be tested. + * + * @param projectId + * @param metricsHandlerClass + * @param hrtime + * @param apiEndpoint + */ +function getFakeBigtable( + projectId: string, + metricsHandlerClass: typeof GCPMetricsHandler | typeof TestMetricsHandler, + hrtime: FakeHRTime, + apiEndpoint?: string, +) { + const FakeOperationsMetricsCollector = proxyquire( + '../src/client-side-metrics/operation-metrics-collector.js', + { + 'node:process': { + hrtime, + }, + }, + ).OperationMetricsCollector; + const FakeClientSideMetricsConfigManager = proxyquire( + '../src/client-side-metrics/metrics-config-manager.js', + { + './operation-metrics-collector.js': { + OperationMetricsCollector: FakeOperationsMetricsCollector, + }, + }, + ).ClientSideMetricsConfigManager; + // Normally the options passed into the client are passed into the metrics + // handler so when we mock out the metrics handler, it really should have + // the same options that are passed into the client. + const options = { + projectId, + apiEndpoint, + }; + const metricHandler = new metricsHandlerClass(options); + const newClient = getFakeBigtableWithoutHandler(options, hrtime); + newClient._metricsConfigManager = new FakeClientSideMetricsConfigManager([ + metricHandler, + ]); + return newClient; +} + +function getHandlerFromExporter(Exporter: typeof CloudMonitoringExporter) { + return proxyquire('../src/client-side-metrics/gcp-metrics-handler.js', { + './exporter': { + CloudMonitoringExporter: Exporter, + }, + }).GCPMetricsHandler; +} + +function readRowsAssertionCheck( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], + method: string, + streaming: string, +) { + assert.strictEqual(requestsHandled.length, 4); + const firstRequest = requestsHandled[0] as any; + // We would expect these parameters to be different every time so delete + // them from the comparison after checking they exist. + assert(firstRequest.attemptLatency); + assert(firstRequest.serverLatency); + delete firstRequest.attemptLatency; + delete firstRequest.serverLatency; + delete firstRequest.metricsCollectorData.appProfileId; + assert.deepStrictEqual(firstRequest, { + connectivityErrorCount: 0, + streaming, + status: 'OK', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method, + projectId, + }, + }); + const secondRequest = requestsHandled[1] as any; + // We would expect these parameters to be different every time so delete + // them from the comparison after checking they exist. + assert(secondRequest.operationLatency); + assert(secondRequest.firstResponseLatency); + assert.strictEqual(secondRequest.applicationLatency, 0); + delete secondRequest.operationLatency; + delete secondRequest.firstResponseLatency; + delete secondRequest.applicationLatency; + delete secondRequest.metricsCollectorData.appProfileId; + assert.deepStrictEqual(secondRequest, { + status: 'OK', + streaming, + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method, + table: 'my-table', + projectId, + }, + retryCount: 0, + }); + // We would expect these parameters to be different every time so delete + // them from the comparison after checking they exist. + const thirdRequest = requestsHandled[2] as any; + assert(thirdRequest.attemptLatency); + assert(thirdRequest.serverLatency); + delete thirdRequest.attemptLatency; + delete thirdRequest.serverLatency; + delete thirdRequest.metricsCollectorData.appProfileId; + assert.deepStrictEqual(thirdRequest, { + connectivityErrorCount: 0, + streaming, + status: 'OK', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table2', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method, + projectId, + }, + }); + const fourthRequest = requestsHandled[3] as any; + // We would expect these parameters to be different every time so delete + // them from the comparison after checking they exist. + assert(fourthRequest.operationLatency); + assert(fourthRequest.firstResponseLatency); + assert.strictEqual(fourthRequest.applicationLatency, 0); + delete fourthRequest.operationLatency; + delete fourthRequest.firstResponseLatency; + delete fourthRequest.applicationLatency; + delete fourthRequest.metricsCollectorData.appProfileId; + assert.deepStrictEqual(fourthRequest, { + status: 'OK', + streaming, + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method, + table: 'my-table2', + projectId, + }, + retryCount: 0, + }); +} + +function checkMultiRowCall( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], +) { + readRowsAssertionCheck( + projectId, + requestsHandled, + 'Bigtable.ReadRows', + 'true', + ); +} + +function checkSingleRowCall( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], +) { + readRowsAssertionCheck( + projectId, + requestsHandled, + 'Bigtable.ReadRow', + 'false', + ); +} + +/** + * Checks if metrics have been published to Google Cloud Monitoring. + * + * This asynchronous function queries Google Cloud Monitoring to verify + * that the expected metrics from the Bigtable client library have been + * successfully published. It constructs a `MetricServiceClient` to + * interact with the Cloud Monitoring API and retrieves time series data + * for a predefined set of metrics. The test passes if time series data + * is found for each of the specified metrics within a defined time + * interval. + * + * @param {string} projectId The Google Cloud project ID where metrics are + * expected to be published. + * @throws {Error} If no time series data is found for any of the specified + * metrics, indicating that the metrics were not successfully published to + * Cloud Monitoring. + */ +async function checkForPublishedMetrics(projectId: string) { + const monitoringClient = new MetricServiceClient({projectId}); // Correct instantiation + const now = Math.floor(Date.now() / 1000); + const filters = [ + 'metric.type="bigtable.googleapis.com/client/attempt_latencies"', + 'metric.type="bigtable.googleapis.com/client/operation_latencies"', + 'metric.type="bigtable.googleapis.com/client/retry_count"', + 'metric.type="bigtable.googleapis.com/client/server_latencies"', + 'metric.type="bigtable.googleapis.com/client/first_response_latencies"', + ]; + for (let i = 0; i < filters.length; i++) { + const filter = filters[i]; + const [series] = await monitoringClient.listTimeSeries({ + name: `projects/${projectId}`, + interval: { + endTime: { + seconds: now, + nanos: 0, + }, + startTime: { + seconds: now - 1000 * 60 * 60 * 24, + nanos: 0, + }, + }, + filter, + }); + assert(series.length > 0); + } +} + +describe('Bigtable/ClientSideMetrics', () => { + let defaultProjectId: string; + + before(async () => { + /* + For both the default project and the secondary project we need to create + instances with some data in them so that the tests can collect all the + metrics they would normally collect in a typical situation and compare + those metrics against expected results. + + We need tests like "should send the metrics to Google Cloud Monitoring for a + ReadRows call with a second project" that work with a second project because + we want to ensure that when a user specifies a second project that the + metrics actually get written for that other project instead of the default + project. + */ + for (const bigtable of [ + new Bigtable(), + new Bigtable({projectId: SECOND_PROJECT_ID}), + ]) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtableWithInsert(bigtable, columnFamilyId, instanceId, [ + tableId1, + tableId2, + ]); + } + defaultProjectId = await new Promise((resolve, reject) => { + bigtable.getProjectId_((err: Error | null, projectId?: string) => { + if (err) { + reject(err); + } else { + resolve(projectId as string); + } + }); + }); + } + }); + + after(async () => { + for (const bigtable of [ + new Bigtable(), + new Bigtable({projectId: SECOND_PROJECT_ID}), + ]) { + try { + // If the instance has been deleted already by another source, we don't + // want this after hook to block the continuous integration pipeline. + const instance = bigtable.instance(instanceId1); + await instance.delete({}); + } catch (e) { + console.warn('The instance has been deleted already'); + } + try { + // If the instance has been deleted already by another source, we don't + // want this after hook to block the continuous integration pipeline. + const instance = bigtable.instance(instanceId2); + await instance.delete({}); + } catch (e) { + console.warn('The instance has been deleted already'); + } + } + }); + + describe('Bigtable/ClientSideMetricsToGCM', () => { + // This test suite ensures that for each test all the export calls are + // successful even when multiple instances and tables are created. + async function mockBigtable( + projectId: string, + done: mocha.Done, + apiEndpoint?: string, + ) { + /* + The exporter is called every x seconds, but we only want to test the value + it receives once. Since done cannot be called multiple times in mocha, + exported variable ensures we only test the value export receives one time. + */ + let exported = false; + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. + */ + const timeout = setTimeout(() => { + if (!exported) { + done( + new Error( + 'The exporters have not completed yet and the timeout is over', + ), + ); + } + }, 120000); + + class TestExporter extends CloudMonitoringExporter { + constructor(options: ClientOptions) { + super(options); + } + + async export( + metrics: ResourceMetrics, + resultCallback: (result: ExportResult) => void, + ): Promise { + try { + await super.export(metrics, (result: ExportResult) => { + if (!exported) { + exported = true; + try { + clearTimeout(timeout); + // The test passes when the code is 0 because that means the + // result from calling export was successful. + assert.strictEqual(result.code, 0); + resultCallback({code: 0}); + void checkForPublishedMetrics(projectId) + .then(() => { + done(); + }) + .catch(err => { + done(new Error('Metrics have not been published')); + done(err); + }); + } catch (error) { + // The code here isn't 0 so we report the original error to the mocha test runner. + done(result); + done(error); + } + } else { + resultCallback({code: 0}); + } + }); + } catch (error) { + done(error); + } + } + } + + return getFakeBigtable( + projectId, + getHandlerFromExporter(TestExporter), + new FakeHRTime(), + apiEndpoint, + ); + } + + it('should send the metrics to Google Cloud Monitoring for a ReadRows call', done => { + (async () => { + try { + const bigtable = await mockBigtable(defaultProjectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtable(bigtable, columnFamilyId, instanceId, [ + tableId1, + tableId2, + ]); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.getRows(); + const table2 = instance.table(tableId2); + await table2.getRows(); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a custom endpoint', done => { + (async () => { + try { + const bigtable = await mockBigtable( + defaultProjectId, + done, + 'bogus-endpoint', + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + try { + // This call will fail because we are trying to hit a bogus endpoint. + // The idea here is that we just want to record at least one metric + // so that the exporter gets executed. + await table.getRows(); + } catch (e: unknown) { + // Try blocks just need a catch/finally block. + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a ReadRows call with a second project', done => { + (async () => { + try { + // This is the second project the test is configured to work with: + const projectId = SECOND_PROJECT_ID; + const bigtable = await mockBigtable(projectId, done); + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtable(bigtable, columnFamilyId, instanceId, [ + tableId1, + tableId2, + ]); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.getRows(); + const table2 = instance.table(tableId2); + await table2.getRows(); + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('Bigtable/ClientSideMetricsToGCMTimeout', () => { + // This test suite simulates a situation where the user creates multiple + // clients and ensures that the exporter doesn't produce any errors even + // when multiple clients are attempting an export. + async function mockBigtable( + projectId: string, + done: mocha.Done, + onExportSuccess?: () => void, + ) { + class TestExporter extends CloudMonitoringExporter { + constructor(options: ClientOptions) { + super(options); + } + + async export( + metrics: ResourceMetrics, + resultCallback: (result: ExportResult) => void, + ): Promise { + try { + await super.export(metrics, async (result: ExportResult) => { + try { + // The code is expected to be 0 because the + // result from calling export was successful. + assert.strictEqual(result.code, 0); + resultCallback({code: 0}); + if (onExportSuccess) { + onExportSuccess(); + } + } catch (error) { + // The code here isn't 0 so we report the original error to the + // mocha test runner. + // The test fails here because it means that an export was + // unsuccessful. + done(result); + done(error); + resultCallback({code: 0}); + } + }); + } catch (error) { + done(error); + resultCallback({code: 0}); + } + } + } + + /* + Below we mock out the table so that it sends the metrics to a test exporter + that will still send the metrics to Google Cloud Monitoring, but then also + ensure the export was successful and pass the test with code 0 if it is + successful. + */ + return getFakeBigtable( + projectId, + getHandlerFromExporter(TestExporter), + new FakeHRTime(), + ); + } + + it('should send the metrics to Google Cloud Monitoring for a ReadRows call', done => { + let testFinished = false; + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + setTimeout(() => { + testFinished = true; + done(); + }, 120000); + (async () => { + try { + const bigtable1 = await mockBigtable(defaultProjectId, done); + const bigtable2 = await mockBigtable(defaultProjectId, done); + for (const bigtable of [bigtable1, bigtable2]) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtable(bigtable, columnFamilyId, instanceId, [ + tableId1, + tableId2, + ]); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.getRows(); + const table2 = instance.table(tableId2); + await table2.getRows(); + } + } + } catch (e) { + done(new Error('An error occurred while running the script')); + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to Google Cloud Monitoring for a ReadRows call with thirty clients', done => { + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. When the timeout is finished, if there were no export + errors then the test passes. + */ + const testTimeout = setTimeout(() => { + done(new Error('The test timed out')); + }, 480000); + let testComplete = false; + const numClients = 30; + (async () => { + try { + const bigtableList = []; + const completedSet = new Set(); + for ( + let bigtableCount = 0; + bigtableCount < numClients; + bigtableCount++ + ) { + const currentCount = bigtableCount; + const onExportSuccess = () => { + completedSet.add(currentCount); + if (completedSet.size === numClients) { + // If every client has completed the export then pass the test. + clearTimeout(testTimeout); + if (!testComplete) { + testComplete = true; + done(); + } + } + }; + bigtableList.push( + await mockBigtable(defaultProjectId, done, onExportSuccess), + ); + } + for (const bigtable of bigtableList) { + for (const instanceId of [instanceId1, instanceId2]) { + await setupBigtable(bigtable, columnFamilyId, instanceId, [ + tableId1, + tableId2, + ]); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId1); + await table.getRows(); + const table2 = instance.table(tableId2); + await table2.getRows(); + } + } + } catch (e) { + done(e); + done(new Error('An error occurred while running the script')); + } + })().catch(err => { + throw err; + }); + }); + }); + describe('Bigtable/ClientSideMetricsToMetricsHandler', () => { + /** + * This method is called to do a bunch of basic assertion checks that are + * expected to pass when a client makes two getRows calls. + * + * @param projectId The projectId the request was made with + * @param requestsHandled The requests handled by the mock metrics handler + */ + function standardAssertionChecks( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[], + ) { + const firstRequest = requestsHandled[0] as any; + // We would expect these parameters to be different every time so delete + // them from the comparison after checking they exist. + assert(firstRequest.attemptLatency); + assert(firstRequest.serverLatency); + delete firstRequest.attemptLatency; + delete firstRequest.serverLatency; + delete firstRequest.metricsCollectorData.appProfileId; + assert.deepStrictEqual(firstRequest, { + connectivityErrorCount: 0, + streaming: 'true', + status: 'OK', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method: 'Bigtable.ReadRows', + projectId, + }, + }); + const secondRequest = requestsHandled[1] as any; + // We would expect these parameters to be different every time so delete + // them from the comparison after checking they exist. + assert(secondRequest.operationLatency); + assert(secondRequest.firstResponseLatency); + assert.strictEqual(secondRequest.applicationLatency, 0); + delete secondRequest.operationLatency; + delete secondRequest.firstResponseLatency; + delete secondRequest.applicationLatency; + delete secondRequest.metricsCollectorData.appProfileId; + assert.deepStrictEqual(secondRequest, { + status: 'OK', + streaming: 'true', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method: 'Bigtable.ReadRows', + table: 'my-table', + projectId, + }, + retryCount: 0, + }); + // We would expect these parameters to be different every time so delete + // them from the comparison after checking they exist. + const thirdRequest = requestsHandled[2] as any; + assert(thirdRequest.attemptLatency); + assert(thirdRequest.serverLatency); + delete thirdRequest.attemptLatency; + delete thirdRequest.serverLatency; + delete thirdRequest.metricsCollectorData.appProfileId; + assert.deepStrictEqual(thirdRequest, { + connectivityErrorCount: 0, + streaming: 'true', + status: 'OK', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table2', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method: 'Bigtable.ReadRows', + projectId, + }, + }); + const fourthRequest = requestsHandled[3] as any; + // We would expect these parameters to be different every time so delete + // them from the comparison after checking they exist. + assert(fourthRequest.operationLatency); + assert(fourthRequest.firstResponseLatency); + assert.strictEqual(fourthRequest.applicationLatency, 0); + delete fourthRequest.operationLatency; + delete fourthRequest.firstResponseLatency; + delete fourthRequest.applicationLatency; + delete fourthRequest.metricsCollectorData.appProfileId; + assert.deepStrictEqual(fourthRequest, { + status: 'OK', + streaming: 'true', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method: 'Bigtable.ReadRows', + table: 'my-table2', + projectId, + }, + retryCount: 0, + }); + } + + /** + * This method is called to check that the requests handled from the + * readRows streaming calls have the right application latencies and other + * appropriate metrics. + * + * @param projectId The projectId the request was made with + * @param requestsHandled The requests handled by the mock metrics handler + */ + function applicationLatenciesChecksHandlers( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[], + ) { + const compareValue = [ + { + serverLatency: undefined, + attemptLatency: 23000, + connectivityErrorCount: 0, + streaming: 'true', + status: 'OK', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table', + cluster: '', + zone: 'global', + method: 'Bigtable.ReadRows', + projectId, + }, + }, + { + status: 'OK', + streaming: 'true', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table', + cluster: '', + zone: 'global', + method: 'Bigtable.ReadRows', + projectId, + }, + client_name: 'nodejs-bigtable', + operationLatency: 25000, + retryCount: 0, + firstResponseLatency: 2000, + applicationLatency: 18000, // From the stream for loop + }, + { + attemptLatency: 2000, + serverLatency: undefined, + connectivityErrorCount: 0, + streaming: 'true', + status: 'OK', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table2', + cluster: '', + zone: 'global', + method: 'Bigtable.ReadRows', + projectId, + }, + }, + { + status: 'OK', + streaming: 'true', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table2', + cluster: '', + zone: 'global', + method: 'Bigtable.ReadRows', + projectId, + }, + client_name: 'nodejs-bigtable', + operationLatency: 4000, + retryCount: 0, + firstResponseLatency: 2000, + applicationLatency: 0, // This is from the getRows call. + }, + ]; + assert.deepStrictEqual(requestsHandled, compareValue); + } + + /** + * This method is called to check that the requests handled from the + * readRows streaming calls have the right application latencies and other + * appropriate metrics. + * + * @param projectId The projectId the request was made with + * @param requestsHandled The requests handled by the mock metrics handler + */ + function applicationLatenciesChecksIterative( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[], + ) { + const compareValue = [ + { + serverLatency: undefined, + attemptLatency: 28000, + connectivityErrorCount: 0, + streaming: 'true', + status: 'OK', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table', + cluster: '', + zone: 'global', + method: 'Bigtable.ReadRows', + projectId, + }, + }, + { + status: 'OK', + streaming: 'true', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table', + cluster: '', + zone: 'global', + method: 'Bigtable.ReadRows', + projectId, + }, + client_name: 'nodejs-bigtable', + operationLatency: 30000, + retryCount: 0, + firstResponseLatency: 2000, + applicationLatency: 16000, // From the stream for loop + }, + { + attemptLatency: 2000, + serverLatency: undefined, + connectivityErrorCount: 0, + streaming: 'true', + status: 'OK', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table2', + cluster: '', + zone: 'global', + method: 'Bigtable.ReadRows', + projectId, + }, + }, + { + status: 'OK', + streaming: 'true', + metricsCollectorData: { + instanceId: instanceId1, + table: 'my-table2', + cluster: '', + zone: 'global', + method: 'Bigtable.ReadRows', + projectId, + }, + client_name: 'nodejs-bigtable', + operationLatency: 4000, + retryCount: 0, + firstResponseLatency: 2000, + applicationLatency: 0, // This is from the getRows call. + }, + ]; + assert.deepStrictEqual(requestsHandled, compareValue); + } + + async function mockBigtable( + projectId: string, + done: mocha.Done, + checkFn: ( + projectId: string, + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[], + ) => void, + hrtime: FakeHRTime, + ) { + let handlerRequestCount = 0; + class TestGCPMetricsHandler extends TestMetricsHandler { + projectId = projectId; + onOperationComplete(data: OnOperationCompleteData) { + handlerRequestCount++; + try { + super.onOperationComplete(data); + if (handlerRequestCount > 1) { + assert.strictEqual(this.requestsHandled.length, 4); + checkFn(projectId, this.requestsHandled); + done(); + } + } catch (e) { + done(e); + } + } + } + + const bigtable = getFakeBigtable( + projectId, + TestGCPMetricsHandler, + hrtime, + ); + await setupBigtable(bigtable, columnFamilyId, instanceId1, [ + tableId1, + tableId2, + ]); + return bigtable; + } + + it('should send the metrics to the metrics handler for a ReadRows call', done => { + (async () => { + const projectId = defaultProjectId; + const bigtable = await mockBigtable( + projectId, + done, + standardAssertionChecks, + new FakeHRTime(), + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + await table.getRows(); + const table2 = instance.table(tableId2); + await table2.getRows(); + })().catch(err => { + throw err; + }); + }); + it('should pass the projectId to the metrics handler properly', done => { + (async () => { + try { + const projectId = SECOND_PROJECT_ID; + const bigtable = await mockBigtable( + projectId, + done, + standardAssertionChecks, + new FakeHRTime(), + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + await table.getRows(); + const table2 = instance.table(tableId2); + await table2.getRows(); + } catch (e) { + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should send the metrics to the metrics handler for a single row read', done => { + (async () => { + try { + const projectId = SECOND_PROJECT_ID; + const bigtable = await mockBigtable( + projectId, + done, + checkSingleRowCall, + new FakeHRTime(), + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + const row = new Row(table, 'rowId'); + await row.get(); + const table2 = instance.table(tableId2); + const row2 = new Row(table2, 'rowId'); + await row2.get(); + } catch (e) { + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should record the right metrics when handling rows through readrows stream', done => { + (async () => { + try { + const hrtime = new FakeHRTime(); + const bigtable = await mockBigtable( + SECOND_PROJECT_ID, + done, + applicationLatenciesChecksHandlers, + hrtime, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + // Mock stream behaviour: + // @ts-ignore + table.bigtable.request = () => { + const chunks = generateChunksFromRequest( + {}, + { + chunkSize: 1, + valueSize: 1, + errorAfterChunkNo: 2, + keyFrom: 0, + keyTo: 3, + chunksPerResponse: 1, + debugLog: () => {}, + }, + ); + const data = { + lastRowKey: chunks[2].rowKey, + chunks, + }; + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + stream.emit('data', data); + stream.emit('end'); + }); + + return stream; + }; + const stream = table.createReadStream(); + stream.on('data', () => { + // Simulate an application that takes 5 seconds between row reads. + hrtime.bigint(); + hrtime.bigint(); + hrtime.bigint(); + hrtime.bigint(); + hrtime.bigint(); + }); + stream.on('end', async () => { + const table2 = instance.table(tableId2); + await table2.getRows(); + }); + } catch (e) { + done(e); + } + })().catch(err => { + throw err; + }); + }); + it('should record the right metrics when iterating through readrows stream', done => { + (async () => { + try { + const hrtime = new FakeHRTime(); + const bigtable = await mockBigtable( + SECOND_PROJECT_ID, + done, + applicationLatenciesChecksIterative, + hrtime, + ); + const instance = bigtable.instance(instanceId1); + const table = instance.table(tableId1); + // Mock stream behaviour: + // @ts-ignore + table.bigtable.request = () => { + const chunks = generateChunksFromRequest( + {}, + { + chunkSize: 1, + valueSize: 1, + errorAfterChunkNo: 2, + keyFrom: 0, + keyTo: 3, + chunksPerResponse: 1, + debugLog: () => {}, + }, + ); + const data = { + lastRowKey: chunks[2].rowKey, + chunks, + }; + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + stream.emit('data', data); + stream.emit('end'); + }); + + return stream; + }; + const stream = table.createReadStream(); + for await (const row of stream) { + // Simulate an application that takes 5 seconds between row reads. + hrtime.bigint(); + hrtime.bigint(); + hrtime.bigint(); + hrtime.bigint(); + hrtime.bigint(); + } + const table2 = instance.table(tableId2); + await table2.getRows(); + } catch (e) { + done(e); + } + })().catch(err => { + throw err; + }); + }); + }); +}); diff --git a/handwritten/bigtable/system-test/cloud-monitoring-exporter.ts b/handwritten/bigtable/system-test/cloud-monitoring-exporter.ts new file mode 100644 index 00000000000..f484c8e0582 --- /dev/null +++ b/handwritten/bigtable/system-test/cloud-monitoring-exporter.ts @@ -0,0 +1,86 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {describe} from 'mocha'; +import { + CloudMonitoringExporter, + ExportResult, +} from '../src/client-side-metrics/exporter'; +import {ResourceMetrics} from '@opentelemetry/sdk-metrics'; +import {Bigtable} from '../src'; +import * as assert from 'assert'; +import {expectedOtelExportInput} from '../test-common/expected-otel-export-input'; + +describe('Bigtable/CloudMonitoringExporter', () => { + it('Should send an otel exported value to the CloudMonitoringExporter', done => { + // When this test is run, metrics should be visible at the following link: + // https://pantheon.corp.google.com/monitoring/metrics-explorer;duration=PT1H?inv=1&invt=Abo9_A&project={projectId} + // This test will add metrics so that they are available in Pantheon + (async () => { + const resultCallback: (result: ExportResult) => void = ( + result: ExportResult, + ) => { + try { + assert.strictEqual(result.code, 0); + done(); + } catch (error) { + // Code isn't 0 so report the original error. + done(result); + done(error); + } + }; + const bigtable = new Bigtable(); + const projectId: string = await new Promise((resolve, reject) => { + bigtable.getProjectId_((err, projectId) => { + if (err) { + reject(err); + } else { + resolve(projectId as string); + } + }); + }); + const transformedExportInput = JSON.parse( + JSON.stringify(expectedOtelExportInput).replace( + /my-project/g, + projectId, + ), + ) as unknown as typeof expectedOtelExportInput; + { + // This replaces the fake dates in time series with recent dates in the right order. + let latestTime = Math.floor(Date.now() / 1000) - 5; + transformedExportInput.scopeMetrics.reverse().forEach(scopeMetric => { + scopeMetric.metrics.reverse().forEach(metric => { + metric.dataPoints.reverse().forEach(dataPoint => { + dataPoint.endTime = [latestTime, 0]; + latestTime -= 5; + dataPoint.startTime = [latestTime, 0]; + latestTime -= 5; + }); + }); + }); + } + const exporter = new CloudMonitoringExporter({}); // Pass empty object as options + exporter + .export( + transformedExportInput as unknown as ResourceMetrics, + resultCallback, + ) + .catch(err => { + throw err; + }); + })().catch(err => { + throw err; + }); + }); +}); diff --git a/handwritten/bigtable/system-test/cluster.ts b/handwritten/bigtable/system-test/cluster.ts new file mode 100644 index 00000000000..8e1c9e9f4a6 --- /dev/null +++ b/handwritten/bigtable/system-test/cluster.ts @@ -0,0 +1,354 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {afterEach, beforeEach, describe, it} from 'mocha'; +import {generateId} from './common'; +import {Bigtable, ClusterInfo, Instance, Cluster} from '../src'; +import assert = require('assert'); +import {ClusterUtils} from '../src/utils/cluster'; +import {SetClusterMetadataOptions} from '../src/cluster'; + +export interface ValidationError { + message: string; +} + +function isValidationError(err: any): err is ValidationError { + return (err as ValidationError).message !== undefined; +} + +describe('Cluster', () => { + const bigtable = new Bigtable(); + let instance: Instance; + + async function checkMetadata( + cluster: Cluster, + compareValues: SetClusterMetadataOptions, + isConfigDefined: boolean, + ): Promise { + const metadata = await cluster.getMetadata({}); + const {clusterConfig, serveNodes} = metadata[0]; + assert.strictEqual(serveNodes, compareValues.nodes); + if (clusterConfig) { + assert.equal(isConfigDefined, true); + assert.equal( + clusterConfig.clusterAutoscalingConfig?.autoscalingLimits + ?.minServeNodes, + compareValues.minServeNodes, + ); + assert.equal( + clusterConfig.clusterAutoscalingConfig?.autoscalingLimits + ?.maxServeNodes, + compareValues.maxServeNodes, + ); + assert.equal( + clusterConfig.clusterAutoscalingConfig?.autoscalingTargets + ?.cpuUtilizationPercent, + compareValues.cpuUtilizationPercent, + ); + } else { + assert.equal(isConfigDefined, false); + } + } + + async function createNewInstance(clusters: ClusterInfo[]): Promise { + const instanceId: string = generateId('instance'); + instance = bigtable.instance(instanceId); + const [, operation] = await instance.create({ + clusters, + labels: { + time_created: Date.now(), + }, + }); + await operation.promise(); + } + async function createStandardNewInstance( + clusterId: string, + nodes: number, + ): Promise { + return await createNewInstance(standardCreationClusters(clusterId, nodes)); + } + function standardCreationClusters( + clusterId: string, + nodes: number, + ): ClusterInfo[] { + return [ + { + id: clusterId, + location: 'us-east1-c', + nodes, + }, + ]; + } + afterEach(async () => { + await instance.delete(); + }); + describe('Create cluster', () => { + describe('With manual scaling', () => { + let clusterId: string; + let cluster: Cluster; + beforeEach(async () => { + clusterId = generateId('cluster'); + await createStandardNewInstance(clusterId, 2); + cluster = instance.cluster(clusterId); + }); + it('should create an instance with clusters for manual scaling', async () => { + await checkMetadata(cluster, {nodes: 2}, false); + }); + it('should create an instance and then create a cluster for manual scaling', async () => { + const clusterId2: string = generateId('cluster'); + const cluster2 = instance.cluster(clusterId2); + const [, operation] = await cluster2.create({ + location: 'us-west1-c', + nodes: 3, + }); + await operation.promise(); + await checkMetadata(cluster2, {nodes: 3}, false); + }); + describe('Using an incorrect configuration', () => { + let cluster2: Cluster; + beforeEach(async () => { + const clusterId2: string = generateId('cluster'); + cluster2 = instance.cluster(clusterId2); + }); + it('should throw an error when providing no cluster configuration', async () => { + try { + const [, operation] = await cluster2.create({ + location: 'us-west1-c', + }); + await operation.promise(); + assert.fail(); + } catch (e) { + assert.ok(isValidationError(e)); + assert.equal(e.message, ClusterUtils.noConfigError); + } + }); + it('should throw an error when providing manual and autoscaling configurations', async () => { + try { + const [, operation] = await cluster2.create({ + location: 'us-west1-c', + nodes: 2, + minServeNodes: 3, + }); + await operation.promise(); + assert.fail(); + } catch (e) { + assert.ok(isValidationError(e)); + assert.equal(e.message, ClusterUtils.allConfigError); + } + }); + it('should throw an error when missing all autoscaling configurations', async () => { + try { + const [, operation] = await cluster2.create({ + location: 'us-west1-c', + minServeNodes: 3, + cpuUtilizationPercent: 51, + }); + await operation.promise(); + assert.fail(); + } catch (e) { + assert.ok(isValidationError(e)); + assert.equal(e.message, ClusterUtils.incompleteConfigError); + } + }); + }); + }); + describe('With automatic scaling', () => { + const minServeNodes = 2; + const maxServeNodes = 4; + const cpuUtilizationPercent = 50; + + const createClusterOptions = { + location: 'us-west1-c', + minServeNodes, + maxServeNodes, + cpuUtilizationPercent, + }; + it('should create an instance with clusters for automatic scaling', async () => { + const clusterId = generateId('cluster'); + await createNewInstance([ + Object.assign({id: clusterId}, createClusterOptions), + ]); + const cluster: Cluster = instance.cluster(clusterId); + await checkMetadata( + cluster, + { + ...createClusterOptions, + nodes: minServeNodes, + }, + true, + ); + }); + it('should create an instance and then create clusters for automatic scaling', async () => { + const clusterId: string = generateId('cluster'); + await createStandardNewInstance(clusterId, 2); + const clusterId2: string = generateId('cluster'); + const cluster: Cluster = instance.cluster(clusterId2); + const [, operation] = await cluster.create(createClusterOptions); + await operation.promise(); + await checkMetadata( + cluster, + { + ...createClusterOptions, + nodes: minServeNodes, + }, + true, + ); + }); + }); + }); + describe('Update cluster', () => { + describe('Updating manual scaling for a cluster', () => { + let cluster: Cluster; + const startingNodes = 2; + + beforeEach(async () => { + const clusterId = generateId('cluster'); + await createStandardNewInstance(clusterId, startingNodes); + cluster = instance.cluster(clusterId); + }); + + it('should change nodes for manual scaling', async () => { + const updateNodes = 5; + const [operation] = await cluster.setMetadata({nodes: updateNodes}); + await operation.promise(); + await checkMetadata( + cluster, + { + nodes: updateNodes, + }, + false, + ); + }); + it('should change cluster to autoscaling', async () => { + const minServeNodes = 3; + const maxServeNodes = 4; + const cpuUtilizationPercent = 50; + const [operation] = await cluster.setMetadata({ + minServeNodes, + maxServeNodes, + cpuUtilizationPercent, + }); + await operation.promise(); + await checkMetadata( + cluster, + { + nodes: startingNodes, + minServeNodes, + maxServeNodes, + cpuUtilizationPercent, + }, + true, + ); + }); + describe('Using an incorrect configuration', () => { + it('should throw an error when providing no cluster configuration', async () => { + try { + const [operation] = await cluster.setMetadata({}); + await operation.promise(); + assert.fail(); + } catch (e) { + assert.ok(isValidationError(e)); + assert.equal(e.message, ClusterUtils.noConfigError); + } + }); + it('should throw an error when providing manual and autoscaling configurations', async () => { + try { + const [operation] = await cluster.setMetadata({ + nodes: 2, + minServeNodes: 3, + }); + await operation.promise(); + assert.fail(); + } catch (e) { + assert.ok(isValidationError(e)); + assert.equal(e.message, ClusterUtils.allConfigError); + } + }); + it('should throw an error when missing some autoscaling configurations', async () => { + try { + const [operation] = await cluster.setMetadata({ + minServeNodes: 3, + cpuUtilizationPercent: 51, + }); + await operation.promise(); + assert.fail(); + } catch (e) { + assert.ok(isValidationError(e)); + assert.equal(e.message, ClusterUtils.incompleteConfigError); + } + }); + }); + }); + describe('Starting from autoscaling', () => { + let cluster: Cluster; + + const minServeNodes = 3; + const maxServeNodes = 4; + const cpuUtilizationPercent = 50; + const createClusterOptions = { + location: 'us-west1-c', + minServeNodes, + maxServeNodes, + cpuUtilizationPercent, + }; + + beforeEach(async () => { + const clusterId = generateId('cluster'); + await createNewInstance([ + Object.assign({id: clusterId}, createClusterOptions), + ]); + cluster = instance.cluster(clusterId); + }); + + it('should change cluster to manual scaling', async () => { + const updateNodes = 5; + const [operation] = await cluster.setMetadata({ + nodes: updateNodes, + }); + await operation.promise(); + await checkMetadata( + cluster, + { + nodes: updateNodes, + }, + false, + ); + }); + it('should change autoscaling properties', async () => { + const newMinServeNodes = 5; + const newMaxServeNodes = 6; + const newCpuUtilizationPercent = 53; + assert.notEqual(minServeNodes, newMinServeNodes); + assert.notEqual(maxServeNodes, newMaxServeNodes); + assert.notEqual(cpuUtilizationPercent, newCpuUtilizationPercent); + const [operation] = await cluster.setMetadata({ + minServeNodes: newMinServeNodes, + maxServeNodes: newMaxServeNodes, + cpuUtilizationPercent: newCpuUtilizationPercent, + }); + await operation.promise(); + await checkMetadata( + cluster, + { + nodes: minServeNodes, + minServeNodes: newMinServeNodes, + maxServeNodes: newMaxServeNodes, + cpuUtilizationPercent: newCpuUtilizationPercent, + }, + true, + ); + }); + }); + }); +}); diff --git a/handwritten/bigtable/system-test/common.ts b/handwritten/bigtable/system-test/common.ts new file mode 100644 index 00000000000..06560422f17 --- /dev/null +++ b/handwritten/bigtable/system-test/common.ts @@ -0,0 +1,32 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as uuid from 'uuid'; +import {Cluster} from '../src/cluster'; +import * as inst from '../src/instance'; + +export const PREFIX = 'gt-'; + +export function generateId(resourceType: string) { + const newUuid = uuid.v1().substr(4, 4); + return `${PREFIX}${resourceType}-${newUuid}-${Date.now()}`; +} + +export class FakeCluster extends Cluster { + calledWith_: Array<{}>; + constructor(...args: [inst.Instance, string]) { + super(args[0], args[1]); + this.calledWith_ = args; + } +} diff --git a/handwritten/bigtable/system-test/data/mutate-rows-retry-test.json b/handwritten/bigtable/system-test/data/mutate-rows-retry-test.json new file mode 100644 index 00000000000..e88fbc4bb25 --- /dev/null +++ b/handwritten/bigtable/system-test/data/mutate-rows-retry-test.json @@ -0,0 +1,117 @@ +{ + "tests": [ + { + "name": "valid mutation", + "max_retries": 3, + "mutations_request": [ + { "method": "insert", "key": "foo", "data": {} }, + { "method": "insert", "key": "bar", "data": {} }, + { "method": "insert", "key": "baz", "data": {} } + ], + "responses": [ + { "code": 200, "entry_codes": [ 0, 0, 0 ] } + ], + "mutation_batches_invoked": [ + [ "foo", "bar", "baz" ] + ] + }, { + "name": "retries the failed mutations", + "max_retries": 3, + "mutations_request": [ + { "method": "insert", "key": "foo", "data": {} }, + { "method": "insert", "key": "bar", "data": {} }, + { "method": "insert", "key": "baz", "data": {} } + ], + "responses": [ + { "code": 200, "entry_codes": [ 0, 4, 4 ] }, + { "code": 200, "entry_codes": [ 4, 0 ] }, + { "code": 200, "entry_codes": [ 4 ] }, + { "code": 200, "entry_codes": [ 0 ] } + ], + "mutation_batches_invoked": [ + [ "foo", "bar", "baz" ], + [ "bar", "baz" ], + [ "bar" ], + [ "bar" ] + ] + }, { + "name": "has a `PartialFailureError` error when an entry fails after the retries", + "max_retries": 3, + "mutations_request": [ + { "method": "insert", "key": "foo", "data": {} }, + { "method": "insert", "key": "bar", "data": {} }, + { "method": "insert", "key": "baz", "data": {} } + ], + "responses": [ + { "code": 200, "entry_codes": [ 0, 4, 0 ] }, + { "code": 200, "entry_codes": [ 4 ] }, + { "code": 200, "entry_codes": [ 4 ] }, + { "code": 200, "entry_codes": [ 4 ] } + ], + "mutation_batches_invoked": [ + [ "foo", "bar", "baz" ], + [ "bar" ], + [ "bar" ], + [ "bar" ] + ], + "errors": [ + { "index_in_mutations_request": 1 } + ] + }, { + "name": "does not retry unretryable mutations", + "max_retries": 5, + "mutations_request": [ + { "method": "insert", "key": "foo", "data": {} }, + { "method": "insert", "key": "bar", "data": {} }, + { "method": "insert", "key": "baz", "data": {} }, + { "method": "insert", "key": "qux", "data": {} }, + { "method": "insert", "key": "quux", "data": {} }, + { "method": "insert", "key": "corge", "data": {} } + ], + "responses": [ + { "code": 200, "entry_codes": [ 4, 4, 4, 4, 4, 1 ] }, + { "code": 200, "entry_codes": [ 4, 14, 14, 14, 0 ] }, + { "code": 200, "entry_codes": [ 1, 4, 4, 0 ] }, + { "code": 200, "entry_codes": [ 0, 4 ] }, + { "code": 200, "entry_codes": [ 4 ] }, + { "code": 200, "entry_codes": [ 1 ] } + ], + "mutation_batches_invoked": [ + [ "foo", "bar", "baz", "qux", "quux", "corge" ], + [ "foo", "bar", "baz", "qux", "quux" ], + [ "foo", "bar", "baz", "qux" ], + [ "bar", "baz" ], + [ "baz" ], + [ "baz" ] + ], + "errors": [ + { "index_in_mutations_request": 0 }, + { "index_in_mutations_request": 2 }, + { "index_in_mutations_request": 5 } + ] + }, { + "name": "considers network errors towards the retry count", + "max_retries": 3, + "mutations_request": [ + { "method": "insert", "key": "foo", "data": {} }, + { "method": "insert", "key": "bar", "data": {} }, + { "method": "insert", "key": "baz", "data": {} } + ], + "responses": [ + { "code": 200, "entry_codes": [ 0, 4, 0 ] }, + { "code": 429 }, + { "code": 200, "entry_codes": [ 4 ] }, + { "code": 200, "entry_codes": [ 4 ] } + ], + "mutation_batches_invoked": [ + [ "foo", "bar", "baz" ], + [ "bar" ], + [ "bar" ], + [ "bar" ] + ], + "errors": [ + { "index_in_mutations_request": 1 } + ] + } + ] +} diff --git a/handwritten/bigtable/system-test/data/read-rows-retry-test.json b/handwritten/bigtable/system-test/data/read-rows-retry-test.json new file mode 100644 index 00000000000..d97291a2f6e --- /dev/null +++ b/handwritten/bigtable/system-test/data/read-rows-retry-test.json @@ -0,0 +1,333 @@ +{ + "tests": [ + + + { + "name": "simple read", + "max_retries": 3, + "request_options": [ + { + "rowKeys": [], + "rowRanges": [{}] + } + ], + "responses": [ + { "row_keys": [ "a", "b", "c" ] } + ], + "row_keys_read": [ + [ "a", "b", "c" ] + ] + }, + + + + { + "name": "retries a failed read", + "max_retries": 3, + "request_options": [ + { "rowKeys": [], + "rowRanges": [{}] + }, + { "rowKeys": [], "rowRanges": [ { "startKeyOpen": "b" } ] } + ], + "responses": [ + { "row_keys": [ "a", "b" ], "end_with_error": 4 }, + { "row_keys": [ "c" ] } + ], + "row_keys_read": [ + [ "a", "b" ], + [ "c" ] + ] + }, + + + + { + "name": "fails after all available retries", + "max_retries": 3, + "request_options": [ + { "rowKeys": [], + "rowRanges": [{}] + }, + { "rowKeys": [], + "rowRanges": [{}] + }, + { "rowKeys": [], + "rowRanges": [{}] + }, + { "rowKeys": [], + "rowRanges": [{}] + } + ], + "responses": [ + { "end_with_error": 4 }, + { "end_with_error": 4 }, + { "end_with_error": 4 }, + { "end_with_error": 4 } + ], + "row_keys_read": [ + [], [], [], [] + ], + "error": 4 + }, + + + + + { + "name": "resets the retry counter after a successful read", + "max_retries": 4, + "request_options": [ + { "rowKeys": [], + "rowRanges": [{}] + }, + { "rowKeys": [], "rowRanges": [ { "startKeyOpen": "a" } ] }, + { "rowKeys": [], "rowRanges": [ { "startKeyOpen": "a" } ] }, + { "rowKeys": [], "rowRanges": [ { "startKeyOpen": "a" } ] }, + { "rowKeys": [], "rowRanges": [ { "startKeyOpen": "a" } ] }, + { "rowKeys": [], "rowRanges": [ { "startKeyOpen": "b" } ] }, + { "rowKeys": [], "rowRanges": [ { "startKeyOpen": "b" } ] }, + { "rowKeys": [], "rowRanges": [ { "startKeyOpen": "b" } ] } + ], + "responses": [ + { "row_keys": [ "a" ], "end_with_error": 4 }, + { "end_with_error": 4 }, + { "end_with_error": 4 }, + { "end_with_error": 4 }, + { "row_keys": [ "b" ], "end_with_error": 4 }, + { "end_with_error": 4 }, + { "end_with_error": 4 }, + { "row_keys": [ "c" ] } + ], + "row_keys_read": [ + [ "a" ], [], [], [], [ "b" ], [], [], [ "c" ] + ] + }, + + + + { + "name": "moves the start point of a range being consumed", + "max_retries": 3, + "createReadStream_options": { + "ranges": [{ + "start": "a", + "end": "z" + }] + }, + "request_options": [ + { "rowKeys": [], "rowRanges": [ { "startKeyClosed": "a", "endKeyClosed": "z" } ] }, + { "rowKeys": [], "rowRanges": [ { "startKeyOpen": "b", "endKeyClosed": "z" } ] } + ], + "responses": [ + { "row_keys": [ "a", "b" ], "end_with_error": 4 }, + { "row_keys": [ "c" ] } + ], + "row_keys_read": [ + [ "a", "b" ], + [ "c" ] + ] + }, + + + + { + "name": "removes ranges already consumed", + "max_retries": 3, + "createReadStream_options": { + "ranges": [{ + "start": "a", + "end": "c" + }, { + "start": "x", + "end": "z" + }] + }, + "request_options": [ + { "rowKeys": [], + "rowRanges": [ + { "startKeyClosed": "a", "endKeyClosed": "c" }, + { "startKeyClosed": "x", "endKeyClosed": "z" } + ] }, + { "rowKeys": [], + "rowRanges": [ { "startKeyClosed": "x", "endKeyClosed": "z" } ] } + ], + "responses": [ + { "row_keys": [ "a", "b", "c" ], "end_with_error": 4 }, + { "row_keys": [ "x" ] } + ], + "row_keys_read": [ + [ "a", "b", "c" ], + [ "x" ] + ] + }, + + + + { + "name": "removes keys already read", + "max_retries": 3, + "createReadStream_options": { + "keys": ["a", "b", "x"] + }, + "request_options": [ + { "rowKeys": [ "a", "b", "x" ], "rowRanges": [] }, + { "rowKeys": [ "x" ], "rowRanges": [] } + ], + "responses": [ + { "row_keys": [ "a", "b", "c" ], "end_with_error": 4 }, + { "row_keys": [ "x" ] } + ], + "row_keys_read": [ + [ "a", "b", "c" ], + [ "x" ] + ] + }, + + + { + "name": "adjust the limit based on the number of rows read", + "max_retries": 3, + "createReadStream_options": { + "limit": 10 + }, + "request_options": [ + { "rowKeys": [], "rowRanges": [{}], "rowsLimit": 10 }, + { "rowsLimit": 8, "rowKeys":[], "rowRanges": [ { "startKeyOpen": "b" } ] } + ], + "responses": [ + { "row_keys": [ "a", "b" ], "end_with_error": 4 }, + { "row_keys": [ "x" ] } + ], + "row_keys_read": [ + [ "a", "b" ], + [ "x" ] + ] + }, + + + + + + { + "name": "does the previous 5 things in one giant test case", + "max_retries": 4, + "createReadStream_options": { + "limit": 10, + "ranges": [{ + "start": "a", + "end": "c" + }, { + "start": "p", + "end": "s" + }, { + "start": "x", + "end": "z" + }], + "keys": [ "a", "b", "c", "p", "q", "r", "s", "x", "y", "z" ] + }, + "request_options": [ + { + "rowKeys": [ "a", "b", "c", "p", "q", "r", "s", "x", "y", "z" ], + "rowsLimit": 10, + "rowRanges": [ + { "startKeyClosed": "a", "endKeyClosed": "c" }, + { "startKeyClosed": "p", "endKeyClosed": "s" }, + { "startKeyClosed": "x", "endKeyClosed": "z" } + ] + }, + { + "rowKeys": [ "b", "c", "p", "q", "r", "s", "x", "y", "z" ], + "rowsLimit": 9, + "rowRanges": [ + { "startKeyOpen": "a", "endKeyClosed": "c" }, + { "startKeyClosed": "p", "endKeyClosed": "s" }, + { "startKeyClosed": "x", "endKeyClosed": "z" } + ] + }, + { + "rowKeys": [ "c", "p", "q", "r", "s", "x", "y", "z" ], + "rowsLimit": 8, + "rowRanges": [ + { "startKeyOpen": "b", "endKeyClosed": "c" }, + { "startKeyClosed": "p", "endKeyClosed": "s" }, + { "startKeyClosed": "x", "endKeyClosed": "z" } + ] + }, + { + "rowKeys": [ "c", "p", "q", "r", "s", "x", "y", "z" ], + "rowsLimit": 8, + "rowRanges": [ + { "startKeyOpen": "b", "endKeyClosed": "c" }, + { "startKeyClosed": "p", "endKeyClosed": "s" }, + { "startKeyClosed": "x", "endKeyClosed": "z" } + ] + }, + { + "rowKeys": [ "c", "p", "q", "r", "s", "x", "y", "z" ], + "rowsLimit": 8, + "rowRanges": [ + { "startKeyOpen": "b", "endKeyClosed": "c" }, + { "startKeyClosed": "p", "endKeyClosed": "s" }, + { "startKeyClosed": "x", "endKeyClosed": "z" } + ] + }, + { + "rowKeys": [ "c", "p", "q", "r", "s", "x", "y", "z" ], + "rowsLimit": 8, + "rowRanges": [ + { "startKeyOpen": "b", "endKeyClosed": "c" }, + { "startKeyClosed": "p", "endKeyClosed": "s" }, + { "startKeyClosed": "x", "endKeyClosed": "z" } + ] + }, + { + "rowKeys": [ "p", "q", "r", "s", "x", "y", "z" ], + "rowsLimit": 7, + "rowRanges": [ + { "startKeyClosed": "p", "endKeyClosed": "s" }, + { "startKeyClosed": "x", "endKeyClosed": "z" } + ] + }, + { + "rowKeys": [ "y", "z" ], + "rowsLimit": 2, + "rowRanges": [ + { "startKeyOpen": "x", "endKeyClosed": "z" } + ] + }, + { + "rowKeys": [ "z" ], + "rowsLimit": 1, + "rowRanges": [ + { "startKeyOpen": "y", "endKeyClosed": "z" } + ] + } + ], + "responses": [ + { "row_keys": [ "a" ], "end_with_error": 4 }, + { "row_keys": [ "b" ], "end_with_error": 4 }, + { "end_with_error": 4 }, + { "end_with_error": 4 }, + { "end_with_error": 4 }, + { "row_keys": [ "c" ], "end_with_error": 4 }, + { "row_keys": [ "p", "q", "r", "s", "x" ], "end_with_error": 4 }, + { "row_keys": [ "y" ], "end_with_error": 4 }, + { "row_keys": [ "z" ] } + ], + "row_keys_read": [ + [ "a" ], + [ "b" ], + [], + [], + [], + [ "c" ], + [ "p", "q", "r", "s", "x" ], + [ "y" ], + [ "z" ] + ] + } + + + ] +} diff --git a/handwritten/bigtable/system-test/fixtures/sample/src/index.js b/handwritten/bigtable/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..fa99c268e2f --- /dev/null +++ b/handwritten/bigtable/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 bigtable = require('@google-cloud/bigtable'); + +function main() { + const bigtableClient = new bigtable.Bigtable(); +} + +main(); diff --git a/handwritten/bigtable/system-test/fixtures/sample/src/index.ts b/handwritten/bigtable/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..af16dbd2025 --- /dev/null +++ b/handwritten/bigtable/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,33 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 {Bigtable} from '@google-cloud/bigtable'; + +// check that the client class type name can be used +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function doStuffWithBigtable(client: Bigtable) { + // client.close(); +} + +function main() { + // check that the client instance can be created + const bigtableClient = new Bigtable(); + doStuffWithBigtable(bigtableClient); +} + +main(); diff --git a/handwritten/bigtable/system-test/gcp-metrics-handler.ts b/handwritten/bigtable/system-test/gcp-metrics-handler.ts new file mode 100644 index 00000000000..2608d6e191b --- /dev/null +++ b/handwritten/bigtable/system-test/gcp-metrics-handler.ts @@ -0,0 +1,306 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {describe} from 'mocha'; +import {expectedRequestsHandled} from '../test-common/metrics-handler-fixture'; +import { + OnAttemptCompleteData, + OnOperationCompleteData, +} from '../src/client-side-metrics/metrics-handler'; +import { + CloudMonitoringExporter, + ExportResult, +} from '../src/client-side-metrics/exporter'; +import {Bigtable} from '../src'; +import {ResourceMetrics} from '@opentelemetry/sdk-metrics'; +import * as assert from 'assert'; +import {ClientOptions} from 'google-gax'; +import * as proxyquire from 'proxyquire'; + +function getHandler(Exporter: typeof CloudMonitoringExporter) { + const FakeCGPMetricsHandler = proxyquire( + '../src/client-side-metrics/gcp-metrics-handler.js', + { + './exporter': { + CloudMonitoringExporter: Exporter, + }, + }, + ).GCPMetricsHandler; + return new FakeCGPMetricsHandler(); +} + +describe('Bigtable/GCPMetricsHandler', () => { + it('Should export a value to the GCPMetricsHandler', done => { + (async () => { + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. + */ + const timeout = setTimeout(() => { + done(new Error('The export never happened')); + }, 120000); + /* + The exporter is called every x seconds, but we only want to test the value + it receives once. Since done cannot be called multiple times in mocha, + exported variable ensures we only test the value export receives one time. + */ + let exported = false; + function getTestResultCallback( + resultCallback: (result: ExportResult) => void, + ) { + return (result: ExportResult) => { + exported = true; + try { + clearTimeout(timeout); + assert.strictEqual(result.code, 0); + done(); + resultCallback({code: 0}); + } catch (error) { + // Code isn't 0 so report the original error. + done(result); + done(error); + } + }; + } + class MockExporter extends CloudMonitoringExporter { + constructor(options: ClientOptions) { + super(options); + } + + async export( + metrics: ResourceMetrics, + resultCallback: (result: ExportResult) => void, + ): Promise { + const testResultCallback = getTestResultCallback(resultCallback); + if (!exported) { + await super.export(metrics, testResultCallback); + } else { + resultCallback({code: 0}); + } + } + } + + const bigtable = new Bigtable(); + const projectId: string = await new Promise((resolve, reject) => { + bigtable.getProjectId_((err, projectId) => { + if (err) { + reject(err); + } else { + resolve(projectId as string); + } + }); + }); + const handler = getHandler(MockExporter); + const transformedRequestsHandled = JSON.parse( + JSON.stringify(expectedRequestsHandled).replace( + /my-project/g, + projectId, + ), + ); + for (const request of transformedRequestsHandled) { + if (request.attemptLatency) { + handler.onAttemptComplete(request as OnAttemptCompleteData); + } else { + handler.onOperationComplete(request as OnOperationCompleteData); + } + } + })().catch(err => { + done(err); + }); + }); + it('Should export a value to two GCPMetricsHandlers', done => { + // This test ensures that when we create two GCPMetricsHandlers much like + // what we would be doing when calling readRows on two separate tables that + // the data doesn't store duplicates in the same place and export twice as + // much data as it should. + (async () => { + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. + */ + const timeout = setTimeout(() => { + done(new Error('The export never happened')); + }, 120000); + /* + The exporter is called every x seconds, but we only want to test the value + it receives once. Since done cannot be called multiple times in mocha, + exported variable ensures we only test the value export receives one time. + */ + let exportedCount = 0; + function getTestResultCallback( + resultCallback: (result: ExportResult) => void, + ) { + return (result: ExportResult) => { + exportedCount++; + try { + assert.strictEqual(result.code, 0); + } catch (error) { + // Code isn't 0 so report the original error. + done(result); + done(error); + } + if (exportedCount === 1) { + // We are expecting two calls to an exporter. One for each + // metrics handler. + clearTimeout(timeout); + done(); + } + // The resultCallback needs to be called to end the exporter operation + // so that the test shuts down in mocha. + resultCallback({code: 0}); + }; + } + class MockExporter extends CloudMonitoringExporter { + constructor(options: ClientOptions) { + super(options); + } + + async export( + metrics: ResourceMetrics, + resultCallback: (result: ExportResult) => void, + ): Promise { + if (exportedCount < 1) { + // The code below uses the test callback to ensure the export was successful. + const testResultCallback = getTestResultCallback(resultCallback); + await super.export(metrics, testResultCallback); + } else { + // After the test is complete the periodic exporter may still be + // running in which case we don't want to do any checks. We just + // want to call the resultCallback so that there are no hanging + // threads. + resultCallback({code: 0}); + } + } + } + + const bigtable = new Bigtable(); + const projectId: string = await new Promise((resolve, reject) => { + bigtable.getProjectId_((err, projectId) => { + if (err) { + reject(err); + } else { + resolve(projectId as string); + } + }); + }); + const handler = getHandler(MockExporter); + const handler2 = handler; + const transformedRequestsHandled = JSON.parse( + JSON.stringify(expectedRequestsHandled).replace( + /my-project/g, + projectId, + ), + ); + for (const request of transformedRequestsHandled) { + if (request.attemptLatency) { + handler.onAttemptComplete(request as OnAttemptCompleteData); + } else { + handler.onOperationComplete(request as OnOperationCompleteData); + } + } + for (const request of transformedRequestsHandled) { + if (request.attemptLatency) { + handler2.onAttemptComplete(request as OnAttemptCompleteData); + } else { + handler2.onOperationComplete(request as OnOperationCompleteData); + } + } + })().catch(err => { + done(err); + }); + }); + it('Should write two duplicate points inserted into the metrics handler', done => { + (async () => { + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. + */ + const timeout = setTimeout(() => { + done(new Error('The export never happened')); + }, 120000); + /* + The exporter is called every x seconds, but we only want to test the value + it receives once. Since done cannot be called multiple times in mocha, + exported variable ensures we only test the value export receives one time. + */ + let exported = false; + function getTestResultCallback( + resultCallback: (result: ExportResult) => void, + ) { + return (result: ExportResult) => { + exported = true; + try { + clearTimeout(timeout); + assert.strictEqual(result.code, 0); + done(); + resultCallback({code: 0}); + } catch (error) { + // Code isn't 0 so report the original error. + done(result); + done(error); + } + }; + } + class MockExporter extends CloudMonitoringExporter { + constructor(options: ClientOptions) { + super(options); + } + + async export( + metrics: ResourceMetrics, + resultCallback: (result: ExportResult) => void, + ): Promise { + const testResultCallback = getTestResultCallback(resultCallback); + if (!exported) { + await super.export(metrics, testResultCallback); + } else { + resultCallback({code: 0}); + } + } + } + + const bigtable = new Bigtable(); + const projectId: string = await new Promise((resolve, reject) => { + bigtable.getProjectId_((err, projectId) => { + if (err) { + reject(err); + } else { + resolve(projectId as string); + } + }); + }); + const handler = getHandler(MockExporter); // Pass options with exporter + const transformedRequestsHandled = JSON.parse( + JSON.stringify(expectedRequestsHandled).replace( + /my-project/g, + projectId, + ), + ); + for (let i = 0; i < 2; i++) { + for (const request of transformedRequestsHandled) { + if (request.attemptLatency) { + handler.onAttemptComplete(request as OnAttemptCompleteData); + } else { + handler.onOperationComplete(request as OnOperationCompleteData); + } + } + } + })().catch(err => { + done(err); + }); + }); +}); diff --git a/handwritten/bigtable/system-test/install.ts b/handwritten/bigtable/system-test/install.ts new file mode 100644 index 00000000000..5257a7ba101 --- /dev/null +++ b/handwritten/bigtable/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts', + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js', + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/handwritten/bigtable/system-test/mutate-rows.ts b/handwritten/bigtable/system-test/mutate-rows.ts new file mode 100644 index 00000000000..f7df751b0b5 --- /dev/null +++ b/handwritten/bigtable/system-test/mutate-rows.ts @@ -0,0 +1,160 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {Bigtable} from '../src'; +import {Test} from './testTypes'; +const {tests} = + require('../../system-test/data/mutate-rows-retry-test.json') as { + tests: Test[]; + }; + +import * as assert from 'assert'; +import {afterEach, beforeEach, describe, it} from 'mocha'; +import * as sinon from 'sinon'; +import {EventEmitter} from 'events'; +import {Entry, PartialFailureError} from '../src/table'; +import {CancellableStream, GrpcClient, GoogleAuth} from 'google-gax'; +import {BigtableClient} from '../src/v2'; +import {PassThrough} from 'stream'; + +const {grpc} = new GrpcClient(); + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function dispatch(emitter: EventEmitter, response: any) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const emits: any[] = []; + emits.push({name: 'request'}); + emits.push({name: 'response', arg: {code: response.code}}); + if (response.entry_codes) { + emits.push({name: 'data', arg: entryResponses(response.entry_codes)}); + } + emits.push({name: 'end'}); + let index = 0; + setImmediate(next); + + function next() { + if (index < emits.length) { + const emit = emits[index]; + index++; + emitter.emit(emit.name, emit.arg); + setImmediate(next); + } + } +} + +function entryResponses(statusCodes: number[]) { + return { + entries: statusCodes.map((code, index) => ({ + index, + status: {code}, + })), + }; +} + +describe('Bigtable/Table', () => { + const bigtable = new Bigtable(); + bigtable.api = {}; + bigtable.auth = { + getProjectId(callback: Function) { + callback(null, 'project-id'); + }, + } as GoogleAuth; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (bigtable as any).grpcCredentials = grpc.credentials.createInsecure(); + + const INSTANCE = bigtable.instance('instance'); + const TABLE = INSTANCE.table('table'); + + describe('mutate()', () => { + let clock: sinon.SinonFakeTimers; + let mutationBatchesInvoked: Array<{}>; + let mutationCallTimes: number[]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let responses: any[] | null; + let currentRetryAttempt: number; + + beforeEach(() => { + clock = sinon.useFakeTimers({ + toFake: ['setTimeout', 'setImmediate', 'Date', 'nextTick'], + }); + mutationBatchesInvoked = []; + mutationCallTimes = []; + responses = null; + bigtable.api.BigtableClient = { + mutateRows: (reqOpts, options) => { + // TODO: Currently retry options for retry-request are ignored. + // Retry-request is not handling grpc errors correctly, so + // we are handling retries in table.ts and disabling retries in + // gax to avoid a request getting retried in multiple places. + // Re-enable this test after switching back to using the retry + // logic in gax + // const retryRequestOptions = { + // noResponseRetries: 0, + // objectMode: true, + // shouldRetryFn: shouldRetryRequest, + // currentRetryAttempt: currentRetryAttempt++, + // }; + mutationBatchesInvoked.push( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + reqOpts!.entries!.map(entry => (entry.rowKey as any).asciiSlice()), + ); + // assert.deepStrictEqual( + // options!.retryRequestOptions, + // retryRequestOptions + // ); + mutationCallTimes.push(new Date().getTime()); + const emitter = new PassThrough({objectMode: true}); + dispatch(emitter, responses!.shift()); + return emitter as {} as CancellableStream; + }, + } as BigtableClient; + }); + + afterEach(() => { + clock.restore(); + }); + + tests.forEach(test => { + it(test.name, done => { + currentRetryAttempt = 0; + responses = test.responses; + TABLE.maxRetries = test.max_retries; + TABLE.mutate(test.mutations_request, error => { + assert.deepStrictEqual( + mutationBatchesInvoked, + test.mutation_batches_invoked, + ); + if (test.errors) { + const expectedIndices = test.errors.map(error => { + return error.index_in_mutations_request; + }); + assert.deepStrictEqual(error!.name, 'PartialFailureError'); + const actualIndices = (error as PartialFailureError).errors!.map( + error => { + return test.mutations_request.indexOf( + (error as {entry: Entry}).entry, + ); + }, + ); + assert.deepStrictEqual(expectedIndices, actualIndices); + } else { + assert.ifError(error); + } + done(); + }); + clock.runAll(); + }); + }); + }); +}); diff --git a/handwritten/bigtable/system-test/read-modify-write-row-interceptors.ts b/handwritten/bigtable/system-test/read-modify-write-row-interceptors.ts new file mode 100644 index 00000000000..420b7146ed8 --- /dev/null +++ b/handwritten/bigtable/system-test/read-modify-write-row-interceptors.ts @@ -0,0 +1,297 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {describe, it, before, after} from 'mocha'; +import {Bigtable} from '../src'; +import {ServiceError} from 'google-gax'; +import {ClientSideMetricsConfigManager} from '../src/client-side-metrics/metrics-config-manager'; +import {TestMetricsHandler} from '../test-common/test-metrics-handler'; +import { + OnAttemptCompleteData, + OnOperationCompleteData, +} from '../src/client-side-metrics/metrics-handler'; +import {OperationMetricsCollector} from '../src/client-side-metrics/operation-metrics-collector'; +import { + MethodName, + StreamingState, +} from '../src/client-side-metrics/client-side-metrics-attributes'; +import * as assert from 'assert'; +import {status as GrpcStatus} from '@grpc/grpc-js'; +import {createMetricsUnaryInterceptorProvider} from '../src/client-side-metrics/metric-interceptor'; + +const INSTANCE_ID = 'isolated-rmw-instance'; +const TABLE_ID = 'isolated-rmw-table'; +const ZONE = 'us-central2-a'; +const CLUSTER = 'fake-cluster'; +const COLUMN_FAMILY = 'traits'; +const COLUMN_FAMILIES = [COLUMN_FAMILY]; +const ROW_KEY = 'gwashington'; +const COLUMN = 'teeth'; + +/** + * Creates a Bigtable instance if it does not already exist. + * + * @param bigtable - The Bigtable client. + * @param instanceId - The ID of the instance to create. + * @param clusterId - The ID of the initial cluster in the instance. + * @param locationId - The location (region) for the initial cluster. + * @returns The created instance object if successful, otherwise logs a message and returns the existing instance. + */ +async function createInstance( + bigtable: Bigtable, + instanceId: string, + clusterId: string, + locationId: string, +) { + const instance = bigtable.instance(instanceId); + + const [exists] = await instance.exists(); + if (exists) { + console.log(`Instance ${instanceId} already exists.`); + return instance; + } + + const [i, operation] = await instance.create({ + clusters: [ + { + id: clusterId, + location: locationId, + nodes: 3, + }, + ], + labels: { + time_created: Date.now(), + }, + }); + await operation.promise(); + console.log(`Created instance ${instanceId}`); + return i; +} + +/** + * Creates a Bigtable table if it does not already exist. + * + * @param bigtable - The Bigtable client. + * @param instanceId - The ID of the instance containing the table. + * @param tableId - The ID of the table to create. + * @param families - An array of column family names to create in the table. + * @returns A promise that resolves with the created Table object. + */ +async function createTable( + bigtable: Bigtable, + instanceId: string, + tableId: string, + families: string[], +) { + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId); + + const [exists] = await table.exists(); + if (exists) { + console.log(`Table ${tableId} already exists.`); + return table; + } + + const [t] = await table.create({ + families: families, + }); + const row = table.row(ROW_KEY); + await row.save({ + [COLUMN_FAMILY]: { + [COLUMN]: 'shiny', + }, + }); + console.log(`Created table ${tableId}`); + return t; +} + +/** + * Creates and returns a TestMetricsHandler instance for testing purposes. + * + * @returns A TestMetricsHandler instance with the projectId set to 'test-project-id'. + */ +function getTestMetricsHandler() { + const testMetricsHandler = new TestMetricsHandler(); + testMetricsHandler.projectId = 'test-project-id'; + return testMetricsHandler; +} + +/** + * Asynchronously retrieves the project ID associated with the Bigtable client. + * + * @param bigtable - The Bigtable client instance. + * @returns A promise that resolves with the project ID as a string. + * @throws An error if the project ID cannot be retrieved. + */ +async function getProjectIdFromClient(bigtable: Bigtable): Promise { + return new Promise((resolve, reject) => { + bigtable.getProjectId_((err, projectId) => { + if (err) { + reject(err); + } else { + resolve(projectId!); + } + }); + }); +} + +describe('Bigtable/ReadModifyWriteRowInterceptorMetrics', () => { + let bigtable: Bigtable; + let testMetricsHandler: TestMetricsHandler; + + before(async () => { + bigtable = new Bigtable(); + await getProjectIdFromClient(bigtable); + await createInstance(bigtable, INSTANCE_ID, CLUSTER, ZONE); + await createTable(bigtable, INSTANCE_ID, TABLE_ID, COLUMN_FAMILIES); + testMetricsHandler = getTestMetricsHandler(); + bigtable._metricsConfigManager = new ClientSideMetricsConfigManager([ + testMetricsHandler, + ]); + }); + + after(async () => { + const instance = bigtable.instance(INSTANCE_ID); + await instance.delete(); + }); + + it('should record and export correct metrics for ReadModifyWriteRow via interceptors', async () => { + const instance = bigtable.instance(INSTANCE_ID); + + const table = instance.table(TABLE_ID); + + /* + fakeReadModifyWriteRowMethod is just a fake method on a table that makes a + call to the readWriteModifyRow grpc endpoint. It demonstrates what a method + might look like when trying to make a unary call while extracting + information from the headers and trailers that the server returns so that + the extracted information can be recorded in client side metrics. + */ + (table as any).fakeReadModifyWriteRowMethod = async () => { + // 1. Create a metrics collector. + const metricsCollector = new OperationMetricsCollector( + table, + MethodName.READ_MODIFY_WRITE_ROW, + StreamingState.UNARY, + (table as any).bigtable._metricsConfigManager!.metricsHandlers, + ); + // 2. Tell the metrics collector an attempt has been started. + metricsCollector.onOperationStart(); + metricsCollector.onAttemptStart(); + // 3. Make a unary call with gax options that include interceptors. The + // interceptors are built from a method that hooks them up to the + // metrics collector + const responseArray = await new Promise((resolve, reject) => { + bigtable.request( + { + client: 'BigtableClient', + method: 'readModifyWriteRow', + reqOpts: { + tableName: table.name, + rowKey: Buffer.from(ROW_KEY), + rules: [ + { + familyName: COLUMN_FAMILY, + columnQualifier: Buffer.from(COLUMN), + appendValue: Buffer.from('-wood'), + }, + ], + appProfileId: undefined, + }, + gaxOpts: createMetricsUnaryInterceptorProvider( + {}, + metricsCollector, + ), + }, + (err: ServiceError | null, resp?: any) => { + if (err) { + reject(err); + } else { + resolve(resp); + } + }, + ); + }); + // 4. Tell the metrics collector the attempt is over + metricsCollector.onAttemptComplete(GrpcStatus.OK); + metricsCollector.onOperationComplete(GrpcStatus.OK, 0); + // 5. Return results of method call to the user + return responseArray; + }; + + await (table as any).fakeReadModifyWriteRowMethod(); + + assert.strictEqual(testMetricsHandler.requestsHandled.length, 2); + + const attemptCompleteData = testMetricsHandler.requestsHandled.find( + m => (m as {attemptLatency?: number}).attemptLatency !== undefined, + ) as OnAttemptCompleteData | undefined; + const operationCompleteData = testMetricsHandler.requestsHandled.find( + m => (m as {operationLatency?: number}).operationLatency !== undefined, + ) as OnOperationCompleteData | undefined; + + assert.ok(attemptCompleteData, 'OnAttemptCompleteData should be present'); + assert.ok( + operationCompleteData, + 'OnOperationCompleteData should be present', + ); + if (!attemptCompleteData || !operationCompleteData) { + throw new Error('Metrics data is missing'); // Should be caught by asserts above + } + assert.strictEqual( + attemptCompleteData.metricsCollectorData.method, + MethodName.READ_MODIFY_WRITE_ROW, + ); + assert.strictEqual(attemptCompleteData.status, 'OK'); + assert.strictEqual( + attemptCompleteData.metricsCollectorData.table, + TABLE_ID, + ); + assert.strictEqual( + attemptCompleteData.metricsCollectorData.instanceId, + INSTANCE_ID, + ); + assert.ok(attemptCompleteData.attemptLatency >= 0); + assert(attemptCompleteData.serverLatency); + assert.ok(attemptCompleteData.serverLatency >= 0); + assert.strictEqual(attemptCompleteData.metricsCollectorData.zone, ZONE); + assert.strictEqual( + attemptCompleteData.metricsCollectorData.cluster, + CLUSTER, + ); + assert.strictEqual(attemptCompleteData.streaming, StreamingState.UNARY); + + assert.strictEqual( + operationCompleteData.metricsCollectorData.method, + MethodName.READ_MODIFY_WRITE_ROW, + ); + assert.strictEqual(operationCompleteData.status, 'OK'); + assert.strictEqual( + operationCompleteData.metricsCollectorData.table, + TABLE_ID, + ); + assert.strictEqual( + operationCompleteData.metricsCollectorData.instanceId, + INSTANCE_ID, + ); + assert.ok(operationCompleteData.operationLatency >= 0); + assert.strictEqual(operationCompleteData.retryCount, 0); + assert.strictEqual(operationCompleteData.metricsCollectorData.zone, ZONE); + assert.strictEqual( + operationCompleteData.metricsCollectorData.cluster, + CLUSTER, + ); + assert.strictEqual(operationCompleteData.streaming, StreamingState.UNARY); + }); +}); diff --git a/handwritten/bigtable/system-test/read-rows-acceptance-test.json b/handwritten/bigtable/system-test/read-rows-acceptance-test.json new file mode 100644 index 00000000000..e0969590839 --- /dev/null +++ b/handwritten/bigtable/system-test/read-rows-acceptance-test.json @@ -0,0 +1,859 @@ +{ + "tests": [{ + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: false\n"], + "name": "invalid - no commit", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDIJdmFsdWUtVkFMSAA="], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["commit_row: true\n"], + "name": "invalid - no cell key before commit", + "chunks_base64": ["SAE="], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["timestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: false\n"], + "name": "invalid - no cell key before value", + "chunks_base64": ["IGQyCXZhbHVlLVZBTEgA"], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "family_name: <\n value: \"B\"\n>\ntimestamp_micros: 98\nvalue: \"value-VAL_2\"\ncommit_row: true\n"], + "name": "invalid - new col family must specify qualifier", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgYzILdmFsdWUtVkFMXzFIAA==", "EgMKAUIgYjILdmFsdWUtVkFMXzJIAQ=="], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: false\n", "commit_row: true\n"], + "name": "bare commit implies ts=0", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDIJdmFsdWUtVkFMSAA=", "SAE="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 100 + }, { + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n"], + "name": "simple row with timestamp", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDIJdmFsdWUtVkFMSAE="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\nvalue: \"value-VAL\"\ncommit_row: true\n"], + "name": "missing timestamp, implied ts=0", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMyCXZhbHVlLVZBTEgB"], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ncommit_row: true\n"], + "name": "empty cell value", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUNIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "timestamp_micros: 98\nvalue: \"value-VAL_2\"\ncommit_row: true\n"], + "name": "two unsplit cells", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgYzILdmFsdWUtVkFMXzFIAA==", "IGIyC3ZhbHVlLVZBTF8ySAE="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 99 + }, { + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 98 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "qualifier: <\n value: \"D\"\n>\ntimestamp_micros: 98\nvalue: \"value-VAL_2\"\ncommit_row: true\n"], + "name": "two qualifiers", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgYzILdmFsdWUtVkFMXzFIAA==", "GgMKAUQgYjILdmFsdWUtVkFMXzJIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 99 + }, { + "fm": "A", + "rk": "RK", + "qual": "D", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 98 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "family_name: <\n value: \"B\"\n>\nqualifier: <\n value: \"E\"\n>\ntimestamp_micros: 98\nvalue: \"value-VAL_2\"\ncommit_row: true\n"], + "name": "two families", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgYzILdmFsdWUtVkFMXzFIAA==", "EgMKAUIaAwoBRSBiMgt2YWx1ZS1WQUxfMkgB"], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 99 + }, { + "fm": "B", + "rk": "RK", + "qual": "E", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 98 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nlabels: \"L_1\"\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "timestamp_micros: 98\nlabels: \"L_2\"\nvalue: \"value-VAL_2\"\ncommit_row: true\n"], + "name": "with labels", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgYyoDTF8xMgt2YWx1ZS1WQUxfMUgA", "IGIqA0xfMjILdmFsdWUtVkFMXzJIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "L_1", + "error": false, + "value": "value-VAL_1", + "ts": 99 + }, { + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "L_2", + "error": false, + "value": "value-VAL_2", + "ts": 98 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"alue-VAL\"\ncommit_row: false\n", "commit_row: true\n"], + "name": "split cell, bare commit", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDIBdjgKSAA=", "MghhbHVlLVZBTEgA", "SAE="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 100 + }, { + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"alue-VAL\"\ncommit_row: true\n"], + "name": "split cell", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDIBdjgKSAA=", "MghhbHVlLVZBTEgB"], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nlabels: \"L\"\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"a\"\nvalue_size: 10\ncommit_row: false\n", "value: \"l\"\nvalue_size: 10\ncommit_row: false\n", "value: \"ue-VAL\"\ncommit_row: true\n"], + "name": "split four ways", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZCoBTDIBdjgKSAA=", "MgFhOApIAA==", "MgFsOApIAA==", "MgZ1ZS1WQUxIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "L", + "error": false, + "value": "value-VAL", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"alue-VAL_1\"\ncommit_row: false\n", "timestamp_micros: 98\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"alue-VAL_2\"\ncommit_row: true\n"], + "name": "two split cells", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgYzIBdjgKSAA=", "MgphbHVlLVZBTF8xSAA=", "IGIyAXY4CkgA", "MgphbHVlLVZBTF8ySAE="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 99 + }, { + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 98 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"alue-VAL_1\"\ncommit_row: false\n", "qualifier: <\n value: \"D\"\n>\ntimestamp_micros: 98\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"alue-VAL_2\"\ncommit_row: true\n"], + "name": "multi-qualifier splits", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgYzIBdjgKSAA=", "MgphbHVlLVZBTF8xSAA=", "GgMKAUQgYjIBdjgKSAA=", "MgphbHVlLVZBTF8ySAE="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 99 + }, { + "fm": "A", + "rk": "RK", + "qual": "D", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 98 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"a\"\nvalue_size: 10\ncommit_row: false\n", "value: \"lue-VAL_1\"\ncommit_row: false\n", "qualifier: <\n value: \"D\"\n>\ntimestamp_micros: 98\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"a\"\nvalue_size: 10\ncommit_row: false\n", "value: \"lue-VAL_2\"\ncommit_row: true\n"], + "name": "multi-qualifier multi-split", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgYzIBdjgKSAA=", "MgFhOApIAA==", "MglsdWUtVkFMXzFIAA==", "GgMKAUQgYjIBdjgKSAA=", "MgFhOApIAA==", "MglsdWUtVkFMXzJIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 99 + }, { + "fm": "A", + "rk": "RK", + "qual": "D", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 98 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"alue-VAL_1\"\ncommit_row: false\n", "family_name: <\n value: \"B\"\n>\nqualifier: <\n value: \"E\"\n>\ntimestamp_micros: 98\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"alue-VAL_2\"\ncommit_row: true\n"], + "name": "multi-family split", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgYzIBdjgKSAA=", "MgphbHVlLVZBTF8xSAA=", "EgMKAUIaAwoBRSBiMgF2OApIAA==", "MgphbHVlLVZBTF8ySAE="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 99 + }, { + "fm": "B", + "rk": "RK", + "qual": "E", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 98 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: false\n", "row_key: \"RK_2\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: false\n"], + "name": "invalid - no commit between rows", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQyBkMgl2YWx1ZS1WQUxIAA==", "CgRSS18yEgMKAUEaAwoBQyBkMgl2YWx1ZS1WQUxIAA=="], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: false\n", "row_key: \"RK_2\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n"], + "name": "invalid - no commit after first row", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQyBkMgl2YWx1ZS1WQUxIAA==", "CgRSS18yEgMKAUEaAwoBQyBkMgl2YWx1ZS1WQUxIAQ=="], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n", "row_key: \"RK_2\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: false\n"], + "name": "invalid - last row missing commit", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQyBkMgl2YWx1ZS1WQUxIAQ==", "CgRSS18yEgMKAUEaAwoBQyBkMgl2YWx1ZS1WQUxIAA=="], + "results": [{ + "fm": "A", + "rk": "RK_1", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 100 + }, { + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n", "row_key: \"RK_1\"\nfamily_name: <\n value: \"B\"\n>\nqualifier: <\n value: \"D\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n"], + "name": "invalid - duplicate row key", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQyBkMgl2YWx1ZS1WQUxIAQ==", "CgRSS18xEgMKAUIaAwoBRCBkMgl2YWx1ZS1WQUxIAQ=="], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n", "timestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n"], + "name": "invalid - new row missing row key", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQyBkMgl2YWx1ZS1WQUxIAQ==", "IGQyCXZhbHVlLVZBTEgB"], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n", "row_key: \"RK_2\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n"], + "name": "two rows", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQyBkMgl2YWx1ZS1WQUxIAQ==", "CgRSS18yEgMKAUEaAwoBQyBkMgl2YWx1ZS1WQUxIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK_1", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 100 + }, { + "fm": "A", + "rk": "RK_2", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\nvalue: \"value-VAL\"\ncommit_row: true\n", "row_key: \"RK_2\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n"], + "name": "two rows implicit timestamp", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQzIJdmFsdWUtVkFMSAE=", "CgRSS18yEgMKAUEaAwoBQyBkMgl2YWx1ZS1WQUxIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK_1", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 0 + }, { + "fm": "A", + "rk": "RK_2", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ncommit_row: true\n", "row_key: \"RK_2\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n"], + "name": "two rows empty value", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQ0gB", "CgRSS18yEgMKAUEaAwoBQyBkMgl2YWx1ZS1WQUxIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK_1", + "qual": "C", + "label": "", + "error": false, + "value": "", + "ts": 0 + }, { + "fm": "A", + "rk": "RK_2", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "timestamp_micros: 98\nvalue: \"value-VAL_2\"\ncommit_row: true\n", "row_key: \"RK_2\"\nfamily_name: <\n value: \"B\"\n>\nqualifier: <\n value: \"D\"\n>\ntimestamp_micros: 97\nvalue: \"value-VAL_3\"\ncommit_row: true\n"], + "name": "two rows, one with multiple cells", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQyBjMgt2YWx1ZS1WQUxfMUgA", "IGIyC3ZhbHVlLVZBTF8ySAE=", "CgRSS18yEgMKAUIaAwoBRCBhMgt2YWx1ZS1WQUxfM0gB"], + "results": [{ + "fm": "A", + "rk": "RK_1", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 99 + }, { + "fm": "A", + "rk": "RK_1", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 98 + }, { + "fm": "B", + "rk": "RK_2", + "qual": "D", + "label": "", + "error": false, + "value": "value-VAL_3", + "ts": 97 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "qualifier: <\n value: \"D\"\n>\ntimestamp_micros: 98\nvalue: \"value-VAL_2\"\ncommit_row: true\n", "row_key: \"RK_2\"\nfamily_name: <\n value: \"B\"\n>\nqualifier: <\n value: \"E\"\n>\ntimestamp_micros: 97\nvalue: \"value-VAL_3\"\ncommit_row: false\n", "qualifier: <\n value: \"F\"\n>\ntimestamp_micros: 96\nvalue: \"value-VAL_4\"\ncommit_row: true\n"], + "name": "two rows, multiple cells", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQyBjMgt2YWx1ZS1WQUxfMUgA", "GgMKAUQgYjILdmFsdWUtVkFMXzJIAQ==", "CgRSS18yEgMKAUIaAwoBRSBhMgt2YWx1ZS1WQUxfM0gA", "GgMKAUYgYDILdmFsdWUtVkFMXzRIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK_1", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 99 + }, { + "fm": "A", + "rk": "RK_1", + "qual": "D", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 98 + }, { + "fm": "B", + "rk": "RK_2", + "qual": "E", + "label": "", + "error": false, + "value": "value-VAL_3", + "ts": 97 + }, { + "fm": "B", + "rk": "RK_2", + "qual": "F", + "label": "", + "error": false, + "value": "value-VAL_4", + "ts": 96 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "family_name: <\n value: \"B\"\n>\nqualifier: <\n value: \"E\"\n>\ntimestamp_micros: 98\nvalue: \"value-VAL_2\"\ncommit_row: true\n", "row_key: \"RK_2\"\nfamily_name: <\n value: \"M\"\n>\nqualifier: <\n value: \"O\"\n>\ntimestamp_micros: 97\nvalue: \"value-VAL_3\"\ncommit_row: false\n", "family_name: <\n value: \"N\"\n>\nqualifier: <\n value: \"P\"\n>\ntimestamp_micros: 96\nvalue: \"value-VAL_4\"\ncommit_row: true\n"], + "name": "two rows, multiple cells, multiple families", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQyBjMgt2YWx1ZS1WQUxfMUgA", "EgMKAUIaAwoBRSBiMgt2YWx1ZS1WQUxfMkgB", "CgRSS18yEgMKAU0aAwoBTyBhMgt2YWx1ZS1WQUxfM0gA", "EgMKAU4aAwoBUCBgMgt2YWx1ZS1WQUxfNEgB"], + "results": [{ + "fm": "A", + "rk": "RK_1", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 99 + }, { + "fm": "B", + "rk": "RK_1", + "qual": "E", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 98 + }, { + "fm": "M", + "rk": "RK_2", + "qual": "O", + "label": "", + "error": false, + "value": "value-VAL_3", + "ts": 97 + }, { + "fm": "N", + "rk": "RK_2", + "qual": "P", + "label": "", + "error": false, + "value": "value-VAL_4", + "ts": 96 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 99\nlabels: \"L_1\"\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "timestamp_micros: 98\nvalue: \"value-VAL_2\"\ncommit_row: true\n", "row_key: \"RK_2\"\nfamily_name: <\n value: \"B\"\n>\nqualifier: <\n value: \"D\"\n>\ntimestamp_micros: 97\nlabels: \"L_3\"\nvalue: \"value-VAL_3\"\ncommit_row: false\n", "timestamp_micros: 96\nvalue: \"value-VAL_4\"\ncommit_row: true\n"], + "name": "two rows, four cells, 2 labels", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQyBjKgNMXzEyC3ZhbHVlLVZBTF8xSAA=", "IGIyC3ZhbHVlLVZBTF8ySAE=", "CgRSS18yEgMKAUIaAwoBRCBhKgNMXzMyC3ZhbHVlLVZBTF8zSAA=", "IGAyC3ZhbHVlLVZBTF80SAE="], + "results": [{ + "fm": "A", + "rk": "RK_1", + "qual": "C", + "label": "L_1", + "error": false, + "value": "value-VAL_1", + "ts": 99 + }, { + "fm": "A", + "rk": "RK_1", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 98 + }, { + "fm": "B", + "rk": "RK_2", + "qual": "D", + "label": "L_3", + "error": false, + "value": "value-VAL_3", + "ts": 97 + }, { + "fm": "B", + "rk": "RK_2", + "qual": "D", + "label": "", + "error": false, + "value": "value-VAL_4", + "ts": 96 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"alue-VAL_1\"\ncommit_row: true\n", "row_key: \"RK_2\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"alue-VAL_2\"\ncommit_row: true\n"], + "name": "two rows with splits, same timestamp", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQyBkMgF2OApIAA==", "MgphbHVlLVZBTF8xSAE=", "CgRSS18yEgMKAUEaAwoBQyBkMgF2OApIAA==", "MgphbHVlLVZBTF8ySAE="], + "results": [{ + "fm": "A", + "rk": "RK_1", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 100 + }, { + "fm": "A", + "rk": "RK_2", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 100 + }] + }, { + "chunks": ["reset_row: true\n"], + "name": "invalid - bare reset", + "chunks_base64": ["QAE="], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["reset_row: true\n", "row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: false\n"], + "name": "invalid - bad reset, no commit", + "chunks_base64": ["QAE=", "CgJSSxIDCgFBGgMKAUMgZDIJdmFsdWUtVkFMSAA="], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: false\n", "reset_row: true\n", "timestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n"], + "name": "invalid - missing key after reset", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDIJdmFsdWUtVkFMSAA=", "QAE=", "IGQyCXZhbHVlLVZBTEgB"], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: false\n", "reset_row: true\n"], + "name": "no data after reset", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDIJdmFsdWUtVkFMSAA=", "QAE="], + "results": null + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: false\n", "reset_row: true\n", "row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: true\n"], + "name": "simple reset", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDIJdmFsdWUtVkFMSAA=", "QAE=", "CgJSSxIDCgFBGgMKAUMgZDIJdmFsdWUtVkFMSAE="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "reset_row: true\n", "row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_2\"\ncommit_row: true\n"], + "name": "reset to new val", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDILdmFsdWUtVkFMXzFIAA==", "QAE=", "CgJSSxIDCgFBGgMKAUMgZDILdmFsdWUtVkFMXzJIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "reset_row: true\n", "row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"D\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_1\"\ncommit_row: true\n"], + "name": "reset to new qual", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDILdmFsdWUtVkFMXzFIAA==", "QAE=", "CgJSSxIDCgFBGgMKAUQgZDILdmFsdWUtVkFMXzFIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "D", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "timestamp_micros: 98\nvalue: \"value-VAL_2\"\ncommit_row: false\n", "reset_row: true\n", "row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_2\"\ncommit_row: true\n"], + "name": "reset with splits", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDILdmFsdWUtVkFMXzFIAA==", "IGIyC3ZhbHVlLVZBTF8ySAA=", "QAE=", "CgJSSxIDCgFBGgMKAUMgZDILdmFsdWUtVkFMXzJIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "reset_row: true\n", "row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_2\"\ncommit_row: false\n", "timestamp_micros: 97\nvalue: \"value-VAL_3\"\ncommit_row: true\n"], + "name": "reset two cells", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDILdmFsdWUtVkFMXzFIAA==", "QAE=", "CgJSSxIDCgFBGgMKAUMgZDILdmFsdWUtVkFMXzJIAA==", "IGEyC3ZhbHVlLVZBTF8zSAE="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 100 + }, { + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_3", + "ts": 97 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "reset_row: true\n", "row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_2\"\ncommit_row: false\n", "reset_row: true\n", "row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_3\"\ncommit_row: true\n"], + "name": "two resets", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDILdmFsdWUtVkFMXzFIAA==", "QAE=", "CgJSSxIDCgFBGgMKAUMgZDILdmFsdWUtVkFMXzJIAA==", "QAE=", "CgJSSxIDCgFBGgMKAUMgZDILdmFsdWUtVkFMXzNIAQ=="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_3", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "reset_row: true\n", "row_key: \"RK\"\nfamily_name: <\n value: \"B\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_2\"\ncommit_row: false\n", "qualifier: <\n value: \"D\"\n>\ntimestamp_micros: 97\nvalue: \"value-VAL_3\"\ncommit_row: true\n"], + "name": "reset then two cells", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDILdmFsdWUtVkFMXzFIAA==", "QAE=", "CgJSSxIDCgFCGgMKAUMgZDILdmFsdWUtVkFMXzJIAA==", "GgMKAUQgYTILdmFsdWUtVkFMXzNIAQ=="], + "results": [{ + "fm": "B", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 100 + }, { + "fm": "B", + "rk": "RK", + "qual": "D", + "label": "", + "error": false, + "value": "value-VAL_3", + "ts": 97 + }] + }, { + "chunks": ["row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_1\"\ncommit_row: false\n", "reset_row: true\n", "row_key: \"RK_2\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_2\"\ncommit_row: true\n"], + "name": "reset to new row", + "chunks_base64": ["CgRSS18xEgMKAUEaAwoBQyBkMgt2YWx1ZS1WQUxfMUgA", "QAE=", "CgRSS18yEgMKAUEaAwoBQyBkMgt2YWx1ZS1WQUxfMkgB"], + "results": [{ + "fm": "A", + "rk": "RK_2", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_2", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nlabels: \"L\"\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"a\"\nvalue_size: 10\ncommit_row: false\n", "reset_row: true\n", "row_key: \"RK_1\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL_1\"\ncommit_row: true\n"], + "name": "reset in between chunks", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZCoBTDIBdjgKSAA=", "MgFhOApIAA==", "QAE=", "CgRSS18xEgMKAUEaAwoBQyBkMgt2YWx1ZS1WQUxfMUgB"], + "results": [{ + "fm": "A", + "rk": "RK_1", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL_1", + "ts": 100 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nlabels: \"L\"\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"a\"\nvalue_size: 10\nreset_row: true\n"], + "name": "invalid - reset with chunk", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZCoBTDIBdjgKSAA=", "MgFhOApAAQ=="], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nlabels: \"L\"\nvalue: \"v\"\nvalue_size: 10\ncommit_row: false\n", "value: \"a\"\nvalue_size: 10\ncommit_row: true\n"], + "name": "invalid - commit with chunk", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZCoBTDIBdjgKSAA=", "MgFhOApIAQ=="], + "results": [{ + "fm": "", + "rk": "", + "qual": "", + "label": "", + "error": true, + "value": "", + "ts": 0 + }] + }, { + "chunks": ["row_key: \"RK\"\nfamily_name: <\n value: \"A\"\n>\nqualifier: <\n value: \"C\"\n>\ntimestamp_micros: 100\nvalue: \"value-VAL\"\ncommit_row: false\n", "commit_row: false\n", "commit_row: true\n"], + "name": "empty cell chunk", + "chunks_base64": ["CgJSSxIDCgFBGgMKAUMgZDIJdmFsdWUtVkFMSAA=", "SAA=", "SAE="], + "results": [{ + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "value-VAL", + "ts": 100 + }, { + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "", + "ts": 0 + }, { + "fm": "A", + "rk": "RK", + "qual": "C", + "label": "", + "error": false, + "value": "", + "ts": 0 + }] + }] +} diff --git a/handwritten/bigtable/system-test/read-rows-acceptance-tests.ts b/handwritten/bigtable/system-test/read-rows-acceptance-tests.ts new file mode 100644 index 00000000000..530ac03d7c1 --- /dev/null +++ b/handwritten/bigtable/system-test/read-rows-acceptance-tests.ts @@ -0,0 +1,164 @@ +// Copyright 2017 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +import {Test} from './testTypes'; +const testcases = require('../../system-test/read-rows-acceptance-test.json') + .tests as Test[]; +import {PassThrough} from 'stream'; +import {Table} from '../src/table.js'; +import {Row} from '../src/row.js'; +import {protobuf} from 'google-gax'; +import * as fs from 'fs'; +import * as path from 'path'; +import {Instance} from '../src/instance'; +import {Bigtable, AbortableDuplex} from '../src'; +import {ClientSideMetricsConfigManager} from '../src/client-side-metrics/metrics-config-manager'; +import { + ITabularApiSurface, + OperationMetricsCollector, +} from '../src/client-side-metrics/operation-metrics-collector'; +import { + MethodName, + StreamingState, +} from '../src/client-side-metrics/client-side-metrics-attributes'; + +class FakeOperationMetricsCollector extends OperationMetricsCollector { + onOperationComplete() {} + onResponse() {} + onAttemptStart() {} + onAttemptComplete() {} + onOperationStart() {} + wrapRequest() {} + onMetadataReceived() {} + onRowReachesUser() {} + onStatusMetadataReceived() {} +} + +class FakeMetricsConfigManager extends ClientSideMetricsConfigManager { + createOperation( + methodName: MethodName, + streaming: StreamingState, + table: ITabularApiSurface, + ): OperationMetricsCollector { + return new FakeOperationMetricsCollector(table, methodName, streaming, []); + } +} + +const protosJson = path.resolve(__dirname, '../protos/protos.json'); +const root = protobuf.Root.fromJSON( + JSON.parse(fs.readFileSync(protosJson).toString()), +); +const ReadRowsResponse = root.lookupType('google.bigtable.v2.ReadRowsResponse'); +const CellChunk = root.lookupType( + 'google.bigtable.v2.ReadRowsResponse.CellChunk', +); +describe('Read Row Acceptance tests', () => { + testcases.forEach(test => { + it(test.name, done => { + const table = new Table({id: 'xyz'} as Instance, 'my-table'); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const results: any[] = []; + const rawResults = test.results || []; + const errorCount = rawResults.filter(result => result.error).length; + rawResults + .filter(result => !result.error) + .forEach(result => { + const existingRow = results.find(filter => filter.key === result.rk); + const row = existingRow || {key: result.rk, data: {}}; + const data = row.data; + if (typeof existingRow === 'undefined') { + results.push(row); + } + const family = data[result.fm] || {}; + data[result.fm] = family; + const qualifier = family[result.qual] || []; + family[result.qual] = qualifier; + const resultLabels: string[] = []; + if (result.label !== '') { + resultLabels.push(result.label); + } + qualifier.push({ + value: result.value, + timestamp: '' + result.ts, + labels: resultLabels, + }); + }); + + table.bigtable = {} as Bigtable; + table.bigtable._metricsConfigManager = new FakeMetricsConfigManager([]); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (table.bigtable.request as any) = () => { + const stream = new PassThrough({ + objectMode: true, + }); + + (stream as {} as AbortableDuplex).abort = () => {}; + + setImmediate(() => { + test.chunks_base64 + .map(chunk => { + const cellChunk = CellChunk.decode( + Buffer.from(chunk as string, 'base64'), + ); //.decode64(chunk); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let readRowsResponse: any = {chunks: [cellChunk]}; + readRowsResponse = ReadRowsResponse.create(readRowsResponse); + readRowsResponse = ReadRowsResponse.toObject(readRowsResponse, { + defaults: true, + longs: String, + oneofs: true, + }); + return readRowsResponse; + }) + .forEach(readRowsResponse => stream.push(readRowsResponse)); + stream.push(null); + }); + + return stream; + }; + + const tableRows = results.map(rawRow => { + const row = new Row(table, rawRow.key); + row.data = rawRow.data; + return row; + }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const errors: any[] = []; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const rows: any[] = []; + + table + .createReadStream({}) + .on('error', err => { + errors.push(err); + verify(); + }) + .on('data', row => { + rows.push(row); + }) + .on('end', () => { + verify(); + }); + function verify() { + assert.strictEqual(errors.length, errorCount, ' error count mismatch'); + assert.strictEqual(rows.length, results.length, 'row count mismatch'); + assert.deepStrictEqual(rows, tableRows, 'row mismatch'); + done(); + } + }); + }); +}); diff --git a/handwritten/bigtable/system-test/read-rows.ts b/handwritten/bigtable/system-test/read-rows.ts new file mode 100644 index 00000000000..8d26fe77ce2 --- /dev/null +++ b/handwritten/bigtable/system-test/read-rows.ts @@ -0,0 +1,249 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {Bigtable} from '../src'; +import {Mutation} from '../src/mutation.js'; +const {tests} = require('../../system-test/data/read-rows-retry-test.json') as { + tests: Test[]; +}; +import {google} from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it, afterEach, beforeEach} from 'mocha'; +import * as sinon from 'sinon'; +import {EventEmitter} from 'events'; +import {Test} from './testTypes'; +import {ServiceError, GrpcClient, GoogleError, CallOptions} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as proxyquire from 'proxyquire'; +import {TabularApiSurface} from '../src/tabular-api-surface'; +import * as mocha from 'mocha'; +import {generateId} from './common'; + +const {grpc} = new GrpcClient(); + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function dispatch(emitter: EventEmitter, response: any) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const emits: any[] = [{name: 'request'}]; + if (response.row_keys) { + emits.push.apply(emits, [ + {name: 'response', arg: 200}, + { + name: 'data', + arg: {chunks: response.row_keys.map(rowResponse)}, + }, + ]); + } + if (response.end_with_error) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const error: any = new Error(); + error.code = response.end_with_error; + emits.push({name: 'error', arg: error}); + } else { + emits.push({name: 'end'}); + } + let index = 0; + setImmediate(next); + + function next() { + if (index < emits.length) { + const emit = emits[index]; + index++; + emitter.emit(emit.name, emit.arg); + setImmediate(next); + } + } +} + +function rowResponse(rowKey: {}) { + return { + rowKey: Mutation.convertToBytes(rowKey), + familyName: {value: 'family'}, + qualifier: {value: 'qualifier'}, + valueSize: 0, + timestampMicros: 0, + labels: [], + commitRow: true, + value: 'value', + }; +} + +describe('Bigtable/Table', () => { + /** + * We have to mock out the metrics handler because the metrics handler with + * open telemetry causes clock.runAll() to throw an infinite loop error. This + * is most likely because of the periodic reader as it schedules pending + * events on the node event loop which conflicts with the sinon clock. + */ + class TestGCPMetricsHandler { + onOperationComplete() {} + onAttemptComplete() {} + } + const FakeTabularApiSurface = proxyquire('../src/tabular-api-surface.js', { + './client-side-metrics/gcp-metrics-handler': { + GCPMetricsHandler: TestGCPMetricsHandler, + }, + }).TabularApiSurface; + const FakeTable: TabularApiSurface = proxyquire('../src/table.js', { + './tabular-api-surface.js': {TabularApiSurface: FakeTabularApiSurface}, + }).Table; + const FakeInstance = proxyquire('../src/instance.js', { + './table.js': {Table: FakeTable}, + }).Instance; + const FakeBigtable = proxyquire('../src/index.js', { + './instance.js': {Instance: FakeInstance}, + }).Bigtable; + + const bigtable = new FakeBigtable(); + const INSTANCE_NAME = generateId('instance'); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (bigtable as any).grpcCredentials = grpc.credentials.createInsecure(); + + describe('close', () => { + it('should fail when invoking readRows with closed client', async () => { + const instance = bigtable.instance(INSTANCE_NAME); + const table = instance.table('fake-table'); + const [, operation] = await instance.create({ + clusters: { + id: 'fake-cluster3', + location: 'us-west1-c', + nodes: 1, + }, + }); + await operation.promise(); + const gaxOptions: CallOptions = { + retry: { + retryCodes: [grpc.status.DEADLINE_EXCEEDED, grpc.status.NOT_FOUND], + }, + maxRetries: 10, + }; + await table.create({ + gaxOptions, + }); + await table.getRows(); // This is done to initialize the data client + await bigtable.close(); + try { + await table.getRows(); + assert.fail( + 'An error should have been thrown because the client is closed', + ); + } catch (err: any) { + assert.strictEqual(err.message, 'The client has already been closed.'); + } + }); + after(async () => { + const bigtableSecondClient = new Bigtable(); + const instance = bigtableSecondClient.instance(INSTANCE_NAME); + await instance.delete({}); + }); + }); + + describe('createReadStream', () => { + const INSTANCE = bigtable.instance('instance'); + const TABLE = INSTANCE.table('table'); + let endCalled: boolean; + let error: ServiceError | null; + let requestedOptions: Array<{}>; + let responses: Array<{}> | null; + let rowKeysRead: Array>; + let stub: sinon.SinonStub; + + beforeEach(() => { + endCalled = false; + error = null; + responses = null; + rowKeysRead = []; + requestedOptions = []; + stub = sinon.stub(bigtable, 'request').callsFake(cfg => { + const reqOpts = (cfg as any).reqOpts; + const requestOptions = {} as google.bigtable.v2.IRowSet; + if (reqOpts.rows && reqOpts.rows.rowRanges) { + requestOptions.rowRanges = reqOpts.rows.rowRanges.map( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (range: any) => { + const convertedRowRange = {} as {[index: string]: string}; + Object.keys(range).forEach( + key => (convertedRowRange[key] = range[key].asciiSlice()), + ); + return convertedRowRange; + }, + ); + } + if (reqOpts.rows && reqOpts.rows.rowKeys) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + requestOptions.rowKeys = reqOpts.rows.rowKeys.map((rowKeys: any) => + rowKeys.asciiSlice(), + ); + } + if (reqOpts.rowsLimit) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (requestOptions as any).rowsLimit = reqOpts.rowsLimit; + } + requestedOptions.push(requestOptions); + rowKeysRead.push([]); + const requestStream = new PassThrough({objectMode: true}); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (requestStream as any).abort = () => {}; + dispatch(requestStream, responses!.shift()); + return requestStream; + }); + }); + + afterEach(() => { + stub.restore(); + }); + + tests.forEach(test => { + it(test.name, (done: mocha.Done) => { + responses = test.responses; + TABLE.maxRetries = test.max_retries; + TABLE.createReadStream(test.createReadStream_options) + .on('data', (row: any) => + rowKeysRead[rowKeysRead.length - 1].push(row.id), + ) + .on('end', () => { + endCalled = true; + doAssertionChecks(); + }) + .on('error', (err: any) => { + error = err as ServiceError; + doAssertionChecks(); + }); + + function doAssertionChecks() { + try { + if (test.error) { + assert(!endCalled, ".on('end') should not have been invoked"); + assert.strictEqual(error!.code, test.error); + } else { + assert(endCalled, ".on('end') shoud have been invoked"); + assert.ifError(error); + } + assert.deepStrictEqual(rowKeysRead, test.row_keys_read); + assert(responses); + assert.strictEqual( + responses.length, + 0, + 'not all the responses were used', + ); + assert.deepStrictEqual(requestedOptions, test.request_options); + done(); + } catch (e) { + done(e); + } + } + }); + }); + }); +}); diff --git a/handwritten/bigtable/system-test/service-path.ts b/handwritten/bigtable/system-test/service-path.ts new file mode 100644 index 00000000000..19910f3d5e2 --- /dev/null +++ b/handwritten/bigtable/system-test/service-path.ts @@ -0,0 +1,206 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {describe, it} from 'mocha'; +import * as assert from 'assert'; +import {ServiceError} from 'google-gax'; +import {Bigtable} from '../src'; +import {BigtableClient, BigtableInstanceAdminClient} from '../src/v2'; + +describe('Service Path', () => { + it('Setting universe domain should set the service path', async () => { + // Set the environment variable + process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN = 'otherDomain'; + + const universeDomain = 'someUniverseDomain'; // or your universe domain if not using emulator + const options = { + universeDomain, + }; + const bigtable = new Bigtable({ + BigtableClient: options, + BigtableInstanceAdminClient: options, + BigtableTableAdminClient: options, + }); + // Need to mock getProjectId_ since it normally uses auth and auth isn't + // available in unit tests. + bigtable.getProjectId_ = ( + callback: (err: Error | null, projectId?: string) => void, + ) => { + callback(null, 'projectId'); + }; + try { + // This is necessary to initialize the bigtable instance admin client. + await bigtable.getInstances({timeout: 1000}); + } catch (e) { + const expectedMessage = + 'Total timeout of API google.bigtable.admin.v2.BigtableInstanceAdmin exceeded 1000 milliseconds retrying error Error: 14 UNAVAILABLE: Name resolution failed for target dns:bigtableadmin.someUniverseDomain:443 before any response was received.'; + assert.strictEqual( + (e as ServiceError).message.substring(0, expectedMessage.length), + expectedMessage, + ); + } finally { + assert.strictEqual( + ( + bigtable.api + .BigtableInstanceAdminClient as BigtableInstanceAdminClient + )['_opts'].servicePath, + `bigtableadmin.${universeDomain}`, + ); + } + try { + // This will fail in unit tests, but is necessary to initialize the + // bigtable client. + const instance = bigtable.instance('instanceId'); + const table = instance.table('tableId'); + await table.getRows({gaxOptions: {timeout: 1000}}); + } catch (e) { + const expectedMessage = + '14 UNAVAILABLE: Name resolution failed for target dns:bigtable.someUniverseDomain:443'; + assert.strictEqual( + (e as ServiceError).message.substring(0, expectedMessage.length), + expectedMessage, + ); + } finally { + assert.strictEqual( + (bigtable.api.BigtableClient as BigtableClient)['_opts'].servicePath, + `bigtable.${universeDomain}`, + ); + } + + // Clean up the environment variable after the test + delete process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN; + }); + it('Setting universe domain and custom endpoint should set the service path to custom endpoint', async () => { + // Set the environment variable + process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN = 'otherDomain'; + + const universeDomain = 'someUniverseDomain'; // or your universe domain if not using emulator + const apiEndpoint = 'someApiEndpoint'; + const options = { + universeDomain, + }; + const bigtable = new Bigtable({ + apiEndpoint, + BigtableClient: options, + BigtableInstanceAdminClient: options, + BigtableTableAdminClient: options, + }); + // Need to mock getProjectId_ since it normally uses auth and auth isn't + // available in unit tests. + bigtable.getProjectId_ = ( + callback: (err: Error | null, projectId?: string) => void, + ) => { + callback(null, 'projectId'); + }; + try { + // This is necessary to initialize the bigtable instance admin client. + await bigtable.getInstances({timeout: 1000}); + } catch (e) { + const expectedMessage = + 'Total timeout of API google.bigtable.admin.v2.BigtableInstanceAdmin exceeded 1000 milliseconds retrying error Error: 14 UNAVAILABLE: Name resolution failed for target dns:someApiEndpoint:443 before any response was received.'; + assert.strictEqual( + (e as ServiceError).message.substring(0, expectedMessage.length), + expectedMessage, + ); + } finally { + assert.strictEqual( + ( + bigtable.api + .BigtableInstanceAdminClient as BigtableInstanceAdminClient + )['_opts'].servicePath, + apiEndpoint, + ); + } + try { + // This will fail in unit tests, but is necessary to initialize the + // bigtable client. + const instance = bigtable.instance('instanceId'); + const table = instance.table('tableId'); + await table.getRows({gaxOptions: {timeout: 1000}}); + } catch (e) { + const expectedMessage = + '14 UNAVAILABLE: Name resolution failed for target dns:someApiEndpoint:443'; + assert.strictEqual( + (e as ServiceError).message.substring(0, expectedMessage.length), + expectedMessage, + ); + } finally { + assert.strictEqual( + (bigtable.api.BigtableClient as BigtableClient)['_opts'].servicePath, + apiEndpoint, + ); + } + + // Clean up the environment variable after the test + delete process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN; + }); + it('Setting GOOGLE_CLOUD_UNIVERSE_DOMAIN should set the service path', async () => { + const universeDomain = 'someUniverseDomain'; // or your universe domain if not using emulator + + // Set the environment variable + process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN = universeDomain; + const bigtable = new Bigtable(); // No options needed, it will pick up the env var + + // Need to mock getProjectId_ since it normally uses auth and auth isn't + // available in unit tests. + bigtable.getProjectId_ = ( + callback: (err: Error | null, projectId?: string) => void, + ) => { + callback(null, 'projectId'); + }; + + try { + // This is necessary to initialize the bigtable instance admin client. + await bigtable.getInstances({timeout: 1000}); + } catch (e) { + const expectedMessage = + 'Total timeout of API google.bigtable.admin.v2.BigtableInstanceAdmin exceeded 1000 milliseconds retrying error Error: 14 UNAVAILABLE: Name resolution failed for target dns:bigtableadmin.someUniverseDomain:443 before any response was received.'; + assert.strictEqual( + (e as ServiceError).message.substring(0, expectedMessage.length), + expectedMessage, + ); + } finally { + assert.strictEqual( + ( + bigtable.api + .BigtableInstanceAdminClient as BigtableInstanceAdminClient + )['_opts'].servicePath, + `bigtableadmin.${universeDomain}`, + ); + } + + try { + // This will fail in unit tests, but is necessary to initialize the + // bigtable client. + const instance = bigtable.instance('instanceId'); + const table = instance.table('tableId'); + await table.getRows({gaxOptions: {timeout: 1000}}); + } catch (e) { + const expectedMessage = + '14 UNAVAILABLE: Name resolution failed for target dns:bigtable.someUniverseDomain:443'; + assert.strictEqual( + (e as ServiceError).message.substring(0, expectedMessage.length), + expectedMessage, + ); + } finally { + assert.strictEqual( + (bigtable.api.BigtableClient as BigtableClient)['_opts'].servicePath, + `bigtable.${universeDomain}`, + ); + } + + // Clean up the environment variable after the test + delete process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN; + }); +}); diff --git a/handwritten/bigtable/system-test/testTypes.ts b/handwritten/bigtable/system-test/testTypes.ts new file mode 100644 index 00000000000..43613cc677e --- /dev/null +++ b/handwritten/bigtable/system-test/testTypes.ts @@ -0,0 +1,48 @@ +// 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. + +import {ServiceError} from 'google-gax'; +import {GetRowsOptions} from '../src/table'; + +export interface Test { + name: string; + max_retries: number; + mutations_request: Array<{ + method: string; + key: string; + data: {}; + }>; + responses: Array<{ + code: number; + entry_codes: number[]; + }>; + mutation_batches_invoked: string[]; + errors: Array<{ + index_in_mutations_request: number; + }>; + results: Array<{ + fm: string; + rk: string; + qual: string; + label: string; + error: boolean; + value: string; + ts: number; + }>; + chunks_base64: Array<{}>; + error: ServiceError; + request_options: {}; + row_keys_read: {}; + createReadStream_options: GetRowsOptions; +} diff --git a/handwritten/bigtable/system-test/tpc-tests.ts b/handwritten/bigtable/system-test/tpc-tests.ts new file mode 100644 index 00000000000..68c97be5d3a --- /dev/null +++ b/handwritten/bigtable/system-test/tpc-tests.ts @@ -0,0 +1,119 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {after, describe, it} from 'mocha'; +import {Bigtable} from '../src'; + +// INSTRUCTIONS FOR RUNNING TEST: +// 1. Change describe.skip to describe.only below. +// 2. Reassign process.env.GOOGLE_APPLICATION_CREDENTIALS to local key file. +// 3. Reassign UNIVERSE_DOMAIN_CONSTANT to the universe domain to test. +// 4. Run `npm run system-test`. + +describe.skip('Universe domain tests', () => { + // These tests are only designed to pass when using the service account + // credentials for the universe domain environment so we skip them in the CI pipeline. + // + // To see successful tests, uncomment the following line: + // process.env.GOOGLE_APPLICATION_CREDENTIALS = '/path/to/key.json'; + const UNIVERSE_DOMAIN_CONSTANT = 'my-universe-domain'; + + async function runTest(done: Mocha.Done, bigtable: Bigtable) { + try { + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId); + + // Create the instance if it doesn't exist: + const [instanceInfo] = await instance.exists(); + if (!instanceInfo) { + const [, operation] = await instance.create({ + clusters: { + id: 'fake-cluster3', + location: 'u-us-prp1-a', + nodes: 1, + }, + }); + await operation.promise(); + } + + // Create the table and the column families. + const [tableExists] = await table.exists(); + if (!tableExists) { + await table.create({families: [columnFamilyId]}); // Create column family + } else { + // Check if column family exists and create it if not. + const [families] = await table.getFamilies(); + + if ( + !families.some((family: {id: string}) => family.id === columnFamilyId) + ) { + await table.createFamily(columnFamilyId); + } + } + + // Run the readrows operation: + await table.getRows(); + done(); + } catch (e) { + done(e); + } + } + + const instanceId = 'emulator-test-instance'; + const tableId = 'my-table'; + const columnFamilyId = 'cf1'; + + after(async () => { + // TODO: Solve the issue where tests fail because instances don't get created on time. + // Notes: Creating instances can take time and if they are not ready in + // time then tests can fail. This shouldn't happen because if the create + // instance long running operation completes then the instance should be + // ready and shouldn't produce the `Error: 5 NOT_FOUND` error. + // Uncomment the code below when the task above is addressed: + // const instance = bigtable.instance(instanceId); + // await instance.delete({}); + }); + + it('should set the universe with a client option', done => { + const universeDomain = UNIVERSE_DOMAIN_CONSTANT; // or your universe domain if not using emulator + const options = { + universeDomain, + }; + const bigtable = new Bigtable(options); + runTest(done, bigtable).catch(err => { + throw err; + }); + }); + + it('should set the universe domain with a client option for the gapic clients', done => { + const universeDomain = UNIVERSE_DOMAIN_CONSTANT; // or your universe domain if not using emulator + const options = { + BigtableClient: {universeDomain}, + BigtableInstanceAdminClient: {universeDomain}, + BigtableTableAdminClient: {universeDomain}, + }; + const bigtable = new Bigtable(options); + runTest(done, bigtable).catch(err => { + throw err; + }); + }); + + it('Should set universe domain with an environment variable', done => { + process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN = UNIVERSE_DOMAIN_CONSTANT; + const bigtable = new Bigtable(); + runTest(done, bigtable).catch(err => { + throw err; + }); + }); +}); diff --git a/handwritten/bigtable/test-common/expected-otel-export-input.ts b/handwritten/bigtable/test-common/expected-otel-export-input.ts new file mode 100644 index 00000000000..b6aec4d9ae9 --- /dev/null +++ b/handwritten/bigtable/test-common/expected-otel-export-input.ts @@ -0,0 +1,1832 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +export const RETRY_COUNT_NAME = + 'bigtable.googleapis.com/internal/client/retry_count'; +export const CONNECTIIVTY_ERROR_COUNT = + 'bigtable.googleapis.com/internal/client/connectivity_error_count'; + +/** + * An example of the expected output format after converting + * `expectedOtelExportInput` using the `metricsToRequest` function. + * + * This object represents the data structure that is ready to be sent to the + * Google Cloud Monitoring API's `createTimeSeries` method. It demonstrates + * how OpenTelemetry metrics are transformed into the Cloud Monitoring format, + * including the structure of time series data, metric types, resource labels, + * and data point values. + * + */ +export const expectedOtelExportConvertedValue = { + name: 'projects/my-project', + timeSeries: [ + { + metric: { + type: 'bigtable.googleapis.com/internal/client/operation_latencies', + labels: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + status: 'OK', + streaming: 'true', + }, + }, + resource: { + type: 'bigtable_client_raw', + labels: { + cluster: 'fake-cluster3', + instance: 'fakeInstanceId', + project_id: 'my-project', + table: 'fakeTableId', + zone: 'us-west1-c', + }, + }, + metricKind: 'CUMULATIVE', + valueType: 'DISTRIBUTION', + points: [ + { + interval: { + endTime: { + seconds: 456, + nanos: 789, + }, + startTime: { + seconds: 123, + nanos: 789, + }, + }, + value: { + distributionValue: { + count: '1', + mean: 6000, + bucketOptions: { + explicitBuckets: { + bounds: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + }, + }, + bucketCounts: [ + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '1', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + ], + }, + }, + }, + ], + unit: 'ms', + }, + { + metric: { + type: 'bigtable.googleapis.com/internal/client/attempt_latencies', + labels: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + status: 'DEADLINE_EXCEEDED', + streaming: 'true', + }, + }, + resource: { + type: 'bigtable_client_raw', + labels: { + cluster: 'fake-cluster3', + instance: 'fakeInstanceId', + project_id: 'my-project', + table: 'fakeTableId', + zone: 'us-west1-c', + }, + }, + metricKind: 'CUMULATIVE', + valueType: 'DISTRIBUTION', + points: [ + { + interval: { + endTime: { + seconds: 456, + nanos: 789, + }, + startTime: { + seconds: 123, + nanos: 789, + }, + }, + value: { + distributionValue: { + count: '1', + mean: 2000, + bucketOptions: { + explicitBuckets: { + bounds: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + }, + }, + bucketCounts: [ + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '1', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + ], + }, + }, + }, + ], + unit: 'ms', + }, + { + metric: { + type: 'bigtable.googleapis.com/internal/client/attempt_latencies', + labels: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + status: 'OK', + streaming: 'true', + }, + }, + resource: { + type: 'bigtable_client_raw', + labels: { + cluster: 'fake-cluster3', + instance: 'fakeInstanceId', + project_id: 'my-project', + table: 'fakeTableId', + zone: 'us-west1-c', + }, + }, + metricKind: 'CUMULATIVE', + valueType: 'DISTRIBUTION', + points: [ + { + interval: { + endTime: { + seconds: 456, + nanos: 789, + }, + startTime: { + seconds: 123, + nanos: 789, + }, + }, + value: { + distributionValue: { + count: '1', + mean: 1000, + bucketOptions: { + explicitBuckets: { + bounds: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + }, + }, + bucketCounts: [ + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '1', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + ], + }, + }, + }, + ], + unit: 'ms', + }, + { + metric: { + type: 'bigtable.googleapis.com/internal/client/retry_count', + labels: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + status: 'OK', + }, + }, + resource: { + type: 'bigtable_client_raw', + labels: { + cluster: 'fake-cluster3', + instance: 'fakeInstanceId', + project_id: 'my-project', + table: 'fakeTableId', + zone: 'us-west1-c', + }, + }, + valueType: 'INT64', + points: [ + { + interval: { + endTime: { + seconds: 456, + nanos: 789, + }, + startTime: { + seconds: 123, + nanos: 789, + }, + }, + value: { + int64Value: 1, + }, + }, + ], + }, + { + metric: { + type: 'bigtable.googleapis.com/internal/client/retry_count', + labels: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + }, + }, + resource: { + type: 'bigtable_client_raw', + labels: { + cluster: 'fake-cluster3', + instance: 'fakeInstanceId', + project_id: 'my-project', + table: 'fakeTableId', + zone: 'us-west1-c', + }, + }, + valueType: 'INT64', + points: [ + { + interval: { + endTime: { + seconds: 456, + nanos: 789, + }, + startTime: { + seconds: 123, + nanos: 789, + }, + }, + value: { + int64Value: 1, + }, + }, + ], + }, + { + metric: { + type: 'bigtable.googleapis.com/internal/client/application_latencies', + labels: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + }, + }, + resource: { + type: 'bigtable_client_raw', + labels: { + cluster: 'fake-cluster3', + instance: 'fakeInstanceId', + project_id: 'my-project', + table: 'fakeTableId', + zone: 'us-west1-c', + }, + }, + metricKind: 'CUMULATIVE', + valueType: 'DISTRIBUTION', + points: [ + { + interval: { + endTime: { + seconds: 456, + nanos: 789, + }, + startTime: { + seconds: 123, + nanos: 789, + }, + }, + value: { + distributionValue: { + count: '1', + mean: 1256, + bucketOptions: { + explicitBuckets: { + bounds: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + }, + }, + bucketCounts: [ + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '1', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + ], + }, + }, + }, + ], + unit: 'ms', + }, + { + metric: { + type: 'bigtable.googleapis.com/internal/client/first_response_latencies', + labels: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + status: 'OK', + }, + }, + resource: { + type: 'bigtable_client_raw', + labels: { + cluster: 'fake-cluster3', + instance: 'fakeInstanceId', + project_id: 'my-project', + table: 'fakeTableId', + zone: 'us-west1-c', + }, + }, + metricKind: 'CUMULATIVE', + valueType: 'DISTRIBUTION', + points: [ + { + interval: { + endTime: { + seconds: 456, + nanos: 789, + }, + startTime: { + seconds: 123, + nanos: 789, + }, + }, + value: { + distributionValue: { + count: '1', + mean: 2000, + bucketOptions: { + explicitBuckets: { + bounds: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + }, + }, + bucketCounts: [ + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '1', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + ], + }, + }, + }, + ], + unit: 'ms', + }, + { + metric: { + type: 'bigtable.googleapis.com/internal/client/server_latencies', + labels: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + status: 'DEADLINE_EXCEEDED', + streaming: 'true', + }, + }, + resource: { + type: 'bigtable_client_raw', + labels: { + cluster: 'fake-cluster3', + instance: 'fakeInstanceId', + project_id: 'my-project', + table: 'fakeTableId', + zone: 'us-west1-c', + }, + }, + metricKind: 'CUMULATIVE', + valueType: 'DISTRIBUTION', + points: [ + { + interval: { + endTime: { + seconds: 456, + nanos: 789, + }, + startTime: { + seconds: 123, + nanos: 789, + }, + }, + value: { + distributionValue: { + count: '1', + mean: 101, + bucketOptions: { + explicitBuckets: { + bounds: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + }, + }, + bucketCounts: [ + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '1', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + ], + }, + }, + }, + ], + unit: 'ms', + }, + { + metric: { + type: 'bigtable.googleapis.com/internal/client/server_latencies', + labels: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + status: 'OK', + streaming: 'true', + }, + }, + resource: { + type: 'bigtable_client_raw', + labels: { + cluster: 'fake-cluster3', + instance: 'fakeInstanceId', + project_id: 'my-project', + table: 'fakeTableId', + zone: 'us-west1-c', + }, + }, + metricKind: 'CUMULATIVE', + valueType: 'DISTRIBUTION', + points: [ + { + interval: { + endTime: { + seconds: 456, + nanos: 789, + }, + startTime: { + seconds: 123, + nanos: 789, + }, + }, + value: { + distributionValue: { + count: '1', + mean: 103, + bucketOptions: { + explicitBuckets: { + bounds: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + }, + }, + bucketCounts: [ + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '1', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + '0', + ], + }, + }, + }, + ], + unit: 'ms', + }, + { + metric: { + type: 'bigtable.googleapis.com/internal/client/connectivity_error_count', + labels: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + status: 'DEADLINE_EXCEEDED', + }, + }, + resource: { + type: 'bigtable_client_raw', + labels: { + cluster: 'fake-cluster3', + instance: 'fakeInstanceId', + project_id: 'my-project', + table: 'fakeTableId', + zone: 'us-west1-c', + }, + }, + valueType: 'INT64', + points: [ + { + interval: { + endTime: { + seconds: 456, + nanos: 789, + }, + startTime: { + seconds: 123, + nanos: 789, + }, + }, + value: { + int64Value: 0, + }, + }, + ], + }, + { + metric: { + type: 'bigtable.googleapis.com/internal/client/connectivity_error_count', + labels: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + status: 'OK', + }, + }, + resource: { + type: 'bigtable_client_raw', + labels: { + cluster: 'fake-cluster3', + instance: 'fakeInstanceId', + project_id: 'my-project', + table: 'fakeTableId', + zone: 'us-west1-c', + }, + }, + valueType: 'INT64', + points: [ + { + interval: { + endTime: { + seconds: 456, + nanos: 789, + }, + startTime: { + seconds: 123, + nanos: 789, + }, + }, + value: { + int64Value: 0, + }, + }, + ], + }, + ], +}; + +/** + * An example of an `ExportInput` object, representing OpenTelemetry metrics + * data in the format expected by the `metricsToRequest` function. + * + * This object demonstrates the structure of the input data, including + * resource attributes, scope information, and a collection of metrics + * (both counter and distribution types) with their associated data points. + * + * @remarks + * This structure is designed to be converted into a Google Cloud Monitoring + * `CreateTimeSeriesRequest` using the `metricsToRequest` function. It + * includes various types of metrics that are sent by the Bigtable client + * library, such as operation latencies, attempt latencies, retry counts, + * and server latencies. + * + */ +export const expectedOtelExportInput = { + resource: { + _attributes: { + 'service.name': 'Cloud Bigtable Table', + 'telemetry.sdk.language': 'nodejs', + 'telemetry.sdk.name': 'opentelemetry', + 'telemetry.sdk.version': '1.30.1', + }, + asyncAttributesPending: false, + _syncAttributes: { + 'service.name': 'Cloud Bigtable Table', + 'telemetry.sdk.language': 'nodejs', + 'telemetry.sdk.name': 'opentelemetry', + 'telemetry.sdk.version': '1.30.1', + }, + _asyncAttributesPromise: {}, + }, + scopeMetrics: [ + { + scope: { + name: 'bigtable.googleapis.com', + version: '', + }, + metrics: [ + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/operation_latencies', + type: 'HISTOGRAM', + description: + "The total end-to-end latency across all RPC attempts associated with a Bigtable operation. This metric measures an operation's round trip from the client to Bigtable and back to the client and includes all retries.", + unit: 'ms', + valueType: 1, + advice: { + explicitBucketBoundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, + 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, + 5000, 10000, 20000, 50000, 100000, 200000, 400000, 800000, + 1600000, 3200000, + ], + }, + }, + aggregationTemporality: 1, + dataPointType: 0, + dataPoints: [ + { + attributes: { + streaming: 'true', + projectId: 'my-project', + status: 'OK', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 6000, + max: 6000, + sum: 6000, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, + ], + }, + count: 1, + }, + }, + ], + }, + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/attempt_latencies', + type: 'HISTOGRAM', + description: + 'The latencies of a client RPC attempt. Under normal circumstances, this value is identical to operation_latencies. If the client receives transient errors, however, then operation_latencies is the sum of all attempt_latencies and the exponential delays.', + unit: 'ms', + valueType: 1, + advice: { + explicitBucketBoundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, + 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, + 5000, 10000, 20000, 50000, 100000, 200000, 400000, 800000, + 1600000, 3200000, + ], + }, + }, + aggregationTemporality: 1, + dataPointType: 0, + dataPoints: [ + { + attributes: { + streaming: 'true', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + projectId: 'my-project', + status: 'DEADLINE_EXCEEDED', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 2000, + max: 2000, + sum: 2000, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, + ], + }, + count: 1, + }, + }, + { + attributes: { + streaming: 'true', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + projectId: 'my-project', + status: 'OK', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 1000, + max: 1000, + sum: 1000, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, + ], + }, + count: 1, + }, + }, + ], + }, + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/retry_count', + type: 'COUNTER', + description: + 'A counter that records the number of attempts that an operation required to complete. Under normal circumstances, this value is empty.', + unit: '', + valueType: 1, + advice: {}, + }, + aggregationTemporality: 1, + dataPointType: 3, + dataPoints: [ + { + attributes: { + status: 'OK', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + projectId: 'my-project', + }, + startTime: [123, 789], + endTime: [456, 789], + value: 1, + }, + { + attributes: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + projectId: 'my-project', + }, + startTime: [123, 789], + endTime: [456, 789], + value: 1, + }, + ], + isMonotonic: true, + }, + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/application_latencies', + type: 'HISTOGRAM', + description: + 'The time from when the client receives the response to a request until the application reads the response. This metric is most relevant for ReadRows requests. The start and stop times for this metric depend on the way that you send the read request; see Application blocking latencies timer examples for details.', + unit: 'ms', + valueType: 1, + advice: { + explicitBucketBoundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, + 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, + 5000, 10000, 20000, 50000, 100000, 200000, 400000, 800000, + 1600000, 3200000, + ], + }, + }, + aggregationTemporality: 1, + dataPointType: 0, + dataPoints: [ + { + attributes: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + projectId: 'my-project', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 1256, + max: 1256, + sum: 1256, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, + ], + }, + count: 1, + }, + }, + ], + }, + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/first_response_latencies', + type: 'HISTOGRAM', + description: + 'Latencies from when a client sends a request and receives the first row of the response.', + unit: 'ms', + valueType: 1, + advice: { + explicitBucketBoundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, + 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, + 5000, 10000, 20000, 50000, 100000, 200000, 400000, 800000, + 1600000, 3200000, + ], + }, + }, + aggregationTemporality: 1, + dataPointType: 0, + dataPoints: [ + { + attributes: { + status: 'OK', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + projectId: 'my-project', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 2000, + max: 2000, + sum: 2000, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, + ], + }, + count: 1, + }, + }, + ], + }, + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/server_latencies', + type: 'HISTOGRAM', + description: + 'Latencies between the time when the Google frontend receives an RPC and when it sends the first byte of the response.', + unit: 'ms', + valueType: 1, + advice: { + explicitBucketBoundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, + 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, + 5000, 10000, 20000, 50000, 100000, 200000, 400000, 800000, + 1600000, 3200000, + ], + }, + }, + aggregationTemporality: 1, + dataPointType: 0, + dataPoints: [ + { + attributes: { + streaming: 'true', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + status: 'DEADLINE_EXCEEDED', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + projectId: 'my-project', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 101, + max: 101, + sum: 101, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, + ], + }, + count: 1, + }, + }, + { + attributes: { + streaming: 'true', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + status: 'OK', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + projectId: 'my-project', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 103, + max: 103, + sum: 103, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, + ], + }, + count: 1, + }, + }, + ], + }, + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/connectivity_error_count', + type: 'COUNTER', + description: + "The number of requests that failed to reach Google's network. In normal cases, this number is 0. When the number is not 0, it can indicate connectivity issues between the application and the Google network.", + unit: '', + valueType: 1, + advice: {}, + }, + aggregationTemporality: 1, + dataPointType: 3, + dataPoints: [ + { + attributes: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + status: 'DEADLINE_EXCEEDED', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + projectId: 'my-project', + }, + startTime: [123, 789], + endTime: [456, 789], + value: 0, + }, + { + attributes: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + status: 'OK', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + projectId: 'my-project', + }, + startTime: [123, 789], + endTime: [456, 789], + value: 0, + }, + ], + isMonotonic: true, + }, + ], + }, + ], +}; + +export const expectedOtelHundredExportInputs = { + resource: { + _attributes: { + 'service.name': 'Cloud Bigtable Table', + 'telemetry.sdk.language': 'nodejs', + 'telemetry.sdk.name': 'opentelemetry', + 'telemetry.sdk.version': '1.30.1', + 'monitored_resource.project_id': 'cloud-native-db-dpes-shared', + }, + asyncAttributesPending: false, + _syncAttributes: { + 'service.name': 'Cloud Bigtable Table', + 'telemetry.sdk.language': 'nodejs', + 'telemetry.sdk.name': 'opentelemetry', + 'telemetry.sdk.version': '1.30.1', + 'monitored_resource.project_id': 'cloud-native-db-dpes-shared', + }, + _asyncAttributesPromise: {}, + }, + scopeMetrics: [ + { + scope: { + name: 'bigtable.googleapis.com', + version: '', + }, + metrics: [ + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/operation_latencies', + type: 'HISTOGRAM', + description: + "The total end-to-end latency across all RPC attempts associated with a Bigtable operation. This metric measures an operation's round trip from the client to Bigtable and back to the client and includes all retries.", + unit: 'ms', + valueType: 1, + advice: { + explicitBucketBoundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, + 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, + 5000, 10000, 20000, 50000, 100000, 200000, 400000, 800000, + 1600000, 3200000, + ], + }, + }, + aggregationTemporality: 1, + dataPointType: 0, + dataPoints: [ + { + attributes: { + streaming: 'true', + status: 'OK', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 10000, + max: 10000, + sum: 1000000, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }, + count: 100, + }, + }, + ], + }, + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/attempt_latencies', + type: 'HISTOGRAM', + description: + 'The latencies of a client RPC attempt. Under normal circumstances, this value is identical to operation_latencies. If the client receives transient errors, however, then operation_latencies is the sum of all attempt_latencies and the exponential delays.', + unit: 'ms', + valueType: 1, + advice: { + explicitBucketBoundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, + 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, + 5000, 10000, 20000, 50000, 100000, 200000, 400000, 800000, + 1600000, 3200000, + ], + }, + }, + aggregationTemporality: 1, + dataPointType: 0, + dataPoints: [ + { + attributes: { + streaming: 'true', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + status: 'DEADLINE_EXCEEDED', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 4000, + max: 4000, + sum: 400000, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }, + count: 100, + }, + }, + { + attributes: { + streaming: 'true', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + status: 'OK', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 3000, + max: 3000, + sum: 300000, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }, + count: 100, + }, + }, + ], + }, + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/retry_count', + type: 'COUNTER', + description: + 'A counter that records the number of attempts that an operation required to complete. Under normal circumstances, this value is empty.', + unit: '', + valueType: 1, + advice: {}, + }, + aggregationTemporality: 1, + dataPointType: 3, + dataPoints: [ + { + attributes: { + status: 'OK', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: 100, + }, + { + attributes: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: 100, + }, + ], + isMonotonic: true, + }, + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/application_latencies', + type: 'HISTOGRAM', + description: + 'The time from when the client receives the response to a request until the application reads the response. This metric is most relevant for ReadRows requests. The start and stop times for this metric depend on the way that you send the read request; see Application blocking latencies timer examples for details.', + unit: 'ms', + valueType: 1, + advice: { + explicitBucketBoundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, + 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, + 5000, 10000, 20000, 50000, 100000, 200000, 400000, 800000, + 1600000, 3200000, + ], + }, + }, + aggregationTemporality: 1, + dataPointType: 0, + dataPoints: [ + { + attributes: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 1000, + max: 1000, + sum: 200000, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }, + count: 200, + }, + }, + ], + }, + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/first_response_latencies', + type: 'HISTOGRAM', + description: + 'Latencies from when a client sends a request and receives the first row of the response.', + unit: 'ms', + valueType: 1, + advice: { + explicitBucketBoundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, + 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, + 5000, 10000, 20000, 50000, 100000, 200000, 400000, 800000, + 1600000, 3200000, + ], + }, + }, + aggregationTemporality: 1, + dataPointType: 0, + dataPoints: [ + { + attributes: { + status: 'OK', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 2000, + max: 2000, + sum: 200000, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + }, + count: 100, + }, + }, + ], + }, + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/server_latencies', + type: 'HISTOGRAM', + description: + 'Latencies between the time when the Google frontend receives an RPC and when it sends the first byte of the response.', + unit: 'ms', + valueType: 1, + advice: { + explicitBucketBoundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, + 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, + 5000, 10000, 20000, 50000, 100000, 200000, 400000, 800000, + 1600000, 3200000, + ], + }, + }, + aggregationTemporality: 1, + dataPointType: 0, + dataPoints: [ + { + attributes: { + streaming: 'true', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + status: 'DEADLINE_EXCEEDED', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 101, + max: 101, + sum: 10100, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, + ], + }, + count: 100, + }, + }, + { + attributes: { + streaming: 'true', + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + status: 'OK', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: { + min: 103, + max: 103, + sum: 10300, + buckets: { + boundaries: [ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, + 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, + 2000, 5000, 10000, 20000, 50000, 100000, 200000, 400000, + 800000, 1600000, 3200000, + ], + counts: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, + ], + }, + count: 100, + }, + }, + ], + }, + { + descriptor: { + name: 'bigtable.googleapis.com/internal/client/connectivity_error_count', + type: 'COUNTER', + description: + "The number of requests that failed to reach Google's network. In normal cases, this number is 0. When the number is not 0, it can indicate connectivity issues between the application and the Google network.", + unit: '', + valueType: 1, + advice: {}, + }, + aggregationTemporality: 1, + dataPointType: 3, + dataPoints: [ + { + attributes: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + status: 'DEADLINE_EXCEEDED', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: 0, + }, + { + attributes: { + method: 'Bigtable.ReadRows', + client_uid: 'fake-uuid', + status: 'OK', + client_name: 'nodejs-bigtable', + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + }, + startTime: [123, 789], + endTime: [456, 789], + value: 0, + }, + ], + isMonotonic: true, + }, + ], + }, + ], +}; diff --git a/handwritten/bigtable/test-common/metrics-handler-fixture.ts b/handwritten/bigtable/test-common/metrics-handler-fixture.ts new file mode 100644 index 00000000000..da218f1cb66 --- /dev/null +++ b/handwritten/bigtable/test-common/metrics-handler-fixture.ts @@ -0,0 +1,65 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +export const expectedRequestsHandled = [ + { + attemptLatency: 2000, + serverLatency: 101, + connectivityErrorCount: 0, + streaming: 'true', + status: 'DEADLINE_EXCEEDED', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method: 'Bigtable.ReadRows', + projectId: 'my-project', + }, + }, + { + attemptLatency: 1000, + serverLatency: 103, + connectivityErrorCount: 0, + streaming: 'true', + status: 'OK', + client_name: 'nodejs-bigtable', + metricsCollectorData: { + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method: 'Bigtable.ReadRows', + projectId: 'my-project', + }, + }, + { + status: 'OK', + streaming: 'true', + metricsCollectorData: { + instanceId: 'fakeInstanceId', + table: 'fakeTableId', + cluster: 'fake-cluster3', + zone: 'us-west1-c', + method: 'Bigtable.ReadRows', + projectId: 'my-project', + }, + client_name: 'nodejs-bigtable', + operationLatency: 6000, + applicationLatency: 1256, + retryCount: 1, + firstResponseLatency: 2000, + }, +]; diff --git a/handwritten/bigtable/test-common/replace-timestamps.ts b/handwritten/bigtable/test-common/replace-timestamps.ts new file mode 100644 index 00000000000..e52c54b76ef --- /dev/null +++ b/handwritten/bigtable/test-common/replace-timestamps.ts @@ -0,0 +1,39 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {expectedOtelExportInput} from './expected-otel-export-input'; + +/** + * Replaces the timestamp values within an `ExportInput` object with + * standardized test values. + * + * This function is designed for testing purposes to make timestamp comparisons + * in tests more predictable and reliable. It recursively traverses the + * `ExportInput` object, finds all `startTime` and `endTime` properties, and + * replaces their numeric values with standardized test values. + */ +export function replaceTimestamps( + request: typeof expectedOtelExportInput, + newStartTime: [number, number], + newEndTime: [number, number], +) { + request.scopeMetrics.forEach(scopeMetric => { + scopeMetric.metrics.forEach(metric => { + metric.dataPoints.forEach(dataPoint => { + dataPoint.startTime = newStartTime; + dataPoint.endTime = newEndTime; + }); + }); + }); +} diff --git a/handwritten/bigtable/test-common/test-metrics-handler.ts b/handwritten/bigtable/test-common/test-metrics-handler.ts new file mode 100644 index 00000000000..4be2dbf78d8 --- /dev/null +++ b/handwritten/bigtable/test-common/test-metrics-handler.ts @@ -0,0 +1,67 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import { + IMetricsHandler, + OnAttemptCompleteData, + OnOperationCompleteData, +} from '../src/client-side-metrics/metrics-handler'; + +/** + * A test implementation of the IMetricsHandler interface. Used for testing purposes. + * It logs the metrics and attributes received by the onOperationComplete and onAttemptComplete methods. + */ +export class TestMetricsHandler implements IMetricsHandler { + messages = {value: ''}; + projectId = 'projectId'; + requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = []; + + /** + * Logs the metrics and attributes received for an operation completion. + * @param {OnOperationCompleteData} data Metrics related to the completed operation. + */ + onOperationComplete(data: OnOperationCompleteData) { + const mergedMetricsCollectorData = Object.assign( + {projectId: this.projectId}, + data.metricsCollectorData, + ); + const dataWithProject = Object.assign( + {metricsCollectorData: mergedMetricsCollectorData}, + data, + ); + dataWithProject.client_name = 'nodejs-bigtable'; + this.requestsHandled.push(dataWithProject); + this.messages.value += 'Recording parameters for onOperationComplete:\n'; + this.messages.value += `${JSON.stringify(dataWithProject)}\n`; + } + + /** + * Logs the metrics and attributes received for an attempt completion. + * @param {OnOperationCompleteData} data Metrics related to the completed attempt. + */ + onAttemptComplete(data: OnAttemptCompleteData) { + const mergedMetricsCollectorData = Object.assign( + {projectId: this.projectId}, + data.metricsCollectorData, + ); + const dataWithProject = Object.assign( + {metricsCollectorData: mergedMetricsCollectorData}, + data, + ); + dataWithProject.client_name = 'nodejs-bigtable'; + this.requestsHandled.push(dataWithProject); + this.messages.value += 'Recording parameters for onAttemptComplete:\n'; + this.messages.value += `${JSON.stringify(dataWithProject)}\n`; + } +} diff --git a/handwritten/bigtable/test-common/utils/readRowsImpl.ts b/handwritten/bigtable/test-common/utils/readRowsImpl.ts new file mode 100644 index 00000000000..dc268def23c --- /dev/null +++ b/handwritten/bigtable/test-common/utils/readRowsImpl.ts @@ -0,0 +1,475 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {protos} from '../../src'; +import {GoogleError, Status} from 'google-gax'; +import { + ChunkGeneratorParameters, + DebugLog, + ReadRowsServiceParameters, + ReadRowsWritableStream, +} from '../../test/utils/readRowsServiceParameters'; +import {google} from '../../protos/protos'; +import IRowRange = google.bigtable.v2.IRowRange; + +// Generate documentation for this function +/** Pretty prints the request object. + * @param request The request object to pretty print. + * @param debugLog A function that logs debug messages. + */ +function prettyPrintRequest( + request: protos.google.bigtable.v2.IReadRowsRequest, + debugLog: DebugLog, +) { + // pretty-printing important parts of the request. + // doing it field by field because we want to apply .toString() to all key fields + debugLog('received request: {'); + debugLog(` tableName: "${request.tableName}",`); + if (request.rows) { + debugLog(' rows: {'); + if (request.rows.rowKeys) { + debugLog(' rowKeys: ['); + for (const key of request.rows.rowKeys) { + debugLog(` "${key.toString()}",`); + } + debugLog(' ],'); + } + if (request.rows.rowRanges) { + debugLog(' rowRanges: ['); + for (const range of request.rows.rowRanges) { + debugLog(' {'); + if (range.startKeyOpen) { + debugLog(` startKeyOpen: "${range.startKeyOpen.toString()}",`); + } + if (range.startKeyClosed) { + debugLog( + ` startKeyClosed: "${range.startKeyClosed.toString()}",`, + ); + } + if (range.endKeyOpen) { + debugLog(` endKeyOpen: "${range.endKeyOpen.toString()}",`); + } + if (range.endKeyClosed) { + debugLog(` endKeyClosed: "${range.endKeyClosed.toString()}",`); + } + debugLog(' },'); + } + debugLog(' ],'); + } + debugLog(' },'); + } + debugLog('}'); +} + +/** Generates chunks for rows in a fake table that match the provided RowSet. + * The fake table contains monotonically increasing zero padded rows + * in the range [keyFrom, keyTo). + * @param chunkGeneratorParameters The parameters for generating chunks. + * @param debugLog The logging function for printing test output. + * @returns {protos.google.bigtable.v2.ReadRowsResponse.ICellChunk[]} The generated chunks. + */ +function generateChunks( + chunkGeneratorParameters: ChunkGeneratorParameters, + debugLog: DebugLog, +): protos.google.bigtable.v2.ReadRowsResponse.ICellChunk[] { + const keyFrom = chunkGeneratorParameters.keyFrom; + const keyTo = chunkGeneratorParameters.keyTo; + debugLog(`generating chunks from ${keyFrom} to ${keyTo}`); + + const chunks: protos.google.bigtable.v2.ReadRowsResponse.ICellChunk[] = []; + for (let key = keyFrom; key < keyTo; ++key) { + // the keys must be increasing, but we also want to keep them readable, + // so we'll use keys 00000000, 00000001, 00000002, etc. stored as Buffers + const binaryKey = Buffer.from(key.toString().padStart(8, '0')); + debugLog(`generating chunks for ${key}`); + const rowKey = binaryKey.toString('base64'); + let remainingBytes = chunkGeneratorParameters.valueSize; + let chunkCounter = 0; + while (remainingBytes > 0) { + debugLog(` remaining bytes: ${remainingBytes}`); + const chunk: protos.google.bigtable.v2.ReadRowsResponse.ICellChunk = {}; + if (chunkCounter === 0) { + chunk.rowKey = rowKey; + chunk.familyName = { + value: 'family', + }; + chunk.qualifier = { + value: Buffer.from('qualifier').toString('base64'), + }; + } + const thisChunkSize = Math.min( + chunkGeneratorParameters.chunkSize, + remainingBytes, + ); + remainingBytes -= thisChunkSize; + const value = Buffer.from('a'.repeat(remainingBytes)).toString('base64'); + chunk.value = value; + if (remainingBytes === 0) { + debugLog(` setting commit flag for rowKey ${key}`); + chunk.commitRow = true; + } + chunks.push(chunk); + ++chunkCounter; + } + } + debugLog(`generated ${chunks.length} chunks between ${keyFrom} and ${keyTo}`); + return chunks; +} + +/** Checks if the given key is in the provided RowSet. + * @param stringKey The key to check. + * @param rowSet The RowSet to check against. + * @returns {boolean} True if the key is in the RowSet, false otherwise. + */ +function isKeyInRowSet( + stringKey: string, + rowSet?: protos.google.bigtable.v2.IRowSet | null, +): boolean { + if (!rowSet) { + return true; + } + // primitive support for row ranges + if (rowSet.rowRanges || rowSet.rowKeys) { + for (const requestKey of rowSet.rowKeys ?? []) { + if (stringKey === requestKey.toString()) { + return true; + } + } + for (const range of rowSet.rowRanges ?? []) { + let startOk = true; + let endOk = true; + if (range.startKeyOpen && range.startKeyOpen.toString() >= stringKey) { + startOk = false; + } + if (range.startKeyClosed && range.startKeyClosed.toString() > stringKey) { + startOk = false; + } + if (range.endKeyOpen && range.endKeyOpen.toString() <= stringKey) { + endOk = false; + } + if (range.endKeyClosed && range.endKeyClosed.toString() < stringKey) { + endOk = false; + } + if (startOk && endOk) { + return true; + } + } + return false; + } + return true; +} + +/** Gets the key value for the given property specified in the request. + * @param request The request object to get the key value from. + * @param property The property from the request to get the value from. + * @returns {string | undefined} The key value from the request. + */ +function getKeyValue( + request: protos.google.bigtable.v2.IReadRowsRequest, + property: keyof IRowRange, +) { + if ( + request?.rows?.rowRanges && + request?.rows?.rowRanges[0] && + request?.rows?.rowRanges[0][property]?.toString() + ) { + return request?.rows?.rowRanges[0][property]?.toString(); + } + return undefined; +} + +/** Gets the key from the request object. + * @param stream The stream object to get the key from. + * @param keySelectionParameters The parameters for selecting the key. + * @returns {number} The selected key for generating chunks + */ +function getSelectedKey( + request: protos.google.bigtable.v2.IReadRowsRequest, + keySelectionParameters: { + keyOpenProperty: keyof IRowRange; + keyClosedProperty: keyof IRowRange; + defaultKey?: number; + }, +) { + const keyRequestOpen = getKeyValue( + request, + keySelectionParameters.keyOpenProperty, + ); + const keyRequestClosed = getKeyValue( + request, + keySelectionParameters.keyClosedProperty, + ); + const defaultKey = keySelectionParameters.defaultKey; + return defaultKey === undefined + ? keyRequestClosed === undefined + ? parseInt(keyRequestOpen as string) + 1 + : parseInt(keyRequestClosed as string) + : defaultKey; +} + +/** Generates chunks for rows in a fake table that match the provided RowSet. + * The fake table contains monotonically increasing zero padded rows + * in the range [keyFrom, keyTo). + * @param request The request object to generate chunks from. + * @param serviceParameters The parameters for generating chunks. + * @param debugLog A function that logs debug messages. + * @returns {protos.google.bigtable.v2.ReadRowsResponse.ICellChunk[]} The generated chunks. + */ +export function generateChunksFromRequest( + request: protos.google.bigtable.v2.IReadRowsRequest, + serviceParameters: ReadRowsServiceParameters, +) { + return generateChunks( + { + keyFrom: getSelectedKey(request, { + keyOpenProperty: 'startKeyOpen', + keyClosedProperty: 'startKeyClosed', + defaultKey: serviceParameters.keyFrom, + }), + keyTo: getSelectedKey(request, { + keyOpenProperty: 'endKeyOpen', + keyClosedProperty: 'endKeyClosed', + defaultKey: serviceParameters.keyTo, + }), + chunkSize: serviceParameters.chunkSize, + valueSize: serviceParameters.valueSize, + }, + serviceParameters.debugLog, + ); +} + +/** A class that handles the ReadRows request. + * @param stream The stream object that is passed into the request. + * @param debugLog A function that logs debug messages. + */ +class ReadRowsRequestHandler { + public cancelled: boolean; + public stopWaiting: () => void; + constructor( + readonly stream: ReadRowsWritableStream, + readonly debugLog: DebugLog, + ) { + this.cancelled = false; + this.stopWaiting = () => {}; + } + + /** Sends the response object to the stream. + * @param response The response object to send. + */ + async sendResponse( + response: protos.google.bigtable.v2.IReadRowsResponse, + ): Promise { + // an asynchronous function to write a response object to stream, reused several times below. + // captures `cancelled` variable + return new Promise(resolve => { + const debugLog = this.debugLog; + const stream = this.stream; + setTimeout(async () => { + if (this.cancelled) { + resolve(); + return; + } + const canSendMore = stream.write(response); + if (response.chunks && response.chunks.length > 0) { + debugLog(`sent ${response.chunks.length} chunks`); + } + // Log a message if the lastScannedRowKey is provided. + if (response.lastScannedRowKey) { + const binaryKey = Buffer.from( + response.lastScannedRowKey as string, + 'base64', + ); + const stringKey = binaryKey.toString(); + debugLog(`sent lastScannedRowKey = ${stringKey}`); + } + if (!canSendMore) { + // Before doing any more writing with the stream, drain the stream. + debugLog('awaiting for back pressure'); + await new Promise(resolve => { + this.stopWaiting = resolve; + stream.once('drain', resolve); + }); + } + resolve(); + }, 0); + }); + } +} + +/** Implementation of the server streaming ReadRows call. + * The implementation returns monotonically increasing zero padded rows + * in the range [keyFrom, keyTo) if they are provided. Instances of this object + * are used to store data that needs to be shared between multiple requests. + * For instance, the service ignores the errorAfterChunkNo value after the + * service has already emitted an error. + * + * @param serviceParameters The parameters for the implementation. + */ +export class ReadRowsImpl { + private errorAfterChunkNo?: number; + + /** + * Constructor for creating the ReadRows service. Constructor is private to + * encourage use of createService with the factory pattern to restrict the + * way that the service is created for better encapsulation. + * + * @param serviceParameters The parameters for creating the service + * @private + */ + private constructor(readonly serviceParameters: ReadRowsServiceParameters) { + this.errorAfterChunkNo = serviceParameters.errorAfterChunkNo; + } + + /** + Factory method that returns an implementation of the server handling streaming + ReadRows calls that would return monotonically increasing zero padded rows + in the range [keyFrom, keyTo). The returned implementation can be passed to + gRPC server. + @param serviceParameters The parameters for creating the service + */ + static createService(serviceParameters: ReadRowsServiceParameters) { + return async (stream: ReadRowsWritableStream): Promise => { + await new ReadRowsImpl(serviceParameters).handleRequest(stream); + }; + } + + /** Handles the ReadRows request. + * @param stream The stream object that is passed into the request. + */ + private async handleRequest(stream: ReadRowsWritableStream) { + const debugLog = this.serviceParameters.debugLog; + const hook = this.serviceParameters.hook; + if (hook) { + hook(stream.request); + } + + prettyPrintRequest(stream.request, debugLog); + const readRowsRequestHandler = new ReadRowsRequestHandler(stream, debugLog); + stream.on('cancelled', () => { + debugLog('gRPC server received cancel()'); + readRowsRequestHandler.cancelled = true; + readRowsRequestHandler.stopWaiting(); + stream.emit('error', new Error('Cancelled')); + }); + const chunks = generateChunksFromRequest( + stream.request, + this.serviceParameters, + ); + await this.sendAllChunks(readRowsRequestHandler, chunks); + } + + /** Sends all chunks to the stream. + * @param readRowsRequestHandler The handler for the request. + * @param chunks The chunks to send. + */ + private async sendAllChunks( + readRowsRequestHandler: ReadRowsRequestHandler, + chunks: protos.google.bigtable.v2.ReadRowsResponse.ICellChunk[], + ) { + const stream = readRowsRequestHandler.stream; + const debugLog = readRowsRequestHandler.debugLog; + const deadlineExceededError = this.serviceParameters.deadlineExceededError; + + let chunksSent = 0; + let lastScannedRowKey: string | undefined; + let currentResponseChunks: protos.google.bigtable.v2.ReadRowsResponse.ICellChunk[] = + []; + let chunkIdx = 0; + let skipThisRow = false; + + for (const chunk of chunks) { + if (readRowsRequestHandler.cancelled) { + break; + } + + if (chunk.rowKey) { + const binaryKey = Buffer.from(chunk.rowKey as string, 'base64'); + const stringKey = binaryKey.toString(); + + debugLog(`starting row with key ${stringKey}`); + if (isKeyInRowSet(stringKey, stream.request.rows)) { + skipThisRow = false; + } else { + debugLog( + `skipping row with key ${stringKey} because it's out of requested range or keys`, + ); + skipThisRow = true; + lastScannedRowKey = chunk.rowKey as string; + } + } + + if (chunk.commitRow) { + debugLog('commit row'); + } + + if (!skipThisRow) { + currentResponseChunks.push(chunk); + ++chunkIdx; + } + + if ( + currentResponseChunks.length === + this.serviceParameters.chunksPerResponse || + chunkIdx === this.errorAfterChunkNo || + // if we skipped a row and set lastScannedRowKey, dump everything and send a separate message with lastScannedRowKey + lastScannedRowKey || + deadlineExceededError + ) { + const response: protos.google.bigtable.v2.IReadRowsResponse = { + chunks: currentResponseChunks, + }; + chunksSent += currentResponseChunks.length; + await readRowsRequestHandler.sendResponse(response); + currentResponseChunks = []; + + if (chunkIdx === this.errorAfterChunkNo) { + debugLog(`sending error after chunk #${chunkIdx}`); + this.errorAfterChunkNo = undefined; // do not send error for the second time + const error = new GoogleError('Uh oh'); + error.code = Status.ABORTED; + stream.emit('error', error); + readRowsRequestHandler.cancelled = true; + break; + } + + if (deadlineExceededError) { + debugLog('sending deadline exceeded error'); + const error = new GoogleError('Deadline exceeded'); + error.code = Status.DEADLINE_EXCEEDED; + stream.emit('error', error); + readRowsRequestHandler.cancelled = true; + break; + } + } + + if (lastScannedRowKey) { + const response: protos.google.bigtable.v2.IReadRowsResponse = { + lastScannedRowKey, + }; + await readRowsRequestHandler.sendResponse(response); + lastScannedRowKey = undefined; + } + } + if (!readRowsRequestHandler.cancelled && currentResponseChunks.length > 0) { + const response: protos.google.bigtable.v2.IReadRowsResponse = { + chunks: currentResponseChunks, + lastScannedRowKey, + }; + chunksSent += currentResponseChunks.length; + await readRowsRequestHandler.sendResponse(response); + } + debugLog(`in total, sent ${chunksSent} chunks`); + stream.end(); + } +} diff --git a/handwritten/bigtable/test/admin/bigtable-admin.ts b/handwritten/bigtable/test/admin/bigtable-admin.ts new file mode 100644 index 00000000000..93823408596 --- /dev/null +++ b/handwritten/bigtable/test/admin/bigtable-admin.ts @@ -0,0 +1,196 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub, SinonSandbox} from 'sinon'; +import {describe, it} from 'mocha'; +import * as bigtabletableadminModule from '../../src'; + +import {protobuf, operationsProtos} from 'google-gax'; +import {TableAdminClient} from '../../src/admin'; + +// Copied from v2/gapic_bigtable_table_admin_v2.ts +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +// Copied from v2/gapic_bigtable_table_admin_v2.ts +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +// The GAPIC generated tests don't cover our supplemental methods, so this +// basically just copies the code for checkRestoreTableProgress. +describe('restoreTable', () => { + it('invokes checkOptimizeRestoredTableProgress without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkOptimizeRestoredTableProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkOptimizeRestoredTableProgress with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkOptimizeRestoredTableProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); +}); + +describe('waitForConsistency', () => { + let sandbox: SinonSandbox; + + beforeEach(() => { + sandbox = sinon.createSandbox(); + }); + + afterEach(() => { + sandbox.restore(); + }); + + it('accepts a token object', async () => { + const token = 'test'; + const client = new TableAdminClient(); + sandbox.stub(client, 'generateConsistencyToken').callsFake(() => { + assert.ok(false, 'should not have been called'); + }); + + sandbox.stub(client, 'checkConsistency').callsFake(req => { + assert.strictEqual(req.consistencyToken, token); + return [ + { + consistent: true, + }, + ]; + }); + + await client.waitForConsistency('tableName', token); + }); + + it('calls without error', async () => { + const tableName = 'test'; + const consistencyToken = 'token'; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const config: any = { + toFake: [ + 'setTimeout', + 'clearTimeout', + 'setInterval', + 'clearInterval', + 'Date', + ], + }; + + const fakeTimers = sandbox.useFakeTimers(config); + + const client = new TableAdminClient(); + sandbox.stub(client, 'generateConsistencyToken').callsFake(tn => { + assert.strictEqual(tn.name, tableName); + return [ + { + consistencyToken, + }, + ]; + }); + + let consistent = false; + const checkStub = sandbox + .stub(client, 'checkConsistency') + .callsFake(req => { + assert.strictEqual(req.consistencyToken, consistencyToken); + const rv = { + consistent, + }; + consistent = true; + return [rv]; + }); + + const promise = client.waitForConsistency(tableName); + while (!consistent) { + // This is gross, but we basically have to wait a few ticks + // to make sure the function has called setTimeout, before + // advancing the fake timer. + for (let i = 0; i < 5; i++) { + await Promise.resolve(); + } + } + fakeTimers.tick(5500); + + await promise; + + assert.strictEqual(checkStub.callCount, 2); + }); + + it('errors on generateConsistencyToken', async () => { + const client = new TableAdminClient(); + sandbox.stub(client, 'generateConsistencyToken').callsFake(() => { + throw new Error('it failed!'); + }); + sandbox.stub(client, 'checkConsistency').callsFake(() => { + throw new Error('should not be called'); + }); + + await assert.rejects(() => client.waitForConsistency('foo')); + }); + + it('errors on checkConsistency', async () => { + const client = new TableAdminClient(); + sandbox.stub(client, 'generateConsistencyToken').callsFake(() => [ + { + consistencyToken: 'foo', + }, + ]); + sandbox.stub(client, 'checkConsistency').callsFake(() => { + throw new Error('it failed!'); + }); + + await assert.rejects(() => client.waitForConsistency('foo')); + }); +}); diff --git a/handwritten/bigtable/test/admin/gc-rule-builder.ts b/handwritten/bigtable/test/admin/gc-rule-builder.ts new file mode 100644 index 00000000000..d6b972d4421 --- /dev/null +++ b/handwritten/bigtable/test/admin/gc-rule-builder.ts @@ -0,0 +1,194 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 gc from '../../src/admin/gc-rule-builder'; +import {GcRuleBuilder} from '../../src/admin/gc-rule-builder'; + +import * as assert from 'assert'; +import {describe, it} from 'mocha'; + +describe('GcRuleBuilder', () => { + it('has working TypeScript types', () => { + // Not really much to do here at runtime, but this will break + // if one of them is wrong. + const union: gc.GcUnion = { + union: {}, + }; + const intersection: gc.GcIntersection = { + intersection: {}, + }; + + const grouping: gc.GcGrouping = { + union: {}, + }; + + const ruleItem: gc.GcRuleItem = { + maxNumVersions: 10, + }; + + assert.ok(union); + assert.ok(intersection); + assert.ok(grouping); + assert.ok(ruleItem); + }); + + it('makes basic rules', () => { + // This is a no-op outside of checking, which is tested below. + GcRuleBuilder.rule({ + maxNumVersions: 1, + }); + }); + + it('has working union building', () => { + const rule = GcRuleBuilder.union( + GcRuleBuilder.rule({ + maxNumVersions: 1, + }), + GcRuleBuilder.rule({ + maxAge: { + seconds: 1, + }, + }), + ); + + assert.deepStrictEqual(rule, { + union: { + rules: [ + { + maxNumVersions: 1, + }, + { + maxAge: { + seconds: 1, + }, + }, + ], + }, + }); + }); + + it('has working intersection building', () => { + const rule = GcRuleBuilder.intersection( + GcRuleBuilder.rule({ + maxNumVersions: 1, + }), + GcRuleBuilder.rule({ + maxAge: { + seconds: 1, + }, + }), + ); + + assert.deepStrictEqual(rule, { + intersection: { + rules: [ + { + maxNumVersions: 1, + }, + { + maxAge: { + seconds: 1, + }, + }, + ], + }, + }); + }); + + it('can nest', () => { + const rule = GcRuleBuilder.intersection( + GcRuleBuilder.union( + GcRuleBuilder.rule({ + maxNumVersions: 10, + }), + ), + GcRuleBuilder.rule({ + maxNumVersions: 1, + }), + GcRuleBuilder.rule({ + maxAge: { + seconds: 1, + }, + }), + ); + + assert.deepStrictEqual(rule, { + intersection: { + rules: [ + { + union: { + rules: [ + { + maxNumVersions: 10, + }, + ], + }, + }, + { + maxNumVersions: 1, + }, + { + maxAge: { + seconds: 1, + }, + }, + ], + }, + }); + }); + + it('catches invalid groupings', () => { + // Both a union and intersection + assert.throws(() => { + GcRuleBuilder.union({ + union: {}, + intersection: {}, + }); + }); + + // Union/intersection + rules + assert.throws(() => { + GcRuleBuilder.union({ + union: {}, + maxNumVersions: 1, + }); + }); + + // Union/intersection as rule + assert.throws(() => { + GcRuleBuilder.rule( + GcRuleBuilder.union({ + maxNumVersions: 1, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }) as any, + ); + }); + }); + + it('catches invalid rules', () => { + // Unfortunately, limitations in TypeScript keep us from doing a really + // thorough check on rule validity (no runtime types). We can at least check + // that the user didn't pass more than one thing. + assert.throws(() => { + // TS won't compile this. + GcRuleBuilder.rule({ + maxNumVersions: 1, + maxAge: { + seconds: 1, + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any); + }); + }); +}); diff --git a/handwritten/bigtable/test/admin/v2/gapic_bigtable_instance_admin_v2.ts b/handwritten/bigtable/test/admin/v2/gapic_bigtable_instance_admin_v2.ts new file mode 100644 index 00000000000..e7eec14e296 --- /dev/null +++ b/handwritten/bigtable/test/admin/v2/gapic_bigtable_instance_admin_v2.ts @@ -0,0 +1,6654 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../../../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as bigtableinstanceadminModule from '../../../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../../../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.BigtableInstanceAdminClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new bigtableinstanceadminModule.admin.InstanceAdminClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigtableadmin.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new bigtableinstanceadminModule.admin.InstanceAdminClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + bigtableinstanceadminModule.admin.InstanceAdminClient.servicePath; + assert.strictEqual(servicePath, 'bigtableadmin.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + bigtableinstanceadminModule.admin.InstanceAdminClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigtableadmin.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigtableadmin.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigtableadmin.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new bigtableinstanceadminModule.admin.InstanceAdminClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigtableadmin.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new bigtableinstanceadminModule.admin.InstanceAdminClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'bigtableadmin.configured.example.com', + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new bigtableinstanceadminModule.admin.InstanceAdminClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = bigtableinstanceadminModule.admin.InstanceAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new bigtableinstanceadminModule.admin.InstanceAdminClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigtableInstanceAdminStub, undefined); + await client.initialize(); + assert(client.bigtableInstanceAdminStub); + }); + + it('has close method for the initialized client', done => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => { + throw err; + }); + assert(client.bigtableInstanceAdminStub); + client + .close() + .then(() => { + done(); + }) + .catch(err => { + throw err; + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigtableInstanceAdminStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch(err => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetInstanceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Instance(), + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetInstanceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Instance(), + ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IInstance | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetInstanceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetInstanceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListInstancesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListInstancesResponse(), + ); + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListInstancesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListInstancesResponse(), + ); + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IListInstancesResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListInstancesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listInstances(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListInstancesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.listInstances(request), expectedError); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.Instance(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.Instance', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Instance(), + ); + client.innerApiCalls.updateInstance = stubSimpleCall(expectedResponse); + const [response] = await client.updateInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.Instance(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.Instance', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Instance(), + ); + client.innerApiCalls.updateInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IInstance | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.Instance(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.Instance', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.Instance(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.Instance', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.updateInstance(request), expectedError); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteInstanceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteInstance = stubSimpleCall(expectedResponse); + const [response] = await client.deleteInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteInstanceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteInstanceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteInstanceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteInstance(request), expectedError); + }); + }); + + describe('getCluster', () => { + it('invokes getCluster without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Cluster(), + ); + client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); + const [response] = await client.getCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Cluster(), + ); + client.innerApiCalls.getCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCluster( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.ICluster | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCluster = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getCluster(request), expectedError); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListClustersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListClustersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListClustersResponse(), + ); + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListClustersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListClustersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListClustersResponse(), + ); + client.innerApiCalls.listClusters = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IListClustersResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListClustersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListClustersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListClustersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListClustersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.listClusters(request), expectedError); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteCluster = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCluster( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteCluster(request), expectedError); + }); + }); + + describe('createAppProfile', () => { + it('invokes createAppProfile without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateAppProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateAppProfileRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.AppProfile(), + ); + client.innerApiCalls.createAppProfile = stubSimpleCall(expectedResponse); + const [response] = await client.createAppProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAppProfile without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateAppProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateAppProfileRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.AppProfile(), + ); + client.innerApiCalls.createAppProfile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAppProfile( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IAppProfile | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAppProfile with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateAppProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateAppProfileRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAppProfile = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createAppProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAppProfile with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateAppProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateAppProfileRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.createAppProfile(request), expectedError); + }); + }); + + describe('getAppProfile', () => { + it('invokes getAppProfile without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetAppProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetAppProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.AppProfile(), + ); + client.innerApiCalls.getAppProfile = stubSimpleCall(expectedResponse); + const [response] = await client.getAppProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAppProfile without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetAppProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetAppProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.AppProfile(), + ); + client.innerApiCalls.getAppProfile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAppProfile( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IAppProfile | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAppProfile with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetAppProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetAppProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAppProfile = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getAppProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAppProfile with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetAppProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetAppProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getAppProfile(request), expectedError); + }); + }); + + describe('deleteAppProfile', () => { + it('invokes deleteAppProfile without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteAppProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteAppProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteAppProfile = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAppProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAppProfile without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteAppProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteAppProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteAppProfile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAppProfile( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAppProfile with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteAppProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteAppProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAppProfile = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteAppProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAppProfile with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteAppProfileRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteAppProfileRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteAppProfile(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy(), + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy(), + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy(), + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy(), + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('getLogicalView', () => { + it('invokes getLogicalView without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetLogicalViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetLogicalViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ); + client.innerApiCalls.getLogicalView = stubSimpleCall(expectedResponse); + const [response] = await client.getLogicalView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLogicalView without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetLogicalViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetLogicalViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ); + client.innerApiCalls.getLogicalView = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLogicalView( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.ILogicalView | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLogicalView with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetLogicalViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetLogicalViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getLogicalView = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getLogicalView(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLogicalView with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetLogicalViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetLogicalViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getLogicalView(request), expectedError); + }); + }); + + describe('deleteLogicalView', () => { + it('invokes deleteLogicalView without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteLogicalViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteLogicalViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteLogicalView = stubSimpleCall(expectedResponse); + const [response] = await client.deleteLogicalView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLogicalView without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteLogicalViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteLogicalViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteLogicalView = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteLogicalView( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLogicalView with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteLogicalViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteLogicalViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteLogicalView = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteLogicalView(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLogicalView with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteLogicalViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteLogicalViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteLogicalView(request), expectedError); + }); + }); + + describe('getMaterializedView', () => { + it('invokes getMaterializedView without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetMaterializedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetMaterializedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ); + client.innerApiCalls.getMaterializedView = + stubSimpleCall(expectedResponse); + const [response] = await client.getMaterializedView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMaterializedView without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetMaterializedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetMaterializedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ); + client.innerApiCalls.getMaterializedView = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMaterializedView( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IMaterializedView | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMaterializedView with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetMaterializedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetMaterializedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMaterializedView = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getMaterializedView(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMaterializedView with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetMaterializedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetMaterializedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getMaterializedView(request), expectedError); + }); + }); + + describe('deleteMaterializedView', () => { + it('invokes deleteMaterializedView without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteMaterializedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteMaterializedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteMaterializedView = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteMaterializedView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMaterializedView without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteMaterializedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteMaterializedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteMaterializedView = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMaterializedView( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMaterializedView with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteMaterializedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteMaterializedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMaterializedView = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deleteMaterializedView(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deleteMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMaterializedView with closed client', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteMaterializedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteMaterializedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects( + client.deleteMaterializedView(request), + expectedError, + ); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateInstanceRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateInstanceRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.ICreateInstanceMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.ICreateInstanceMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with call error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateInstanceRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateInstanceRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInstanceProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateInstanceProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('partialUpdateInstance', () => { + it('invokes partialUpdateInstance without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.PartialUpdateInstanceRequest(), + ); + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.PartialUpdateInstanceRequest', + ['instance', 'name'], + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.partialUpdateInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.partialUpdateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.partialUpdateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.partialUpdateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes partialUpdateInstance without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.PartialUpdateInstanceRequest(), + ); + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.PartialUpdateInstanceRequest', + ['instance', 'name'], + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.partialUpdateInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.partialUpdateInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IUpdateInstanceMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.IInstance, + protos.google.bigtable.admin.v2.IUpdateInstanceMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.partialUpdateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.partialUpdateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes partialUpdateInstance with call error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.PartialUpdateInstanceRequest(), + ); + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.PartialUpdateInstanceRequest', + ['instance', 'name'], + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.partialUpdateInstance = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.partialUpdateInstance(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.partialUpdateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.partialUpdateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes partialUpdateInstance with LRO error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.PartialUpdateInstanceRequest(), + ); + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.PartialUpdateInstanceRequest', + ['instance', 'name'], + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.partialUpdateInstance = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.partialUpdateInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.partialUpdateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.partialUpdateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkPartialUpdateInstanceProgress without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkPartialUpdateInstanceProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPartialUpdateInstanceProgress with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkPartialUpdateInstanceProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateClusterRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateClusterRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.ICreateClusterMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.ICreateClusterMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with call error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateClusterRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with LRO error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateClusterRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateClusterProgress without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateClusterProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateClusterProgress with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateClusterProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.Cluster(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.Cluster', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.Cluster(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.Cluster', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IUpdateClusterMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IUpdateClusterMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with call error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.Cluster(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.Cluster', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with LRO error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.Cluster(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.Cluster', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateClusterProgress without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateClusterProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateClusterProgress with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateClusterProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('partialUpdateCluster', () => { + it('invokes partialUpdateCluster without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.PartialUpdateClusterRequest(), + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.PartialUpdateClusterRequest', + ['cluster', 'name'], + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.partialUpdateCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.partialUpdateCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.partialUpdateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.partialUpdateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes partialUpdateCluster without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.PartialUpdateClusterRequest(), + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.PartialUpdateClusterRequest', + ['cluster', 'name'], + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.partialUpdateCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.partialUpdateCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IPartialUpdateClusterMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.ICluster, + protos.google.bigtable.admin.v2.IPartialUpdateClusterMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.partialUpdateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.partialUpdateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes partialUpdateCluster with call error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.PartialUpdateClusterRequest(), + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.PartialUpdateClusterRequest', + ['cluster', 'name'], + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.partialUpdateCluster = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.partialUpdateCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.partialUpdateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.partialUpdateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes partialUpdateCluster with LRO error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.PartialUpdateClusterRequest(), + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.PartialUpdateClusterRequest', + ['cluster', 'name'], + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.partialUpdateCluster = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.partialUpdateCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.partialUpdateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.partialUpdateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkPartialUpdateClusterProgress without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkPartialUpdateClusterProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPartialUpdateClusterProgress with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkPartialUpdateClusterProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateAppProfile', () => { + it('invokes updateAppProfile without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateAppProfileRequest(), + ); + request.appProfile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateAppProfileRequest', + ['appProfile', 'name'], + ); + request.appProfile.name = defaultValue1; + const expectedHeaderRequestParams = `app_profile.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateAppProfile = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateAppProfile(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAppProfile without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateAppProfileRequest(), + ); + request.appProfile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateAppProfileRequest', + ['appProfile', 'name'], + ); + request.appProfile.name = defaultValue1; + const expectedHeaderRequestParams = `app_profile.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateAppProfile = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAppProfile( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IUpdateAppProfileMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.IAppProfile, + protos.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAppProfile with call error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateAppProfileRequest(), + ); + request.appProfile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateAppProfileRequest', + ['appProfile', 'name'], + ); + request.appProfile.name = defaultValue1; + const expectedHeaderRequestParams = `app_profile.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAppProfile = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateAppProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAppProfile with LRO error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateAppProfileRequest(), + ); + request.appProfile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateAppProfileRequest', + ['appProfile', 'name'], + ); + request.appProfile.name = defaultValue1; + const expectedHeaderRequestParams = `app_profile.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAppProfile = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateAppProfile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAppProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAppProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateAppProfileProgress without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateAppProfileProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateAppProfileProgress with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateAppProfileProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createLogicalView', () => { + it('invokes createLogicalView without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateLogicalViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateLogicalViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createLogicalView = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createLogicalView(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLogicalView without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateLogicalViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateLogicalViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createLogicalView = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createLogicalView( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.ICreateLogicalViewMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.ICreateLogicalViewMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLogicalView with call error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateLogicalViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateLogicalViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createLogicalView = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createLogicalView(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLogicalView with LRO error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateLogicalViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateLogicalViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createLogicalView = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createLogicalView(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateLogicalViewProgress without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateLogicalViewProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateLogicalViewProgress with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateLogicalViewProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateLogicalView', () => { + it('invokes updateLogicalView without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateLogicalViewRequest(), + ); + request.logicalView ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateLogicalViewRequest', + ['logicalView', 'name'], + ); + request.logicalView.name = defaultValue1; + const expectedHeaderRequestParams = `logical_view.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateLogicalView = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateLogicalView(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateLogicalView without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateLogicalViewRequest(), + ); + request.logicalView ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateLogicalViewRequest', + ['logicalView', 'name'], + ); + request.logicalView.name = defaultValue1; + const expectedHeaderRequestParams = `logical_view.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateLogicalView = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateLogicalView( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IUpdateLogicalViewMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.ILogicalView, + protos.google.bigtable.admin.v2.IUpdateLogicalViewMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateLogicalView with call error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateLogicalViewRequest(), + ); + request.logicalView ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateLogicalViewRequest', + ['logicalView', 'name'], + ); + request.logicalView.name = defaultValue1; + const expectedHeaderRequestParams = `logical_view.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateLogicalView = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateLogicalView(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateLogicalView with LRO error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateLogicalViewRequest(), + ); + request.logicalView ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateLogicalViewRequest', + ['logicalView', 'name'], + ); + request.logicalView.name = defaultValue1; + const expectedHeaderRequestParams = `logical_view.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateLogicalView = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateLogicalView(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateLogicalView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLogicalView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateLogicalViewProgress without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateLogicalViewProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateLogicalViewProgress with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateLogicalViewProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createMaterializedView', () => { + it('invokes createMaterializedView without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateMaterializedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateMaterializedViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createMaterializedView = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createMaterializedView(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMaterializedView without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateMaterializedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateMaterializedViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createMaterializedView = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMaterializedView( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.ICreateMaterializedViewMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.ICreateMaterializedViewMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMaterializedView with call error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateMaterializedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateMaterializedViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMaterializedView = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createMaterializedView(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMaterializedView with LRO error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateMaterializedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateMaterializedViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMaterializedView = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createMaterializedView(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateMaterializedViewProgress without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateMaterializedViewProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateMaterializedViewProgress with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateMaterializedViewProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateMaterializedView', () => { + it('invokes updateMaterializedView without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateMaterializedViewRequest(), + ); + request.materializedView ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateMaterializedViewRequest', + ['materializedView', 'name'], + ); + request.materializedView.name = defaultValue1; + const expectedHeaderRequestParams = `materialized_view.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateMaterializedView = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateMaterializedView(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaterializedView without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateMaterializedViewRequest(), + ); + request.materializedView ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateMaterializedViewRequest', + ['materializedView', 'name'], + ); + request.materializedView.name = defaultValue1; + const expectedHeaderRequestParams = `materialized_view.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateMaterializedView = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMaterializedView( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.IUpdateMaterializedViewMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.IMaterializedView, + protos.google.bigtable.admin.v2.IUpdateMaterializedViewMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaterializedView with call error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateMaterializedViewRequest(), + ); + request.materializedView ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateMaterializedViewRequest', + ['materializedView', 'name'], + ); + request.materializedView.name = defaultValue1; + const expectedHeaderRequestParams = `materialized_view.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMaterializedView = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateMaterializedView(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMaterializedView with LRO error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateMaterializedViewRequest(), + ); + request.materializedView ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateMaterializedViewRequest', + ['materializedView', 'name'], + ); + request.materializedView.name = defaultValue1; + const expectedHeaderRequestParams = `materialized_view.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMaterializedView = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateMaterializedView(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateMaterializedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMaterializedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateMaterializedViewProgress without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateMaterializedViewProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateMaterializedViewProgress with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateMaterializedViewProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listAppProfiles', () => { + it('invokes listAppProfiles without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAppProfilesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAppProfilesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), + generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), + generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), + ]; + client.innerApiCalls.listAppProfiles = stubSimpleCall(expectedResponse); + const [response] = await client.listAppProfiles(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAppProfiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAppProfiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAppProfiles without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAppProfilesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAppProfilesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), + generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), + generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), + ]; + client.innerApiCalls.listAppProfiles = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAppProfiles( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IAppProfile[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAppProfiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAppProfiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAppProfiles with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAppProfilesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAppProfilesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAppProfiles = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listAppProfiles(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAppProfiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAppProfiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAppProfilesStream without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAppProfilesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAppProfilesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), + generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), + generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), + ]; + client.descriptors.page.listAppProfiles.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAppProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.AppProfile[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.AppProfile) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listAppProfiles.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAppProfiles, request), + ); + assert( + (client.descriptors.page.listAppProfiles.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listAppProfilesStream with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAppProfilesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAppProfilesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAppProfiles.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAppProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.AppProfile[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.AppProfile) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAppProfiles.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAppProfiles, request), + ); + assert( + (client.descriptors.page.listAppProfiles.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAppProfiles without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAppProfilesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAppProfilesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), + generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), + generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), + ]; + client.descriptors.page.listAppProfiles.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.bigtable.admin.v2.IAppProfile[] = []; + const iterable = client.listAppProfilesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAppProfiles.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listAppProfiles.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAppProfiles with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAppProfilesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAppProfilesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAppProfiles.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAppProfilesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.bigtable.admin.v2.IAppProfile[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAppProfiles.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listAppProfiles.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listHotTablets', () => { + it('invokes listHotTablets without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListHotTabletsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListHotTabletsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), + generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), + generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), + ]; + client.innerApiCalls.listHotTablets = stubSimpleCall(expectedResponse); + const [response] = await client.listHotTablets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listHotTablets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHotTablets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHotTablets without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListHotTabletsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListHotTabletsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), + generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), + generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), + ]; + client.innerApiCalls.listHotTablets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listHotTablets( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IHotTablet[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listHotTablets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHotTablets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHotTablets with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListHotTabletsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListHotTabletsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listHotTablets = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listHotTablets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listHotTablets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHotTablets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHotTabletsStream without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListHotTabletsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListHotTabletsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), + generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), + generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), + ]; + client.descriptors.page.listHotTablets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listHotTabletsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.HotTablet[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.HotTablet) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listHotTablets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listHotTablets, request), + ); + assert( + (client.descriptors.page.listHotTablets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listHotTabletsStream with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListHotTabletsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListHotTabletsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHotTablets.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listHotTabletsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.HotTablet[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.HotTablet) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listHotTablets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listHotTablets, request), + ); + assert( + (client.descriptors.page.listHotTablets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listHotTablets without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListHotTabletsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListHotTabletsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), + generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), + generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), + ]; + client.descriptors.page.listHotTablets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.bigtable.admin.v2.IHotTablet[] = []; + const iterable = client.listHotTabletsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listHotTablets.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listHotTablets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listHotTablets with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListHotTabletsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListHotTabletsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHotTablets.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listHotTabletsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.bigtable.admin.v2.IHotTablet[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listHotTablets.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listHotTablets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listLogicalViews', () => { + it('invokes listLogicalViews without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListLogicalViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListLogicalViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ), + ]; + client.innerApiCalls.listLogicalViews = stubSimpleCall(expectedResponse); + const [response] = await client.listLogicalViews(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listLogicalViews as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLogicalViews as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLogicalViews without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListLogicalViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListLogicalViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ), + ]; + client.innerApiCalls.listLogicalViews = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listLogicalViews( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.ILogicalView[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listLogicalViews as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLogicalViews as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLogicalViews with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListLogicalViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListLogicalViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listLogicalViews = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listLogicalViews(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listLogicalViews as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLogicalViews as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLogicalViewsStream without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListLogicalViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListLogicalViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ), + ]; + client.descriptors.page.listLogicalViews.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listLogicalViewsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.LogicalView[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.LogicalView) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listLogicalViews.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLogicalViews, request), + ); + assert( + (client.descriptors.page.listLogicalViews.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listLogicalViewsStream with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListLogicalViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListLogicalViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listLogicalViews.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listLogicalViewsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.LogicalView[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.LogicalView) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listLogicalViews.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLogicalViews, request), + ); + assert( + (client.descriptors.page.listLogicalViews.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listLogicalViews without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListLogicalViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListLogicalViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.LogicalView(), + ), + ]; + client.descriptors.page.listLogicalViews.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.bigtable.admin.v2.ILogicalView[] = []; + const iterable = client.listLogicalViewsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listLogicalViews.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listLogicalViews.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listLogicalViews with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListLogicalViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListLogicalViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listLogicalViews.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLogicalViewsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.bigtable.admin.v2.ILogicalView[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listLogicalViews.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listLogicalViews.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listMaterializedViews', () => { + it('invokes listMaterializedViews without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListMaterializedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListMaterializedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ), + ]; + client.innerApiCalls.listMaterializedViews = + stubSimpleCall(expectedResponse); + const [response] = await client.listMaterializedViews(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMaterializedViews as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMaterializedViews as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMaterializedViews without error using callback', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListMaterializedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListMaterializedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ), + ]; + client.innerApiCalls.listMaterializedViews = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMaterializedViews( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IMaterializedView[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMaterializedViews as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMaterializedViews as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMaterializedViews with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListMaterializedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListMaterializedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMaterializedViews = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listMaterializedViews(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listMaterializedViews as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMaterializedViews as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMaterializedViewsStream without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListMaterializedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListMaterializedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ), + ]; + client.descriptors.page.listMaterializedViews.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listMaterializedViewsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.MaterializedView[] = + []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.MaterializedView) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listMaterializedViews + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listMaterializedViews, request), + ); + assert( + ( + client.descriptors.page.listMaterializedViews + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listMaterializedViewsStream with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListMaterializedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListMaterializedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMaterializedViews.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listMaterializedViewsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.MaterializedView[] = + []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.MaterializedView) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listMaterializedViews + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listMaterializedViews, request), + ); + assert( + ( + client.descriptors.page.listMaterializedViews + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listMaterializedViews without error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListMaterializedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListMaterializedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.MaterializedView(), + ), + ]; + client.descriptors.page.listMaterializedViews.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.bigtable.admin.v2.IMaterializedView[] = []; + const iterable = client.listMaterializedViewsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listMaterializedViews + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listMaterializedViews + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listMaterializedViews with error', async () => { + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListMaterializedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListMaterializedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMaterializedViews.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMaterializedViewsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.bigtable.admin.v2.IMaterializedView[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listMaterializedViews + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listMaterializedViews + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('appProfile', async () => { + const fakePath = '/rendered/path/appProfile'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + app_profile: 'appProfileValue', + }; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.appProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('appProfilePath', () => { + const result = client.appProfilePath( + 'projectValue', + 'instanceValue', + 'appProfileValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.appProfilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAppProfileName', () => { + const result = client.matchProjectFromAppProfileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.appProfilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromAppProfileName', () => { + const result = client.matchInstanceFromAppProfileName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.appProfilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAppProfileFromAppProfileName', () => { + const result = client.matchAppProfileFromAppProfileName(fakePath); + assert.strictEqual(result, 'appProfileValue'); + assert( + (client.pathTemplates.appProfilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('authorizedView', async () => { + const fakePath = '/rendered/path/authorizedView'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + table: 'tableValue', + authorized_view: 'authorizedViewValue', + }; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authorizedViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.authorizedViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('authorizedViewPath', () => { + const result = client.authorizedViewPath( + 'projectValue', + 'instanceValue', + 'tableValue', + 'authorizedViewValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.authorizedViewPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAuthorizedViewName', () => { + const result = client.matchProjectFromAuthorizedViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.authorizedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromAuthorizedViewName', () => { + const result = client.matchInstanceFromAuthorizedViewName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.authorizedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTableFromAuthorizedViewName', () => { + const result = client.matchTableFromAuthorizedViewName(fakePath); + assert.strictEqual(result, 'tableValue'); + assert( + (client.pathTemplates.authorizedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAuthorizedViewFromAuthorizedViewName', () => { + const result = + client.matchAuthorizedViewFromAuthorizedViewName(fakePath); + assert.strictEqual(result, 'authorizedViewValue'); + assert( + (client.pathTemplates.authorizedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('backup', async () => { + const fakePath = '/rendered/path/backup'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + cluster: 'clusterValue', + backup: 'backupValue', + }; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath( + 'projectValue', + 'instanceValue', + 'clusterValue', + 'backupValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromBackupName', () => { + const result = client.matchInstanceFromBackupName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromBackupName', () => { + const result = client.matchClusterFromBackupName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, 'backupValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('cluster', async () => { + const fakePath = '/rendered/path/cluster'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + cluster: 'clusterValue', + }; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath( + 'projectValue', + 'instanceValue', + 'clusterValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromClusterName', () => { + const result = client.matchInstanceFromClusterName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('hotTablet', async () => { + const fakePath = '/rendered/path/hotTablet'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + cluster: 'clusterValue', + hot_tablet: 'hotTabletValue', + }; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.hotTabletPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hotTabletPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hotTabletPath', () => { + const result = client.hotTabletPath( + 'projectValue', + 'instanceValue', + 'clusterValue', + 'hotTabletValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.hotTabletPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromHotTabletName', () => { + const result = client.matchProjectFromHotTabletName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.hotTabletPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromHotTabletName', () => { + const result = client.matchInstanceFromHotTabletName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.hotTabletPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromHotTabletName', () => { + const result = client.matchClusterFromHotTabletName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.hotTabletPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchHotTabletFromHotTabletName', () => { + const result = client.matchHotTabletFromHotTabletName(fakePath); + assert.strictEqual(result, 'hotTabletValue'); + assert( + (client.pathTemplates.hotTabletPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('instance', async () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + }; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath('projectValue', 'instanceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('logicalView', async () => { + const fakePath = '/rendered/path/logicalView'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + logical_view: 'logicalViewValue', + }; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.logicalViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.logicalViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('logicalViewPath', () => { + const result = client.logicalViewPath( + 'projectValue', + 'instanceValue', + 'logicalViewValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.logicalViewPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromLogicalViewName', () => { + const result = client.matchProjectFromLogicalViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.logicalViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromLogicalViewName', () => { + const result = client.matchInstanceFromLogicalViewName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.logicalViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogicalViewFromLogicalViewName', () => { + const result = client.matchLogicalViewFromLogicalViewName(fakePath); + assert.strictEqual(result, 'logicalViewValue'); + assert( + (client.pathTemplates.logicalViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('materializedView', async () => { + const fakePath = '/rendered/path/materializedView'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + materialized_view: 'materializedViewValue', + }; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.materializedViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.materializedViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('materializedViewPath', () => { + const result = client.materializedViewPath( + 'projectValue', + 'instanceValue', + 'materializedViewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.materializedViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromMaterializedViewName', () => { + const result = client.matchProjectFromMaterializedViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.materializedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromMaterializedViewName', () => { + const result = client.matchInstanceFromMaterializedViewName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.materializedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchMaterializedViewFromMaterializedViewName', () => { + const result = + client.matchMaterializedViewFromMaterializedViewName(fakePath); + assert.strictEqual(result, 'materializedViewValue'); + assert( + (client.pathTemplates.materializedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('schemaBundle', async () => { + const fakePath = '/rendered/path/schemaBundle'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + table: 'tableValue', + schema_bundle: 'schemaBundleValue', + }; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.schemaBundlePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.schemaBundlePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('schemaBundlePath', () => { + const result = client.schemaBundlePath( + 'projectValue', + 'instanceValue', + 'tableValue', + 'schemaBundleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.schemaBundlePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSchemaBundleName', () => { + const result = client.matchProjectFromSchemaBundleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.schemaBundlePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromSchemaBundleName', () => { + const result = client.matchInstanceFromSchemaBundleName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.schemaBundlePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTableFromSchemaBundleName', () => { + const result = client.matchTableFromSchemaBundleName(fakePath); + assert.strictEqual(result, 'tableValue'); + assert( + (client.pathTemplates.schemaBundlePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSchemaBundleFromSchemaBundleName', () => { + const result = client.matchSchemaBundleFromSchemaBundleName(fakePath); + assert.strictEqual(result, 'schemaBundleValue'); + assert( + (client.pathTemplates.schemaBundlePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('snapshot', async () => { + const fakePath = '/rendered/path/snapshot'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + cluster: 'clusterValue', + snapshot: 'snapshotValue', + }; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.snapshotPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.snapshotPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('snapshotPath', () => { + const result = client.snapshotPath( + 'projectValue', + 'instanceValue', + 'clusterValue', + 'snapshotValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.snapshotPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSnapshotName', () => { + const result = client.matchProjectFromSnapshotName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromSnapshotName', () => { + const result = client.matchInstanceFromSnapshotName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromSnapshotName', () => { + const result = client.matchClusterFromSnapshotName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSnapshotFromSnapshotName', () => { + const result = client.matchSnapshotFromSnapshotName(fakePath); + assert.strictEqual(result, 'snapshotValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('table', async () => { + const fakePath = '/rendered/path/table'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + table: 'tableValue', + }; + const client = new bigtableinstanceadminModule.admin.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.tablePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tablePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tablePath', () => { + const result = client.tablePath( + 'projectValue', + 'instanceValue', + 'tableValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tablePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTableName', () => { + const result = client.matchProjectFromTableName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromTableName', () => { + const result = client.matchInstanceFromTableName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTableFromTableName', () => { + const result = client.matchTableFromTableName(fakePath); + assert.strictEqual(result, 'tableValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/handwritten/bigtable/test/admin/v2/gapic_bigtable_table_admin_v2.ts b/handwritten/bigtable/test/admin/v2/gapic_bigtable_table_admin_v2.ts new file mode 100644 index 00000000000..d70d42ff308 --- /dev/null +++ b/handwritten/bigtable/test/admin/v2/gapic_bigtable_table_admin_v2.ts @@ -0,0 +1,7355 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../../../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as bigtabletableadminModule from '../../../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../../../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.BigtableTableAdminClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new bigtabletableadminModule.admin.TableAdminClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigtableadmin.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new bigtabletableadminModule.admin.TableAdminClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + bigtabletableadminModule.admin.TableAdminClient.servicePath; + assert.strictEqual(servicePath, 'bigtableadmin.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + bigtabletableadminModule.admin.TableAdminClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigtableadmin.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigtableadmin.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigtableadmin.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new bigtabletableadminModule.admin.TableAdminClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigtableadmin.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'bigtableadmin.configured.example.com', + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new bigtabletableadminModule.admin.TableAdminClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = bigtabletableadminModule.admin.TableAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new bigtabletableadminModule.admin.TableAdminClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigtableTableAdminStub, undefined); + await client.initialize(); + assert(client.bigtableTableAdminStub); + }); + + it('has close method for the initialized client', done => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => { + throw err; + }); + assert(client.bigtableTableAdminStub); + client + .close() + .then(() => { + done(); + }) + .catch(err => { + throw err; + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigtableTableAdminStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch(err => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createTable', () => { + it('invokes createTable without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateTableRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Table(), + ); + client.innerApiCalls.createTable = stubSimpleCall(expectedResponse); + const [response] = await client.createTable(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTable without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateTableRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Table(), + ); + client.innerApiCalls.createTable = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTable( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.ITable | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTable with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateTableRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTable = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createTable(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTable with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateTableRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.createTable(request), expectedError); + }); + }); + + describe('getTable', () => { + it('invokes getTable without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Table(), + ); + client.innerApiCalls.getTable = stubSimpleCall(expectedResponse); + const [response] = await client.getTable(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTable without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Table(), + ); + client.innerApiCalls.getTable = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTable( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.ITable | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTable with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTable = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTable(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTable with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getTable(request), expectedError); + }); + }); + + describe('deleteTable', () => { + it('invokes deleteTable without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTable = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTable(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTable without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTable = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTable( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTable with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTable = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteTable(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTable with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteTable(request), expectedError); + }); + }); + + describe('getAuthorizedView', () => { + it('invokes getAuthorizedView without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetAuthorizedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetAuthorizedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ); + client.innerApiCalls.getAuthorizedView = stubSimpleCall(expectedResponse); + const [response] = await client.getAuthorizedView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAuthorizedView without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetAuthorizedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetAuthorizedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ); + client.innerApiCalls.getAuthorizedView = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAuthorizedView( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IAuthorizedView | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAuthorizedView with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetAuthorizedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetAuthorizedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAuthorizedView = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getAuthorizedView(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAuthorizedView with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetAuthorizedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetAuthorizedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getAuthorizedView(request), expectedError); + }); + }); + + describe('deleteAuthorizedView', () => { + it('invokes deleteAuthorizedView without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteAuthorizedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteAuthorizedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteAuthorizedView = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteAuthorizedView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAuthorizedView without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteAuthorizedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteAuthorizedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteAuthorizedView = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAuthorizedView( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAuthorizedView with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteAuthorizedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteAuthorizedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAuthorizedView = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteAuthorizedView(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAuthorizedView with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteAuthorizedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteAuthorizedViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteAuthorizedView(request), expectedError); + }); + }); + + describe('modifyColumnFamilies', () => { + it('invokes modifyColumnFamilies without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ModifyColumnFamiliesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Table(), + ); + client.innerApiCalls.modifyColumnFamilies = + stubSimpleCall(expectedResponse); + const [response] = await client.modifyColumnFamilies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.modifyColumnFamilies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.modifyColumnFamilies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyColumnFamilies without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ModifyColumnFamiliesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Table(), + ); + client.innerApiCalls.modifyColumnFamilies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.modifyColumnFamilies( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.ITable | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.modifyColumnFamilies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.modifyColumnFamilies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyColumnFamilies with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ModifyColumnFamiliesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.modifyColumnFamilies = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.modifyColumnFamilies(request), expectedError); + const actualRequest = ( + client.innerApiCalls.modifyColumnFamilies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.modifyColumnFamilies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyColumnFamilies with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ModifyColumnFamiliesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.modifyColumnFamilies(request), expectedError); + }); + }); + + describe('dropRowRange', () => { + it('invokes dropRowRange without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DropRowRangeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DropRowRangeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.dropRowRange = stubSimpleCall(expectedResponse); + const [response] = await client.dropRowRange(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.dropRowRange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.dropRowRange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes dropRowRange without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DropRowRangeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DropRowRangeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.dropRowRange = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.dropRowRange( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.dropRowRange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.dropRowRange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes dropRowRange with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DropRowRangeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DropRowRangeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.dropRowRange = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.dropRowRange(request), expectedError); + const actualRequest = ( + client.innerApiCalls.dropRowRange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.dropRowRange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes dropRowRange with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DropRowRangeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DropRowRangeRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.dropRowRange(request), expectedError); + }); + }); + + describe('generateConsistencyToken', () => { + it('invokes generateConsistencyToken without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GenerateConsistencyTokenRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GenerateConsistencyTokenRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.GenerateConsistencyTokenResponse(), + ); + client.innerApiCalls.generateConsistencyToken = + stubSimpleCall(expectedResponse); + const [response] = await client.generateConsistencyToken(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateConsistencyToken as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateConsistencyToken as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateConsistencyToken without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GenerateConsistencyTokenRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GenerateConsistencyTokenRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.GenerateConsistencyTokenResponse(), + ); + client.innerApiCalls.generateConsistencyToken = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateConsistencyToken( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateConsistencyToken as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateConsistencyToken as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateConsistencyToken with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GenerateConsistencyTokenRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GenerateConsistencyTokenRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateConsistencyToken = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.generateConsistencyToken(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.generateConsistencyToken as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateConsistencyToken as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateConsistencyToken with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GenerateConsistencyTokenRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GenerateConsistencyTokenRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects( + client.generateConsistencyToken(request), + expectedError, + ); + }); + }); + + describe('checkConsistency', () => { + it('invokes checkConsistency without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CheckConsistencyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CheckConsistencyRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.CheckConsistencyResponse(), + ); + client.innerApiCalls.checkConsistency = stubSimpleCall(expectedResponse); + const [response] = await client.checkConsistency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkConsistency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkConsistency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkConsistency without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CheckConsistencyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CheckConsistencyRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.CheckConsistencyResponse(), + ); + client.innerApiCalls.checkConsistency = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkConsistency( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.ICheckConsistencyResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkConsistency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkConsistency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkConsistency with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CheckConsistencyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CheckConsistencyRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkConsistency = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkConsistency(request), expectedError); + const actualRequest = ( + client.innerApiCalls.checkConsistency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkConsistency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkConsistency with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CheckConsistencyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CheckConsistencyRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.checkConsistency(request), expectedError); + }); + }); + + describe('getSnapshot', () => { + it('invokes getSnapshot without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetSnapshotRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Snapshot(), + ); + client.innerApiCalls.getSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.getSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetSnapshotRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Snapshot(), + ); + client.innerApiCalls.getSnapshot = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.ISnapshot | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetSnapshotRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSnapshot = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetSnapshotRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getSnapshot(request), expectedError); + }); + }); + + describe('deleteSnapshot', () => { + it('invokes deleteSnapshot without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteSnapshotRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSnapshot without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteSnapshotRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSnapshot = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSnapshot with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteSnapshotRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSnapshot = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSnapshot with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteSnapshotRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteSnapshot(request), expectedError); + }); + }); + + describe('getBackup', () => { + it('invokes getBackup without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetBackupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Backup(), + ); + client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); + const [response] = await client.getBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetBackupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Backup(), + ); + client.innerApiCalls.getBackup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackup( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IBackup | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetBackupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetBackupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getBackup(request), expectedError); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateBackupRequest(), + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateBackupRequest', + ['backup', 'name'], + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Backup(), + ); + client.innerApiCalls.updateBackup = stubSimpleCall(expectedResponse); + const [response] = await client.updateBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateBackupRequest(), + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateBackupRequest', + ['backup', 'name'], + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.Backup(), + ); + client.innerApiCalls.updateBackup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IBackup | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateBackupRequest(), + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateBackupRequest', + ['backup', 'name'], + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateBackupRequest(), + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateBackupRequest', + ['backup', 'name'], + ); + request.backup.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.updateBackup(request), expectedError); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteBackupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteBackup = stubSimpleCall(expectedResponse); + const [response] = await client.deleteBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteBackupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteBackup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteBackupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteBackupRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteBackup(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy(), + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy(), + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy(), + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy(), + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'], + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('getSchemaBundle', () => { + it('invokes getSchemaBundle without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetSchemaBundleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetSchemaBundleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ); + client.innerApiCalls.getSchemaBundle = stubSimpleCall(expectedResponse); + const [response] = await client.getSchemaBundle(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchemaBundle without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetSchemaBundleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetSchemaBundleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ); + client.innerApiCalls.getSchemaBundle = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSchemaBundle( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.ISchemaBundle | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchemaBundle with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetSchemaBundleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetSchemaBundleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSchemaBundle = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getSchemaBundle(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchemaBundle with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.GetSchemaBundleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.GetSchemaBundleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getSchemaBundle(request), expectedError); + }); + }); + + describe('deleteSchemaBundle', () => { + it('invokes deleteSchemaBundle without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteSchemaBundleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteSchemaBundleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSchemaBundle = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSchemaBundle(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchemaBundle without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteSchemaBundleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteSchemaBundleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSchemaBundle = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSchemaBundle( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchemaBundle with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteSchemaBundleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteSchemaBundleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSchemaBundle = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteSchemaBundle(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchemaBundle with closed client', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.DeleteSchemaBundleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.DeleteSchemaBundleRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteSchemaBundle(request), expectedError); + }); + }); + + describe('createTableFromSnapshot', () => { + it('invokes createTableFromSnapshot without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateTableFromSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateTableFromSnapshotRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createTableFromSnapshot = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createTableFromSnapshot(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTableFromSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTableFromSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTableFromSnapshot without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateTableFromSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateTableFromSnapshotRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createTableFromSnapshot = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTableFromSnapshot( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTableFromSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTableFromSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTableFromSnapshot with call error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateTableFromSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateTableFromSnapshotRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTableFromSnapshot = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createTableFromSnapshot(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createTableFromSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTableFromSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTableFromSnapshot with LRO error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateTableFromSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateTableFromSnapshotRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTableFromSnapshot = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createTableFromSnapshot(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createTableFromSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTableFromSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateTableFromSnapshotProgress without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkCreateTableFromSnapshotProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTableFromSnapshotProgress with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateTableFromSnapshotProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateTable', () => { + it('invokes updateTable without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateTableRequest(), + ); + request.table ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateTableRequest', + ['table', 'name'], + ); + request.table.name = defaultValue1; + const expectedHeaderRequestParams = `table.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateTable = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateTable(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTable without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateTableRequest(), + ); + request.table ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateTableRequest', + ['table', 'name'], + ); + request.table.name = defaultValue1; + const expectedHeaderRequestParams = `table.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateTable = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTable( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUpdateTableMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUpdateTableMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTable with call error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateTableRequest(), + ); + request.table ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateTableRequest', + ['table', 'name'], + ); + request.table.name = defaultValue1; + const expectedHeaderRequestParams = `table.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTable = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateTable(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTable with LRO error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateTableRequest(), + ); + request.table ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateTableRequest', + ['table', 'name'], + ); + request.table.name = defaultValue1; + const expectedHeaderRequestParams = `table.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTable = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateTable(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateTableProgress without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateTableProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateTableProgress with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkUpdateTableProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('undeleteTable', () => { + it('invokes undeleteTable without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UndeleteTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UndeleteTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.undeleteTable = + stubLongRunningCall(expectedResponse); + const [operation] = await client.undeleteTable(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteTable without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UndeleteTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UndeleteTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.undeleteTable = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeleteTable( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUndeleteTableMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IUndeleteTableMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteTable with call error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UndeleteTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UndeleteTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteTable = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.undeleteTable(request), expectedError); + const actualRequest = ( + client.innerApiCalls.undeleteTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteTable with LRO error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UndeleteTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UndeleteTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteTable = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.undeleteTable(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.undeleteTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeleteTableProgress without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeleteTableProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeleteTableProgress with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUndeleteTableProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createAuthorizedView', () => { + it('invokes createAuthorizedView without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateAuthorizedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateAuthorizedViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createAuthorizedView = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createAuthorizedView(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAuthorizedView without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateAuthorizedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateAuthorizedViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createAuthorizedView = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAuthorizedView( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.ICreateAuthorizedViewMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.ICreateAuthorizedViewMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAuthorizedView with call error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateAuthorizedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateAuthorizedViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAuthorizedView = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createAuthorizedView(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAuthorizedView with LRO error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateAuthorizedViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateAuthorizedViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAuthorizedView = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createAuthorizedView(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateAuthorizedViewProgress without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateAuthorizedViewProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateAuthorizedViewProgress with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateAuthorizedViewProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateAuthorizedView', () => { + it('invokes updateAuthorizedView without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateAuthorizedViewRequest(), + ); + request.authorizedView ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateAuthorizedViewRequest', + ['authorizedView', 'name'], + ); + request.authorizedView.name = defaultValue1; + const expectedHeaderRequestParams = `authorized_view.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateAuthorizedView = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateAuthorizedView(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAuthorizedView without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateAuthorizedViewRequest(), + ); + request.authorizedView ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateAuthorizedViewRequest', + ['authorizedView', 'name'], + ); + request.authorizedView.name = defaultValue1; + const expectedHeaderRequestParams = `authorized_view.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateAuthorizedView = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAuthorizedView( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.IAuthorizedView, + protos.google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAuthorizedView with call error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateAuthorizedViewRequest(), + ); + request.authorizedView ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateAuthorizedViewRequest', + ['authorizedView', 'name'], + ); + request.authorizedView.name = defaultValue1; + const expectedHeaderRequestParams = `authorized_view.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAuthorizedView = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateAuthorizedView(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAuthorizedView with LRO error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateAuthorizedViewRequest(), + ); + request.authorizedView ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateAuthorizedViewRequest', + ['authorizedView', 'name'], + ); + request.authorizedView.name = defaultValue1; + const expectedHeaderRequestParams = `authorized_view.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAuthorizedView = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateAuthorizedView(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAuthorizedView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAuthorizedView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateAuthorizedViewProgress without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateAuthorizedViewProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateAuthorizedViewProgress with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateAuthorizedViewProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('snapshotTable', () => { + it('invokes snapshotTable without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.SnapshotTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.SnapshotTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.snapshotTable = + stubLongRunningCall(expectedResponse); + const [operation] = await client.snapshotTable(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.snapshotTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.snapshotTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes snapshotTable without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.SnapshotTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.SnapshotTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.snapshotTable = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.snapshotTable( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.ISnapshotTableMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.ISnapshot, + protos.google.bigtable.admin.v2.ISnapshotTableMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.snapshotTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.snapshotTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes snapshotTable with call error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.SnapshotTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.SnapshotTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.snapshotTable = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.snapshotTable(request), expectedError); + const actualRequest = ( + client.innerApiCalls.snapshotTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.snapshotTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes snapshotTable with LRO error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.SnapshotTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.SnapshotTableRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.snapshotTable = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.snapshotTable(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.snapshotTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.snapshotTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSnapshotTableProgress without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkSnapshotTableProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSnapshotTableProgress with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkSnapshotTableProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createBackup', () => { + it('invokes createBackup without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateBackupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateBackupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICreateBackupMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICreateBackupMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with call error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateBackupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with LRO error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateBackupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupProgress without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateBackupProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupProgress with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkCreateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('restoreTable', () => { + it('invokes restoreTable without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.RestoreTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.RestoreTableRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.restoreTable = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreTable(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreTable without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.RestoreTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.RestoreTableRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.restoreTable = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreTable( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IRestoreTableMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.ITable, + protos.google.bigtable.admin.v2.IRestoreTableMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreTable with call error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.RestoreTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.RestoreTableRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreTable = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.restoreTable(request), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreTable with LRO error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.RestoreTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.RestoreTableRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreTable = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.restoreTable(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreTableProgress without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestoreTableProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreTableProgress with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkRestoreTableProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('copyBackup', () => { + it('invokes copyBackup without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CopyBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CopyBackupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.copyBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.copyBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.copyBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.copyBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes copyBackup without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CopyBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CopyBackupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.copyBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.copyBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICopyBackupMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.IBackup, + protos.google.bigtable.admin.v2.ICopyBackupMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.copyBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.copyBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes copyBackup with call error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CopyBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CopyBackupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.copyBackup = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.copyBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.copyBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.copyBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes copyBackup with LRO error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CopyBackupRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CopyBackupRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.copyBackup = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.copyBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.copyBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.copyBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCopyBackupProgress without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCopyBackupProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCopyBackupProgress with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkCopyBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createSchemaBundle', () => { + it('invokes createSchemaBundle without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateSchemaBundleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateSchemaBundleRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createSchemaBundle = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createSchemaBundle(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchemaBundle without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateSchemaBundleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateSchemaBundleRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createSchemaBundle = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSchemaBundle( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.ICreateSchemaBundleMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.ICreateSchemaBundleMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchemaBundle with call error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateSchemaBundleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateSchemaBundleRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSchemaBundle = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createSchemaBundle(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchemaBundle with LRO error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.CreateSchemaBundleRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.CreateSchemaBundleRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSchemaBundle = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createSchemaBundle(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSchemaBundleProgress without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSchemaBundleProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSchemaBundleProgress with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateSchemaBundleProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateSchemaBundle', () => { + it('invokes updateSchemaBundle without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateSchemaBundleRequest(), + ); + request.schemaBundle ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateSchemaBundleRequest', + ['schemaBundle', 'name'], + ); + request.schemaBundle.name = defaultValue1; + const expectedHeaderRequestParams = `schema_bundle.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateSchemaBundle = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSchemaBundle(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSchemaBundle without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateSchemaBundleRequest(), + ); + request.schemaBundle ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateSchemaBundleRequest', + ['schemaBundle', 'name'], + ); + request.schemaBundle.name = defaultValue1; + const expectedHeaderRequestParams = `schema_bundle.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateSchemaBundle = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSchemaBundle( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IUpdateSchemaBundleMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.bigtable.admin.v2.ISchemaBundle, + protos.google.bigtable.admin.v2.IUpdateSchemaBundleMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSchemaBundle with call error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateSchemaBundleRequest(), + ); + request.schemaBundle ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateSchemaBundleRequest', + ['schemaBundle', 'name'], + ); + request.schemaBundle.name = defaultValue1; + const expectedHeaderRequestParams = `schema_bundle.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSchemaBundle = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateSchemaBundle(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSchemaBundle with LRO error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.UpdateSchemaBundleRequest(), + ); + request.schemaBundle ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.UpdateSchemaBundleRequest', + ['schemaBundle', 'name'], + ); + request.schemaBundle.name = defaultValue1; + const expectedHeaderRequestParams = `schema_bundle.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSchemaBundle = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateSchemaBundle(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSchemaBundle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSchemaBundle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateSchemaBundleProgress without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateSchemaBundleProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateSchemaBundleProgress with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateSchemaBundleProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listTables', () => { + it('invokes listTables without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListTablesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), + ]; + client.innerApiCalls.listTables = stubSimpleCall(expectedResponse); + const [response] = await client.listTables(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTables as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTables as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTables without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListTablesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), + ]; + client.innerApiCalls.listTables = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTables( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.ITable[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTables as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTables as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTables with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListTablesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTables = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listTables(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTables as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTables as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTablesStream without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListTablesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), + ]; + client.descriptors.page.listTables.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTablesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.Table[] = []; + stream.on('data', (response: protos.google.bigtable.admin.v2.Table) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listTables.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTables, request), + ); + assert( + (client.descriptors.page.listTables.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listTablesStream with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListTablesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTables.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listTablesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.Table[] = []; + stream.on('data', (response: protos.google.bigtable.admin.v2.Table) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTables.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTables, request), + ); + assert( + (client.descriptors.page.listTables.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTables without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListTablesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), + ]; + client.descriptors.page.listTables.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.bigtable.admin.v2.ITable[] = []; + const iterable = client.listTablesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTables.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listTables.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTables with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListTablesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTables.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listTablesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.bigtable.admin.v2.ITable[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTables.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listTables.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listAuthorizedViews', () => { + it('invokes listAuthorizedViews without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAuthorizedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAuthorizedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ), + ]; + client.innerApiCalls.listAuthorizedViews = + stubSimpleCall(expectedResponse); + const [response] = await client.listAuthorizedViews(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAuthorizedViews as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAuthorizedViews as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthorizedViews without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAuthorizedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAuthorizedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ), + ]; + client.innerApiCalls.listAuthorizedViews = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAuthorizedViews( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IAuthorizedView[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAuthorizedViews as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAuthorizedViews as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthorizedViews with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAuthorizedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAuthorizedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAuthorizedViews = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listAuthorizedViews(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAuthorizedViews as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAuthorizedViews as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthorizedViewsStream without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAuthorizedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAuthorizedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ), + ]; + client.descriptors.page.listAuthorizedViews.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAuthorizedViewsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.AuthorizedView[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.AuthorizedView) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listAuthorizedViews.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAuthorizedViews, request), + ); + assert( + (client.descriptors.page.listAuthorizedViews.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listAuthorizedViewsStream with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAuthorizedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAuthorizedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAuthorizedViews.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAuthorizedViewsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.AuthorizedView[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.AuthorizedView) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAuthorizedViews.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAuthorizedViews, request), + ); + assert( + (client.descriptors.page.listAuthorizedViews.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAuthorizedViews without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAuthorizedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAuthorizedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.AuthorizedView(), + ), + ]; + client.descriptors.page.listAuthorizedViews.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.bigtable.admin.v2.IAuthorizedView[] = []; + const iterable = client.listAuthorizedViewsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAuthorizedViews.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listAuthorizedViews.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAuthorizedViews with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListAuthorizedViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListAuthorizedViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAuthorizedViews.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAuthorizedViewsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.bigtable.admin.v2.IAuthorizedView[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAuthorizedViews.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listAuthorizedViews.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listSnapshots', () => { + it('invokes listSnapshots without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSnapshotsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), + ]; + client.innerApiCalls.listSnapshots = stubSimpleCall(expectedResponse); + const [response] = await client.listSnapshots(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshots without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSnapshotsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), + ]; + client.innerApiCalls.listSnapshots = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSnapshots( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.ISnapshot[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshots with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSnapshotsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSnapshots = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listSnapshots(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshotsStream without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSnapshotsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), + ]; + client.descriptors.page.listSnapshots.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.Snapshot[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.Snapshot) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSnapshots, request), + ); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSnapshotsStream with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSnapshotsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSnapshots.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.Snapshot[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.Snapshot) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSnapshots, request), + ); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSnapshots without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSnapshotsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), + ]; + client.descriptors.page.listSnapshots.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.bigtable.admin.v2.ISnapshot[] = []; + const iterable = client.listSnapshotsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSnapshots.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSnapshots with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSnapshotsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSnapshots.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSnapshotsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.bigtable.admin.v2.ISnapshot[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSnapshots.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListBackupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListBackupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListBackupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListBackupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), + ]; + client.innerApiCalls.listBackups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.IBackup[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListBackupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListBackupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackups = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listBackups(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupsStream without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListBackupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListBackupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), + ]; + client.descriptors.page.listBackups.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.Backup[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.Backup) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackups, request), + ); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listBackupsStream with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListBackupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListBackupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.Backup[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.Backup) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackups, request), + ); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listBackups without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListBackupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListBackupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), + generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), + ]; + client.descriptors.page.listBackups.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.bigtable.admin.v2.IBackup[] = []; + const iterable = client.listBackupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listBackups with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListBackupsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListBackupsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listBackupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.bigtable.admin.v2.IBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listSchemaBundles', () => { + it('invokes listSchemaBundles without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSchemaBundlesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSchemaBundlesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ), + ]; + client.innerApiCalls.listSchemaBundles = stubSimpleCall(expectedResponse); + const [response] = await client.listSchemaBundles(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSchemaBundles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSchemaBundles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemaBundles without error using callback', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSchemaBundlesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSchemaBundlesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ), + ]; + client.innerApiCalls.listSchemaBundles = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSchemaBundles( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.admin.v2.ISchemaBundle[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSchemaBundles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSchemaBundles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemaBundles with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSchemaBundlesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSchemaBundlesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSchemaBundles = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listSchemaBundles(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSchemaBundles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSchemaBundles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemaBundlesStream without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSchemaBundlesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSchemaBundlesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ), + ]; + client.descriptors.page.listSchemaBundles.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSchemaBundlesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.SchemaBundle[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.SchemaBundle) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSchemaBundles.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSchemaBundles, request), + ); + assert( + (client.descriptors.page.listSchemaBundles.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSchemaBundlesStream with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSchemaBundlesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSchemaBundlesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchemaBundles.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSchemaBundlesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.bigtable.admin.v2.SchemaBundle[] = []; + stream.on( + 'data', + (response: protos.google.bigtable.admin.v2.SchemaBundle) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSchemaBundles.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSchemaBundles, request), + ); + assert( + (client.descriptors.page.listSchemaBundles.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSchemaBundles without error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSchemaBundlesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSchemaBundlesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ), + generateSampleMessage( + new protos.google.bigtable.admin.v2.SchemaBundle(), + ), + ]; + client.descriptors.page.listSchemaBundles.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.bigtable.admin.v2.ISchemaBundle[] = []; + const iterable = client.listSchemaBundlesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSchemaBundles.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSchemaBundles.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSchemaBundles with error', async () => { + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.admin.v2.ListSchemaBundlesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.admin.v2.ListSchemaBundlesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchemaBundles.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSchemaBundlesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.bigtable.admin.v2.ISchemaBundle[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSchemaBundles.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSchemaBundles.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('Path templates', () => { + describe('appProfile', async () => { + const fakePath = '/rendered/path/appProfile'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + app_profile: 'appProfileValue', + }; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.appProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('appProfilePath', () => { + const result = client.appProfilePath( + 'projectValue', + 'instanceValue', + 'appProfileValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.appProfilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAppProfileName', () => { + const result = client.matchProjectFromAppProfileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.appProfilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromAppProfileName', () => { + const result = client.matchInstanceFromAppProfileName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.appProfilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAppProfileFromAppProfileName', () => { + const result = client.matchAppProfileFromAppProfileName(fakePath); + assert.strictEqual(result, 'appProfileValue'); + assert( + (client.pathTemplates.appProfilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('authorizedView', async () => { + const fakePath = '/rendered/path/authorizedView'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + table: 'tableValue', + authorized_view: 'authorizedViewValue', + }; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authorizedViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.authorizedViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('authorizedViewPath', () => { + const result = client.authorizedViewPath( + 'projectValue', + 'instanceValue', + 'tableValue', + 'authorizedViewValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.authorizedViewPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAuthorizedViewName', () => { + const result = client.matchProjectFromAuthorizedViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.authorizedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromAuthorizedViewName', () => { + const result = client.matchInstanceFromAuthorizedViewName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.authorizedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTableFromAuthorizedViewName', () => { + const result = client.matchTableFromAuthorizedViewName(fakePath); + assert.strictEqual(result, 'tableValue'); + assert( + (client.pathTemplates.authorizedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAuthorizedViewFromAuthorizedViewName', () => { + const result = + client.matchAuthorizedViewFromAuthorizedViewName(fakePath); + assert.strictEqual(result, 'authorizedViewValue'); + assert( + (client.pathTemplates.authorizedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('backup', async () => { + const fakePath = '/rendered/path/backup'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + cluster: 'clusterValue', + backup: 'backupValue', + }; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath( + 'projectValue', + 'instanceValue', + 'clusterValue', + 'backupValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromBackupName', () => { + const result = client.matchInstanceFromBackupName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromBackupName', () => { + const result = client.matchClusterFromBackupName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, 'backupValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('cluster', async () => { + const fakePath = '/rendered/path/cluster'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + cluster: 'clusterValue', + }; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath( + 'projectValue', + 'instanceValue', + 'clusterValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromClusterName', () => { + const result = client.matchInstanceFromClusterName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('hotTablet', async () => { + const fakePath = '/rendered/path/hotTablet'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + cluster: 'clusterValue', + hot_tablet: 'hotTabletValue', + }; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.hotTabletPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hotTabletPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hotTabletPath', () => { + const result = client.hotTabletPath( + 'projectValue', + 'instanceValue', + 'clusterValue', + 'hotTabletValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.hotTabletPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromHotTabletName', () => { + const result = client.matchProjectFromHotTabletName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.hotTabletPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromHotTabletName', () => { + const result = client.matchInstanceFromHotTabletName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.hotTabletPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromHotTabletName', () => { + const result = client.matchClusterFromHotTabletName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.hotTabletPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchHotTabletFromHotTabletName', () => { + const result = client.matchHotTabletFromHotTabletName(fakePath); + assert.strictEqual(result, 'hotTabletValue'); + assert( + (client.pathTemplates.hotTabletPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('instance', async () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + }; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath('projectValue', 'instanceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('logicalView', async () => { + const fakePath = '/rendered/path/logicalView'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + logical_view: 'logicalViewValue', + }; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.logicalViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.logicalViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('logicalViewPath', () => { + const result = client.logicalViewPath( + 'projectValue', + 'instanceValue', + 'logicalViewValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.logicalViewPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromLogicalViewName', () => { + const result = client.matchProjectFromLogicalViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.logicalViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromLogicalViewName', () => { + const result = client.matchInstanceFromLogicalViewName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.logicalViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogicalViewFromLogicalViewName', () => { + const result = client.matchLogicalViewFromLogicalViewName(fakePath); + assert.strictEqual(result, 'logicalViewValue'); + assert( + (client.pathTemplates.logicalViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('materializedView', async () => { + const fakePath = '/rendered/path/materializedView'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + materialized_view: 'materializedViewValue', + }; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.materializedViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.materializedViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('materializedViewPath', () => { + const result = client.materializedViewPath( + 'projectValue', + 'instanceValue', + 'materializedViewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.materializedViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromMaterializedViewName', () => { + const result = client.matchProjectFromMaterializedViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.materializedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromMaterializedViewName', () => { + const result = client.matchInstanceFromMaterializedViewName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.materializedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchMaterializedViewFromMaterializedViewName', () => { + const result = + client.matchMaterializedViewFromMaterializedViewName(fakePath); + assert.strictEqual(result, 'materializedViewValue'); + assert( + (client.pathTemplates.materializedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('schemaBundle', async () => { + const fakePath = '/rendered/path/schemaBundle'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + table: 'tableValue', + schema_bundle: 'schemaBundleValue', + }; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.schemaBundlePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.schemaBundlePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('schemaBundlePath', () => { + const result = client.schemaBundlePath( + 'projectValue', + 'instanceValue', + 'tableValue', + 'schemaBundleValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.schemaBundlePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSchemaBundleName', () => { + const result = client.matchProjectFromSchemaBundleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.schemaBundlePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromSchemaBundleName', () => { + const result = client.matchInstanceFromSchemaBundleName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.schemaBundlePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTableFromSchemaBundleName', () => { + const result = client.matchTableFromSchemaBundleName(fakePath); + assert.strictEqual(result, 'tableValue'); + assert( + (client.pathTemplates.schemaBundlePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSchemaBundleFromSchemaBundleName', () => { + const result = client.matchSchemaBundleFromSchemaBundleName(fakePath); + assert.strictEqual(result, 'schemaBundleValue'); + assert( + (client.pathTemplates.schemaBundlePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('snapshot', async () => { + const fakePath = '/rendered/path/snapshot'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + cluster: 'clusterValue', + snapshot: 'snapshotValue', + }; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.snapshotPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.snapshotPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('snapshotPath', () => { + const result = client.snapshotPath( + 'projectValue', + 'instanceValue', + 'clusterValue', + 'snapshotValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.snapshotPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSnapshotName', () => { + const result = client.matchProjectFromSnapshotName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromSnapshotName', () => { + const result = client.matchInstanceFromSnapshotName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromSnapshotName', () => { + const result = client.matchClusterFromSnapshotName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSnapshotFromSnapshotName', () => { + const result = client.matchSnapshotFromSnapshotName(fakePath); + assert.strictEqual(result, 'snapshotValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('table', async () => { + const fakePath = '/rendered/path/table'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + table: 'tableValue', + }; + const client = new bigtabletableadminModule.admin.TableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.tablePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tablePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tablePath', () => { + const result = client.tablePath( + 'projectValue', + 'instanceValue', + 'tableValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tablePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTableName', () => { + const result = client.matchProjectFromTableName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromTableName', () => { + const result = client.matchInstanceFromTableName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTableFromTableName', () => { + const result = client.matchTableFromTableName(fakePath); + assert.strictEqual(result, 'tableValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/handwritten/bigtable/test/app-profile.ts b/handwritten/bigtable/test/app-profile.ts new file mode 100644 index 00000000000..581c46f9806 --- /dev/null +++ b/handwritten/bigtable/test/app-profile.ts @@ -0,0 +1,561 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as promisify from '@google-cloud/promisify'; +import * as assert from 'assert'; +import {describe, it, before, beforeEach} from 'mocha'; +import * as proxyquire from 'proxyquire'; +import {CallOptions} from 'google-gax'; + +let promisified = false; +const fakePromisify = Object.assign({}, promisify, { + promisifyAll(klass: Function) { + if (klass.name === 'AppProfile') { + promisified = true; + } + }, +}); + +describe('Bigtable/AppProfile', () => { + const APP_PROFILE_ID = 'my-app-profile'; + const PROJECT_ID = 'grape-spaceship-123'; + + const INSTANCE = { + name: `projects/${PROJECT_ID}/instances/i`, + bigtable: {projectId: PROJECT_ID}, + }; + + const APP_PROFILE_NAME = `${INSTANCE.name}/appProfiles/${APP_PROFILE_ID}`; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let AppProfile: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let appProfile: any; + + class FakeCluster { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + instance: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + id: any; + name: string; + bigtable: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + constructor(instance: any, id: any) { + this.instance = instance; + this.id = id; + this.name = 'cluster-name'; + this.bigtable = instance.bigtable; + } + } + + before(() => { + AppProfile = proxyquire('../src/app-profile.js', { + '../src/cluster.js': {Cluster: FakeCluster}, + '@google-cloud/promisify': fakePromisify, + }).AppProfile; + }); + + beforeEach(() => { + appProfile = new AppProfile(INSTANCE, APP_PROFILE_NAME); + }); + + describe('instantiation', () => { + it('should promisify all the things', () => { + assert(promisified); + }); + + it('should localize Bigtable instance', () => { + assert.strictEqual(appProfile.bigtable, INSTANCE.bigtable); + }); + + it('should localize Instance instance', () => { + assert.strictEqual(appProfile.instance, INSTANCE); + }); + + it('should expand name into full resource path', () => { + assert.strictEqual(appProfile.name, APP_PROFILE_NAME); + }); + + it('should leave full app profile name unaltered', () => { + const appProfile = new AppProfile(INSTANCE, APP_PROFILE_NAME); + assert.strictEqual(appProfile.name, APP_PROFILE_NAME); + }); + + it('should localize the name from the ID', () => { + assert.strictEqual(appProfile.id, APP_PROFILE_ID); + }); + + it('should leave full app profile name unaltered and localize the id from the name', () => { + const appProfile = new AppProfile(INSTANCE, APP_PROFILE_NAME); + assert.strictEqual(appProfile.name, APP_PROFILE_NAME); + assert.strictEqual(appProfile.id, APP_PROFILE_ID); + }); + + it('should throw if cluster id in wrong format', () => { + const id = `appProfiles/${APP_PROFILE_ID}`; + assert.throws(() => { + new AppProfile(INSTANCE, id); + }, Error); + }); + }); + + describe('formatAppProfile_', () => { + const errorReg = + /An app profile routing policy can only contain "any" for multi cluster routing, a `Cluster` for single routing, or a set of clusterIds as strings or `Clusters` for multi cluster routing\./; + + it("should accept an 'any' cluster routing policy", () => { + const formattedAppProfile = AppProfile.formatAppProfile_({ + routing: 'any', + }); + assert.deepStrictEqual(formattedAppProfile.multiClusterRoutingUseAny, {}); + }); + + describe('with a single cluster routing policy', () => { + const clusterId = 'my-cluster'; + const cluster = new FakeCluster(INSTANCE, clusterId); + + it('should accept allowTransactionalWrites not being set', () => { + const formattedAppProfile = AppProfile.formatAppProfile_({ + routing: cluster, + }); + assert.deepStrictEqual(formattedAppProfile.singleClusterRouting, { + clusterId, + }); + }); + + it('should accept allowTransactionalWrites', () => { + const formattedAppProfile = AppProfile.formatAppProfile_({ + routing: cluster, + allowTransactionalWrites: true, + }); + assert.deepStrictEqual(formattedAppProfile.singleClusterRouting, { + clusterId, + allowTransactionalWrites: true, + }); + }); + + it('should accept description', () => { + const description = 'my-description'; + const formattedAppProfile = AppProfile.formatAppProfile_({ + description, + }); + assert.strictEqual(formattedAppProfile.description, description); + }); + + it('should throw for an invalid routing policy', () => { + assert.throws( + AppProfile.formatAppProfile_.bind(null, { + routing: 'not-any', + }), + errorReg, + ); + }); + }); + + describe('with a multi cluster routing policy', () => { + it('should use multi cluster routing when providing an array of clusters', () => { + const clusterIds = ['clusterId1', 'clusterId2']; + const clusters = clusterIds.map( + clusterId => new FakeCluster(INSTANCE, clusterId), + ); + const formattedAppProfile = AppProfile.formatAppProfile_({ + routing: new Set(clusters), + }); + assert.deepStrictEqual( + new Set(formattedAppProfile.multiClusterRoutingUseAny.clusterIds), + new Set(clusterIds), + ); + }); + it('should ensure elements in the array are clusters', () => { + const notAllClusters = [ + new FakeCluster(INSTANCE, 'clusterId'), + 'not a cluster', + ]; + assert.throws( + AppProfile.formatAppProfile_.bind(null, { + routing: notAllClusters, + }), + errorReg, + ); + }); + }); + }); + + describe('create', () => { + it('should call createAppProfile from instance', done => { + const options = {}; + + appProfile.instance.createAppProfile = ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + id: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + options_: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback: any, + ) => { + assert.strictEqual(id, appProfile.id); + assert.strictEqual(options_, options); + callback(); + }; + + appProfile.create(options, done); + }); + + it('should not require options', done => { + appProfile.instance.createAppProfile = ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + id: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + options: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback: any, + ) => { + assert.deepStrictEqual(options, {}); + callback(); + }; + + appProfile.create(done); + }); + }); + + describe('delete', () => { + it('should make the correct request', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + appProfile.bigtable.request = (config: any, callback: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'deleteAppProfile'); + + assert.deepStrictEqual(config.reqOpts, { + name: appProfile.name, + }); + + callback(); + }; + + appProfile.delete(done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + appProfile.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + appProfile.delete({gaxOptions}, assert.ifError); + }); + + it('should accept ignoreWarnings', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + appProfile.bigtable.request = (config: any) => { + assert.strictEqual(config.reqOpts.ignoreWarnings, true); + done(); + }; + + appProfile.delete({ignoreWarnings: true}, assert.ifError); + }); + }); + + describe('exists', () => { + it('should not require gaxOptions', done => { + appProfile.getMetadata = (gaxOptions: CallOptions) => { + assert.deepStrictEqual(gaxOptions, {}); + done(); + }; + + appProfile.exists(assert.ifError); + }); + + it('should pass gaxOptions to getMetadata', done => { + const gaxOptions = {}; + + appProfile.getMetadata = (gaxOptions_: CallOptions) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }; + + appProfile.exists(gaxOptions, assert.ifError); + }); + + it('should return false if error code is 5', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const error: any = new Error('Error.'); + error.code = 5; + + appProfile.getMetadata = ( + gaxOptions: CallOptions, + callback: Function, + ) => { + callback(error); + }; + + appProfile.exists((err: Error, exists: boolean) => { + assert.ifError(err); + assert.strictEqual(exists, false); + done(); + }); + }); + + it('should return error if code is not 5', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const error: any = new Error('Error.'); + error.code = 'NOT-5'; + + appProfile.getMetadata = ( + gaxOptions: CallOptions, + callback: Function, + ) => { + callback(error); + }; + + appProfile.exists((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return true if no error', done => { + appProfile.getMetadata = ( + gaxOptions: CallOptions, + callback: Function, + ) => { + callback(null, {}); + }; + + appProfile.exists((err: Error, exists: boolean) => { + assert.ifError(err); + assert.strictEqual(exists, true); + done(); + }); + }); + }); + + describe('get', () => { + it('should call getMetadata', done => { + const gaxOptions = {}; + + appProfile.getMetadata = (gaxOptions_: CallOptions) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }; + + appProfile.get(gaxOptions, assert.ifError); + }); + + it('should not require gaxOptions', done => { + appProfile.getMetadata = (gaxOptions: CallOptions) => { + assert.deepStrictEqual(gaxOptions, {}); + done(); + }; + + appProfile.get(assert.ifError); + }); + + it('should return an error from getMetadata', done => { + const error = new Error('Error.'); + + appProfile.getMetadata = ( + gaxOptions: CallOptions, + callback: Function, + ) => { + callback(error); + }; + + appProfile.get((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return self and API response', done => { + const metadata = {}; + + appProfile.getMetadata = ( + gaxOptions: CallOptions, + callback: Function, + ) => { + callback(null, metadata); + }; + + appProfile.get((err: Error, appProfile_: {}, metadata_: {}) => { + assert.ifError(err); + assert.strictEqual(appProfile_, appProfile); + assert.strictEqual(metadata_, metadata); + done(); + }); + }); + }); + + describe('getMetadata', () => { + it('should make correct request', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + appProfile.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'getAppProfile'); + + assert.deepStrictEqual(config.reqOpts, { + name: appProfile.name, + }); + + assert.deepStrictEqual(config.gaxOpts, {}); + + done(); + }; + + appProfile.getMetadata(assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + appProfile.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + appProfile.getMetadata(gaxOptions, assert.ifError); + }); + + it('should update metadata', done => { + const metadata = {}; + + appProfile.bigtable.request = (config: {}, callback: Function) => { + callback(null, metadata); + }; + + appProfile.getMetadata(() => { + assert.strictEqual(appProfile.metadata, metadata); + done(); + }); + }); + + it('should execute callback with original arguments', done => { + const args = [{}, {}, {}]; + + appProfile.bigtable.request = (config: {}, callback: Function) => { + callback(...args); + }; + + appProfile.getMetadata((...argies: Array<{}>) => { + assert.deepStrictEqual([].slice.call(argies), args); + done(); + }); + }); + }); + + describe('setMetadata', () => { + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + appProfile.bigtable.request = (config: any, callback: Function) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'updateAppProfile'); + assert.strictEqual(config.reqOpts.appProfile.name, APP_PROFILE_NAME); + callback(); + }; + + appProfile.setMetadata({}, done); + }); + + it('should respect the description option', done => { + const options = {description: 'my-description'}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + appProfile.bigtable.request = (config: any) => { + assert( + config.reqOpts.updateMask.paths.indexOf('description') !== -1, + "updateMask does not should include 'description'", + ); + assert.strictEqual( + config.reqOpts.appProfile.description, + options.description, + ); + done(); + }; + + appProfile.setMetadata(options, assert.ifError); + }); + + it('should respect the ignoreWarnings option', done => { + const options = {ignoreWarnings: true}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + appProfile.bigtable.request = (config: any) => { + assert.strictEqual(config.reqOpts.ignoreWarnings, true); + done(); + }; + + appProfile.setMetadata(options, assert.ifError); + }); + + describe('should respect the routing option when', () => { + const clusterId = 'my-cluster'; + const cluster = new FakeCluster(INSTANCE, clusterId); + + it("has an 'any' value", done => { + const options = {routing: 'any'}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + appProfile.bigtable.request = (config: any) => { + assert( + config.reqOpts.updateMask.paths.indexOf( + 'multi_cluster_routing_use_any', + ) !== -1, + "updateMask does not should include 'multi_cluster_routing_use_any'", + ); + assert.deepStrictEqual( + config.reqOpts.appProfile.multiClusterRoutingUseAny, + {}, + ); + done(); + }; + + appProfile.setMetadata(options, assert.ifError); + }); + + it('has a cluster value', done => { + const options = {routing: cluster}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + appProfile.bigtable.request = (config: any) => { + assert( + config.reqOpts.updateMask.paths.indexOf( + 'single_cluster_routing', + ) !== -1, + "updateMask does not should include 'single_cluster_routing'", + ); + assert.deepStrictEqual( + config.reqOpts.appProfile.singleClusterRouting, + {clusterId}, + ); + done(); + }; + + appProfile.setMetadata(options, assert.ifError); + }); + }); + + it('should execute callback with all arguments', done => { + const args = [{}, {}, {}]; + appProfile.bigtable.request = (config: {}, callback: Function) => { + callback(...args); + }; + appProfile.setMetadata({}, (...argies: Array<{}>) => { + assert.deepStrictEqual([].slice.call(argies), args); + done(); + }); + }); + }); +}); diff --git a/handwritten/bigtable/test/authorized-views.ts b/handwritten/bigtable/test/authorized-views.ts new file mode 100644 index 00000000000..a36eefd4336 --- /dev/null +++ b/handwritten/bigtable/test/authorized-views.ts @@ -0,0 +1,517 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {beforeEach, describe} from 'mocha'; +import {AbortableDuplex, Bigtable, RawFilter, RequestCallback} from '../src'; +import {PassThrough} from 'stream'; +import * as assert from 'assert'; +import {Mutation} from '../src/mutation'; +import * as mocha from 'mocha'; +import {Row} from '../src'; + +describe('Bigtable/AuthorizedViews', () => { + describe('Authorized View methods should have requests that match Table and Row requests', () => { + const bigtable = new Bigtable({}); + const fakeTableName = 'fake-table'; + const fakeInstanceName = 'fake-instance'; + const fakeViewName = 'fake-view'; + const instance = bigtable.instance(fakeInstanceName); + const table = instance.table(fakeTableName); + const view = instance.view(fakeTableName, fakeViewName); + + /** This function mocks out the request function and compares the request + * passed into it to ensure it is correct. + * + * @param done The function to call when ending the mocha test + * @param compareFn The function that maps the requestCount to the + * request that we would expect to be passed into `request`. + */ + function mockCallbackRequest( + done: mocha.Done, + compareFn: (requestCount: number) => unknown, + resp?: {}, + ) { + let requestCount = 0; + table.bigtable.request = ( + config?: any, + callback?: RequestCallback, + ) => { + try { + requestCount++; + delete config['retryOpts']; + if ( + config && + config.gaxOpts && + config.gaxOpts.otherArgs && + config.gaxOpts.otherArgs.options + ) { + delete config.gaxOpts.otherArgs['options']; + } + assert.deepStrictEqual(config, compareFn(requestCount)); + } catch (err: unknown) { + done(err); + } + if (callback) { + callback(null, resp); + } + const stream = new PassThrough({ + objectMode: true, + }); + setImmediate(() => { + stream.end(); + }); + return stream as {} as AbortableDuplex; + }; + } + + /** + * This function gets the basic structure of the requests we would + * expect when first making a request for a table and then for an + * authorized view. + * + * @param requestCount The number of calls that have been made to request() + * + * @return The expected table or authorized view in the request that will + * reach the request options. + */ + function getBaseRequestOptions(requestCount: number) { + const requestForTable = { + tableName: `projects/{{projectId}}/instances/${fakeInstanceName}/tables/${fakeTableName}`, + }; + const requestForAuthorizedView = { + authorizedViewName: `projects/{{projectId}}/instances/${fakeInstanceName}/tables/${fakeTableName}/authorizedViews/${fakeViewName}`, + }; + return requestCount === 1 ? requestForTable : requestForAuthorizedView; + } + + describe('Table', () => { + describe('should make ReadRows grpc requests', () => { + /** + * This function mocks out the request function to expect a readRows + * request when the tests are run. + * + * @param done The function to call when ending the mocha test + */ + function setupReadRows(done: mocha.Done) { + mockCallbackRequest(done, requestCount => { + return { + client: 'BigtableClient', + method: 'readRows', + gaxOpts: { + maxRetries: 4, + otherArgs: { + headers: { + 'bigtable-attempt': 0, + }, + }, + }, + reqOpts: Object.assign( + { + appProfileId: undefined, + rows: { + rowKeys: [], + rowRanges: [ + { + startKeyClosed: Buffer.from('7'), + endKeyClosed: Buffer.from('9'), + }, + ], + }, + filter: { + columnQualifierRegexFilter: Buffer.from('abc'), + }, + rowsLimit: 5, + }, + getBaseRequestOptions(requestCount), + ), + }; + }); + } + + it('requests for createReadStream should match', done => { + setupReadRows(done); + (async () => { + const opts = { + decode: true, + end: '9', + filter: [{column: 'abc'}], + gaxOptions: { + maxRetries: 4, + }, + limit: 5, + start: '7', + }; + await table.createReadStream(opts); + await view.createReadStream(opts); + done(); + })().catch(err => { + throw err; + }); + }); + it('requests for getRows should match', done => { + setupReadRows(done); + (async () => { + const opts = { + decode: true, + end: '9', + filter: [{column: 'abc'}], + gaxOptions: { + maxRetries: 4, + }, + limit: 5, + start: '7', + }; + await table.getRows(opts); + await view.getRows(opts); + done(); + })().catch(err => { + throw err; + }); + }); + }); + describe('should make MutateRows grpc requests', () => { + /** + * This function mocks out the request function to expect a mutateRows + * request when the tests are run. + * + * @param done The function to call when ending the mocha test + */ + function setupMutateRows(done: mocha.Done) { + mockCallbackRequest(done, requestCount => { + return { + client: 'BigtableClient', + method: 'mutateRows', + gaxOpts: { + maxRetries: 0, + otherArgs: { + headers: { + ['bigtable-attempt']: 0, + }, + }, + }, + reqOpts: Object.assign(getBaseRequestOptions(requestCount), { + appProfileId: undefined, + entries: [ + { + rowKey: Buffer.from('some-id'), + mutations: [ + { + setCell: { + familyName: 'follows', + columnQualifier: + Mutation.convertToBytes('tjefferson'), + timestampMicros: 2, + value: Mutation.convertToBytes(1), + }, + }, + ], + }, + ], + }), + }; + }); + } + it('requests for mutate should match', done => { + (async () => { + setupMutateRows(done); + const mutation = { + key: 'some-id', + data: { + follows: { + tjefferson: { + value: 1, + timestamp: 2, + }, + }, + }, + method: Mutation.methods.INSERT, + }; + // Currently the client retries on an end event if all the data + // hasn't been sent back so maxRetries needs to be 0. + const gaxOptions = {maxRetries: 0}; + table.maxRetries = 0; + await table.mutate(mutation, {gaxOptions}); + view.maxRetries = 0; + await view.mutate(mutation, {gaxOptions}); + done(); + })().catch(err => { + throw err; + }); + }); + it('requests for insert should match', done => { + (async () => { + setupMutateRows(done); + const mutation = { + key: 'some-id', + data: { + follows: { + tjefferson: { + value: 1, + timestamp: 2, + }, + }, + }, + }; + // Currently the client retries on an end event if all the data + // hasn't been sent back so maxRetries needs to be 0. + const gaxOptions = {maxRetries: 0}; + table.maxRetries = 0; + await table.insert(mutation, gaxOptions); + view.maxRetries = 0; + await view.insert(mutation, gaxOptions); + done(); + })().catch(err => { + throw err; + }); + }); + }); + describe('should make SampleRowKeys grpc requests', () => { + /** + * This function mocks out the request function to expect a sampleRowKeys + * request when the tests are run. + * + * @param done The function to call when ending the mocha test + */ + function setupSampleRowKeys(done: mocha.Done) { + mockCallbackRequest(done, requestCount => { + return { + client: 'BigtableClient', + method: 'sampleRowKeys', + gaxOpts: { + maxRetries: 4, + }, + reqOpts: Object.assign(getBaseRequestOptions(requestCount), { + appProfileId: undefined, + }), + }; + }); + } + it('requests for sampleRowKeys should match', done => { + setupSampleRowKeys(done); + (async () => { + const opts = { + maxRetries: 4, + }; + await table.sampleRowKeys(opts); + await view.sampleRowKeys(opts); + done(); + })().catch(err => { + throw err; + }); + }); + it('requests for sampleRowKeysStream should match', done => { + setupSampleRowKeys(done); + (async () => { + const gaxOptions = {maxRetries: 4}; + await table.sampleRowKeysStream(gaxOptions); + await view.sampleRowKeysStream(gaxOptions); + done(); + })().catch(err => { + throw err; + }); + }); + }); + }); + describe('Row', () => { + const rowId = 'row-id'; + let row: Row; + + beforeEach(() => { + row = table.row(rowId); + }); + + describe('should make readModifyWriteRow grpc requests', () => { + /** + * This function mocks out the request function to expect a readRows + * request when the tests are run. + * + * @param done The function to call when ending the mocha test + */ + function setupReadModifyWriteRow(done: mocha.Done) { + mockCallbackRequest( + done, + requestCount => { + return { + client: 'BigtableClient', + method: 'readModifyWriteRow', + gaxOpts: { + maxRetries: 4, + otherArgs: {}, + }, + reqOpts: Object.assign( + { + appProfileId: undefined, + rowKey: Buffer.from(rowId), + rules: [ + { + familyName: 'columnFamilyName', + columnQualifier: Buffer.from('columnName'), + incrementAmount: 7, + }, + ], + }, + getBaseRequestOptions(requestCount), + ), + }; + }, + { + row: { + families: [ + { + name: 'columnFamilyName', + columns: [ + { + qualifier: Buffer.from('columnName'), + cells: [ + { + labels: [], + timestampMicros: '4', + value: Mutation.convertToBytes(7), + }, + ], + }, + ], + }, + ], + }, + }, + ); + } + + it('requests for createRules should match', done => { + setupReadModifyWriteRow(done); + (async () => { + const rule = { + column: 'columnFamilyName:columnName', + increment: 7, + }; + const gaxOpts = {maxRetries: 4}; + await row.createRules(rule, gaxOpts); + await view.createRules({rules: rule, rowId: rowId}, gaxOpts); + done(); + })().catch(err => { + throw err; + }); + }); + it('requests for increment should match', done => { + setupReadModifyWriteRow(done); + (async () => { + // Change the response so that format families can run. + const column = 'columnFamilyName:columnName'; + const gaxOpts = {maxRetries: 4}; + await row.increment(column, 7, gaxOpts); + await view.increment({column, rowId}, 7, gaxOpts); + done(); + })().catch(err => { + throw err; + }); + }); + }); + describe('should make checkAndMutateRequest grpc requests', () => { + /** + * This function mocks out the request function to expect a readRows + * request when the tests are run. + * + * @param done The function to call when ending the mocha test + */ + function setupCheckAndMutateRow(done: mocha.Done) { + mockCallbackRequest( + done, + requestCount => { + return { + client: 'BigtableClient', + method: 'checkAndMutateRow', + gaxOpts: { + maxRetries: 4, + otherArgs: {}, + }, + reqOpts: Object.assign( + { + appProfileId: undefined, + rowKey: Buffer.from(rowId), + predicateFilter: { + familyNameRegexFilter: 'columnFamilyName', + }, + trueMutations: [ + { + deleteFromColumn: { + familyName: 'columnFamilyName', + columnQualifier: Buffer.from('columnName'), + timeRange: undefined, + }, + }, + ], + falseMutations: [], + }, + getBaseRequestOptions(requestCount), + ), + }; + }, + { + row: { + families: [ + { + name: 'columnFamilyName', + columns: [ + { + qualifier: Buffer.from('columnName'), + cells: [ + { + labels: [], + timestampMicros: '4', + value: Mutation.convertToBytes(7), + }, + ], + }, + ], + }, + ], + }, + }, + ); + } + + it('requests for filter should match', done => { + setupCheckAndMutateRow(done); + (async () => { + const filter: RawFilter = { + family: 'columnFamilyName', + value: 'columnName', + }; + const mutations = [ + { + method: 'delete', + data: ['columnFamilyName:columnName'], + }, + ]; + await row.filter(filter, { + onMatch: mutations, + gaxOptions: {maxRetries: 4}, + }); + await view.filter( + {filter, rowId}, + { + onMatch: mutations, + gaxOptions: {maxRetries: 4}, + }, + ); + done(); + })().catch(err => { + throw err; + }); + }); + }); + }); + }); +}); diff --git a/handwritten/bigtable/test/backup.ts b/handwritten/bigtable/test/backup.ts new file mode 100644 index 00000000000..915bcde6bad --- /dev/null +++ b/handwritten/bigtable/test/backup.ts @@ -0,0 +1,810 @@ +// 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 {PreciseDate} from '@google-cloud/precise-date'; +import * as promisify from '@google-cloud/promisify'; +import * as assert from 'assert'; +import {before, beforeEach, describe, it, afterEach} from 'mocha'; +import * as proxyquire from 'proxyquire'; +import * as pumpify from 'pumpify'; +import {ServiceError} from 'google-gax'; + +import * as clusterTypes from '../src/cluster'; +import * as backupTypes from '../src/backup'; +import * as instanceTypes from '../src/instance'; +import * as sinon from 'sinon'; + +import {Bigtable, RequestOptions} from '../src'; +import {Table} from '../src/table'; +import {generateId} from '../system-test/common'; +import {Backup} from '../src/backup'; + +let promisified = false; +const fakePromisify = Object.assign({}, promisify, { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + promisifyAll(klass: Function, options: any) { + if (klass.name === 'Backup') { + promisified = true; + assert.deepStrictEqual(options.exclude, [ + 'endDate', + 'expireDate', + 'startDate', + ]); + } + }, +}); + +class FakeTable extends Table { + calledWith_: Array<{}>; + constructor(...args: [instanceTypes.Instance, string]) { + super(args[0], args[1]); + this.calledWith_ = args; + } +} + +class FakeInstance extends instanceTypes.Instance { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + calledWith_: Array<{}>; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + constructor(...args: [Bigtable, string]) { + super(...args); + this.calledWith_ = args; + } +} + +describe('Bigtable/Backup', () => { + const BACKUP_ID = 'my-backup'; + let CLUSTER: clusterTypes.Cluster; + let BACKUP_NAME: string; + + let Backup: typeof backupTypes.Backup; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let backup: any; + + before(() => { + Backup = proxyquire('../src/backup.js', { + '@google-cloud/promisify': fakePromisify, + './table.js': {Table: FakeTable}, + './instance.js': {Instance: FakeInstance}, + pumpify, + }).Backup; + }); + + beforeEach(() => { + CLUSTER = { + bigtable: {} as Bigtable, + name: 'a/b/c/d', + instance: { + name: 'instance-name', + }, + } as clusterTypes.Cluster; + BACKUP_NAME = CLUSTER.name + '/backups/' + BACKUP_ID; + backup = new Backup(CLUSTER, BACKUP_ID); + }); + + describe('instantiation', () => { + it('should promisify all the things', () => { + assert(promisified); + }); + + it('should localize Bigtable instance', () => { + assert.strictEqual(backup.bigtable, CLUSTER.bigtable); + }); + + it('should localize the Cluster instance', () => { + assert.strictEqual(backup.cluster, CLUSTER); + }); + + it('should localize name and id when provided with name', () => { + const backup = new Backup(CLUSTER, BACKUP_NAME); + assert.strictEqual(backup.name, BACKUP_NAME); + assert.strictEqual(backup.id, BACKUP_ID); + }); + + it('should throw if name is in wrong format', () => { + const badName = '/other/cluster/backup/id'; + assert.throws(() => { + new Backup(CLUSTER, badName); + }, /Backup id '\/other\/cluster\/backup\/id' is not formatted correctly.\nPlease use the format 'my-backup' or 'a\/b\/c\/d\/backups\/my-backup'\./); + }); + + it('should localize name and id when provided with id', () => { + const backup = new Backup(CLUSTER, BACKUP_ID); + assert.strictEqual(backup.name, BACKUP_NAME); + assert.strictEqual(backup.id, BACKUP_ID); + }); + }); + + describe('endDate accessor', () => { + it('should throw if metadata is not set', () => { + assert.throws(() => { + backup.metadata = undefined; + backup.endDate; + }, /An endTime is required to convert to Date./); + }); + + it('should throw if endTime is not set on metadata', () => { + assert.throws(() => { + backup.metadata = {}; + backup.endDate; + }, /An endTime is required to convert to Date./); + }); + + it('should return PreciseDate', () => { + const seconds = 30; + const nanos = 1000; + const expectedEndDate = new PreciseDate({seconds, nanos}); + backup.metadata = { + endTime: {seconds, nanos}, + }; + const convertedEndDate = backup.endDate; + assert.deepStrictEqual(convertedEndDate, expectedEndDate); + }); + }); + + describe('expireDate accessor', () => { + it('should throw if metadata is not set', () => { + assert.throws(() => { + backup.metadata = undefined; + backup.expireDate; + }, /An expireTime is required to convert to Date./); + }); + + it('should throw if expireTime is not set on metadata', () => { + assert.throws(() => { + backup.metadata = {}; + backup.expireDate; + }, /An expireTime is required to convert to Date./); + }); + + it('should return PreciseDate', () => { + const seconds = 30; + const nanos = 1000; + const expectedExpireDate = new PreciseDate({seconds, nanos}); + backup.metadata = { + expireTime: {seconds, nanos}, + }; + const convertedExpireDate = backup.expireDate; + assert.deepStrictEqual(convertedExpireDate, expectedExpireDate); + }); + }); + + describe('startDate accessor', () => { + it('should throw if metadata is not set', () => { + assert.throws(() => { + backup.metadata = undefined; + backup.startDate; + }, /A startTime is required to convert to Date./); + }); + + it('should throw if startTime is not set on metadata', () => { + assert.throws(() => { + backup.metadata = {}; + backup.startDate; + }, /A startTime is required to convert to Date./); + }); + + it('should return PreciseDate', () => { + const seconds = 30; + const nanos = 1000; + const expectedStartDate = new PreciseDate({seconds, nanos}); + backup.metadata = { + startTime: {seconds, nanos}, + }; + const convertedStartDate = backup.startDate; + assert.deepStrictEqual(convertedStartDate, expectedStartDate); + }); + }); + + describe('create', () => { + it('should call createBackup from cluster', done => { + const config = {}; + + backup.cluster.createBackup = ( + id: string, + _config: {}, + callback: Function, + ) => { + assert.strictEqual(id, backup.id); + assert.strictEqual(_config, config); + callback(); // done() + }; + + backup.create(config, done); + }); + }); + + describe('copy', () => { + beforeEach(() => { + backup.bigtable.request = ( + config: RequestOptions, + callback: (err: ServiceError | null, res: RequestOptions) => void, + ) => { + callback(null, config); + }; + }); + + it('should correctly copy backup from the cluster to a custom project', done => { + const destinationProjectId = generateId('project'); + const bigtable = new Bigtable({projectId: destinationProjectId}); + const backupId = generateId('backup'); + const newBackupId = generateId('backup'); + const backup = new Backup(CLUSTER, backupId); + const destinationInstanceId = generateId('instance'); + const destinationClusterId = generateId('cluster'); + const instance = new FakeInstance(bigtable, destinationInstanceId); + // In callback, config is object received in request function so must be + // of type any so that this test can compile and so that asserts can test + // its properties. + backup.copy( + { + cluster: new clusterTypes.Cluster(instance, destinationClusterId), + id: newBackupId, + expireTime: new PreciseDate(177), + gaxOptions: { + timeout: 139, + }, + }, + ( + err?: ServiceError | Error | null, + backup?: Backup | null, + config?: any, + ) => { + assert.strictEqual( + backup?.name, + `projects/${destinationProjectId}/instances/${destinationInstanceId}/clusters/${destinationClusterId}/backups/${newBackupId}`, + ); + assert.strictEqual(config?.client, 'BigtableTableAdminClient'); + assert.strictEqual(config?.method, 'copyBackup'); + assert.deepStrictEqual(config?.reqOpts, { + parent: `projects/${destinationProjectId}/instances/${destinationInstanceId}/clusters/${destinationClusterId}`, + backupId: newBackupId, + sourceBackup: `a/b/c/d/backups/${backupId}`, + expireTime: { + seconds: 0, + nanos: 177000000, + }, + }); + assert.deepStrictEqual(config?.gaxOpts, { + timeout: 139, + }); + done(); + }, + ); + }); + }); + + describe('delete', () => { + it('should make the correct request', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + backup.bigtable.request = (config: any, callback: Function) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'deleteBackup'); + assert.deepStrictEqual(config.reqOpts, { + name: backup.name, + }); + assert.deepStrictEqual(config.gaxOpts, {}); + callback(); // done() + }; + + backup.delete(done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + backup.bigtable.request = (config: {gaxOpts: {}}) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + backup.delete(gaxOptions, assert.ifError); + }); + }); + + describe('exists', () => { + it('should not require gaxOptions', done => { + backup.getMetadata = (options: {}) => { + assert.deepStrictEqual(options, {}); + done(); + }; + backup.exists(assert.ifError); + }); + + it('should pass gaxOptions to getMetadata', done => { + const gaxOptions = {}; + backup.getMetadata = (options: {}) => { + assert.strictEqual(options, gaxOptions); + done(); + }; + backup.exists(gaxOptions, assert.ifError); + }); + + it('should return false if error code is 5', done => { + const error = new Error('Error.') as ServiceError; + error.code = 5; + backup.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(error); + }; + backup.exists((err: Error | null, exists: boolean) => { + assert.ifError(err); + assert.strictEqual(exists, false); + done(); + }); + }); + + it('should return error if code is not 5', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const error: any = new Error('Error.'); + error.code = 'NOT-5'; + backup.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(error); + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + backup.exists((err: any) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return true if no error', done => { + backup.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(null, {}); + }; + backup.exists((err: Error | null, exists: boolean) => { + assert.ifError(err); + assert.strictEqual(exists, true); + done(); + }); + }); + }); + + describe('get', () => { + it('should call getMetadata', done => { + const gaxOptions = {}; + backup.getMetadata = (options: {}) => { + assert.strictEqual(options, gaxOptions); + done(); + }; + backup.get(gaxOptions, assert.ifError); + }); + + it('should not require an options object', done => { + backup.getMetadata = (options: {}) => { + assert.deepStrictEqual(options, {}); + done(); + }; + backup.get(assert.ifError); + }); + + it('should return an error from getMetadata', done => { + const error = new Error('Error.'); + backup.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(error); + }; + backup.get((err: Error | null) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return self and API response', done => { + const apiResponse = {}; + backup.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(null, apiResponse); + }; + backup.get((err: Error | null, _backup: {}, _apiResponse: {}) => { + assert.ifError(err); + assert.strictEqual(_backup, backup); + assert.strictEqual(_apiResponse, apiResponse); + done(); + }); + }); + }); + + describe('getIamPolicy', () => { + afterEach(() => { + sinon.restore(); + }); + + it('should correctly call Table#getIamPolicy()', done => { + sinon.stub(Table.prototype, 'getIamPolicy').callsFake((opt, callback) => { + assert.deepStrictEqual(opt, {}); + callback(); // done() + }); + backup.getIamPolicy(done); + }); + + it('should accept options', done => { + const options = {gaxOptions: {}, requestedPolicyVersion: 1}; + + sinon.stub(Table.prototype, 'getIamPolicy').callsFake((opt, callback) => { + assert.strictEqual(opt, options); + callback(); // done() + }); + backup.getIamPolicy(options, done); + }); + }); + + describe('getMetadata', () => { + it('should make the correct request', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + backup.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'getBackup'); + assert.deepStrictEqual(config.reqOpts, { + name: backup.name, + }); + assert.deepStrictEqual(config.gaxOpts, {}); + done(); + }; + + backup.getMetadata(assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + backup.bigtable.request = (config: {gaxOpts: {}}) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + backup.getMetadata(gaxOptions, assert.ifError); + }); + + it('should update the metadata', done => { + const response = {}; + backup.bigtable.request = (config: {}, callback: Function) => { + callback(null, response); + }; + backup.getMetadata((err: Error | null, metadata: {}) => { + assert.ifError(err); + assert.strictEqual(metadata, response); + assert.strictEqual(backup.metadata, response); + done(); + }); + }); + }); + + describe('restore', () => { + it('should delegate to Backup#restoreTo()', done => { + const tableId = 'table-id'; + const callback = assert.ifError; + + backup.restoreTo = ( + config: backupTypes.RestoreTableConfig, + cb: backupTypes.RestoreTableCallback, + ) => { + assert.strictEqual(config.tableId, tableId); + assert.strictEqual(config.instance, backup.cluster.instance); + assert.strictEqual(config.gaxOptions, undefined); + assert.strictEqual(cb, callback); + done(); + }; + + backup.restore(tableId, callback); + }); + + it('should accept gaxOptions', done => { + const tableId = 'table-id'; + const gaxOptions = {}; + + backup.restoreTo = (config: backupTypes.RestoreTableConfig) => { + assert.strictEqual(config.tableId, tableId); + assert.strictEqual(config.instance, backup.cluster.instance); + assert.strictEqual(config.gaxOptions, gaxOptions); + done(); + }; + + backup.restore(tableId, gaxOptions, assert.ifError); + }); + }); + + describe('restoreTo', () => { + it('should send the correct request', done => { + const tableId = 'table-id'; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + backup.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'restoreTable'); + assert.deepStrictEqual(config.reqOpts, { + parent: backup.cluster.instance.name, + tableId, + backup: backup.name, + }); + assert.strictEqual(config.gaxOpts, undefined); + done(); + }; + + (backup as backupTypes.Backup).restoreTo({tableId}, assert.ifError); + }); + + it('should accept instance as instanceId', done => { + const tableId = 'table-id'; + const instance = 'diff-instance'; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + backup.bigtable.request = (config: any) => { + assert.deepStrictEqual( + config.reqOpts.parent.match(/instances\/([^/]+)/)![1], + instance, + ); + done(); + }; + backup.bigtable.instance = (id: string) => { + return new instanceTypes.Instance(backup.bigtable, id); + }; + + (backup as backupTypes.Backup).restoreTo( + {tableId, instance}, + assert.ifError, + ); + }); + + it('should accept instance as instanceName', done => { + const tableId = 'table-id'; + const instance = `${backup.bigtable.projectName}/instances/diff-instance`; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + backup.bigtable.request = (config: any) => { + assert.deepStrictEqual(config.reqOpts.parent, instance); + done(); + }; + backup.bigtable.instance = (name: string) => { + return new instanceTypes.Instance(backup.bigtable, name); + }; + + (backup as backupTypes.Backup).restoreTo( + {tableId, instance}, + assert.ifError, + ); + }); + + it('should accept instance as Instance object', done => { + const tableId = 'table-id'; + const instanceName = `${backup.bigtable.projectName}/instances/diff-instance`; + const instance = new FakeInstance(backup.bigtable, instanceName); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + backup.bigtable.request = (config: any) => { + assert.deepStrictEqual(config.reqOpts.parent, instance.name); + done(); + }; + + backup.restoreTo({tableId, instance}, assert.ifError); + }); + + it('should accept gaxOptions', done => { + const tableId = 'table-id'; + const gaxOptions = {}; + + backup.bigtable.request = (config: {gaxOpts: {}}) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + (backup as backupTypes.Backup).restoreTo( + {tableId, gaxOptions}, + assert.ifError, + ); + }); + + it('should execute callback with error', done => { + const tableId = 'table-id'; + const error = new Error('Error.'); + const args = [{a: 'b'}, {c: 'd'}, {e: 'f'}]; + + backup.bigtable.request = (config: {}, callback: Function) => { + callback(error, ...args); + }; + + backup.restoreTo( + {tableId}, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (err: Error | null, table: {}, ..._args: any[]) => { + assert.strictEqual(err, error); + assert.strictEqual(table, undefined); + assert.deepStrictEqual(_args, args); + done(); + }, + ); + }); + + it('should execute callback with created Table', done => { + const tableId = 'table-id'; + const args = [{a: 'b'}, {c: 'd'}, {e: 'f'}]; + const tableInstance = {}; + + backup.cluster.instance = { + table: (_tableId: string) => { + assert.strictEqual(_tableId, tableId); + return tableInstance; + }, + }; + + backup.bigtable.request = (config: {}, callback: Function) => { + callback(null, ...args); + }; + + backup.restoreTo( + {tableId}, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (err: Error | null, table: {}, ..._args: any[]) => { + assert.ifError(err); + assert.strictEqual(table, tableInstance); + assert.deepStrictEqual(_args, args); + done(); + }, + ); + }); + }); + + describe('setMetadata', () => { + it('should send the correct request', done => { + const metadata = { + testProperty: 'value', + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + backup.bigtable.request = (config: any, callback: Function) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'updateBackup'); + assert.deepStrictEqual(config.reqOpts, { + backup: { + name: backup.name, + ...metadata, + }, + updateMask: { + paths: ['test_property'], + }, + }); + assert.deepStrictEqual(config.gaxOpts, {}); + callback(); // done() + }; + + backup.setMetadata(metadata, done); + }); + + it('should accept gaxOptions', done => { + const metadata = {}; + const gaxOptions = {}; + + backup.bigtable.request = (config: {gaxOpts: {}}) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + backup.setMetadata(metadata, gaxOptions, assert.ifError); + }); + + it('should convert expireTime Date to struct', done => { + const metadata = { + expireTime: new Date(), + }; + const expectedExpireTime = new PreciseDate( + metadata.expireTime, + ).toStruct(); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + backup.bigtable.request = (config: any) => { + assert.deepStrictEqual( + config.reqOpts.backup.expireTime, + expectedExpireTime, + ); + done(); + }; + + backup.setMetadata(metadata, assert.ifError); + }); + + it('should execute the callback and update the metadata', done => { + const metadata = {}; + const response = {}; + + backup.bigtable.request = (config: {}, callback: Function) => { + callback(null, response); + }; + + backup.setMetadata( + metadata, + (err: Error | null, metadata: {}, apiResponse: {}) => { + assert.ifError(err); + assert.strictEqual(metadata, response); + assert.strictEqual(backup.metadata, response); + assert.strictEqual(apiResponse, response); + done(); + }, + ); + }); + }); + + describe('setIamPolicy', () => { + afterEach(() => { + sinon.restore(); + }); + const policy = {}; + it('should correctly call Table#setIamPolicy()', done => { + sinon + .stub(Table.prototype, 'setIamPolicy') + .callsFake((_policy, gaxOpts, callback) => { + assert.strictEqual(_policy, policy); + assert.deepStrictEqual(gaxOpts, {}); + callback(); // done() + }); + backup.setIamPolicy(policy, done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + sinon + .stub(Table.prototype, 'setIamPolicy') + .callsFake((_policy, gaxOpts, callback) => { + assert.strictEqual(_policy, policy); + assert.strictEqual(gaxOpts, gaxOptions); + callback(); // done() + }); + backup.setIamPolicy(policy, gaxOptions, done); + }); + }); + + describe('testIamPermissions', () => { + afterEach(() => { + sinon.restore(); + }); + + const permissions = 'bigtable.backups.get'; + it('should properly call Table#testIamPermissions', done => { + sinon + .stub(Table.prototype, 'testIamPermissions') + .callsFake((_permissions, gaxOpts, callback) => { + assert.strictEqual(_permissions, permissions); + assert.deepStrictEqual(gaxOpts, {}); + callback(); // done() + }); + backup.testIamPermissions(permissions, done); + }); + + it('should accept permissions as array', done => { + const permissions = [ + 'bigtable.backups.get', + 'bigtable.backups.delete', + 'bigtable.backups.update', + 'bigtable.backups.restore', + ]; + sinon + .stub(Table.prototype, 'testIamPermissions') + .callsFake((_permissions, gaxOpts, callback) => { + assert.strictEqual(_permissions, permissions); + assert.deepStrictEqual(gaxOpts, {}); + callback(); // done() + }); + backup.testIamPermissions(permissions, done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + sinon + .stub(Table.prototype, 'testIamPermissions') + .callsFake((_permissions, gaxOpts, callback) => { + assert.strictEqual(_permissions, permissions); + assert.strictEqual(gaxOpts, gaxOptions); + callback(); // done() + }); + backup.testIamPermissions(permissions, gaxOptions, done); + }); + }); +}); diff --git a/handwritten/bigtable/test/base64keymap.ts b/handwritten/bigtable/test/base64keymap.ts new file mode 100644 index 00000000000..9691e0bbc85 --- /dev/null +++ b/handwritten/bigtable/test/base64keymap.ts @@ -0,0 +1,184 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import * as assert from 'assert'; +import {describe, it, before, beforeEach, afterEach} from 'mocha'; +import * as Long from 'long'; +import * as proxyquire from 'proxyquire'; +import * as sn from 'sinon'; + +import {RowStateEnum} from '../src/chunktransformer.js'; +import {Mutation} from '../src/mutation.js'; +import {Row} from '../src/row.js'; +import {EncodedKeyMap, SqlValue} from '../src/execute-query/values.js'; + +describe('Bigtable/EncodedKeyMap', () => { + describe('map tests', () => { + it('test constructor', () => { + const bufferKey = Buffer.from('exampleKey'); + const entries: [string | Buffer, string][] = [ + [bufferKey, 'valueForBufferKey'], + ['stringKey', 'valueForStringKey'], + ]; + + const map = new EncodedKeyMap(entries); + // get works with the same object + assert.deepStrictEqual(map.get(bufferKey), 'valueForBufferKey'); + // get works with a new object + assert.deepStrictEqual( + map.get(Buffer.from('exampleKey')), + 'valueForBufferKey', + ); + // get works with a regular string + assert.deepStrictEqual(map.get('stringKey'), 'valueForStringKey'); + }); + it('test duplicate keys', () => { + const bufferKey1 = Buffer.from('exampleKey'); + const bufferKey2 = Buffer.from('exampleKey'); + const bufferKey3 = Buffer.from('exampleKey'); + const entries: [string | Buffer, string][] = [ + [bufferKey1, 'valueForBufferKey1'], + ['stringKey', 'valueForStringKey1'], + [bufferKey2, 'valueForBufferKey2'], + ['stringKey', 'valueForStringKey2'], + ]; + + const map = new EncodedKeyMap(entries); + // get works with the same object + assert.deepStrictEqual(map.get(bufferKey1), 'valueForBufferKey2'); + assert.deepStrictEqual(map.get(bufferKey2), 'valueForBufferKey2'); + // get works with a new object + assert.deepStrictEqual( + map.get(Buffer.from('exampleKey')), + 'valueForBufferKey2', + ); + // get works with a regular string + assert.deepStrictEqual(map.get('stringKey'), 'valueForStringKey2'); + + // check that old value is replaced + map.set(bufferKey3, 'valueForBufferKey3'); + assert.deepStrictEqual( + map.get(Buffer.from('exampleKey')), + 'valueForBufferKey3', + ); + map.set('stringKey', 'valueForStringKey3'); + assert.deepStrictEqual(map.get('stringKey'), 'valueForStringKey3'); + }); + it('test get/set', () => { + const bufferKey = Buffer.from('exampleKey'); + const map = new EncodedKeyMap(); + map.set(bufferKey, 'valueForBufferKey'); + map.set('stringKey', 'valueForStringKey'); + // get works with the same object + assert.deepStrictEqual(map.get(bufferKey), 'valueForBufferKey'); + // get works with a new object + assert.deepStrictEqual( + map.get(Buffer.from('exampleKey')), + 'valueForBufferKey', + ); + // get works with a regular string + assert.deepStrictEqual(map.get('stringKey'), 'valueForStringKey'); + }); + it('test null vs empty bytes', () => { + const entries: [string | Buffer | null, string][] = [ + [null, 'valueForNull'], + ['', 'valueForEmptyString'], + ]; + + // TS normally would not permit a null key, thus we pass entries as any + const map = new EncodedKeyMap(entries as any); + // get works with the same object + assert.deepStrictEqual(map.get(''), 'valueForEmptyString'); + // get works with a regular string + assert.deepStrictEqual(map.get(null as any), 'valueForNull'); + }); + it('test null vs empty bytes', () => { + const entries: [string | Buffer | null, string][] = [ + [null, 'valueForNull'], + [Buffer.from(''), 'valueForEmptyBuffer'], + ]; + + // TS normally would not permit a null key, thus we pass entries as any + const map = new EncodedKeyMap(entries as any); + // get works with the same object + assert.deepStrictEqual(map.get(Buffer.from('')), 'valueForEmptyBuffer'); + // get works with a regular string + assert.deepStrictEqual(map.get(null as any), 'valueForNull'); + }); + it('map builtin functions', () => { + const entries: [string | Buffer | null, string][] = [ + [Buffer.from('Buffer1'), 'valueForBuffer1'], + ['stringKey1', 'valueForString1'], + ]; + + // TS normally would not permit a null key, thus we pass entries as any + const map = new EncodedKeyMap(entries as any); + + // get works with a buffer + assert.deepStrictEqual( + map.get(Buffer.from('Buffer1')), + 'valueForBuffer1', + ); + // get works with a regular string + assert.deepStrictEqual(map.get('stringKey1'), 'valueForString1'); + + // delete, set, has, size + + map.set(Buffer.from('Buffer2'), 'valueForBuffer2'); + map.set('stringKey2', 'valueForString2'); + + assert.deepStrictEqual(map.size, 4); + + assert.deepStrictEqual( + map.get(Buffer.from('Buffer2')), + 'valueForBuffer2', + ); + assert.deepStrictEqual(map.get('stringKey2'), 'valueForString2'); + + assert.strictEqual(map.has('stringKey2'), true); + assert.strictEqual(map.has(Buffer.from('Buffer2')), true); + + map.delete('stringKey2'); + map.delete(Buffer.from('Buffer2')); + + assert.strictEqual(map.has('stringKey2'), false); + assert.strictEqual(map.has(Buffer.from('Buffer2')), false); + + assert.deepStrictEqual(map.size, 2); + + // iterators + + const keys = [...map.keys()]; + assert.deepStrictEqual(keys[0]?.toString(), 'Buffer1'); + assert.deepStrictEqual(keys[0] instanceof Buffer, true); + assert.deepStrictEqual(keys[1], 'stringKey1'); + + const values = [...map.values()]; + assert.deepStrictEqual(values[0], 'valueForBuffer1'); + assert.deepStrictEqual(values[1], 'valueForString1'); + + const resultForEach: [string | bigint | Uint8Array | null, SqlValue][] = + []; + map.forEach((value, key) => { + resultForEach.push([key, value]); + }); + + assert.deepStrictEqual(resultForEach[0][0]?.toString(), 'Buffer1'); + assert.deepStrictEqual(resultForEach[0][0] instanceof Buffer, true); + assert.deepStrictEqual(resultForEach[0][1], 'valueForBuffer1'); + assert.deepStrictEqual(resultForEach[1][0], 'stringKey1'); + assert.deepStrictEqual(resultForEach[1][1], 'valueForString1'); + }); + }); +}); diff --git a/handwritten/bigtable/test/bytebuffertransformer.ts b/handwritten/bigtable/test/bytebuffertransformer.ts new file mode 100644 index 00000000000..d96f49b9084 --- /dev/null +++ b/handwritten/bigtable/test/bytebuffertransformer.ts @@ -0,0 +1,380 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +import * as sinon from 'sinon'; +import {google} from '../protos/protos'; +import {createProtoRows} from './utils/proto-bytes'; +import {ByteBufferTransformer} from '../src/execute-query/bytebuffertransformer'; +import * as SqlValues from '../src/execute-query/values'; + +type PublicByteBufferTransformer = { + messageQueue: Buffer[]; + messageBuffer: Uint8Array[]; + push: (data: any) => void; + processProtoRowsBatch: ( + partialResultSet: google.bigtable.v2.IPartialResultSet, + ) => void; +}; + +describe('Bigtable/ExecuteQueryByteBufferTransformer', () => { + let checksumValidStub: any; + let checksumIsValid = true; + let byteBuffer: PublicByteBufferTransformer; + + beforeEach(() => { + checksumIsValid = true; + checksumValidStub = sinon + .stub(SqlValues, 'checksumValid') + .callsFake(() => checksumIsValid); + byteBuffer = + new ByteBufferTransformer() as any as PublicByteBufferTransformer; + }); + + afterEach(() => { + checksumValidStub.restore(); + }); + + describe('processProtoRowsBatch', () => { + it('empty result', done => { + assert.throws(() => { + byteBuffer.processProtoRowsBatch({}); + }, /Error: Response did not contain any results!/); + done(); + }); + + it('just checksum', done => { + const response1 = createProtoRows(undefined, undefined, undefined, { + intValue: 1, + }); + const responseWithChecksum = createProtoRows(undefined, 111, undefined); + + // fill the buffer + byteBuffer.processProtoRowsBatch(response1.results!); + + // check that the buffer is filled + assert.strictEqual(byteBuffer.messageQueue.length, 0); + assert.strictEqual(byteBuffer.messageBuffer.length, 1); + assert.strictEqual( + byteBuffer.messageBuffer[0], + response1.results!.protoRowsBatch!.batchData!, + ); + + // send the checksum + byteBuffer.processProtoRowsBatch(responseWithChecksum.results!); + + // check that the buffer is flushed and queue contains the new message + assert.strictEqual(byteBuffer.messageQueue.length, 1); + assert.deepStrictEqual( + byteBuffer.messageQueue[0], + Buffer.concat([ + response1.results!.protoRowsBatch!.batchData! as Buffer, + ]), + ); + assert.strictEqual(byteBuffer.messageBuffer.length, 0); + done(); + }); + + it('checksum flushes the buffer', done => { + const response1 = createProtoRows(undefined, undefined, undefined, { + intValue: 1, + }); + const responseWithChecksum = createProtoRows(undefined, 111, undefined, { + intValue: 2, + }); + + // fill the buffer + byteBuffer.processProtoRowsBatch(response1.results!); + + // check that the buffer is filled + assert.strictEqual(byteBuffer.messageQueue.length, 0); + assert.strictEqual(byteBuffer.messageBuffer.length, 1); + assert.strictEqual( + byteBuffer.messageBuffer[0], + response1.results!.protoRowsBatch!.batchData!, + ); + + // send a reset + byteBuffer.processProtoRowsBatch(responseWithChecksum.results!); + + // check that the buffer is flushed and queue contains the new message + // containing both values + assert.strictEqual(byteBuffer.messageQueue.length, 1); + assert.deepStrictEqual( + byteBuffer.messageQueue[0], + Buffer.concat([ + response1.results!.protoRowsBatch!.batchData! as Buffer, + responseWithChecksum.results!.protoRowsBatch!.batchData! as Buffer, + ]), + ); + assert.strictEqual(byteBuffer.messageBuffer.length, 0); + done(); + }); + + it('just reset', done => { + const responseWithReset = createProtoRows(undefined, undefined, true); + + // send a reset + byteBuffer.processProtoRowsBatch(responseWithReset.results!); + + done(); + }); + + it('reset empties the buffer', done => { + // we first prepare the byteBuffer with a few messages + // then we send a reset and observe that the queue and + // buffer have been emptied and only the new message + // is present + const response1 = createProtoRows(undefined, undefined, undefined, { + intValue: 1, + }); + const responseWithReset = createProtoRows(undefined, undefined, true, { + intValue: 4, + }); + + byteBuffer.processProtoRowsBatch(response1.results!); + + // check that the buffer is filled + assert.strictEqual(byteBuffer.messageQueue.length, 0); + assert.strictEqual(byteBuffer.messageBuffer.length, 1); + assert.strictEqual( + byteBuffer.messageBuffer[0], + response1.results!.protoRowsBatch!.batchData!, + ); + + // send a reset + byteBuffer.processProtoRowsBatch(responseWithReset.results!); + + // check that the buffer has been emptied and populated with + // the new message after the reset + assert.strictEqual(byteBuffer.messageQueue.length, 0); + assert.strictEqual(byteBuffer.messageBuffer.length, 1); + assert.deepStrictEqual( + byteBuffer.messageBuffer[0], + responseWithReset.results!.protoRowsBatch!.batchData!, + ); + done(); + }); + + it('reset empties the queue and buffer', done => { + // we first prepare the byteBuffer with a few messages + // then we send a reset and observe that the queue and + // buffer have been emptied and only the new message + // is present + const responses = [ + createProtoRows(undefined, undefined, undefined, {intValue: 1}), + createProtoRows(undefined, 111, undefined, {intValue: 2}), + createProtoRows(undefined, undefined, undefined, {intValue: 3}), + ]; + const responseWithReset = createProtoRows(undefined, undefined, true, { + intValue: 4, + }); + + // fill the buffer with messages + for (const response of responses) { + byteBuffer.processProtoRowsBatch(response.results!); + } + + // check that the buffer and queue are filled + assert.strictEqual(byteBuffer.messageQueue.length, 1); + assert.deepStrictEqual( + byteBuffer.messageQueue[0], + Buffer.concat([ + responses[0].results!.protoRowsBatch!.batchData! as Buffer, + responses[1].results!.protoRowsBatch!.batchData! as Buffer, + ]), + ); + assert.strictEqual(byteBuffer.messageBuffer.length, 1); + assert.strictEqual( + byteBuffer.messageBuffer[0], + responses[2].results!.protoRowsBatch!.batchData!, + ); + + // send a reset + byteBuffer.processProtoRowsBatch(responseWithReset.results!); + + // check that the buffer and queue have been emptied and populated with + // the new message after the reset + assert.strictEqual(byteBuffer.messageQueue.length, 0); + assert.strictEqual(byteBuffer.messageBuffer.length, 1); + assert.deepStrictEqual( + byteBuffer.messageBuffer[0], + responseWithReset.results!.protoRowsBatch!.batchData!, + ); + done(); + }); + + it('token triggers push', done => { + let pushedData = null; + byteBuffer.push = (data: any) => { + pushedData = data; + }; + const response1 = createProtoRows(undefined, undefined, undefined, { + intValue: 1, + }); + const responseWithToken = createProtoRows('token', 111, undefined, { + intValue: 2, + }); + + // fill the buffer + byteBuffer.processProtoRowsBatch(response1.results!); + + // check that the buffer is filled + assert.strictEqual(byteBuffer.messageQueue.length, 0); + assert.strictEqual(byteBuffer.messageBuffer.length, 1); + assert.strictEqual( + byteBuffer.messageBuffer[0], + response1.results!.protoRowsBatch!.batchData!, + ); + + // send a token + byteBuffer.processProtoRowsBatch(responseWithToken.results!); + + // check that the data was pushed and buffer and queue are empty + // but pushed data contins the value from the 2nd message + assert.strictEqual(byteBuffer.messageBuffer.length, 0); + assert.strictEqual(byteBuffer.messageQueue.length, 0); + assert.deepStrictEqual(pushedData, [ + [ + Buffer.concat([ + response1.results!.protoRowsBatch!.batchData! as Buffer, + responseWithToken.results!.protoRowsBatch!.batchData! as Buffer, + ]), + ], + Buffer.from('token'), + ]); + done(); + }); + + it('separate token', done => { + let pushedData = null; + byteBuffer.push = (data: any) => { + pushedData = data; + }; + const response1 = createProtoRows(undefined, 111, undefined, { + intValue: 1, + }); + const responseWithToken = createProtoRows('token', undefined, undefined); + + // fill the buffer + byteBuffer.processProtoRowsBatch(response1.results!); + + // check that the buffer is filled + assert.strictEqual(byteBuffer.messageQueue.length, 1); + assert.strictEqual(byteBuffer.messageBuffer.length, 0); + + // send a token + byteBuffer.processProtoRowsBatch(responseWithToken.results!); + + // check that the data was pushed and buffer and queue are empty + assert.strictEqual(byteBuffer.messageBuffer.length, 0); + assert.strictEqual(byteBuffer.messageQueue.length, 0); + assert.deepStrictEqual(pushedData, [ + [response1.results!.protoRowsBatch!.batchData! as Buffer], + Buffer.from('token'), + ]); + done(); + }); + + it('checksum without data throws', done => { + const responseWithChecksum = createProtoRows(undefined, 111, undefined); + + // send a checksum + assert.throws(() => { + byteBuffer.processProtoRowsBatch(responseWithChecksum.results!); + }, /Error: Recieved empty batch with non-zero checksum\./); + + done(); + }); + + it('token without checksum throws', done => { + let pushedData = null; + byteBuffer.push = (data: any) => { + pushedData = data; + }; + const response1 = createProtoRows(undefined, undefined, undefined, { + intValue: 1, + }); + const responseWithToken = createProtoRows('token', undefined, undefined); + + // fill the buffer + byteBuffer.processProtoRowsBatch(response1.results!); + + // check that the buffer is filled + assert.strictEqual(byteBuffer.messageQueue.length, 0); + assert.strictEqual(byteBuffer.messageBuffer.length, 1); + assert.strictEqual( + byteBuffer.messageBuffer[0], + response1.results!.protoRowsBatch!.batchData!, + ); + + // send a token + assert.throws(() => { + byteBuffer.processProtoRowsBatch(responseWithToken.results!); + }, /Error: Recieved incomplete batch of rows\./); + + done(); + }); + + it('token without data', done => { + let pushedData = null; + byteBuffer.push = (data: any) => { + pushedData = data; + }; + const responseWithToken = createProtoRows('token', undefined, undefined); + + // check that the buffer and queue are empty + assert.strictEqual(byteBuffer.messageQueue.length, 0); + assert.strictEqual(byteBuffer.messageBuffer.length, 0); + + // send a token + byteBuffer.processProtoRowsBatch(responseWithToken.results!); + + // check that the token was pushed even though the buffer and queue are empty + assert.strictEqual(byteBuffer.messageBuffer.length, 0); + assert.strictEqual(byteBuffer.messageQueue.length, 0); + assert.deepStrictEqual(pushedData, [[], Buffer.from('token')]); + done(); + }); + + it('cheksum properly calculated', done => { + checksumValidStub.restore(); + const response = createProtoRows( + 'token1', + 2412835642, + undefined, + {intValue: 1}, + {intValue: 2}, + ); + byteBuffer.processProtoRowsBatch(response.results!); + done(); + }); + + it('invalid cheksum throws', done => { + checksumValidStub.restore(); + const response = createProtoRows( + 'token1', + 111, + undefined, + {intValue: 1}, + {intValue: 2}, + ); + assert.throws(() => { + byteBuffer.processProtoRowsBatch(response.results!); + }, /Error: Failed to validate next batch of results/); + done(); + }); + }); +}); diff --git a/handwritten/bigtable/test/chunktransformer.ts b/handwritten/bigtable/test/chunktransformer.ts new file mode 100644 index 00000000000..0d2975181f0 --- /dev/null +++ b/handwritten/bigtable/test/chunktransformer.ts @@ -0,0 +1,1211 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as assert from 'assert'; +import {describe, it, before, beforeEach, afterEach} from 'mocha'; +import * as Long from 'long'; +import * as proxyquire from 'proxyquire'; +import * as sn from 'sinon'; + +import {RowStateEnum} from '../src/chunktransformer.js'; +import {Mutation} from '../src/mutation.js'; +import {Row} from '../src/row.js'; + +const ROW_ID = 'my-row'; +const CONVERTED_ROW_ID = 'my-converted-row'; +const sinon = sn.createSandbox(); + +const FakeMutation = { + methods: Mutation.methods, + convertToBytes: sinon.spy(value => { + if (value === ROW_ID) { + return CONVERTED_ROW_ID; + } + return value; + }), + convertFromBytes: sinon.spy(value => { + return value; + }), +}; + +describe('Bigtable/ChunkTransformer', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let ChunkTransformer: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let chunkTransformer: any; + let rows: Row[]; + before(() => { + ChunkTransformer = proxyquire('../src/chunktransformer.js', { + './mutation.js': {Mutation: FakeMutation}, + }).ChunkTransformer; + }); + beforeEach(() => { + chunkTransformer = new ChunkTransformer(); + rows = []; + chunkTransformer.push = (row: Row) => { + rows.push(row); + }; + }); + afterEach(() => { + sinon.restore(); + }); + describe('instantiation', () => { + it('should have initial state', () => { + assert(chunkTransformer instanceof ChunkTransformer); + //chunkTransformer.lastRowKey = ''; + //chunkTransformer.family = {}; + //chunkTransformer.qualifiers = []; + //chunkTransformer.qualifier = {}; + //chunkTransformer.row = {}; + //chunkTransformer.state = RowStateEnum.NEW_ROW; + assert.deepStrictEqual(chunkTransformer.row, {}, 'invalid initial state'); + assert.deepStrictEqual( + chunkTransformer.lastRowKey, + undefined, + 'invalid initial state', + ); + assert.deepStrictEqual( + chunkTransformer.family, + {}, + 'invalid initial state', + ); + assert.deepStrictEqual( + chunkTransformer.qualifiers, + [], + 'invalid initial state', + ); + assert.deepStrictEqual( + chunkTransformer.qualifier, + {}, + 'invalid initial state', + ); + assert.deepStrictEqual( + chunkTransformer.state, + RowStateEnum.NEW_ROW, + 'invalid initial state', + ); + }); + }); + describe('processNewRow', () => { + let processNewRowSpy: sn.SinonSpy; + let resetSpy: sn.SinonSpy; + let commitSpy: sn.SinonSpy; + let destroySpy: sn.SinonSpy; + beforeEach(() => { + processNewRowSpy = sinon.spy(chunkTransformer, 'processNewRow'); + resetSpy = sinon.spy(chunkTransformer, 'reset'); + commitSpy = sinon.spy(chunkTransformer, 'commit'); + destroySpy = sinon.spy(chunkTransformer, 'destroy'); + }); + it('should destroy when row key is defined ', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + chunkTransformer.row = {key: 'abc'}; + processNewRowSpy.call(chunkTransformer, {}); + }); + it('should destroy when chunk key is undefined ', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processNewRowSpy.call(chunkTransformer, {}); + }); + it('should destroy when resetRow is true ', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processNewRowSpy.call(chunkTransformer, { + rowKey: 'key', + resetRow: true, + }); + }); + it('should destroy when resetRow ', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processNewRowSpy.call(chunkTransformer, {resetRow: true}); + }); + it('should destroy when row key is equal to previous row key ', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + chunkTransformer.lastRowKey = 'key'; + + processNewRowSpy.call(chunkTransformer, { + rowKey: 'key', + resetRow: false, + }); + }); + it('should destroy when family name is undefined ', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processNewRowSpy.call(chunkTransformer, {rowKey: 'key'}); + }); + it('should destroy when qualifier is undefined ', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processNewRowSpy.call(chunkTransformer, { + rowKey: 'key', + familyName: 'family', + }); + }); + it('should destroy when valueSize>0 and commitRow=true ', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processNewRowSpy.call(chunkTransformer, { + rowKey: 'key', + familyName: 'family', + qualifier: 'qualifier', + valueSize: 10, + commitRow: true, + }); + }); + it('should commit 1 row ', () => { + const chunk = { + rowKey: 'key', + familyName: {value: 'family'}, + qualifier: {value: 'qualifier'}, + valueSize: 0, + timestampMicros: 0, + labels: [], + commitRow: true, + value: 'value', + }; + chunkTransformer.processNewRow(chunk); + assert(resetSpy.called, 'reset state failed'); + assert(commitSpy.called, 'commit row failed'); + assert.strictEqual( + chunkTransformer.lastRowKey, + chunk.rowKey, + 'wrong state lastRowKey', + ); + const expectedRow = { + key: chunk.rowKey, + data: { + family: { + qualifier: [ + { + value: chunk.value, + timestamp: chunk.timestampMicros, + labels: chunk.labels, + }, + ], + }, + }, + }; + assert.deepStrictEqual(rows[0], expectedRow); + }); + it('partial row ', () => { + const chunk = { + rowKey: 'key', + familyName: {value: 'family'}, + qualifier: {value: 'qualifier'}, + valueSize: 0, + timestampMicros: 0, + labels: [], + commitRow: false, + value: 'value', + }; + chunkTransformer.processNewRow(chunk); + assert(!resetSpy.called, 'invalid call to reset'); + assert(!commitSpy.called, 'inavlid call to commit'); + assert.strictEqual(rows.length, 0, 'wrong call to push'); + const partialRow = { + key: chunk.rowKey, + data: { + family: { + qualifier: [ + { + value: chunk.value, + timestamp: chunk.timestampMicros, + labels: chunk.labels, + }, + ], + }, + }, + }; + assert.deepStrictEqual(chunkTransformer.row, partialRow); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.ROW_IN_PROGRESS, + 'wrong state', + ); + }); + it('partial cell ', () => { + const chunk = { + rowKey: 'key', + familyName: {value: 'family'}, + qualifier: {value: 'qualifier'}, + valueSize: 10, + timestampMicros: 0, + labels: [], + commitRow: false, + value: 'value', + }; + chunkTransformer.processNewRow(chunk); + assert(!resetSpy.called, 'invalid call to reset'); + assert(!commitSpy.called, 'inavlid call to commit'); + assert.strictEqual(rows.length, 0, 'wrong call to push'); + const partialRow = { + key: chunk.rowKey, + data: { + family: { + qualifier: [ + { + value: chunk.value, + timestamp: chunk.timestampMicros, + labels: chunk.labels, + }, + ], + }, + }, + }; + assert.deepStrictEqual(chunkTransformer.row, partialRow); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.CELL_IN_PROGRESS, + 'wrong state', + ); + }); + }); + describe('processRowInProgress', () => { + let processRowInProgressSpy: sn.SinonSpy; + let resetSpy: sn.SinonSpy; + let commitSpy: sn.SinonSpy; + let destroySpy: sn.SinonSpy; + beforeEach(() => { + processRowInProgressSpy = sinon.spy( + chunkTransformer, + 'processRowInProgress', + ); + resetSpy = sinon.spy(chunkTransformer, 'reset'); + commitSpy = sinon.spy(chunkTransformer, 'commit'); + destroySpy = sinon.spy(chunkTransformer, 'destroy'); + }); + it('should destroy when resetRow and rowkey', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processRowInProgressSpy.call(chunkTransformer, { + resetRow: true, + rowKey: 'key', + }); + }); + it('should destroy when resetRow and familyName', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processRowInProgressSpy.call(chunkTransformer, { + resetRow: true, + familyName: 'family', + }); + }); + it('should destroy when resetRow and qualifier', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processRowInProgressSpy.call(chunkTransformer, { + resetRow: true, + qualifier: 'qualifier', + }); + }); + it('should destroy when resetRow and value', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processRowInProgressSpy.call(chunkTransformer, { + resetRow: true, + value: 'value', + }); + }); + it('should destroy when resetRow and timestampMicros', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processRowInProgressSpy.call(chunkTransformer, { + resetRow: true, + timestampMicros: 10, + }); + }); + it('should destroy when rowKey not equal to lastRowKey', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + chunkTransformer.row = {key: 'key1'}; + processRowInProgressSpy.call(chunkTransformer, {rowKey: 'key'}); + }); + it('should destroy when valueSize>0 and commitRow=true ', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processRowInProgressSpy.call(chunkTransformer, { + valueSize: 10, + commitRow: true, + }); + }); + it('should destroy when familyName without qualifier ', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processRowInProgressSpy.call(chunkTransformer, { + familyName: 'family', + }); + }); + it('should reset on resetRow ', () => { + const chunk = {resetRow: true}; + chunkTransformer.processRowInProgress(chunk); + assert(resetSpy.called, 'Did not reset'); + assert.strictEqual(rows.length, 0, 'wrong call to push'); + assert(!commitSpy.called, 'unexpected commit'); + }); + it('bare commitRow should produce qualifer ', () => { + chunkTransformer.qualifiers = []; + chunkTransformer.row = { + key: 'key', + data: { + family: { + qualifier: chunkTransformer.qualifiers, + }, + }, + }; + const chunk = {commitRow: true}; + chunkTransformer.processRowInProgress(chunk); + assert(commitSpy.called, 'did not call commit'); + assert(resetSpy.called, 'did not call reset'); + assert.strictEqual(rows.length, 1, 'wrong call to push'); + const expectedRow = { + key: 'key', + data: { + family: { + qualifier: [ + { + value: undefined, + timestamp: undefined, + labels: undefined, + }, + ], + }, + }, + }; + const row = rows[0]; + assert.deepStrictEqual(row, expectedRow, 'row mismatch'); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.NEW_ROW, + 'state mismatch', + ); + }); + it('chunk with qualifier and commit should produce row ', () => { + chunkTransformer.qualifiers = []; + chunkTransformer.family = { + qualifier: chunkTransformer.qualifiers, + }; + chunkTransformer.row = { + key: 'key', + data: { + family: chunkTransformer.family, + }, + }; + const chunk = { + commitRow: true, + qualifier: {value: 'qualifier2'}, + value: 'value', + timestampMicros: 0, + labels: [], + valueSize: 0, + }; + chunkTransformer.processRowInProgress(chunk); + assert(commitSpy.called, 'did not call commit'); + assert(resetSpy.called, 'did not call reset'); + assert.strictEqual(rows.length, 1, 'wrong call to push'); + const expectedRow = { + key: 'key', + data: { + family: { + qualifier: [], + qualifier2: [ + { + value: 'value', + timestamp: 0, + labels: [], + }, + ], + }, + }, + }; + const row = rows[0]; + assert.deepStrictEqual(row, expectedRow, 'row mismatch'); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.NEW_ROW, + 'state mismatch', + ); + }); + it('chunk with familyName and empty qualifier should produce row', () => { + chunkTransformer.qualifiers = []; + chunkTransformer.family = { + qualifier: chunkTransformer.qualifiers, + }; + chunkTransformer.row = { + key: 'key', + data: { + family: chunkTransformer.family, + }, + }; + const chunk = { + commitRow: true, + familyName: {value: 'family2'}, + qualifier: '', + value: 'value', + timestampMicros: 0, + labels: [], + valueSize: 0, + }; + chunkTransformer.processRowInProgress(chunk); + assert(commitSpy.called, 'did not call commit'); + assert(resetSpy.called, 'did not call reset'); + assert.strictEqual(rows.length, 1, 'wrong call to push'); + const expectedRow = { + key: 'key', + data: { + family: { + qualifier: [ + { + value: 'value', + timestamp: 0, + labels: [], + }, + ], + }, + family2: {}, + }, + }; + const row = rows[0]; + assert.deepStrictEqual(row, expectedRow, 'row mismatch'); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.NEW_ROW, + 'state mismatch', + ); + }); + it('chunk with new family and commitRow should produce row', () => { + chunkTransformer.qualifiers = []; + chunkTransformer.family = { + qualifier: chunkTransformer.qualifiers, + }; + chunkTransformer.row = { + key: 'key', + data: { + family: chunkTransformer.family, + }, + }; + const chunk = { + commitRow: true, + familyName: {value: 'family2'}, + qualifier: {value: 'qualifier2'}, + value: 'value', + timestampMicros: 0, + labels: [], + valueSize: 0, + }; + chunkTransformer.processRowInProgress(chunk); + assert(commitSpy.called, 'did not call commit'); + assert(resetSpy.called, 'did not call reset'); + assert.strictEqual(rows.length, 1, 'wrong call to push'); + const expectedRow = { + key: 'key', + data: { + family: { + qualifier: [], + }, + family2: { + qualifier2: [ + { + value: 'value', + timestamp: 0, + labels: [], + }, + ], + }, + }, + }; + const row = rows[0]; + assert.deepStrictEqual(row, expectedRow, 'row mismatch'); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.NEW_ROW, + 'state mismatch', + ); + }); + it('partial cell ', () => { + chunkTransformer.qualifiers = []; + chunkTransformer.row = { + key: 'key', + data: { + family: { + qualifier: chunkTransformer.qualifiers, + }, + }, + }; + const chunk = { + commitRow: false, + value: 'value2', + valueSize: 10, + timestampMicros: 0, + labels: [], + }; + chunkTransformer.processRowInProgress(chunk); + assert(!commitSpy.called, 'invalid call to commit'); + assert(!resetSpy.called, 'invalid call to reset'); + assert.strictEqual(rows.length, 0, 'wrong call to push'); + const expectedState = { + key: 'key', + data: { + family: { + qualifier: [ + { + value: 'value2', + timestamp: 0, + labels: [], + }, + ], + }, + }, + }; + assert.deepStrictEqual( + chunkTransformer.row, + expectedState, + 'row state mismatch', + ); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.CELL_IN_PROGRESS, + 'state mismatch', + ); + }); + it('should decode numbers', () => { + const RealChunkTransformer = + require('../src/chunktransformer.js').ChunkTransformer; + chunkTransformer = new RealChunkTransformer({decode: true}); + resetSpy = sinon.spy(chunkTransformer, 'reset'); + commitSpy = sinon.spy(chunkTransformer, 'commit'); + destroySpy = sinon.spy(chunkTransformer, 'destroy'); + + chunkTransformer.qualifiers = []; + chunkTransformer.row = { + key: 'key', + data: { + family: { + qualifier: chunkTransformer.qualifiers, + }, + }, + }; + const chunk = { + commitRow: false, + value: Buffer.from(Long.fromNumber(10).toBytesBE()).toString('base64'), + valueSize: 0, + timestampMicros: 0, + labels: [], + }; + chunkTransformer.processRowInProgress(chunk); + assert(!resetSpy.called, 'invalid call to reset'); + assert(!commitSpy.called, 'invalid call to commit'); + assert.strictEqual(rows.length, 0, 'wrong call to push'); + const expectedState = { + key: 'key', + data: { + family: { + qualifier: [ + { + value: 10, + timestamp: 0, + labels: [], + }, + ], + }, + }, + }; + assert.deepStrictEqual( + chunkTransformer.row, + expectedState, + 'row mismatch', + ); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.ROW_IN_PROGRESS, + 'state mismatch', + ); + }); + }); + describe('processCellInProgress', () => { + let processCellInProgressSpy: sn.SinonSpy; + let resetSpy: sn.SinonSpy; + let commitSpy: sn.SinonSpy; + let destroySpy: sn.SinonSpy; + beforeEach(() => { + processCellInProgressSpy = sinon.spy( + chunkTransformer, + 'processCellInProgress', + ); + resetSpy = sinon.spy(chunkTransformer, 'reset'); + commitSpy = sinon.spy(chunkTransformer, 'commit'); + destroySpy = sinon.spy(chunkTransformer, 'destroy'); + }); + it('should destroy when resetRow and rowkey', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processCellInProgressSpy.call(chunkTransformer, { + resetRow: true, + rowKey: 'key', + }); + }); + it('should destroy when resetRow and familyName', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processCellInProgressSpy.call(chunkTransformer, { + resetRow: true, + familyName: 'family', + }); + }); + it('should destroy when resetRow and qualifier', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processCellInProgressSpy.call(chunkTransformer, { + resetRow: true, + qualifier: 'qualifier', + }); + }); + it('should destroy when resetRow and value', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processCellInProgressSpy.call(chunkTransformer, { + resetRow: true, + value: 'value', + }); + }); + it('should destroy when resetRow and timestampMicros', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processCellInProgressSpy.call(chunkTransformer, { + resetRow: true, + timestampMicros: 10, + }); + }); + it('should destroy when valueSize>0 and commitRow=true ', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called); + done(); + }); + processCellInProgressSpy.call(chunkTransformer, { + valueSize: 10, + commitRow: true, + }); + }); + it('should reset on resetRow ', () => { + const chunk = {resetRow: true}; + chunkTransformer.processCellInProgress(chunk); + assert(resetSpy.called, 'did not call reset'); + assert(!commitSpy.called, 'unexpected call to commit'); + assert.strictEqual(rows.length, 0, 'wrong call to push'); + }); + it('should produce row on commitRow', () => { + chunkTransformer.qualifier = { + value: 'value', + size: 0, + timestamp: 0, + labels: [], + }; + chunkTransformer.qualifiers = [chunkTransformer.qualifier]; + chunkTransformer.family = { + qualifier: chunkTransformer.qualifiers, + }; + chunkTransformer.row = { + key: 'key', + data: { + family: chunkTransformer.family, + }, + }; + const chunk = { + commitRow: true, + value: '2', + valueSize: 0, + }; + chunkTransformer.processCellInProgress(chunk); + assert(commitSpy.called, 'did not call commit'); + assert(resetSpy.called, 'did not call reste'); + assert.strictEqual(rows.length, 1, 'wrong call to push'); + const expectedRow = { + key: 'key', + data: { + family: { + qualifier: [ + { + value: 'value2', + size: 0, + timestamp: 0, + labels: [], + }, + ], + }, + }, + }; + const row = rows[0]; + assert.deepStrictEqual(row, expectedRow, 'row mismatch'); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.NEW_ROW, + 'state mismatch', + ); + }); + it('without commitRow should change state to processRowInProgress', () => { + chunkTransformer.qualifier = { + value: 'value', + size: 0, + timestamp: 0, + labels: [], + }; + chunkTransformer.qualifiers = [chunkTransformer.qualifier]; + chunkTransformer.family = { + qualifier: chunkTransformer.qualifiers, + }; + chunkTransformer.row = { + key: 'key', + data: { + family: chunkTransformer.family, + }, + }; + const chunk = { + commitRow: false, + value: '2', + valueSize: 0, + }; + chunkTransformer.processCellInProgress(chunk); + assert(!resetSpy.called, 'invalid call to reset'); + assert(!commitSpy.called, 'invalid call to commit'); + assert.strictEqual(rows.length, 0, 'wrong call to push'); + const expectedState = { + key: 'key', + data: { + family: { + qualifier: [ + { + value: 'value2', + size: 0, + timestamp: 0, + labels: [], + }, + ], + }, + }, + }; + assert.deepStrictEqual( + chunkTransformer.row, + expectedState, + 'row mismatch', + ); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.ROW_IN_PROGRESS, + 'state mismatch', + ); + }); + it('should concat buffer when decode option is false', () => { + chunkTransformer = new ChunkTransformer({decode: false}); + processCellInProgressSpy = sinon.spy( + chunkTransformer, + 'processCellInProgress', + ); + resetSpy = sinon.spy(chunkTransformer, 'reset'); + commitSpy = sinon.spy(chunkTransformer, 'commit'); + destroySpy = sinon.spy(chunkTransformer, 'destroy'); + chunkTransformer.qualifier = { + value: Buffer.from('value', 'base64'), + size: 0, + timestamp: 0, + labels: [], + }; + chunkTransformer.qualifiers = [chunkTransformer.qualifier]; + chunkTransformer.family = { + qualifier: chunkTransformer.qualifiers, + }; + chunkTransformer.row = { + key: 'key', + data: { + family: chunkTransformer.family, + }, + }; + const chunk = { + commitRow: false, + value: Buffer.from('value', 'base64'), + valueSize: 0, + }; + chunkTransformer.processCellInProgress(chunk); + assert(!resetSpy.called, 'invalid call to reset'); + assert(!commitSpy.called, 'invalid call to commit'); + assert.strictEqual(rows.length, 0, 'wrong call to push'); + const expectedState = { + key: 'key', + data: { + family: { + qualifier: [ + { + value: Buffer.concat([ + Buffer.from('value', 'base64'), + Buffer.from('value', 'base64'), + ]), + size: 0, + timestamp: 0, + labels: [], + }, + ], + }, + }, + }; + assert.deepStrictEqual( + chunkTransformer.row, + expectedState, + 'row mismatch', + ); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.ROW_IN_PROGRESS, + 'state mismatch', + ); + }); + }); + describe('_flush', () => { + let _flushSpy: sn.SinonSpy; + let callback: sn.SinonSpy; + let destroySpy: sn.SinonSpy; + beforeEach(() => { + _flushSpy = sinon.spy(chunkTransformer, '_flush'); + callback = sinon.spy(); + destroySpy = sinon.spy(chunkTransformer, 'destroy'); + }); + it('completed row should complete successfully', () => { + chunkTransformer.row = {}; + _flushSpy.call(chunkTransformer, callback); + assert(callback.called, 'did not call callback'); + const err = callback.getCall(0).args[0]; + assert(!err, 'did not expect error'); + }); + it('should call destroy when there is uncommitted row', done => { + chunkTransformer.on('error', () => { + assert(destroySpy.called, 'did not destroyed'); + done(); + }); + chunkTransformer.row = {key: 'abc'}; + _flushSpy.call(chunkTransformer, callback); + }); + }); + describe('_transform', () => { + let callback: sn.SinonSpy; + let processNewRowSpy: sn.SinonSpy; + let processRowInProgressSpy: sn.SinonSpy; + let processCellInProgressSpy: sn.SinonSpy; + beforeEach(() => { + callback = sinon.spy(); + processNewRowSpy = sinon.spy(chunkTransformer, 'processNewRow'); + processRowInProgressSpy = sinon.spy( + chunkTransformer, + 'processRowInProgress', + ); + processCellInProgressSpy = sinon.spy( + chunkTransformer, + 'processCellInProgress', + ); + }); + it('when current state is NEW_ROW should call processNewRow', () => { + const chunk = { + rowKey: 'key', + familyName: {value: 'family'}, + qualifier: {value: 'qualifier'}, + valueSize: 0, + timestampMicros: 0, + labels: [], + commitRow: true, + value: 'value', + }; + chunkTransformer.state = RowStateEnum.NEW_ROW; + const chunks = [chunk]; + chunkTransformer._transform({chunks}, {}, callback); + assert(processNewRowSpy.called, 'did not call processNewRow'); + const err = callback.getCall(0).args[0]; + assert(!err, 'did not expect error'); + }); + it('when current state is ROW_IN_PROGRESS should call processRowInProgress', () => { + chunkTransformer.row = {key: 'key'}; + chunkTransformer.state = RowStateEnum.ROW_IN_PROGRESS; + const chunks = [{key: 'key'}]; + chunkTransformer._transform({chunks}, {}, callback); + assert( + processRowInProgressSpy.called, + 'did not call processRowInProgress', + ); + const err = callback.getCall(0).args[0]; + assert(!err, 'did not expect error'); + }); + it('when current state is CELL_IN_PROGRESS should call processCellInProgress', () => { + chunkTransformer.row = {key: 'key'}; + chunkTransformer.state = RowStateEnum.CELL_IN_PROGRESS; + const chunks = [{key: 'key'}]; + chunkTransformer._transform({chunks}, {}, callback); + assert( + processCellInProgressSpy.called, + 'did not call processCellInProgress', + ); + const err = callback.getCall(0).args[0]; + assert(!err, 'did not expect error'); + }); + it('should change the `lastRowKey` value for `data.lastScannedRowKey`', () => { + chunkTransformer._transform( + {chunks: [], lastScannedRowKey: 'foo'}, + {}, + callback, + ); + assert.deepStrictEqual(chunkTransformer.lastRowKey, 'foo'); + }); + }); + describe('reset', () => { + it('should reset initial state', () => { + chunkTransformer.lastRowKey = 'prevkey'; + chunkTransformer.qualifier = { + value: 'value', + size: 0, + timestamp: 0, + labels: [], + }; + chunkTransformer.qualifiers = [chunkTransformer.qualifier]; + chunkTransformer.family = { + qualifier: chunkTransformer.qualifiers, + }; + chunkTransformer.row = { + key: 'key', + data: { + family: chunkTransformer.family, + }, + }; + chunkTransformer.state = RowStateEnum.CELL_IN_PROGRESS; + chunkTransformer.reset(); + assert.deepStrictEqual(chunkTransformer.row, {}, 'invalid initial state'); + assert.deepStrictEqual( + chunkTransformer.lastRowKey, + 'prevkey', + 'invalid initial state', + ); + assert.deepStrictEqual( + chunkTransformer.family, + {}, + 'invalid initial state', + ); + assert.deepStrictEqual( + chunkTransformer.qualifiers, + [], + 'invalid initial state', + ); + assert.deepStrictEqual( + chunkTransformer.qualifier, + {}, + 'invalid initial state', + ); + assert.deepStrictEqual( + chunkTransformer.state, + RowStateEnum.NEW_ROW, + 'invalid initial state', + ); + }); + }); + describe('commit', () => { + let resetSpy: sn.SinonSpy; + beforeEach(() => { + resetSpy = sinon.spy(chunkTransformer, 'reset'); + }); + it('should reset to initial state and set lastRowKey', () => { + chunkTransformer.lastRowKey = ''; + chunkTransformer.qualifier = { + value: 'value', + size: 0, + timestamp: 0, + labels: [], + }; + chunkTransformer.qualifiers = [chunkTransformer.qualifier]; + chunkTransformer.family = { + qualifier: chunkTransformer.qualifiers, + }; + chunkTransformer.row = { + key: 'key', + data: { + family: chunkTransformer.family, + }, + }; + chunkTransformer.state = RowStateEnum.CELL_IN_PROGRESS; + chunkTransformer.commit(); + assert(resetSpy.called, 'did not call reset'); + assert.deepStrictEqual(chunkTransformer.row, {}, 'invalid initial state'); + assert.deepStrictEqual( + chunkTransformer.lastRowKey, + 'key', + 'invalid initial state', + ); + assert.deepStrictEqual( + chunkTransformer.family, + {}, + 'invalid initial state', + ); + assert.deepStrictEqual( + chunkTransformer.qualifiers, + [], + 'invalid initial state', + ); + assert.deepStrictEqual( + chunkTransformer.qualifier, + {}, + 'invalid initial state', + ); + assert.deepStrictEqual( + chunkTransformer.state, + RowStateEnum.NEW_ROW, + 'invalid initial state', + ); + }); + }); + describe('moveToNextState', () => { + let commitSpy: sn.SinonSpy; + beforeEach(() => { + commitSpy = sinon.spy(chunkTransformer, 'commit'); + }); + it('chunk with commit row should call callback with row and call commit state', () => { + chunkTransformer.qualifier = { + value: 'value', + size: 0, + timestamp: 0, + labels: [], + }; + chunkTransformer.qualifiers = [chunkTransformer.qualifier]; + chunkTransformer.family = { + qualifier: chunkTransformer.qualifiers, + }; + chunkTransformer.row = { + key: 'key', + data: { + family: chunkTransformer.family, + }, + }; + const chunk = { + commitRow: true, + }; + chunkTransformer.moveToNextState(chunk); + assert(commitSpy.called, 'did not call commit'); + assert.strictEqual(rows.length, 1, 'did not call push'); + const expectedRow = { + key: 'key', + data: { + family: { + qualifier: [ + { + value: 'value', + size: 0, + timestamp: 0, + labels: [], + }, + ], + }, + }, + }; + const row = rows[0]; + assert.deepStrictEqual(row, expectedRow, 'row mismatch'); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.NEW_ROW, + 'state mismatch', + ); + }); + it('chunk without commitRow and value size>0 should move to CELL_IN_PROGRESS', () => { + const chunk = { + commitRow: false, + valueSize: 10, + }; + chunkTransformer.state = RowStateEnum.NEW_ROW; + chunkTransformer.moveToNextState(chunk); + assert(!commitSpy.called, 'did not call commit'); + assert.strictEqual(rows.length, 0, 'unexpected call to push'); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.CELL_IN_PROGRESS, + 'wrong state', + ); + }); + it('chunk without commitRow and value size==0 should move to ROW_IN_PROGRESS', () => { + const chunk = { + commitRow: false, + valueSize: 0, + }; + chunkTransformer.state = RowStateEnum.CELL_IN_PROGRESS; + chunkTransformer.moveToNextState(chunk); + assert(!commitSpy.called, 'did not call commit'); + assert.strictEqual(rows.length, 0, 'unexpected call to push'); + assert.strictEqual( + chunkTransformer.state, + RowStateEnum.ROW_IN_PROGRESS, + 'wrong state', + ); + }); + }); + describe('destroy', () => { + it('should emit error when destroy is called with error', done => { + const error = new Error('destroy error'); + chunkTransformer.on('error', (err: Error) => { + assert.strictEqual(err, error, 'did not emit error'); + done(); + }); + chunkTransformer.destroy(error); + }); + it('should not emit if transform is already destroyed', done => { + chunkTransformer.on('close', () => { + done(); + }); + chunkTransformer.destroy(); + chunkTransformer.destroy(); + }); + }); +}); diff --git a/handwritten/bigtable/test/cluster.ts b/handwritten/bigtable/test/cluster.ts new file mode 100644 index 00000000000..a1c963cd22f --- /dev/null +++ b/handwritten/bigtable/test/cluster.ts @@ -0,0 +1,1072 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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 promisify from '@google-cloud/promisify'; +import * as assert from 'assert'; +import {before, beforeEach, describe, it} from 'mocha'; +import * as proxyquire from 'proxyquire'; +import {PassThrough, Readable} from 'stream'; +import {CallOptions} from 'google-gax'; +import {PreciseDate} from '@google-cloud/precise-date'; +import {ClusterUtils} from '../src/utils/cluster'; +import {InstanceOptions, RequestOptions} from '../src'; +import {createClusterOptionsList} from './constants/cluster'; +import * as snapshot from 'snap-shot-it'; + +export interface Options { + nodes?: Number; + gaxOptions?: { + timeout: number; + }; +} + +let promisified = false; +const fakePromisify = Object.assign({}, promisify, { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + promisifyAll(klass: Function, options: any) { + if (klass.name === 'Cluster') { + promisified = true; + assert.deepStrictEqual(options.exclude, ['backup']); + } + }, +}); + +class FakeBackup { + calledWith_: Array<{}>; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + constructor(...args: any[]) { + this.calledWith_ = Array.from(args); + } +} + +describe('Bigtable/Cluster', () => { + const CLUSTER_ID = 'my-cluster'; + const PROJECT_ID = 'grape-spaceship-123'; + + const INSTANCE = { + name: `projects/${PROJECT_ID}/instances/i`, + bigtable: {projectId: PROJECT_ID}, + }; + + const CLUSTER_NAME = `${INSTANCE.name}/clusters/${CLUSTER_ID}`; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let Cluster: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let cluster: any; + + before(() => { + Cluster = proxyquire('../src/cluster.js', { + '@google-cloud/promisify': fakePromisify, + './backup.js': {Backup: FakeBackup}, + }).Cluster; + }); + + beforeEach(() => { + cluster = new Cluster(INSTANCE, CLUSTER_ID); + }); + + describe('instantiation', () => { + it('should promisify all the things', () => { + assert(promisified); + }); + + it('should localize Bigtable instance', () => { + assert.strictEqual(cluster.bigtable, INSTANCE.bigtable); + }); + + it('should localize Instance instance', () => { + assert.strictEqual(cluster.instance, INSTANCE); + }); + + it('should expand id into full resource path', () => { + assert.strictEqual(cluster.name, CLUSTER_NAME); + }); + + it('should leave full cluster names unaltered', () => { + const cluster = new Cluster(INSTANCE, CLUSTER_ID); + assert.strictEqual(cluster.name, CLUSTER_NAME); + }); + + it('should localize the id from the name', () => { + assert.strictEqual(cluster.id, CLUSTER_ID); + }); + + it('should leave full cluster names unaltered and localize the id from the name', () => { + const cluster = new Cluster(INSTANCE, CLUSTER_NAME); + assert.strictEqual(cluster.name, CLUSTER_NAME); + assert.strictEqual(cluster.id, CLUSTER_ID); + }); + + it('should throw if cluster id in wrong format', () => { + const id = `clusters/${CLUSTER_ID}`; + assert.throws(() => { + new Cluster(INSTANCE, id); + }, Error); + }); + }); + + describe('getLocation_', () => { + const LOCATION = 'us-central2-d'; + + it('should format the location name', () => { + const expected = `projects/${PROJECT_ID}/locations/${LOCATION}`; + const formatted = Cluster.getLocation_(PROJECT_ID, LOCATION); + assert.strictEqual(formatted, expected); + }); + + it('should format the location name for project name with /', () => { + const PROJECT_NAME = 'projects/grape-spaceship-123'; + const expected = `projects/${PROJECT_NAME.split( + '/', + ).pop()}/locations/${LOCATION}`; + const formatted = Cluster.getLocation_(PROJECT_NAME, LOCATION); + assert.strictEqual(formatted, expected); + }); + + it('should not re-format a complete location', () => { + const complete = `projects/p/locations/${LOCATION}`; + const formatted = Cluster.getLocation_(PROJECT_ID, complete); + assert.strictEqual(formatted, complete); + }); + }); + + describe('getStorageType_', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const types: any = { + unspecified: 0, + ssd: 1, + hdd: 2, + }; + + it('should default to unspecified', () => { + assert.strictEqual(Cluster.getStorageType_(), types.unspecified); + }); + + it('should lowercase a type', () => { + assert.strictEqual(Cluster.getStorageType_('SSD'), types.ssd); + }); + + Object.keys(types).forEach(type => { + it('should get the storage type for "' + type + '"', () => { + assert.strictEqual(Cluster.getStorageType_(type), types[type]); + }); + }); + }); + + describe('backup', () => { + it('should return a Backup object', () => { + const backupId = 'backup-id'; + const backup = cluster.backup(backupId); + assert(backup instanceof FakeBackup); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const args = (backup as any).calledWith_; + assert.strictEqual(args[0], cluster); + assert.strictEqual(args[1], backupId); + }); + }); + + describe('create', () => { + it('should call createCluster from instance', done => { + const options = {}; + + cluster.instance.createCluster = ( + id: string, + options_: {}, + callback: Function, + ) => { + assert.strictEqual(id, cluster.id); + assert.strictEqual(options_, options); + callback(); // done() + }; + + cluster.create(options, done); + }); + + it('should not require options', done => { + cluster.instance.createCluster = ( + id: string, + options: {}, + callback: Function, + ) => { + assert.deepStrictEqual(options, {}); + callback(); // done() + }; + + cluster.create(done); + }); + }); + + describe('createBackup', () => { + it('should throw if backup id not provided', () => { + assert.throws(() => { + cluster.createBackup(); + }, /An id is required to create a backup\./); + }); + + it('should throw if config is not provided', () => { + assert.throws(() => { + cluster.createBackup('id'); + }, /A configuration object is required\./); + }); + + it('should throw if a source table is not provided', () => { + assert.throws(() => { + cluster.createBackup('id', {}); + }, /A source table is required to backup\./); + }); + + it('should accept table as a string', done => { + const table = 'table-name'; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.reqOpts.backup.sourceTable, table); + done(); + }; + + cluster.createBackup( + 'id', + { + table, + }, + assert.ifError, + ); + }); + + it('should accept table as a Table object', done => { + const table = { + name: 'table-name', + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.reqOpts.backup.sourceTable, table.name); + done(); + }; + + cluster.createBackup( + 'id', + { + table, + }, + assert.ifError, + ); + }); + + it('should not include table in request options', done => { + const table = 'table-name'; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(typeof config.reqOpts.backup.table, 'undefined'); + done(); + }; + + cluster.createBackup( + 'id', + { + table, + }, + assert.ifError, + ); + }); + + it('should convert a Date expireTime to a struct', done => { + const expireTime = new Date(); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.deepStrictEqual( + config.reqOpts.backup.expireTime, + new PreciseDate(expireTime).toStruct(), + ); + done(); + }; + + cluster.createBackup( + 'id', + { + table: 'table-id', + expireTime, + }, + assert.ifError, + ); + }); + + it('should send correct request', done => { + const backupId = 'backup-id'; + const table = 'table-name'; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'createBackup'); + assert.deepStrictEqual(config.reqOpts, { + parent: cluster.name, + backupId, + backup: { + sourceTable: table, + configProperty: true, + }, + }); + assert.strictEqual(typeof config.gaxOpts, 'undefined'); + done(); + }; + + cluster.createBackup( + backupId, + { + table, + configProperty: true, + }, + assert.ifError, + ); + }); + + it('should accept gaxOptions', done => { + const table = 'table-name'; + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + cluster.createBackup( + 'id', + { + table, + gaxOptions, + }, + assert.ifError, + ); + }); + + it('should not include gaxOptions in request options', done => { + const table = 'table-name'; + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(typeof config.reqOpts.gaxOptions, 'undefined'); + done(); + }; + + cluster.createBackup( + 'id', + { + table, + gaxOptions, + }, + assert.ifError, + ); + }); + + it('should execute callback with error and original args', done => { + const error = new Error('Error.'); + const args = [{}, {}, {}]; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any, callback: Function) => { + callback(error, ...args); + }; + + cluster.createBackup( + 'id', + { + table: 'table-name', + }, + (err: Error, backup: {}, ..._args: Array<{}>) => { + assert.strictEqual(err, error); + assert.strictEqual(backup, undefined); + assert.deepStrictEqual(Array.from(_args), args); + done(); + }, + ); + }); + + it('should execute callback with Backup and original args', done => { + const id = 'backup-id'; + const backupInstance = {}; + const args = [{}, {}, {}]; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any, callback: Function) => { + callback(null, ...args); + }; + + cluster.backup = (_id: string) => { + assert.strictEqual(_id, id); + return backupInstance; + }; + + cluster.createBackup( + id, + { + table: 'table-name', + }, + (err: Error, backup: {}, ..._args: Array<{}>) => { + assert.ifError(err); + assert.strictEqual(backup, backupInstance); + assert.deepStrictEqual(Array.from(_args), args); + done(); + }, + ); + }); + }); + + describe('delete', () => { + it('should make the correct request', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any, callback: Function) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'deleteCluster'); + + assert.deepStrictEqual(config.reqOpts, { + name: cluster.name, + }); + + assert.deepStrictEqual(config.gaxOpts, {}); + + callback(); // done() + }; + + cluster.delete(done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + cluster.delete(gaxOptions, assert.ifError); + }); + }); + + describe('exists', () => { + it('should not require gaxOptions', done => { + cluster.getMetadata = (gaxOptions: CallOptions) => { + assert.deepStrictEqual(gaxOptions, {}); + done(); + }; + + cluster.exists(assert.ifError); + }); + + it('should pass gaxOptions to getMetadata', done => { + const gaxOptions = {}; + + cluster.getMetadata = (gaxOptions_: CallOptions) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }; + + cluster.exists(gaxOptions, assert.ifError); + }); + + it('should return false if error code is 5', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const error: any = new Error('Error.'); + error.code = 5; + + cluster.getMetadata = (gaxOptions: CallOptions, callback: Function) => { + callback(error); + }; + + cluster.exists((err: Error, exists: boolean) => { + assert.ifError(err); + assert.strictEqual(exists, false); + done(); + }); + }); + + it('should return error if code is not 5', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const error: any = new Error('Error.'); + error.code = 'NOT-5'; + cluster.getMetadata = (_: CallOptions, callback: Function) => { + callback(error); + }; + cluster.exists((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return true if no error', done => { + cluster.getMetadata = (gaxOptions: CallOptions, callback: Function) => { + callback(null, {}); + }; + cluster.exists((err: Error, exists: boolean) => { + assert.ifError(err); + assert.strictEqual(exists, true); + done(); + }); + }); + }); + + describe('get', () => { + it('should call getMetadata', done => { + const gaxOptions = {}; + cluster.getMetadata = (gaxOptions_: {}) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }; + cluster.get(gaxOptions, assert.ifError); + }); + + it('should not require gaxOptions', done => { + cluster.getMetadata = (gaxOptions: CallOptions) => { + assert.deepStrictEqual(gaxOptions, {}); + done(); + }; + + cluster.get(assert.ifError); + }); + + it('should return an error from getMetadata', done => { + const error = new Error('Error.'); + + cluster.getMetadata = (gaxOptions: CallOptions, callback: Function) => { + callback(error); + }; + + cluster.get((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return self and API response', done => { + const metadata = {}; + + cluster.getMetadata = (gaxOptions: CallOptions, callback: Function) => { + callback(null, metadata); + }; + + cluster.get((err: Error, cluster_: {}, metadata_: {}) => { + assert.ifError(err); + assert.strictEqual(cluster_, cluster); + assert.strictEqual(metadata_, metadata); + done(); + }); + }); + }); + + describe('getBackups', () => { + it('should send the correct request', done => { + const options = {a: 'b'}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'listBackups'); + assert.deepStrictEqual(config.reqOpts, { + parent: cluster.name, + pageSize: undefined, + pageToken: undefined, + ...options, + }); + assert.deepStrictEqual(config.gaxOpts, {}); + + done(); + }; + + cluster.getBackups(options, assert.ifError); + }); + + it('should locate pagination settings from gaxOptions', done => { + const options = { + gaxOptions: { + pageSize: 'size', + pageToken: 'token', + }, + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual( + config.reqOpts.pageSize, + options.gaxOptions.pageSize, + ); + assert.strictEqual( + config.reqOpts.pageToken, + options.gaxOptions.pageToken, + ); + done(); + }; + + cluster.getBackups(options, assert.ifError); + }); + + it('should prefer pageSize and pageToken from options over gaxOptions', done => { + const options = { + pageSize: 'size-good', + pageToken: 'token-good', + gaxOptions: { + pageSize: 'size-bad', + pageToken: 'token-bad', + }, + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.reqOpts.pageSize, options.pageSize); + assert.strictEqual(config.reqOpts.pageToken, options.pageToken); + done(); + }; + + cluster.getBackups(options, assert.ifError); + }); + + it('should remove extraneous pagination settings from request', done => { + const options = { + gaxOptions: { + pageSize: 'size', + pageToken: 'token', + }, + autoPaginate: true, + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(typeof config.gaxOpts.pageSize, 'undefined'); + assert.strictEqual(typeof config.gaxOpts.pageToken, 'undefined'); + assert.strictEqual(typeof config.reqOpts.autoPaginate, 'undefined'); + done(); + }; + + cluster.getBackups(options, assert.ifError); + }); + + it('should accept gaxOptions', done => { + const options = { + gaxOptions: {a: 'b'}, + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(typeof config.reqOpts.gaxOptions, 'undefined'); + assert.deepStrictEqual(config.gaxOpts, options.gaxOptions); + done(); + }; + + cluster.getBackups(options, assert.ifError); + }); + + it('should not send gaxOptions as request options', done => { + const options = { + gaxOptions: {a: 'b'}, + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert(Object.keys(options.gaxOptions).every(k => !config.reqOpts[k])); + done(); + }; + + cluster.getBackups(options, assert.ifError); + }); + + it('should set autoPaginate from options', done => { + const options = { + autoPaginate: true, + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts.autoPaginate, options.autoPaginate); + done(); + }; + + cluster.getBackups(options, assert.ifError); + }); + + it('should prefer autoPaginate from gaxOpts', done => { + const options = { + autoPaginate: false, + gaxOptions: { + autoPaginate: true, + }, + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts.autoPaginate, true); + done(); + }; + + cluster.getBackups(options, assert.ifError); + }); + + it('should execute callback with error and correct response arguments', done => { + const error = new Error('Error.'); + const apiResponse = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any, callback: Function) => { + callback(error, [], null, apiResponse); + }; + + cluster.getBackups( + (err: Error, backups: [], nextQuery: {}, apiResp: {}) => { + assert.strictEqual(err, error); + assert.deepStrictEqual(backups, []); + assert.strictEqual(nextQuery, null); + assert.strictEqual(apiResp, apiResponse); + done(); + }, + ); + }); + + it('should execute callback with Backup instances', done => { + const rawBackup = {name: 'long/formatted/name', a: 'b'}; + const backupInstance = {}; + + cluster.backup = (id: string) => { + assert.strictEqual(id, rawBackup.name.split('/').pop()); + return backupInstance; + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any, callback: Function) => { + callback(null, [rawBackup]); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.getBackups((err: Error, backups: any[]) => { + assert.ifError(err); + assert.deepStrictEqual(backups, [backupInstance]); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + assert.strictEqual((backups[0] as any)!.metadata, rawBackup); + done(); + }); + }); + + it('should create Backup from correct cluster when using - as an id', done => { + cluster.id = '-'; + + const clusterId = 'cluster-id'; + const backupId = 'backup-id'; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any, callback: Function) => { + callback(null, [ + { + name: `projects/project-id/clusters/${clusterId}/backups/${backupId}`, + }, + ]); + }; + + cluster.instance.cluster = (id: string) => { + assert.strictEqual(id, clusterId); + + return { + backup: (id: string) => { + assert.strictEqual(id, backupId); + setImmediate(done); + return {}; + }, + }; + }; + + cluster.getBackups(assert.ifError); + }); + + it('should execute callback with prepared nextQuery', done => { + const options = {pageToken: '1'}; + const nextQuery = {pageToken: '2'}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any, callback: Function) => { + callback(null, [], nextQuery); + }; + + cluster.getBackups(options, (err: Error, backups: [], _nextQuery: {}) => { + assert.ifError(err); + assert.deepStrictEqual(_nextQuery, nextQuery); + done(); + }); + }); + }); + + describe('getBackupsStream', () => { + it('should make correct request', done => { + const options = {a: 'b'}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'listBackupsStream'); + assert.deepStrictEqual(config.reqOpts, { + parent: cluster.name, + ...options, + }); + assert.strictEqual(typeof config.gaxOpts, 'undefined'); + setImmediate(done); + return new PassThrough(); + }; + + cluster.getBackupsStream(options); + }); + + it('should accept gaxOptions', done => { + const options = {gaxOptions: {}}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, options.gaxOptions); + setImmediate(done); + return new PassThrough(); + }; + + cluster.getBackupsStream(options); + }); + + it('should not include gaxOptions in reqOpts', done => { + const options = {gaxOptions: {a: 'b'}}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert(Object.keys(options.gaxOptions).every(k => !config.reqOpts[k])); + setImmediate(done); + return new PassThrough(); + }; + + cluster.getBackupsStream(options); + }); + + it('should transform response backups into Backup objects', done => { + const rawBackup = {name: 'long/formatted/name', a: 'b'}; + const backupInstance = {}; + const requestStream = new Readable({ + objectMode: true, + read() { + this.push(rawBackup); + this.push(null); + }, + }); + + cluster.backup = (id: string) => { + assert.strictEqual(id, rawBackup.name.split('/').pop()); + return backupInstance; + }; + + cluster.bigtable.request = () => requestStream; + + cluster + .getBackupsStream() + .on('error', done) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + .on('data', (backup: any) => { + assert.strictEqual(backup, backupInstance); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + assert.strictEqual((backup as any).metadata, rawBackup); + done(); + }); + }); + + it('should create Backup from correct cluster when using - as an id', done => { + cluster.id = '-'; + + const clusterId = 'cluster-id'; + const backupId = 'backup-id'; + + const requestStream = new Readable({ + objectMode: true, + read() { + this.push({ + name: `projects/project-id/clusters/${clusterId}/backups/${backupId}`, + }); + this.push(null); + }, + }); + + cluster.instance.cluster = (id: string) => { + assert.strictEqual(id, clusterId); + + return { + backup: (id: string) => { + assert.strictEqual(id, backupId); + setImmediate(done); + return {}; + }, + }; + }; + + cluster.bigtable.request = () => requestStream; + + cluster.getBackupsStream().on('error', done); + }); + }); + + describe('getMetadata', () => { + it('should make correct request', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'getCluster'); + assert.deepStrictEqual(config.reqOpts, { + name: cluster.name, + }); + assert.deepStrictEqual(config.gaxOpts, {}); + done(); + }; + cluster.getMetadata(assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + cluster.getMetadata(gaxOptions, assert.ifError); + }); + + it('should update metadata', done => { + const metadata = {}; + cluster.bigtable.request = (config: {}, callback: Function) => { + callback(null, metadata); + }; + cluster.getMetadata(() => { + assert.strictEqual(cluster.metadata, metadata); + done(); + }); + }); + + it('should execute callback with original arguments', done => { + const args = [{}, {}]; + cluster.bigtable.request = (config: {}, callback: Function) => { + callback(...args); + }; + cluster.getMetadata((...argsies: Array<{}>) => { + assert.deepStrictEqual([].slice.call(argsies), args); + done(); + }); + }); + }); + + describe('setMetadata', () => { + beforeEach(() => { + const metadata = { + location: 'projects/{{projectId}}/locations/us-east4-b', + }; + cluster.metadata = metadata; + }); + + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any, callback: Function) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'partialUpdateCluster'); + assert.strictEqual(config.reqOpts.cluster.name, CLUSTER_NAME); + callback(); // done() + }; + + cluster.setMetadata({nodes: 2}, done); + }); + + it('should provide the proper request options asynchronously', async () => { + let currentRequestInput = null; + (cluster.bigtable.request as Function) = (config: RequestOptions) => { + currentRequestInput = config; + }; + for (const options of createClusterOptionsList) { + await cluster.setMetadata(options); + snapshot({ + input: { + id: cluster.id, + options: options, + }, + output: { + config: currentRequestInput, + }, + }); + } + }); + + it('should respect the nodes option', done => { + const options = { + nodes: 3, + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.reqOpts.cluster.serveNodes, options.nodes); + done(); + }; + + cluster.setMetadata(options, assert.ifError); + }); + + it('should accept and pass user provided input through', done => { + const options = { + nodes: 3, + location: 'us-west2-b', + defaultStorageType: 'exellent_type', + }; + + const expectedReqOpts = ClusterUtils.getRequestFromMetadata( + options, + CLUSTER_NAME, + ); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.deepStrictEqual(config.reqOpts, expectedReqOpts); + done(); + }; + + cluster.setMetadata(options, assert.ifError); + }); + + it('should respect the gaxOptions', done => { + const options = { + nodes: 3, + }; + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cluster.bigtable.request = (config: any) => { + assert.strictEqual(config.reqOpts.cluster.serveNodes, options.nodes); + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + cluster.setMetadata(options, gaxOptions, assert.ifError); + }); + + // eslint-disable-next-line no-restricted-properties + it('should execute callback with all arguments', done => { + const args = [{}, {}]; + cluster.bigtable.request = (config: {}, callback: Function) => { + callback(...args); + }; + const name = + 'projects/{{projectId}}/instances/fake-instance/clusters/fake-cluster'; + cluster.name = name; + cluster.setMetadata({nodes: 2}, (...argsies: Array<{}>) => { + assert.deepStrictEqual([].slice.call(argsies), args); + done(); + }); + }); + }); +}); diff --git a/handwritten/bigtable/test/constants/cluster.ts b/handwritten/bigtable/test/constants/cluster.ts new file mode 100644 index 00000000000..1e8c802b19f --- /dev/null +++ b/handwritten/bigtable/test/constants/cluster.ts @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {CreateClusterOptions} from '../../src'; + +export const createClusterOptionsList: CreateClusterOptions[] = [ + {nodes: 2}, + {nodes: 2, storage: 'ssd'}, + {nodes: 2, key: 'kms-key-name'}, + {nodes: 2, encryption: {kmsKeyName: 'kms-key-name'}}, + { + minServeNodes: 2, + maxServeNodes: 3, + cpuUtilizationPercent: 50, + }, +].map(option => Object.assign(option, {location: 'us-central2-d'})); diff --git a/handwritten/bigtable/test/errors.ts b/handwritten/bigtable/test/errors.ts new file mode 100644 index 00000000000..f270f869f89 --- /dev/null +++ b/handwritten/bigtable/test/errors.ts @@ -0,0 +1,201 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {before, describe, it} from 'mocha'; +import {Bigtable} from '../src'; +import * as assert from 'assert'; + +import {GoogleError, grpc, ServiceError} from 'google-gax'; +import {MockServer} from '../src/util/mock-servers/mock-server'; +import { + BigtableAdminClientMockService, + BigtableClientMockService, +} from '../src/util/mock-servers/service-implementations/bigtable-client-mock-service'; +import {MockService} from '../src/util/mock-servers/mock-service'; + +function isServiceError(error: any): error is ServiceError { + return ( + error.code !== undefined && + error.details !== undefined && + error.metadata !== undefined + ); +} + +describe('Bigtable/Errors', () => { + let server: MockServer; + let bigtable: Bigtable; + let table: any; + let service: MockService; + + before(async () => { + // make sure we have everything initialized before starting tests + const port = await new Promise(resolve => { + server = new MockServer(resolve); + }); + bigtable = new Bigtable({ + apiEndpoint: `localhost:${port}`, + }); + service = new BigtableClientMockService(server); + table = bigtable.instance('fake-instance').table('fake-table'); + }); + + describe('with the bigtable data client', () => { + describe('sends errors through a streaming request', () => { + const errorDetails = + 'Table not found: projects/my-project/instances/my-instance/tables/my-table'; + const emitTableNotExistsError = (stream: any) => { + // TODO: Replace stream with type + const metadata = new grpc.Metadata(); + metadata.set( + 'grpc-server-stats-bin', + Buffer.from([0, 0, 116, 73, 159, 3, 0, 0, 0, 0]), + ); + stream.emit('error', { + code: 5, + details: errorDetails, + metadata, + }); + }; + function checkTableNotExistError(err: any) { + if (isServiceError(err)) { + const {code, message, details} = err; + assert.strictEqual(details, errorDetails); + assert.strictEqual(code, 5); + assert.strictEqual(message, `5 NOT_FOUND: ${errorDetails}`); + } else { + assert.fail( + 'Errors checked using this function should all be GoogleErrors', + ); + } + } + describe('with ReadRows service', () => { + before(async () => { + service.setService({ + ReadRows: emitTableNotExistsError, + }); + }); + it('should produce human readable error when passing through gax', done => { + const readStream = table.createReadStream({}); + readStream.on('error', (err: GoogleError) => { + checkTableNotExistError(err); + done(); + }); + }); + }); + describe('with mutateRows service through insert', () => { + before(async () => { + service.setService({ + mutateRows: emitTableNotExistsError, + }); + }); + it('should produce human readable error when passing through gax', async () => { + const timestamp = new Date(); + const rowsToInsert = [ + { + key: 'r2', + data: { + cf1: { + c1: { + value: 'test-value2', + labels: [], + timestamp, + }, + }, + }, + }, + ]; + try { + await table.insert(rowsToInsert); + } catch (err) { + checkTableNotExistError(err); + return; + } + assert.fail('An error should have been thrown by the stream'); + }); + }); + describe('with sampleRowKeys', () => { + before(async () => { + service.setService({ + sampleRowKeys: emitTableNotExistsError, + }); + }); + it('should produce human readable error when passing through gax', async () => { + try { + await table.sampleRowKeys({}); + } catch (err) { + checkTableNotExistError(err); + return; + } + assert.fail('An error should have been thrown by the stream'); + }); + }); + }); + }); + after(async () => { + server.shutdown(() => {}); + }); +}); + +describe('BigtableAdminClient/Errors', () => { + let server: MockServer; + let bigtable: Bigtable; + let service: MockService; + + before(async () => { + // make sure we have everything initialized before starting tests + const port = await new Promise(resolve => { + server = new MockServer(resolve); + }); + bigtable = new Bigtable({ + apiEndpoint: `localhost:${port}`, + }); + service = new BigtableAdminClientMockService(server); + }); + + describe('with getInstances', () => { + const emitGetInstancesError = (stream: any) => { + const metadata = new grpc.Metadata(); + stream.emit('error', { + code: 5, + details: 'getInstances error details', + metadata, + }); + }; + before(async () => { + service.setService({ + listInstances: emitGetInstancesError, + }); + }); + it('should produce human readable error when passing through gax', async () => { + try { + await bigtable.getInstances(); + assert.fail( + 'An error should have been thrown by the getInstances call', + ); + } catch (err) { + assert.strictEqual( + (err as ServiceError).message, + '5 NOT_FOUND: getInstances error details', + ); + } + }); + }); + after(async () => { + server.shutdown(() => {}); + }); +}); diff --git a/handwritten/bigtable/test/executequery.ts b/handwritten/bigtable/test/executequery.ts new file mode 100644 index 00000000000..2e87ac8f323 --- /dev/null +++ b/handwritten/bigtable/test/executequery.ts @@ -0,0 +1,2049 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 promisify from '@google-cloud/promisify'; +import * as assert from 'assert'; +import {before, beforeEach, afterEach, describe, it} from 'mocha'; +import * as sinon from 'sinon'; +import * as proxyquire from 'proxyquire'; +import {grpc} from 'google-gax'; +import * as inst from '../src/instance'; +import {Bigtable} from '../src'; +import {google} from '../protos/protos'; +import * as SqlTypes from '../src/execute-query/types'; +import * as pumpify from 'pumpify'; +import { + ArrayReadableStream, + createMetadata, + createPrepareQueryResponse, + createProtoRows, + pbType, +} from './utils/proto-bytes'; +import {QueryResultRow} from '../src/execute-query/values'; +import { + PreparedStatement, + SHOULD_REFRESH_SOON_PERIOD_MS, +} from '../src/execute-query/preparedstatement'; +import {MetadataConsumer} from '../src/execute-query/metadataconsumer'; +import {PassThrough} from 'stream'; +import * as SqlValues from '../src/execute-query/values'; + +const sandbox = sinon.createSandbox(); + +const fakePromisify = Object.assign({}, promisify, { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + promisifyAll(klass: Function, options: any) { + if (klass.name !== 'Instance') { + return; + } + assert.deepStrictEqual(options.exclude, [ + 'appProfile', + 'cluster', + 'table', + 'getBackupsStream', + 'getTablesStream', + 'getAppProfilesStream', + 'view', + ]); + }, +}); + +class MockPreparedStatement { + callbacks: any[] = []; + markedAsExpired = false; + getData = (cb: any, timeout: any) => { + this.callbacks.push(cb); + }; + getParameterTypes = () => { + return {}; + }; + markAsExpired = () => { + this.markedAsExpired = true; + }; +} + +function createResultSetMetadata( + ...values: [string | null, google.bigtable.v2.Type][] +): SqlTypes.ResultSetMetadata { + return MetadataConsumer.parseMetadata(createMetadata(...values).metadata!); +} + +const performCallbacks = (callbacks: any[], interval: number) => { + let counter = 0; + const performNext = () => { + callbacks[counter++](); + if (counter < callbacks.length) { + setTimeout(performNext, interval); + } + }; + performNext(); +}; + +const createExpiredQueryError = () => { + return { + code: grpc.status.FAILED_PRECONDITION, + details: 'failed precondition', + statusDetails: [ + { + violations: [ + { + type: 'PREPARED_QUERY_EXPIRED', + description: + 'The prepared query has expired. Please re-issue the ExecuteQuery with a valid prepared query.', + }, + ], + }, + ], + }; +}; + +describe('Bigtable/ExecuteQueryStateMachine', () => { + const INSTANCE_ID = 'my-instance'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const BIGTABLE = { + projectName: 'projects/my-project', + projectId: 'my-project', + request: () => {}, + } as Bigtable; + let Instance: typeof inst.Instance; + let instance: inst.Instance; + let checksumValidStub: any; + + before(() => { + Instance = proxyquire('../src/instance.js', { + '@google-cloud/promisify': fakePromisify, + pumpify, + }).Instance; + }); + + beforeEach(() => { + instance = new Instance(BIGTABLE, INSTANCE_ID); + checksumValidStub = sinon + .stub(SqlValues, 'checksumValid') + .callsFake(() => true); + }); + + afterEach(() => { + sandbox.restore(); + checksumValidStub.restore(); + }); + + describe('happy_path', () => { + it('responses within timeout', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows(undefined, undefined, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows(undefined, 111, undefined, {intValue: 2}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows('token1', undefined, undefined), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream.write( + createProtoRows('token2', undefined, undefined), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream.emit('end'); + bigtableStream.emit('close'); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Finished'); + assert.equal(responses.length, 2); + assert.equal(responses[0].get(0), 1); + assert.equal(responses[1].get(0), 2); + done(); + }, + ], + 1, + ); + }); + }); + + describe('queryPlanErrors', () => { + it('one query plan error', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 1); + }, + () => { + preparedStatement.callbacks[0](new Error('fetching QP failed')); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 2); + preparedStatement.callbacks[1]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows('token1', 111, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream.emit('end'); + bigtableStream.emit('close'); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Finished'); + assert.equal(responses[0].get(0), 1); + done(); + }, + ], + 1, + ); + }); + + it('query plan expired error', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const bigtableStream2 = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const expiredError = createExpiredQueryError(); + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 1); + }, + () => { + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + BIGTABLE.request = () => { + return bigtableStream2 as any; + }; + bigtableStream.emit('error', expiredError); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'DrainAndRefreshQueryPlan', + ); + assert.equal(resultStream._stateMachine.retryTimer !== null, true); + assert.equal(preparedStatement.markedAsExpired, true); + // speed up the retry timer + clearTimeout(resultStream._stateMachine.retryTimer); + resultStream._stateMachine.startNextAttempt(); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 2); + preparedStatement.callbacks[1]( + undefined, + 'bytes', + createResultSetMetadata(['f2', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream2.write( + createProtoRows('token1', 111, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream2.emit('end'); + bigtableStream2.emit('close'); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Finished'); + assert.throws(() => { + // we make sure that the column name from the first preparedStatement is not present. + responses[0].get('f1'); + }); + assert.equal(responses[0].get('f2'), 1); + done(); + }, + ], + 1, + ); + }); + + it('query plan expired error after data was recieved', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const bigtableStream2 = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const expiredError = createExpiredQueryError(); + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 1); + }, + () => { + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows(undefined, undefined, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + BIGTABLE.request = () => { + return bigtableStream2 as any; + }; + bigtableStream.emit('error', expiredError); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'DrainAndRefreshQueryPlan', + ); + assert.equal(resultStream._stateMachine.retryTimer !== null, true); + // speed up the retry timer + clearTimeout(resultStream._stateMachine.retryTimer); + resultStream._stateMachine.startNextAttempt(); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 2); + preparedStatement.callbacks[1]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream2.write( + createProtoRows('token1', 111, undefined, {intValue: 2}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream2.emit('end'); + bigtableStream2.emit('close'); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Finished'); + // assert we only got the second response, the first one was discarded + assert.equal(responses.length, 1); + assert.equal(responses[0].get(0), 2); + done(); + }, + ], + 1, + ); + }); + + it('query plan expired error after token', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const expiredError = createExpiredQueryError(); + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + let errorEmitted = false; + const rowsEmitted = 0; + const responses: QueryResultRow[] = []; + resultStream + .on('error', () => { + errorEmitted = true; + }) + .on('data', (row: any) => { + responses.push(row); + }); + + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 1); + }, + () => { + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows('token1', 111, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream.write(expiredError); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Failed'); + assert.equal(responses.length, 1); + assert.equal(responses[0].get(0), 1); + assert.equal(errorEmitted, true); + done(); + }, + ], + 1, + ); + }); + }); + + describe('streamEnding', () => { + it('empty stream', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + let errorEmitted = false; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + let streamEnded = false; + resultStream.on('end', () => { + streamEnded = true; + }); + resultStream.on('error', () => { + errorEmitted = true; + }); + + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 1); + }, + () => { + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.emit('end'); + bigtableStream.emit('close'); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Finished'); + assert.equal(errorEmitted, false); + assert.equal(responses.length, 0); + assert.equal(streamEnded, true); + done(); + }, + ], + 1, + ); + }); + + it('unexpected end after some data before token', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + let errorEmitted = false; + let rowsEmitted = 0; + resultStream + .on('error', () => { + errorEmitted = true; + }) + .on('data', () => { + rowsEmitted += 1; + }); + + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 1); + }, + () => { + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows(undefined, undefined, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.emit('end'); + bigtableStream.emit('close'); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Failed'); + assert.equal(errorEmitted, true); + assert.equal(rowsEmitted, 0); + done(); + }, + ], + 1, + ); + }); + + it('unexpected end before a token', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + let errorEmitted = false; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + resultStream.on('error', () => { + errorEmitted = true; + }); + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 1); + }, + () => { + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows(undefined, undefined, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows('token1', 111, undefined, {intValue: 2}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream.write( + createProtoRows(undefined, undefined, undefined, {intValue: 3}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream.emit('end'); + bigtableStream.emit('close'); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Failed'); + assert.equal(errorEmitted, true); + assert.equal(responses.length, 2); + assert.equal(responses[0].get(0), 1); + assert.equal(responses[1].get(0), 2); + done(); + }, + ], + 1, + ); + }); + + it('empty response - query returned no rows', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + let errorEmitted = false; + let rowsEmitted = 0; + resultStream + .on('error', () => { + errorEmitted = true; + }) + .on('data', () => { + rowsEmitted += 1; + }); + + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 1); + }, + () => { + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows('token1', undefined, undefined), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream.emit('end'); + bigtableStream.emit('close'); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Finished'); + assert.equal(errorEmitted, false); + assert.equal(rowsEmitted, 0); + done(); + }, + ], + 1, + ); + }); + }); + + describe('streamErrors', () => { + it('retryable error before anything', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const bigtableStream2 = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const retryableError = { + code: grpc.status.DEADLINE_EXCEEDED, + message: 'retryable error', + }; + + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + BIGTABLE.request = () => { + return bigtableStream2 as any; + }; + bigtableStream.emit('error', retryableError); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'DrainingBeforeResumeToken', + ); + assert.equal(resultStream._stateMachine.retryTimer !== null, true); + // speed up the retry timer + clearTimeout(resultStream._stateMachine.retryTimer); + resultStream._stateMachine.startNextAttempt(); + }, + () => { + assert.equal(preparedStatement.callbacks.length, 1); // query plan was not refreshed + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream2.write( + createProtoRows(undefined, undefined, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream2.write( + createProtoRows('token', 111, undefined, {intValue: 2}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream2.emit('end'); + bigtableStream2.emit('close'); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Finished'); + assert.equal(responses.length, 2); + assert.equal(responses[0].get(0), 1); + assert.equal(responses[1].get(0), 2); + done(); + }, + ], + 1, + ); + }); + + it('retryable error before token', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const bigtableStream2 = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const retryableError = { + code: grpc.status.DEADLINE_EXCEEDED, + message: 'retryable error', + }; + + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows(undefined, undefined, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + BIGTABLE.request = () => { + return bigtableStream2 as any; + }; + bigtableStream.emit('error', retryableError); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'DrainingBeforeResumeToken', + ); + assert.equal(resultStream._stateMachine.retryTimer !== null, true); + // speed up the retry timer + clearTimeout(resultStream._stateMachine.retryTimer); + resultStream._stateMachine.startNextAttempt(); + }, + () => { + assert.equal(preparedStatement.callbacks.length, 1); // query plan was not refreshed + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream2.write( + createProtoRows(undefined, undefined, undefined, {intValue: 2}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream2.write( + createProtoRows('token', 111, undefined, {intValue: 3}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream2.emit('end'); + bigtableStream2.emit('close'); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Finished'); + assert.equal(responses.length, 2); + // the first message before the retry should have been discarded + assert.equal(responses[0].get(0), 2); + assert.equal(responses[1].get(0), 3); + done(); + }, + ], + 1, + ); + }); + + it('retryable error before token, byteBuffer keeps emitting data', done => { + // in this test we simulate a situation where even though the + // error was emitted, a data event emitted after it. This can + // happen if an event is buffered in the readable part of the byteBuffer + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const bigtableStream2 = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const retryableError = { + code: grpc.status.DEADLINE_EXCEEDED, + message: 'retryable error', + }; + + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + let valuesStream: any = null; + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows(undefined, undefined, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + BIGTABLE.request = () => { + return bigtableStream2 as any; + }; + valuesStream = resultStream._stateMachine.valuesStream; + bigtableStream.emit('error', retryableError); + }, + () => { + // emit data after the error was emitted + valuesStream.emit('data', [ + [ + createProtoRows(undefined, undefined, undefined, {intValue: 2}) + .results?.protoRowsBatch?.batchData, + ], + 'unreachableToken', + ]); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'DrainingBeforeResumeToken', + ); + assert.equal(resultStream._stateMachine.retryTimer !== null, true); + // speed up the retry timer + clearTimeout(resultStream._stateMachine.retryTimer); + resultStream._stateMachine.startNextAttempt(); + }, + () => { + assert.equal(preparedStatement.callbacks.length, 1); // query plan was not refreshed + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream2.write( + createProtoRows(undefined, undefined, undefined, {intValue: 3}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream2.write( + createProtoRows('token', 111, undefined, {intValue: 4}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream2.emit('end'); + bigtableStream2.emit('close'); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Finished'); + assert.equal(responses.length, 2); + // the first message before the retry should have been discarded + assert.equal(responses[0].get(0), 3); + assert.equal(responses[1].get(0), 4); + done(); + }, + ], + 1, + ); + }); + + it('retryable error before token then expire', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const bigtableStream2 = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream2.abort = () => {}; + + const bigtableStream3 = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream3.abort = () => {}; + + const retryableError = { + code: grpc.status.DEADLINE_EXCEEDED, + message: 'retryable error', + }; + + const expiredError = createExpiredQueryError(); + + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows(undefined, undefined, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + BIGTABLE.request = () => { + return bigtableStream2 as any; + }; + bigtableStream.emit('error', retryableError); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'DrainingBeforeResumeToken', + ); + assert.equal(resultStream._stateMachine.retryTimer !== null, true); + // speed up the retry timer + clearTimeout(resultStream._stateMachine.retryTimer); + resultStream._stateMachine.startNextAttempt(); + }, + () => { + assert.equal(preparedStatement.callbacks.length, 1); // query plan was not refreshed + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + BIGTABLE.request = () => { + return bigtableStream3 as any; + }; + bigtableStream2.emit('error', expiredError); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'DrainAndRefreshQueryPlan', + ); + assert.equal(resultStream._stateMachine.retryTimer !== null, true); + // speed up the retry timer + clearTimeout(resultStream._stateMachine.retryTimer); + resultStream._stateMachine.startNextAttempt(); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 2); + preparedStatement.callbacks[1]( + undefined, + 'bytes', + createResultSetMetadata(['f2', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream3.write( + createProtoRows('token1', 111, undefined, {intValue: 2}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + bigtableStream3.emit('end'); + bigtableStream3.emit('close'); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Finished'); + assert.equal(responses.length, 1); + // the first message before the retry should have been discarded + assert.equal(responses[0].get('f2'), 2); + assert.throws(() => { + // we make sure that the column name from the first preparedStatement is not present. + responses[0].get('f1'); + }); + done(); + }, + ], + 1, + ); + }); + + it('retryable error after token then expire', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const bigtableStream2 = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream2.abort = () => {}; + + const bigtableStream3 = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream3.abort = () => {}; + + const retryableError = { + code: grpc.status.DEADLINE_EXCEEDED, + message: 'retryable error', + }; + + const expiredError = createExpiredQueryError(); + + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + let errorEmitted = false; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + resultStream.on('error', () => { + errorEmitted = true; + }); + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows('token1', 111, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + BIGTABLE.request = () => { + return bigtableStream2 as any; + }; + bigtableStream.emit('error', retryableError); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'DrainingAfterResumeToken', + ); + assert.equal(resultStream._stateMachine.retryTimer !== null, true); + // speed up the retry timer + clearTimeout(resultStream._stateMachine.retryTimer); + resultStream._stateMachine.startNextAttempt(); + }, + () => { + assert.equal(preparedStatement.callbacks.length, 1); // query plan was not refreshed + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + BIGTABLE.request = () => { + return bigtableStream3 as any; + }; + bigtableStream2.emit('error', expiredError); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Failed'); + assert.equal(errorEmitted, true); + assert.equal(responses.length, 1); + assert.equal(responses[0].get(0), 1); + done(); + }, + ], + 1, + ); + }); + + it('non-retryable error before token', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const bigtableStream2 = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const nonretryableError = { + code: grpc.status.PERMISSION_DENIED, + message: 'non-retryable error', + }; + + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + let errorEmitted = false; + let rowsEmitted = 0; + resultStream + .on('error', () => { + errorEmitted = true; + }) + .on('data', () => { + rowsEmitted += 1; + }); + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows(undefined, undefined, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + BIGTABLE.request = () => { + return bigtableStream2 as any; + }; + bigtableStream.emit('error', nonretryableError); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Failed'); + assert.equal(errorEmitted, true); + assert.equal(rowsEmitted, 0); + done(); + }, + ], + 1, + ); + }); + + it('non-retryable error after token', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + + const bigtableStream2 = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream2.abort = () => {}; + + const nonretryableError = { + code: grpc.status.PERMISSION_DENIED, + message: 'non-retryable error', + }; + + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + let errorEmitted = false; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + resultStream.on('error', () => { + errorEmitted = true; + }); + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows('token1', 111, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + BIGTABLE.request = () => { + return bigtableStream2 as any; + }; + bigtableStream.emit('error', nonretryableError); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Failed'); + assert.equal(errorEmitted, true); + assert.equal(responses.length, 1); + assert.equal(responses[0].get(0), 1); + done(); + }, + ], + 1, + ); + }); + }); + + describe('timeouts', () => { + it('timeout immediately', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + let errorEmitted = false; + let rowsEmitted = 0; + resultStream + .on('error', () => { + errorEmitted = true; + }) + .on('data', () => { + rowsEmitted += 1; + }); + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + }, + () => { + resultStream._stateMachine.handleTotalTimeout(); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Failed'); + assert.equal(errorEmitted, true); + assert.equal(rowsEmitted, 0); + done(); + }, + ], + 1, + ); + }); + + it('timeout after PQ', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + let errorEmitted = false; + let rowsEmitted = 0; + resultStream + .on('error', () => { + errorEmitted = true; + }) + .on('data', () => { + rowsEmitted += 1; + }); + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 1); + }, + () => { + preparedStatement.callbacks[0](new Error('fetching QP failed!')); + }, + () => { + assert.equal(errorEmitted, false); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 2); + preparedStatement.callbacks[1]( + new Error('fetching QP failed again!'), + ); + }, + () => { + assert.equal(errorEmitted, false); + resultStream._stateMachine.handleTotalTimeout(); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Failed'); + assert.equal(errorEmitted, true); + assert.equal(rowsEmitted, 0); + done(); + }, + ], + 1, + ); + }); + + it('timeout before token', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + let errorEmitted = false; + let rowsEmitted = 0; + resultStream + .on('error', () => { + errorEmitted = true; + }) + .on('data', () => { + rowsEmitted += 1; + }); + + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 1); + }, + () => { + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + resultStream._stateMachine.handleTotalTimeout(); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Failed'); + assert.equal(errorEmitted, true); + assert.equal(rowsEmitted, 0); + done(); + }, + ], + 1, + ); + }); + + it('timeout after token', done => { + const bigtableStream = new PassThrough({ + objectMode: true, + highWaterMark: 0, + }) as any; + bigtableStream.abort = () => {}; + BIGTABLE.request = () => bigtableStream as any; + const preparedStatement = new MockPreparedStatement(); + const resultStream = instance.createExecuteQueryStream({ + preparedStatement, + } as any) as any; + let errorEmitted = false; + const responses: QueryResultRow[] = []; + resultStream.on('data', (row: any) => { + responses.push(row); + }); + resultStream.on('error', () => { + errorEmitted = true; + }); + + performCallbacks( + [ + () => { + clearTimeout(resultStream._stateMachine.timeoutTimer); + assert.equal(resultStream._stateMachine.state, 'AwaitingQueryPlan'); + assert.equal(preparedStatement.callbacks.length, 1); + }, + () => { + preparedStatement.callbacks[0]( + undefined, + 'bytes', + createResultSetMetadata(['f1', pbType({int64Type: {}})]), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'BeforeFirstResumeToken', + ); + bigtableStream.write( + createProtoRows('token1', 111, undefined, {intValue: 1}), + ); + }, + () => { + assert.equal( + resultStream._stateMachine.state, + 'AfterFirstResumeToken', + ); + resultStream._stateMachine.handleTotalTimeout(); + }, + () => { + assert.equal(resultStream._stateMachine.state, 'Failed'); + assert.equal(errorEmitted, true); + assert.equal(responses.length, 1); + assert.equal(responses[0].get(0), 1); + done(); + }, + ], + 1, + ); + }); + }); +}); + +describe('Bigtable/ExecuteQueryPreparedStatementObject', () => { + const INSTANCE_ID = 'my-instance'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const BIGTABLE = { + projectName: 'projects/my-project', + projectId: 'my-project', + request: () => {}, + } as Bigtable; + + let clock: sinon.SinonFakeTimers; + + beforeEach(() => { + clock = sinon.useFakeTimers({ + toFake: ['setTimeout', 'clearTimeout', 'Date'], + }); + }); + + afterEach(() => { + clock.restore(); + sandbox.restore(); + }); + + describe('happy_path', () => { + it('getting prepared query plan', done => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + {a: SqlTypes.Int64()}, + ); + preparedStatement.getData((err, pqBytes, metadata) => { + assert.equal(err, undefined); + assert.equal(pqBytes, 'xd'); + assert.equal(metadata?.get('f').type, 'int64'); + done(); + }, 1000); + clock.runAll(); + }); + + it('getting prepared query plan close to validUntil', done => { + const resp = createPrepareQueryResponse(['f', pbType({int64Type: {}})]); + let pqRequestCb = null; + let requestCounter = 0; + (BIGTABLE as any).request = (req: any, cb: any) => { + requestCounter += 1; + pqRequestCb = cb; + }; + const someTimestamp = 1740000000; + resp.validUntil = google.protobuf.Timestamp.create({ + seconds: someTimestamp / 1000, + nanos: 0, + }); + const preparedStatement = new PreparedStatement( + BIGTABLE, + resp, + {} as any, + { + a: SqlTypes.Int64(), + }, + ); + // Set the time to 100 ms after the "should-refresh" point in time + clock.setSystemTime(someTimestamp - SHOULD_REFRESH_SOON_PERIOD_MS + 100); + let getDataCalls = 0; + const doneAfterGetData = () => { + getDataCalls += 1; + if (getDataCalls > 1) { + // assert only one request was made. + assert.equal(requestCounter, 1); + done(); + } + }; + preparedStatement.getData((err, pqBytes, metadata) => { + assert.equal(err, undefined); + assert.equal(pqBytes, 'xd'); + assert.equal(metadata?.get('f').type, 'int64'); + doneAfterGetData(); + }, 1000); + clock.runAll(); + + // refresh is scheduled + assert.equal(pqRequestCb !== null, true); + + // both getData calls should get the old value before the refresh finishes + preparedStatement.getData((err, pqBytes, metadata) => { + assert.equal(err, undefined); + assert.equal(pqBytes, 'xd'); + assert.equal(metadata?.get('f').type, 'int64'); + doneAfterGetData(); + }, 1000); + clock.runAll(); + }); + + it('getting prepared query plan past validUntil', done => { + const resp = createPrepareQueryResponse(['f', pbType({int64Type: {}})]); + const someTimestamp = 1740000000; + resp.validUntil = google.protobuf.Timestamp.create({ + seconds: someTimestamp / 1000, + nanos: 0, + }); + const preparedStatement = new PreparedStatement( + BIGTABLE, + resp, + {} as any, + { + a: SqlTypes.Int64(), + }, + ); + // Set the time to 100 ms after the "validUntil" point in time + clock.setSystemTime(someTimestamp + 100); + preparedStatement.getData((err, pqBytes, metadata) => { + assert.equal(err, undefined); + assert.equal(pqBytes, 'xd'); + assert.equal(metadata?.get('f').type, 'int64'); + done(); + }, 1000); + clock.runAll(); + }); + + it('multiple getData calls result in only one request', done => { + const originalResp = createPrepareQueryResponse([ + 'f1', + pbType({int64Type: {}}), + ]); + const secondResp = createPrepareQueryResponse([ + 'f2', + pbType({int64Type: {}}), + ]); + let pqRequestCb = null; + let requestCounter = 0; + (BIGTABLE as any).request = (req: any, cb: any) => { + requestCounter += 1; + pqRequestCb = cb; + }; + const someTimestamp = 1740000000; + originalResp.validUntil = google.protobuf.Timestamp.create({ + seconds: someTimestamp / 1000, + nanos: 0, + }); + const preparedStatement = new PreparedStatement( + BIGTABLE, + originalResp, + {} as any, + { + a: SqlTypes.Int64(), + }, + ); + // Set the time to 100 ms after the "should-refresh" point in time + clock.setSystemTime(someTimestamp - SHOULD_REFRESH_SOON_PERIOD_MS + 100); + preparedStatement.getData((err, pqBytes, metadata) => { + assert.equal(err, undefined); + assert.equal(pqBytes, 'xd'); + assert.equal(metadata?.get('f1').type, 'int64'); + }, 1000); + clock.runAll(); + + // refresh is scheduled + assert.equal(pqRequestCb !== null, true); + + // second getData call + preparedStatement.getData((err, pqBytes, metadata) => { + assert.equal(err, undefined); + assert.equal(pqBytes, 'xd'); + assert.equal(metadata?.get('f1').type, 'int64'); + }, 1000); + clock.runAll(); + + // assert only one request was made even though getData was called twice + assert.equal(requestCounter, 1); + + // Bigtable returns the prepareQuery response + pqRequestCb!(null, secondResp); + + preparedStatement.getData((err, pqBytes, metadata) => { + assert.equal(err, undefined); + assert.equal(pqBytes, 'xd'); + assert.equal(metadata?.get('f2').type, 'int64'); + assert.throws(() => { + // we make sure that the column name from the first preparedStatement is not present. + metadata?.get('f1'); + }); + }, 1000); + clock.runAll(); + done(); + }); + }); + + describe('other_cases', () => { + it('getting data after expiration hangs', done => { + const resp = createPrepareQueryResponse(['f', pbType({int64Type: {}})]); + const preparedStatement = new PreparedStatement( + BIGTABLE, + resp, + {} as any, + { + a: SqlTypes.Int64(), + }, + ); + (BIGTABLE as any).request = (req: any, cb: any) => cb(null, resp); + + preparedStatement.markAsExpired(); + assert.equal(preparedStatement.isExpired(), true); + assert.equal((preparedStatement as any).isRefreshing, false); + assert.equal((preparedStatement as any).timer, null); + + let callbackCalled = false; + preparedStatement.getData((err, pqBytes, metadata) => { + callbackCalled = true; + assert.equal(err, undefined); + assert.equal(pqBytes, 'xd'); + assert.equal(metadata?.get('f').type, 'int64'); + }, 1000); + + // getData scheduled getting the query plan immediately after + assert.equal((preparedStatement as any).timer !== null, true); + assert.equal(callbackCalled, false); + clock.tick(1); + assert.equal((preparedStatement as any).timer, null); + assert.equal(callbackCalled, true); + done(); + }); + + it('plan expired during getData callback', done => { + const resp = createPrepareQueryResponse(['f', pbType({int64Type: {}})]); + const preparedStatement = new PreparedStatement( + BIGTABLE, + resp, + {} as any, + { + a: SqlTypes.Int64(), + }, + ); + (BIGTABLE as any).request = (req: any, cb: any) => cb(null, resp); + + preparedStatement.markAsExpired(); + assert.equal(preparedStatement.isExpired(), true); + assert.equal((preparedStatement as any).isRefreshing, false); + assert.equal((preparedStatement as any).timer, null); + + let callbackCalled = false; + preparedStatement.getData((err, pqBytes, metadata) => { + callbackCalled = true; + assert.equal(err, undefined); + assert.equal(pqBytes, 'xd'); + assert.equal(metadata?.get('f').type, 'int64'); + preparedStatement.markAsExpired(); + }, 1000); + + // this callback gets served second. It will get an error + // because the query got expired between the last refresh and serving of this callback + preparedStatement.getData((err, pqBytes, metadata) => { + assert.equal(callbackCalled, true); + assert.equal(pqBytes, undefined); + assert.equal(metadata, undefined); + assert.equal(err?.message, 'Getting a fresh query plan failed.'); + }, 1000); + + // getData scheduled getting the query plan immediately after + assert.equal((preparedStatement as any).timer !== null, true); + assert.equal(callbackCalled, false); + clock.tick(1); + assert.equal((preparedStatement as any).timer, null); + assert.equal(callbackCalled, true); + done(); + }); + + it('plan refresh failed', done => { + const resp = createPrepareQueryResponse(['f', pbType({int64Type: {}})]); + const preparedStatement = new PreparedStatement( + BIGTABLE, + resp, + {} as any, + { + a: SqlTypes.Int64(), + }, + ); + (BIGTABLE as any).request = (req: any, cb: any) => + cb(new Error('Problem')); + + preparedStatement.markAsExpired(); + assert.equal(preparedStatement.isExpired(), true); + assert.equal((preparedStatement as any).isRefreshing, false); + assert.equal((preparedStatement as any).timer, null); + + let callbackCalled = false; + preparedStatement.getData((err, pqBytes, metadata) => { + callbackCalled = true; + assert.equal(pqBytes, undefined); + assert.equal(metadata, undefined); + assert.equal(err?.message, 'Problem'); + }, 1000); + + assert.equal(callbackCalled, false); + clock.tick(1); + assert.equal((preparedStatement as any).timer, null); + assert.equal(callbackCalled, true); + done(); + }); + }); +}); diff --git a/handwritten/bigtable/test/family.ts b/handwritten/bigtable/test/family.ts new file mode 100644 index 00000000000..afaed9b94c5 --- /dev/null +++ b/handwritten/bigtable/test/family.ts @@ -0,0 +1,546 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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 promisify from '@google-cloud/promisify'; +import * as assert from 'assert'; +import {before, beforeEach, afterEach, describe, it} from 'mocha'; +import * as proxyquire from 'proxyquire'; +import * as sinon from 'sinon'; +import {google} from '../protos/protos'; +import * as fm from '../src/family'; +import {Table} from '../src/table'; + +let promisified = false; +const fakePromisify = Object.assign({}, promisify, { + promisifyAll(klass: Function) { + if (klass.name === 'Family') { + promisified = true; + } + }, +}); + +const sandbox = sinon.createSandbox(); + +describe('Bigtable/Family', () => { + const FAMILY_ID = 'family-test'; + const TABLE = { + bigtable: { + request: () => {}, + }, + id: 'my-table', + name: 'projects/my-project/instances/my-inststance/tables/my-table', + getFamilies: () => {}, + createFamily: () => {}, + } as {} as Table; + + const FAMILY_NAME = `${TABLE.name}/columnFamilies/${FAMILY_ID}`; + let Family: typeof fm.Family; + let family: fm.Family; + let FamilyError: typeof fm.FamilyError; + + before(() => { + const Fake = proxyquire('../src/family.js', { + '@google-cloud/promisify': fakePromisify, + }); + Family = Fake.Family; + FamilyError = Fake.FamilyError; + }); + + beforeEach(() => { + family = new Family(TABLE, FAMILY_NAME); + }); + + afterEach(() => sandbox.restore()); + + describe('instantiation', () => { + it('should promisify all the things', () => { + assert(promisified); + }); + + it('should localize the Bigtable instance', () => { + assert.strictEqual(family.bigtable, TABLE.bigtable); + }); + + it('should localize the Table instance', () => { + assert.strictEqual(family.table, TABLE); + }); + + it('should localize the full resource path', () => { + assert.strictEqual(family.id, FAMILY_ID); + }); + + it('should extract the family name', () => { + const family = new Family(TABLE, FAMILY_ID); + assert.strictEqual(family.name, FAMILY_NAME); + }); + + it('should leave full family names unaltered and localize the id from the name', () => { + const family = new Family(TABLE, FAMILY_NAME); + assert.strictEqual(family.name, FAMILY_NAME); + assert.strictEqual(family.id, FAMILY_ID); + }); + + it('should throw if family id in wrong format', () => { + const id = `/project/bad-project/instances/bad-instance/columnFamiles/${FAMILY_ID}`; + assert.throws(() => { + new Family(TABLE, id); + }, Error); + }); + }); + + describe('formatRule_', () => { + it('should capture the max age option', () => { + const originalRule = { + age: 10, + }; + const rule = Family.formatRule_(originalRule); + assert.deepStrictEqual(rule, { + maxAge: originalRule.age, + }); + }); + + it('should capture the max number of versions option', () => { + const originalRule = { + versions: 10, + }; + const rule = Family.formatRule_(originalRule); + assert.deepStrictEqual(rule, { + maxNumVersions: originalRule.versions, + }); + }); + + it('should create a union rule', () => { + const originalRule = { + age: 10, + versions: 2, + union: true, + }; + const rule = Family.formatRule_(originalRule); + assert.deepStrictEqual(rule, { + union: { + rules: [ + { + maxAge: originalRule.age, + }, + { + maxNumVersions: originalRule.versions, + }, + ], + }, + }); + }); + + it('should create an intersecting rule', () => { + const originalRule = { + age: 10, + versions: 2, + }; + const rule = Family.formatRule_(originalRule); + assert.deepStrictEqual(rule, { + intersection: { + rules: [ + { + maxAge: originalRule.age, + }, + { + maxNumVersions: originalRule.versions, + }, + ], + }, + }); + }); + + it('should allow nested rules', () => { + const originalRule = { + age: 10, + rule: {age: 30, versions: 2}, + union: true, + }; + const rule = Family.formatRule_(originalRule); + assert.deepStrictEqual(rule, { + union: { + rules: [ + {maxAge: originalRule.age}, + { + intersection: { + rules: [ + {maxAge: originalRule.rule.age}, + {maxNumVersions: originalRule.rule.versions}, + ], + }, + }, + ], + }, + }); + }); + + it('should throw if union only has one rule', () => { + assert.throws(() => { + Family.formatRule_({age: 10, union: true}); + }, /A union must have more than one garbage collection rule\./); + }); + + it('should throw if no rules are provided', () => { + assert.throws(() => { + Family.formatRule_({}); + }, /No garbage collection rules were specified\./); + }); + }); + + describe('create', () => { + it('should call createFamily from table', done => { + const options = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (family as any).table.createFamily = ( + id: string, + options_: {}, + callback: Function, + ) => { + assert.strictEqual(id, family.id); + assert.strictEqual(options_, options); + callback(); // done() + }; + family.create(options, done); + }); + + it('should not require options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (family as any).table.createFamily = ( + name: string, + options: {}, + callback: Function, + ) => { + assert.deepStrictEqual(options, {}); + callback(); // done() + }; + family.create(done); + }); + }); + + describe('delete', () => { + it('should make the correct request', done => { + sandbox.stub(family.bigtable, 'request').callsFake((config, callback) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'modifyColumnFamilies'); + assert.deepStrictEqual(config.reqOpts, { + name: family.table.name, + modifications: [ + { + id: family.id, + drop: true, + }, + ], + }); + assert.deepStrictEqual(config.gaxOpts, {}); + callback!(null); // done() + }); + family.delete(done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + sandbox.stub(family.bigtable, 'request').callsFake(config => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }); + family.delete(gaxOptions, assert.ifError); + }); + }); + + describe('exists', () => { + it('should not require gaxOptions', done => { + sandbox.stub(family, 'getMetadata').callsFake(gaxOptions => { + assert.deepStrictEqual(gaxOptions, {}); + done(); + }); + family.exists(assert.ifError); + }); + + it('should pass gaxOptions to getMetadata', done => { + const gaxOptions = {}; + sandbox.stub(family, 'getMetadata').callsFake(gaxOptions_ => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }); + family.exists(gaxOptions, assert.ifError); + }); + + it('should return false if FamilyError', done => { + const error = new FamilyError('Error.'); + sandbox.stub(family, 'getMetadata').callsArgWith(1, error); + family.exists((err, exists) => { + assert.ifError(err); + assert.strictEqual(exists, false); + done(); + }); + }); + + it('should return error if not FamilyError', done => { + const error = new Error('Error.'); + sandbox.stub(family, 'getMetadata').callsArgWith(1, error); + family.exists(err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return true if no error', done => { + sandbox.stub(family, 'getMetadata').callsArgWith(1, null, {}); + family.exists((err, exists) => { + assert.ifError(err); + assert.strictEqual(exists, true); + done(); + }); + }); + }); + + describe('get', () => { + it('should call getMetadata', done => { + const options = { + gaxOptions: {}, + }; + sandbox.stub(family, 'getMetadata').callsFake(gaxOptions => { + assert.strictEqual(gaxOptions, options.gaxOptions); + done(); + }); + family.get(options, assert.ifError); + }); + + it('should not require an options object', done => { + sandbox.stub(family, 'getMetadata').callsFake(gaxOptions => { + assert.deepStrictEqual(gaxOptions, undefined); + done(); + }); + family.get(assert.ifError); + }); + + it('should auto create with a FamilyError error', done => { + const error = new FamilyError(TABLE.id); + const options = { + autoCreate: true, + gaxOptions: {}, + }; + sandbox.stub(family, 'getMetadata').callsArgOnWith(1, error); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (family as any).create = (options_: any, callback: Function) => { + assert.strictEqual(options_.gaxOptions, options.gaxOptions); + callback(); + }; + family.get(options, done); + }); + + it('should pass the rules when auto creating', done => { + const error = new FamilyError(TABLE.id); + const options = { + autoCreate: true, + rule: { + versions: 1, + }, + }; + sandbox.stub(family, 'getMetadata').callsArgWith(1, error); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (family as any).create = (options_: {}, callback: Function) => { + assert.deepStrictEqual(options.rule, {versions: 1}); + callback(); + }; + family.get(options, done); + }); + + it('should not auto create without a FamilyError error', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const error: any = new Error('Error.'); + error.code = 'NOT-5'; + const options = { + autoCreate: true, + }; + sandbox.stub(family, 'getMetadata').callsArgWith(1, error); + family.create = () => { + throw new Error('Should not create.'); + }; + family.get(options, err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should not auto create unless requested', done => { + const error = new FamilyError(TABLE.id); + sandbox.stub(family, 'getMetadata').callsArgWith(1, error); + family.create = () => { + throw new Error('Should not create.'); + }; + family.get(err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return an error from getMetadata', done => { + const error = new Error('Error.'); + sandbox.stub(family, 'getMetadata').callsArgWith(1, error); + family.get(err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return self and API response', done => { + const apiResponse = {}; + sandbox.stub(family, 'getMetadata').callsArgWith(1, null, apiResponse); + family.get((err, family_, apiResponse_) => { + assert.ifError(err); + assert.strictEqual(family_, family); + assert.strictEqual(apiResponse_, apiResponse); + done(); + }); + }); + }); + + describe('getMetadata', () => { + it('should accept gaxOptions', done => { + const gaxOptions = {}; + sandbox.stub(family.table, 'getFamilies').callsFake(gaxOptions_ => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }); + family.getMetadata(gaxOptions, assert.ifError); + }); + + it('should return an error to the callback', done => { + const err = new Error('err'); + const response = {}; + sandbox + .stub(family.table, 'getFamilies') + .callsArgWith(1, err, null, response); + family.getMetadata(err_ => { + assert.strictEqual(err, err_); + done(); + }); + }); + + it('should update the metadata', done => { + const family = new Family(TABLE, FAMILY_NAME); + family.metadata = { + a: 'a', + b: 'b', + } as google.bigtable.admin.v2.IColumnFamily; + sandbox.stub(family.table, 'getFamilies').callsArgWith(1, null, [family]); + family.getMetadata((err, metadata) => { + assert.ifError(err); + assert.strictEqual(metadata, family.metadata); + done(); + }); + }); + + it('should return a custom error if no results', done => { + sandbox.stub(family.table, 'getFamilies').callsArgWith(1, null, []); + family.getMetadata(err => { + assert(err instanceof FamilyError); + done(); + }); + }); + }); + + describe('setMetadata', () => { + it('should provide the proper request options', done => { + sandbox.stub(family.bigtable, 'request').callsFake(config => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'modifyColumnFamilies'); + assert.strictEqual(config.reqOpts.name, TABLE.name); + assert.deepStrictEqual(config.reqOpts.modifications, [ + { + id: FAMILY_ID, + update: {}, + }, + ]); + done(); + }); + family.setMetadata({}, assert.ifError); + }); + + it('should respect the gc rule option', done => { + const formatRule = Family.formatRule_; + + const formattedRule = { + a: 'a', + b: 'b', + } as fm.IGcRule; + + const metadata = { + rule: { + c: 'c', + d: 'd', + }, + } as fm.SetFamilyMetadataOptions; + sandbox.stub(Family, 'formatRule_').callsFake(rule => { + assert.strictEqual(rule, metadata.rule); + return formattedRule; + }); + sandbox.stub(family.bigtable, 'request').callsFake(config => { + assert.deepStrictEqual(config.reqOpts, { + name: TABLE.name, + modifications: [ + { + id: family.id, + update: { + gcRule: formattedRule, + }, + }, + ], + }); + Family.formatRule_ = formatRule; + done(); + }); + family.setMetadata(metadata, assert.ifError); + }); + + it('should return an error to the callback', done => { + const error = new Error('err'); + sandbox.stub(family.bigtable, 'request').callsArgWith(1, error); + family.setMetadata({}, err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should update the metadata property', done => { + const fakeMetadata = {}; + const response = { + columnFamilies: { + 'family-test': fakeMetadata, + }, + }; + sandbox.stub(family.bigtable, 'request').callsArgWith(1, null, response); + family.setMetadata({}, (err, metadata, apiResponse) => { + assert.ifError(err); + assert.strictEqual(metadata, fakeMetadata); + assert.strictEqual(family.metadata, fakeMetadata); + assert.strictEqual(apiResponse, response); + done(); + }); + }); + }); + + describe('FamilyError', () => { + it('should set the code and message', () => { + const err = new FamilyError(FAMILY_NAME); + + assert.strictEqual(err.code, 404); + assert.strictEqual( + err.message, + 'Column family not found: ' + FAMILY_NAME + '.', + ); + }); + }); +}); diff --git a/handwritten/bigtable/test/filter.ts b/handwritten/bigtable/test/filter.ts new file mode 100644 index 00000000000..d2dc9fbaed7 --- /dev/null +++ b/handwritten/bigtable/test/filter.ts @@ -0,0 +1,629 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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 assert from 'assert'; +import {afterEach, before, beforeEach, describe, it} from 'mocha'; +import * as proxyquire from 'proxyquire'; +import * as sinon from 'sinon'; +import * as fr from '../src/filter'; +import {Row} from '../src/row'; + +const sandbox = sinon.createSandbox(); + +const FakeMutation = { + convertToBytes: sandbox.spy(value => { + return value; + }), + createTimeRange: sandbox.stub(), +}; + +describe('Bigtable/Filter', () => { + let Filter: typeof fr.Filter; + let FilterError: typeof fr.FilterError; + let filter: fr.Filter; + + before(() => { + const Fake = proxyquire('../src/filter', { + './mutation.js': {Mutation: FakeMutation}, + }); + Filter = Fake.Filter; + FilterError = Fake.FilterError; + }); + + beforeEach(() => { + filter = new Filter(); + }); + + afterEach(() => { + sandbox.restore(); + }); + + describe('instantiation', () => { + it('should create an empty array of filters', () => { + assert.deepStrictEqual(filter.filters_, []); + }); + }); + + describe('convertToRegExpString', () => { + it('should convert a RegExp to a string', () => { + const str = Filter.convertToRegExpString(/\d+/); + assert.strictEqual(str, '\\d+'); + }); + + it('should convert an Array of strings to a single string', () => { + const things = ['a', 'b', 'c']; + const str = Filter.convertToRegExpString(things); + assert.strictEqual(str, '(a|b|c)'); + }); + + it('should convert an Array of buffers to a single string', () => { + const faces = [Buffer.from('.|.'), Buffer.from('=|=')]; + const str = Filter.convertToRegExpString(faces); + assert.strictEqual(str, '(\\.\\|\\.|=\\|=)'); + }); + + it('should not do anything to a string', () => { + const str1 = 'hello'; + const str2 = Filter.convertToRegExpString(str1); + assert.strictEqual(str1, str2); + }); + + it('should convert a number to a string', () => { + const str = Filter.convertToRegExpString(1); + assert.strictEqual(str, '1'); + }); + + it('should not do anything to a buffer', () => { + const str1 = 'hello'; + const buffer = Buffer.from(str1); + const str2 = Filter.convertToRegExpString(buffer); + assert.deepStrictEqual(buffer, str2); + }); + + it('should use a binary encoding on a non utf8 buffer', () => { + const str1 = 'æ'; + const buffer = Buffer.from('æ', 'binary'); + const str2 = Filter.convertToRegExpString(buffer).toString('binary'); + assert.strictEqual(str1, str2); + }); + + it('should throw an error for unknown types', () => { + const errorReg = /Can't convert to RegExp String from unknown type\./; + assert.throws(() => { + Filter.convertToRegExpString(true as {} as string); + }, errorReg); + }); + }); + + describe('createRange', () => { + it('should create a range object', () => { + const start = 'a' as fr.BoundData; + const end = 'b' as fr.BoundData; + const key = 'Key'; + const range = Filter.createRange(start, end, key); + assert.deepStrictEqual(range, { + startKeyClosed: start, + endKeyClosed: end, + }); + }); + + it('should only create start bound', () => { + const start = 'a' as fr.BoundData; + const key = 'Key'; + const range = Filter.createRange(start, null, key); + assert(FakeMutation.convertToBytes.calledWithExactly(start)); + assert.deepStrictEqual(range, { + startKeyClosed: start, + }); + }); + + it('should only create an end bound', () => { + const end = 'b' as fr.BoundData; + const key = 'Key'; + const range = Filter.createRange(null, end, key); + assert(FakeMutation.convertToBytes.calledWithExactly(end)); + assert.deepStrictEqual(range, { + endKeyClosed: end, + }); + }); + + it('should optionally accept inclusive flags', () => { + const start = { + value: 'a', + inclusive: false, + }; + + const end = { + value: 'b', + inclusive: false, + }; + + const key = 'Key'; + + const range = Filter.createRange(start, end, key); + + assert.deepStrictEqual(range, { + startKeyOpen: start.value, + endKeyOpen: end.value, + }); + }); + }); + + describe('parse', () => { + it('should call each individual filter method', () => { + sandbox.spy(Filter.prototype, 'row'); + sandbox.spy(Filter.prototype, 'value'); + const fakeFilter = [ + { + row: 'a', + }, + { + value: 'b', + }, + ]; + Filter.parse(fakeFilter); + assert.strictEqual((Filter.prototype.row as sinon.SinonSpy).callCount, 1); + assert((Filter.prototype.row as sinon.SinonSpy).calledWithExactly('a')); + assert.strictEqual( + (Filter.prototype.value as sinon.SinonSpy).callCount, + 1, + ); + assert((Filter.prototype.value as sinon.SinonSpy).calledWithExactly('b')); + }); + + it('should throw an error for unknown filters', () => { + const fakeFilter = [ + { + wat: 'a', + }, + ]; + + assert.throws(Filter.parse.bind(null, fakeFilter), FilterError); + }); + + it('should return the filter in JSON form', () => { + const fakeProto = {a: 'a'}; + const fakeFilter = [ + { + column: 'a', + }, + ]; + const stub = sandbox.stub(Filter.prototype, 'toProto').returns(fakeProto); + const parsedFilter = Filter.parse(fakeFilter); + assert.strictEqual(parsedFilter, fakeProto); + assert.strictEqual( + (Filter.prototype.toProto as sinon.SinonSpy).callCount, + 1, + ); + stub.restore(); + }); + }); + + describe('all', () => { + it('should create a pass all filter when set to true', done => { + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'passAllFilter'); + assert.strictEqual(value, true); + done(); + }; + + filter.all(true); + }); + + it('should create a block all filter when set to false', done => { + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'blockAllFilter'); + assert.strictEqual(value, true); + done(); + }; + + filter.all(false); + }); + }); + + describe('column', () => { + it('should set the column qualifier regex filter', done => { + const column = { + name: 'fake-column', + }; + + const spy = sandbox.stub(Filter, 'convertToRegExpString').returnsArg(0); + + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'columnQualifierRegexFilter'); + assert.strictEqual(value, column.name); + assert(spy.calledWithExactly(column.name)); + assert(FakeMutation.convertToBytes.calledWithExactly(column.name)); + spy.restore(); + done(); + }; + + filter.column(column); + }); + + it('should handle a binary encoded buffer regex filter', done => { + const column = { + name: Buffer.from('æ', 'binary'), + }; + + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'columnQualifierRegexFilter'); + assert.deepStrictEqual(value, column.name); + assert(FakeMutation.convertToBytes.calledWithExactly(column.name)); + done(); + }; + + filter.column(column); + }); + + it('should accept the short-hand version of column', done => { + const column = 'fake-column'; + + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'columnQualifierRegexFilter'); + assert.strictEqual(value, column); + done(); + }; + + filter.column(column); + }); + + it('should accept the cells per column limit filter', done => { + const column = { + cellLimit: 10, + }; + + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'cellsPerColumnLimitFilter'); + assert.strictEqual(value, column.cellLimit); + done(); + }; + + filter.column(column); + }); + + it('should accept the column range filter', done => { + const fakeRange = { + a: 'a', + b: 'b', + }; + const column = { + start: 'a' as fr.BoundData, + end: 'b' as fr.BoundData, + }; + const spy = sandbox.stub(Filter, 'createRange').returns(fakeRange); + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'columnRangeFilter'); + assert.strictEqual(value, fakeRange); + assert(spy.calledWithExactly(column.start, column.end, 'Qualifier')); + spy.restore(); + done(); + }; + filter.column(column); + }); + }); + + describe('condition', () => { + it('should create a condition filter', done => { + const condition = { + test: {a: 'a'}, + pass: {b: 'b'}, + fail: {c: 'c'}, + }; + const spy = sandbox.stub(Filter, 'parse').returnsArg(0); + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'condition'); + assert.deepStrictEqual(value, { + predicateFilter: condition.test, + trueFilter: condition.pass, + falseFilter: condition.fail, + }); + assert.strictEqual(spy.getCall(0).args[0], condition.test); + assert.strictEqual(spy.getCall(1).args[0], condition.pass); + assert.strictEqual(spy.getCall(2).args[0], condition.fail); + spy.restore(); + done(); + }; + filter.condition(condition); + }); + }); + + describe('family', () => { + it('should create a family name regex filter', done => { + const familyName = 'fake-family'; + const spy = sandbox.stub(Filter, 'convertToRegExpString').returnsArg(0); + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'familyNameRegexFilter'); + assert.strictEqual(value, familyName); + assert(spy.calledWithExactly(familyName)); + spy.restore(); + done(); + }; + filter.family(familyName); + }); + }); + + describe('interleave', () => { + it('should create an interleave filter', done => { + const fakeFilters = [{}, {}, {}]; + + const spy = sandbox.stub(Filter, 'parse').returnsArg(0); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + filter.set = (filterName, value: any) => { + assert.strictEqual(filterName, 'interleave'); + assert.strictEqual(value.filters[0], fakeFilters[0]); + assert.strictEqual(value.filters[1], fakeFilters[1]); + assert.strictEqual(value.filters[2], fakeFilters[2]); + assert.strictEqual(spy.getCall(0).args[0], fakeFilters[0]); + assert.strictEqual(spy.getCall(1).args[0], fakeFilters[1]); + assert.strictEqual(spy.getCall(2).args[0], fakeFilters[2]); + spy.restore(); + done(); + }; + + filter.interleave(fakeFilters); + }); + }); + + describe('label', () => { + it('should apply the label transformer', done => { + const label = 'label'; + + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'applyLabelTransformer'); + assert.strictEqual(value, label); + done(); + }; + + filter.label(label); + }); + }); + + describe('row', () => { + it('should apply the row key regex filter', done => { + const row = { + key: 'gwashinton', + }; + const convertedKey = 'abcd'; + + const spy = sandbox + .stub(Filter, 'convertToRegExpString') + .returns(convertedKey); + + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'rowKeyRegexFilter'); + assert.strictEqual(value, convertedKey); + assert(spy.calledWithExactly(row.key)); + assert(FakeMutation.convertToBytes.calledWithExactly(convertedKey)); + spy.restore(); + done(); + }; + + filter.row(row); + }); + + it('should accept the short-hand version of row key', done => { + const rowKey = 'gwashington'; + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'rowKeyRegexFilter'); + assert.strictEqual(value, rowKey); + done(); + }; + filter.row(rowKey); + }); + + it('should set the row sample filter', done => { + const row = { + sample: 10, + }; + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'rowSampleFilter'); + assert.strictEqual(value, row.sample); + done(); + }; + filter.row(row as {} as Row); + }); + + it('should set the cells per row offset filter', done => { + const row = { + cellOffset: 10, + }; + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'cellsPerRowOffsetFilter'); + assert.strictEqual(value, row.cellOffset); + done(); + }; + filter.row(row); + }); + + it('should set the cells per row limit filter', done => { + const row = { + cellLimit: 10, + }; + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'cellsPerRowLimitFilter'); + assert.strictEqual(value, row.cellLimit); + done(); + }; + filter.row(row); + }); + }); + + describe('set', () => { + it('should create a filter object', () => { + const key = 'notARealFilter'; + const value = {a: 'b'}; + filter.set(key, value); + assert.strictEqual(filter.filters_[0][key], value); + }); + }); + + describe('sink', () => { + it('should set the sink filter', done => { + const sink = true; + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'sink'); + assert.strictEqual(value, sink); + done(); + }; + filter.sink(sink); + }); + }); + + describe('time', () => { + it('should set the timestamp range filter', done => { + const fakeTimeRange = { + start: 10, + end: 10, + }; + const spy = FakeMutation.createTimeRange.returns(fakeTimeRange); + filter.set = (filterName, value) => { + assert.strictEqual(filterName, 'timestampRangeFilter'); + assert.strictEqual(value, fakeTimeRange); + assert(spy.calledWithExactly(fakeTimeRange.start, fakeTimeRange.end)); + done(); + }; + filter.time(fakeTimeRange); + }); + }); + + describe('toProto', () => { + it('should return null when no filters are present', () => { + const filter = new Filter(); + const filterProto = filter.toProto(); + assert.strictEqual(filterProto, null); + }); + + it('should return a plain filter if there is only 1', () => { + filter.filters_ = [{}]; + const filterProto = filter.toProto(); + assert.strictEqual(filterProto, filter.filters_[0]); + }); + + it('should create a chain filter if there are multiple', () => { + filter.filters_ = [{}, {}]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const filterProto = filter.toProto() as any; + assert.strictEqual(filterProto!.chain.filters, filter.filters_); + }); + }); + + describe('value', () => { + it('should set the value regex filter', done => { + const value = { + value: 'fake-value', + }; + const fakeRegExValue = 'abcd'; + const fakeConvertedValue = 'dcba'; + + const regSpy = sandbox + .stub(Filter, 'convertToRegExpString') + .returns(fakeRegExValue); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const bytesSpy = ((FakeMutation as any).convertToBytes = sandbox.spy( + () => { + return fakeConvertedValue; + }, + )); + + filter.set = (filterName, val) => { + assert.strictEqual(filterName, 'valueRegexFilter'); + assert.strictEqual(fakeConvertedValue, val); + assert(regSpy.calledWithExactly(value.value)); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + assert((bytesSpy as any).calledWithExactly(fakeRegExValue)); + regSpy.restore(); + done(); + }; + + filter.value(value); + }); + + it('should accept the short-hand version of value', done => { + const value = 'fake-value'; + + const fakeRegExValue = 'abcd'; + const fakeConvertedValue = 'dcba'; + + const regSpy = sandbox + .stub(Filter, 'convertToRegExpString') + .returns(fakeRegExValue); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const bytesSpy = ((FakeMutation.convertToBytes as any) = sandbox.spy( + () => { + return fakeConvertedValue; + }, + )); + + filter.set = (filterName, val) => { + assert.strictEqual(filterName, 'valueRegexFilter'); + assert.strictEqual(fakeConvertedValue, val); + assert(regSpy.calledWithExactly(value)); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + assert((bytesSpy as any).calledWithExactly(fakeRegExValue)); + regSpy.restore(); + done(); + }; + + filter.value(value); + }); + + it('should accept the value range filter', done => { + const fakeRange = { + a: 'a', + b: 'b', + }; + const value = { + start: 'a' as fr.BoundData, + end: 'b' as fr.BoundData, + }; + const spy = sandbox.stub(Filter, 'createRange').returns(fakeRange); + filter.set = (filterName, val) => { + assert.strictEqual(filterName, 'valueRangeFilter'); + assert.strictEqual(val, fakeRange); + assert(spy.calledWithExactly(value.start, value.end, 'Value')); + spy.restore(); + done(); + }; + filter.value(value); + }); + + it('should apply the strip label transformer', done => { + const value = { + strip: true, + }; + filter.set = (filterName, val) => { + assert.strictEqual(filterName, 'stripValueTransformer'); + assert.strictEqual(val, value.strip); + done(); + }; + filter.value(value); + }); + }); + + describe('FilterError', () => { + it('should set the correct message', () => { + const err = new FilterError('test'); + assert.strictEqual(err.message, 'Unknown filter: test.'); + }); + + it('should set the correct name', () => { + const err = new FilterError('test'); + + assert.strictEqual(err.name, 'FilterError'); + }); + }); +}); diff --git a/handwritten/bigtable/test/gapic_bigtable_v2.ts b/handwritten/bigtable/test/gapic_bigtable_v2.ts new file mode 100644 index 00000000000..39fe62490d3 --- /dev/null +++ b/handwritten/bigtable/test/gapic_bigtable_v2.ts @@ -0,0 +1,2175 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as bigtableModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubServerStreamingCall( + response?: ResponseType, + error?: Error, +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + return sinon.stub().returns(mockStream); +} + +describe('v2.BigtableClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new bigtableModule.v2.BigtableClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigtable.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new bigtableModule.v2.BigtableClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = bigtableModule.v2.BigtableClient.servicePath; + assert.strictEqual(servicePath, 'bigtable.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = bigtableModule.v2.BigtableClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigtable.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new bigtableModule.v2.BigtableClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigtable.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new bigtableModule.v2.BigtableClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigtable.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new bigtableModule.v2.BigtableClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigtable.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new bigtableModule.v2.BigtableClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigtable.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new bigtableModule.v2.BigtableClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = bigtableModule.v2.BigtableClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new bigtableModule.v2.BigtableClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new bigtableModule.v2.BigtableClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigtableStub, undefined); + await client.initialize(); + assert(client.bigtableStub); + }); + + it('has close method for the initialized client', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => { + throw err; + }); + assert(client.bigtableStub); + client + .close() + .then(() => { + done(); + }) + .catch(err => { + throw err; + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigtableStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch(err => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('mutateRow', () => { + it('invokes mutateRow without error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.MutateRowRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedHeaderRequestParams = + 'table_name=projects%2Fvalue%2Finstances%2Fvalue%2Ftables%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.MutateRowResponse(), + ); + client.innerApiCalls.mutateRow = stubSimpleCall(expectedResponse); + const [response] = await client.mutateRow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.mutateRow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateRow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateRow without error using callback', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.MutateRowRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedHeaderRequestParams = + 'table_name=projects%2Fvalue%2Finstances%2Fvalue%2Ftables%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.MutateRowResponse(), + ); + client.innerApiCalls.mutateRow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.mutateRow( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.v2.IMutateRowResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.mutateRow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateRow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateRow with error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.MutateRowRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedHeaderRequestParams = + 'table_name=projects%2Fvalue%2Finstances%2Fvalue%2Ftables%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateRow = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.mutateRow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.mutateRow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateRow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateRow with closed client', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.MutateRowRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.mutateRow(request), expectedError); + }); + }); + + describe('checkAndMutateRow', () => { + it('invokes checkAndMutateRow without error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.CheckAndMutateRowRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedHeaderRequestParams = + 'table_name=projects%2Fvalue%2Finstances%2Fvalue%2Ftables%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.CheckAndMutateRowResponse(), + ); + client.innerApiCalls.checkAndMutateRow = stubSimpleCall(expectedResponse); + const [response] = await client.checkAndMutateRow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkAndMutateRow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkAndMutateRow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAndMutateRow without error using callback', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.CheckAndMutateRowRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedHeaderRequestParams = + 'table_name=projects%2Fvalue%2Finstances%2Fvalue%2Ftables%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.CheckAndMutateRowResponse(), + ); + client.innerApiCalls.checkAndMutateRow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkAndMutateRow( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.v2.ICheckAndMutateRowResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkAndMutateRow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkAndMutateRow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAndMutateRow with error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.CheckAndMutateRowRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedHeaderRequestParams = + 'table_name=projects%2Fvalue%2Finstances%2Fvalue%2Ftables%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.checkAndMutateRow = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkAndMutateRow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.checkAndMutateRow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkAndMutateRow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAndMutateRow with closed client', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.CheckAndMutateRowRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.checkAndMutateRow(request), expectedError); + }); + }); + + describe('pingAndWarm', () => { + it('invokes pingAndWarm without error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.PingAndWarmRequest(), + ); + // path template is empty + request.appProfileId = 'value'; + const expectedHeaderRequestParams = 'app_profile_id=value'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.PingAndWarmResponse(), + ); + client.innerApiCalls.pingAndWarm = stubSimpleCall(expectedResponse); + const [response] = await client.pingAndWarm(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pingAndWarm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pingAndWarm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pingAndWarm without error using callback', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.PingAndWarmRequest(), + ); + // path template is empty + request.appProfileId = 'value'; + const expectedHeaderRequestParams = 'app_profile_id=value'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.PingAndWarmResponse(), + ); + client.innerApiCalls.pingAndWarm = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pingAndWarm( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.v2.IPingAndWarmResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pingAndWarm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pingAndWarm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pingAndWarm with error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.PingAndWarmRequest(), + ); + // path template is empty + request.appProfileId = 'value'; + const expectedHeaderRequestParams = 'app_profile_id=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.pingAndWarm = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.pingAndWarm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.pingAndWarm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pingAndWarm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pingAndWarm with closed client', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.PingAndWarmRequest(), + ); + // path template is empty + request.appProfileId = 'value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.pingAndWarm(request), expectedError); + }); + }); + + describe('readModifyWriteRow', () => { + it('invokes readModifyWriteRow without error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ReadModifyWriteRowRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedHeaderRequestParams = + 'table_name=projects%2Fvalue%2Finstances%2Fvalue%2Ftables%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.ReadModifyWriteRowResponse(), + ); + client.innerApiCalls.readModifyWriteRow = + stubSimpleCall(expectedResponse); + const [response] = await client.readModifyWriteRow(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.readModifyWriteRow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readModifyWriteRow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readModifyWriteRow without error using callback', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ReadModifyWriteRowRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedHeaderRequestParams = + 'table_name=projects%2Fvalue%2Finstances%2Fvalue%2Ftables%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.ReadModifyWriteRowResponse(), + ); + client.innerApiCalls.readModifyWriteRow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.readModifyWriteRow( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.v2.IReadModifyWriteRowResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.readModifyWriteRow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readModifyWriteRow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readModifyWriteRow with error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ReadModifyWriteRowRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedHeaderRequestParams = + 'table_name=projects%2Fvalue%2Finstances%2Fvalue%2Ftables%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.readModifyWriteRow = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.readModifyWriteRow(request), expectedError); + const actualRequest = ( + client.innerApiCalls.readModifyWriteRow as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readModifyWriteRow as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readModifyWriteRow with closed client', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ReadModifyWriteRowRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.readModifyWriteRow(request), expectedError); + }); + }); + + describe('prepareQuery', () => { + it('invokes prepareQuery without error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.PrepareQueryRequest(), + ); + // path template is empty + request.appProfileId = 'value'; + const expectedHeaderRequestParams = 'app_profile_id=value'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.PrepareQueryResponse(), + ); + client.innerApiCalls.prepareQuery = stubSimpleCall(expectedResponse); + const [response] = await client.prepareQuery(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.prepareQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.prepareQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes prepareQuery without error using callback', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.PrepareQueryRequest(), + ); + // path template is empty + request.appProfileId = 'value'; + const expectedHeaderRequestParams = 'app_profile_id=value'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.PrepareQueryResponse(), + ); + client.innerApiCalls.prepareQuery = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.prepareQuery( + request, + ( + err?: Error | null, + result?: protos.google.bigtable.v2.IPrepareQueryResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.prepareQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.prepareQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes prepareQuery with error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.PrepareQueryRequest(), + ); + // path template is empty + request.appProfileId = 'value'; + const expectedHeaderRequestParams = 'app_profile_id=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.prepareQuery = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.prepareQuery(request), expectedError); + const actualRequest = ( + client.innerApiCalls.prepareQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.prepareQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes prepareQuery with closed client', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.PrepareQueryRequest(), + ); + // path template is empty + request.appProfileId = 'value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.prepareQuery(request), expectedError); + }); + }); + + describe('readRows', () => { + it('invokes readRows without error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ReadRowsRequest(), + ); + // path template: {name=projects/*/instances/*}/** + request.materializedViewName = 'projects/value/instances/value/value'; + const expectedHeaderRequestParams = + 'name=projects%2Fvalue%2Finstances%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.ReadRowsResponse(), + ); + client.innerApiCalls.readRows = stubServerStreamingCall(expectedResponse); + const stream = client.readRows(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.ReadRowsResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readRows without error and gaxServerStreamingRetries enabled', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + gaxServerStreamingRetries: true, + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ReadRowsRequest(), + ); + // path template: {name=projects/*/instances/*}/** + request.materializedViewName = 'projects/value/instances/value/value'; + const expectedHeaderRequestParams = + 'name=projects%2Fvalue%2Finstances%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.ReadRowsResponse(), + ); + client.innerApiCalls.readRows = stubServerStreamingCall(expectedResponse); + const stream = client.readRows(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.ReadRowsResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readRows with error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ReadRowsRequest(), + ); + // path template: {name=projects/*/instances/*}/** + request.materializedViewName = 'projects/value/instances/value/value'; + const expectedHeaderRequestParams = + 'name=projects%2Fvalue%2Finstances%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.readRows = stubServerStreamingCall( + undefined, + expectedError, + ); + const stream = client.readRows(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.ReadRowsResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readRows with closed client', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ReadRowsRequest(), + ); + // path template: {name=projects/*/instances/*}/** + request.materializedViewName = 'projects/value/instances/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + const stream = client.readRows(request, { + retryRequestOptions: {noResponseRetries: 0}, + }); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.ReadRowsResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new bigtableModule.v2.BigtableClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + + describe('sampleRowKeys', () => { + it('invokes sampleRowKeys without error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.SampleRowKeysRequest(), + ); + // path template: {name=projects/*/instances/*}/** + request.materializedViewName = 'projects/value/instances/value/value'; + const expectedHeaderRequestParams = + 'name=projects%2Fvalue%2Finstances%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.SampleRowKeysResponse(), + ); + client.innerApiCalls.sampleRowKeys = + stubServerStreamingCall(expectedResponse); + const stream = client.sampleRowKeys(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.SampleRowKeysResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.sampleRowKeys as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.sampleRowKeys as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes sampleRowKeys without error and gaxServerStreamingRetries enabled', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + gaxServerStreamingRetries: true, + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.SampleRowKeysRequest(), + ); + // path template: {name=projects/*/instances/*}/** + request.materializedViewName = 'projects/value/instances/value/value'; + const expectedHeaderRequestParams = + 'name=projects%2Fvalue%2Finstances%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.SampleRowKeysResponse(), + ); + client.innerApiCalls.sampleRowKeys = + stubServerStreamingCall(expectedResponse); + const stream = client.sampleRowKeys(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.SampleRowKeysResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.sampleRowKeys as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.sampleRowKeys as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes sampleRowKeys with error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.SampleRowKeysRequest(), + ); + // path template: {name=projects/*/instances/*}/** + request.materializedViewName = 'projects/value/instances/value/value'; + const expectedHeaderRequestParams = + 'name=projects%2Fvalue%2Finstances%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.sampleRowKeys = stubServerStreamingCall( + undefined, + expectedError, + ); + const stream = client.sampleRowKeys(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.SampleRowKeysResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = ( + client.innerApiCalls.sampleRowKeys as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.sampleRowKeys as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes sampleRowKeys with closed client', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.SampleRowKeysRequest(), + ); + // path template: {name=projects/*/instances/*}/** + request.materializedViewName = 'projects/value/instances/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + const stream = client.sampleRowKeys(request, { + retryRequestOptions: {noResponseRetries: 0}, + }); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.SampleRowKeysResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new bigtableModule.v2.BigtableClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + + describe('mutateRows', () => { + it('invokes mutateRows without error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.MutateRowsRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedHeaderRequestParams = + 'table_name=projects%2Fvalue%2Finstances%2Fvalue%2Ftables%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.MutateRowsResponse(), + ); + client.innerApiCalls.mutateRows = + stubServerStreamingCall(expectedResponse); + const stream = client.mutateRows(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.MutateRowsResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.mutateRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateRows without error and gaxServerStreamingRetries enabled', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + gaxServerStreamingRetries: true, + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.MutateRowsRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedHeaderRequestParams = + 'table_name=projects%2Fvalue%2Finstances%2Fvalue%2Ftables%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.MutateRowsResponse(), + ); + client.innerApiCalls.mutateRows = + stubServerStreamingCall(expectedResponse); + const stream = client.mutateRows(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.MutateRowsResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.mutateRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateRows with error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.MutateRowsRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedHeaderRequestParams = + 'table_name=projects%2Fvalue%2Finstances%2Fvalue%2Ftables%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateRows = stubServerStreamingCall( + undefined, + expectedError, + ); + const stream = client.mutateRows(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.MutateRowsResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = ( + client.innerApiCalls.mutateRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateRows with closed client', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.MutateRowsRequest(), + ); + // path template: {table_name=projects/*/instances/*/tables/*}/** + request.authorizedViewName = + 'projects/value/instances/value/tables/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + const stream = client.mutateRows(request, { + retryRequestOptions: {noResponseRetries: 0}, + }); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.MutateRowsResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new bigtableModule.v2.BigtableClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + + describe('generateInitialChangeStreamPartitions', () => { + it('invokes generateInitialChangeStreamPartitions without error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest', + ['tableName'], + ); + request.tableName = defaultValue1; + const expectedHeaderRequestParams = `table_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse(), + ); + client.innerApiCalls.generateInitialChangeStreamPartitions = + stubServerStreamingCall(expectedResponse); + const stream = client.generateInitialChangeStreamPartitions(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateInitialChangeStreamPartitions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateInitialChangeStreamPartitions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateInitialChangeStreamPartitions without error and gaxServerStreamingRetries enabled', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + gaxServerStreamingRetries: true, + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest', + ['tableName'], + ); + request.tableName = defaultValue1; + const expectedHeaderRequestParams = `table_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse(), + ); + client.innerApiCalls.generateInitialChangeStreamPartitions = + stubServerStreamingCall(expectedResponse); + const stream = client.generateInitialChangeStreamPartitions(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateInitialChangeStreamPartitions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateInitialChangeStreamPartitions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateInitialChangeStreamPartitions with error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest', + ['tableName'], + ); + request.tableName = defaultValue1; + const expectedHeaderRequestParams = `table_name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateInitialChangeStreamPartitions = + stubServerStreamingCall(undefined, expectedError); + const stream = client.generateInitialChangeStreamPartitions(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = ( + client.innerApiCalls.generateInitialChangeStreamPartitions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateInitialChangeStreamPartitions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateInitialChangeStreamPartitions with closed client', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest', + ['tableName'], + ); + request.tableName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + const stream = client.generateInitialChangeStreamPartitions(request, { + retryRequestOptions: {noResponseRetries: 0}, + }); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new bigtableModule.v2.BigtableClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + + describe('readChangeStream', () => { + it('invokes readChangeStream without error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ReadChangeStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.v2.ReadChangeStreamRequest', + ['tableName'], + ); + request.tableName = defaultValue1; + const expectedHeaderRequestParams = `table_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.ReadChangeStreamResponse(), + ); + client.innerApiCalls.readChangeStream = + stubServerStreamingCall(expectedResponse); + const stream = client.readChangeStream(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.ReadChangeStreamResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.readChangeStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readChangeStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readChangeStream without error and gaxServerStreamingRetries enabled', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + gaxServerStreamingRetries: true, + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ReadChangeStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.v2.ReadChangeStreamRequest', + ['tableName'], + ); + request.tableName = defaultValue1; + const expectedHeaderRequestParams = `table_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.ReadChangeStreamResponse(), + ); + client.innerApiCalls.readChangeStream = + stubServerStreamingCall(expectedResponse); + const stream = client.readChangeStream(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.ReadChangeStreamResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.readChangeStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readChangeStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readChangeStream with error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ReadChangeStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.v2.ReadChangeStreamRequest', + ['tableName'], + ); + request.tableName = defaultValue1; + const expectedHeaderRequestParams = `table_name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.readChangeStream = stubServerStreamingCall( + undefined, + expectedError, + ); + const stream = client.readChangeStream(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.ReadChangeStreamResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = ( + client.innerApiCalls.readChangeStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readChangeStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readChangeStream with closed client', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ReadChangeStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.bigtable.v2.ReadChangeStreamRequest', + ['tableName'], + ); + request.tableName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + const stream = client.readChangeStream(request, { + retryRequestOptions: {noResponseRetries: 0}, + }); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.ReadChangeStreamResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new bigtableModule.v2.BigtableClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + + describe('executeQuery', () => { + it('invokes executeQuery without error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ExecuteQueryRequest(), + ); + // path template is empty + request.appProfileId = 'value'; + const expectedHeaderRequestParams = 'app_profile_id=value'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.ExecuteQueryResponse(), + ); + client.innerApiCalls.executeQuery = + stubServerStreamingCall(expectedResponse); + const stream = client.executeQuery(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.ExecuteQueryResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.executeQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executeQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeQuery without error and gaxServerStreamingRetries enabled', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + gaxServerStreamingRetries: true, + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ExecuteQueryRequest(), + ); + // path template is empty + request.appProfileId = 'value'; + const expectedHeaderRequestParams = 'app_profile_id=value'; + const expectedResponse = generateSampleMessage( + new protos.google.bigtable.v2.ExecuteQueryResponse(), + ); + client.innerApiCalls.executeQuery = + stubServerStreamingCall(expectedResponse); + const stream = client.executeQuery(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.ExecuteQueryResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.executeQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executeQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeQuery with error', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ExecuteQueryRequest(), + ); + // path template is empty + request.appProfileId = 'value'; + const expectedHeaderRequestParams = 'app_profile_id=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.executeQuery = stubServerStreamingCall( + undefined, + expectedError, + ); + const stream = client.executeQuery(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.ExecuteQueryResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = ( + client.innerApiCalls.executeQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executeQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeQuery with closed client', async () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.bigtable.v2.ExecuteQueryRequest(), + ); + // path template is empty + request.appProfileId = 'value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + const stream = client.executeQuery(request, { + retryRequestOptions: {noResponseRetries: 0}, + }); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.bigtable.v2.ExecuteQueryResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new bigtableModule.v2.BigtableClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + + describe('Path templates', () => { + describe('authorizedView', async () => { + const fakePath = '/rendered/path/authorizedView'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + table: 'tableValue', + authorized_view: 'authorizedViewValue', + }; + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authorizedViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.authorizedViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('authorizedViewPath', () => { + const result = client.authorizedViewPath( + 'projectValue', + 'instanceValue', + 'tableValue', + 'authorizedViewValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.authorizedViewPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAuthorizedViewName', () => { + const result = client.matchProjectFromAuthorizedViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.authorizedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromAuthorizedViewName', () => { + const result = client.matchInstanceFromAuthorizedViewName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.authorizedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTableFromAuthorizedViewName', () => { + const result = client.matchTableFromAuthorizedViewName(fakePath); + assert.strictEqual(result, 'tableValue'); + assert( + (client.pathTemplates.authorizedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAuthorizedViewFromAuthorizedViewName', () => { + const result = + client.matchAuthorizedViewFromAuthorizedViewName(fakePath); + assert.strictEqual(result, 'authorizedViewValue'); + assert( + (client.pathTemplates.authorizedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('instance', async () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + }; + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath('projectValue', 'instanceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('materializedView', async () => { + const fakePath = '/rendered/path/materializedView'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + materialized_view: 'materializedViewValue', + }; + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.materializedViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.materializedViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('materializedViewPath', () => { + const result = client.materializedViewPath( + 'projectValue', + 'instanceValue', + 'materializedViewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.materializedViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromMaterializedViewName', () => { + const result = client.matchProjectFromMaterializedViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.materializedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromMaterializedViewName', () => { + const result = client.matchInstanceFromMaterializedViewName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.materializedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchMaterializedViewFromMaterializedViewName', () => { + const result = + client.matchMaterializedViewFromMaterializedViewName(fakePath); + assert.strictEqual(result, 'materializedViewValue'); + assert( + (client.pathTemplates.materializedViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('table', async () => { + const fakePath = '/rendered/path/table'; + const expectedParameters = { + project: 'projectValue', + instance: 'instanceValue', + table: 'tableValue', + }; + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.tablePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tablePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tablePath', () => { + const result = client.tablePath( + 'projectValue', + 'instanceValue', + 'tableValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tablePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromTableName', () => { + const result = client.matchProjectFromTableName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromTableName', () => { + const result = client.matchInstanceFromTableName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTableFromTableName', () => { + const result = client.matchTableFromTableName(fakePath); + assert.strictEqual(result, 'tableValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/handwritten/bigtable/test/index.ts b/handwritten/bigtable/test/index.ts new file mode 100644 index 00000000000..361d2527a30 --- /dev/null +++ b/handwritten/bigtable/test/index.ts @@ -0,0 +1,1232 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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 projectify from '@google-cloud/projectify'; +import * as promisify from '@google-cloud/promisify'; +import * as assert from 'assert'; +import {afterEach, before, beforeEach, describe, it} from 'mocha'; +import * as gax from 'google-gax'; +import * as proxyquire from 'proxyquire'; +import * as sn from 'sinon'; + +import {Cluster} from '../src/cluster.js'; +import {Instance, InstanceOptions} from '../src/instance.js'; +import {PassThrough} from 'stream'; +import {RequestOptions} from '../src'; +import * as snapshot from 'snap-shot-it'; +import {createClusterOptionsList} from './constants/cluster'; + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const v2 = require('../src/v2'); +// eslint-disable-next-line @typescript-eslint/no-var-requires +const PKG = require('../../package.json'); + +const sinon = sn.createSandbox(); +const {grpc} = new gax.GrpcClient(); +const noop = () => {}; + +function fakeV2() {} + +let promisified = false; +let replaceProjectIdTokenOverride: Function | null; +const fakePromisify = Object.assign({}, promisify, { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + promisifyAll(klass: Function, options: any) { + if (klass.name !== 'Bigtable') { + return; + } + promisified = true; + assert.deepStrictEqual(options.exclude, [ + 'close', + 'instance', + 'operation', + 'request', + ]); + }, +}); +const fakeReplaceProjectIdToken = Object.assign({}, projectify, { + replaceProjectIdToken(reqOpts: {}) { + if (replaceProjectIdTokenOverride) { + // eslint-disable-next-line prefer-spread, prefer-rest-params + return replaceProjectIdTokenOverride.apply(null, arguments); + } + return reqOpts; + }, +}); + +let googleAuthOverride: Function | null; +function fakeGoogleAuth() { + // eslint-disable-next-line prefer-spread, prefer-rest-params + return (googleAuthOverride || noop).apply(null, arguments); +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function createFake(klass: any) { + return class Fake extends klass { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + calledWith_: any[]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + constructor(...args: any[]) { + super(...args); + this.calledWith_ = args; + } + }; +} + +const FakeCluster = createFake(Cluster); +const FakeInstance = createFake(Instance); + +describe('Bigtable', () => { + const PROJECT_ID = 'test-project'; + const PROJECT_ID_TOKEN = '{{projectId}}'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let bigtableModule: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let Bigtable: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let bigtable: any; + + before(() => { + bigtableModule = proxyquire('../src', { + '@google-cloud/promisify': fakePromisify, + '@google-cloud/projectify': fakeReplaceProjectIdToken, + 'google-gax': { + GoogleAuth: fakeGoogleAuth, + }, + './cluster.js': {Cluster: FakeCluster}, + './instance.js': {Instance: FakeInstance}, + './v2': fakeV2, + }); + Bigtable = bigtableModule.Bigtable; + }); + + afterEach(() => { + sinon.restore(); + }); + + beforeEach(() => { + googleAuthOverride = null; + replaceProjectIdTokenOverride = null; + delete process.env.BIGTABLE_EMULATOR_HOST; + bigtable = new bigtableModule.Bigtable({projectId: PROJECT_ID}); + }); + + describe('instantiation', () => { + const EXPECTED_SCOPES: string[] = []; + const clientClasses = [ + v2.BigtableClient, + v2.BigtableInstanceAdminClient, + v2.BigtableTableAdminClient, + ]; + + for (const clientClass of clientClasses) { + for (const scope of clientClass.scopes) { + if (EXPECTED_SCOPES.indexOf(scope) === -1) { + EXPECTED_SCOPES.push(scope); + } + } + } + + it('should promisify all the things', () => { + assert(promisified); + }); + + it('should work without new', () => { + const bigtable = Bigtable(); + assert(bigtable instanceof Bigtable); + }); + + it('should initialize the API object', () => { + assert.deepStrictEqual(bigtable.api, {}); + }); + + it('should set grpc keepalive options', () => { + const bigtable = Bigtable(); + assert.strictEqual( + bigtable.options.BigtableClient['grpc.keepalive_time_ms'], + 30000, + ); + assert.strictEqual( + bigtable.options.BigtableClient['grpc.keepalive_timeout_ms'], + 10000, + ); + + assert.strictEqual( + bigtable.options.BigtableInstanceAdminClient['grpc.keepalive_time_ms'], + 30000, + ); + assert.strictEqual( + bigtable.options.BigtableInstanceAdminClient[ + 'grpc.keepalive_timeout_ms' + ], + 10000, + ); + + assert.strictEqual( + bigtable.options.BigtableTableAdminClient['grpc.keepalive_time_ms'], + 30000, + ); + assert.strictEqual( + bigtable.options.BigtableTableAdminClient['grpc.keepalive_timeout_ms'], + 10000, + ); + }); + + it('should cache a local google-auth-library instance', () => { + const fakeGoogleAuthInstance = {}; + const options = { + a: 'b', + c: 'd', + }; + + googleAuthOverride = (options_: {}) => { + assert.deepStrictEqual( + options_, + Object.assign( + {}, + options_, + { + libName: 'gccl', + libVersion: PKG.version, + scopes: EXPECTED_SCOPES, + 'grpc.keepalive_time_ms': 30000, + 'grpc.keepalive_timeout_ms': 10000, + }, + options, + ), + ); + return fakeGoogleAuthInstance; + }; + + const bigtable = new Bigtable(options); + assert.strictEqual(bigtable.auth, fakeGoogleAuthInstance); + }); + + it('should localize the projectId', () => { + assert.strictEqual(bigtable.projectId, PROJECT_ID); + }); + + it('should localize options', () => { + const options = { + a: 'b', + c: 'd', + }; + + const bigtable = new Bigtable(options); + const expectedOptions = Object.assign( + { + port: 443, + sslCreds: undefined, + libName: 'gccl', + libVersion: PKG.version, + scopes: EXPECTED_SCOPES, + 'grpc.keepalive_time_ms': 30000, + 'grpc.keepalive_timeout_ms': 10000, + }, + options, + ); + + assert.deepStrictEqual(bigtable.options, { + BigtableClient: Object.assign( + {}, + bigtable.options['BigtableClient'], + { + servicePath: 'bigtable.googleapis.com', + }, + expectedOptions, + ), + BigtableInstanceAdminClient: Object.assign( + {}, + bigtable.options['BigtableInstanceAdminClient'], + { + servicePath: 'bigtableadmin.googleapis.com', + }, + expectedOptions, + ), + BigtableTableAdminClient: Object.assign( + {}, + bigtable.options['BigtableTableAdminClient'], + { + servicePath: 'bigtableadmin.googleapis.com', + }, + expectedOptions, + ), + }); + }); + + it('should work with the emulator', () => { + process.env.BIGTABLE_EMULATOR_HOST = 'override:8080'; + + const options = { + a: 'b', + c: 'd', + }; + + const expectedOptions = Object.assign( + { + servicePath: 'override', + port: 8080, + sslCreds: grpc.credentials.createInsecure(), + libName: 'gccl', + libVersion: PKG.version, + scopes: EXPECTED_SCOPES, + 'grpc.keepalive_time_ms': 30000, + 'grpc.keepalive_timeout_ms': 10000, + }, + options, + ); + + const bigtable = new Bigtable(options); + + assert.strictEqual( + bigtable.customEndpoint, + process.env.BIGTABLE_EMULATOR_HOST, + ); + + assert.deepStrictEqual(bigtable.options, { + BigtableClient: Object.assign( + {}, + bigtable.options['BigtableClient'], + expectedOptions, + ), + BigtableInstanceAdminClient: Object.assign( + {}, + bigtable.options['BigtableInstanceAdminClient'], + expectedOptions, + ), + BigtableTableAdminClient: Object.assign( + {}, + bigtable.options['BigtableTableAdminClient'], + expectedOptions, + ), + }); + }); + + it('should work with a customEndpoint', () => { + const options = { + apiEndpoint: 'customEndpoint:9090', + a: 'b', + c: 'd', + }; + + const expectedOptions = Object.assign( + { + servicePath: 'customEndpoint', + port: 9090, + sslCreds: grpc.credentials.createInsecure(), + libName: 'gccl', + libVersion: PKG.version, + scopes: EXPECTED_SCOPES, + 'grpc.keepalive_time_ms': 30000, + 'grpc.keepalive_timeout_ms': 10000, + }, + options, + ); + + const bigtable = new Bigtable(options); + + assert.strictEqual(bigtable.customEndpoint, options.apiEndpoint); + + assert.deepStrictEqual(bigtable.options, { + BigtableClient: Object.assign( + {}, + bigtable.options['BigtableClient'], + expectedOptions, + ), + BigtableInstanceAdminClient: Object.assign( + {}, + bigtable.options['BigtableInstanceAdminClient'], + expectedOptions, + ), + BigtableTableAdminClient: Object.assign( + {}, + bigtable.options['BigtableTableAdminClient'], + expectedOptions, + ), + }); + }); + + it('should default projectId to token', () => { + const bigtable = new Bigtable(); + assert.strictEqual(bigtable.projectId, PROJECT_ID_TOKEN); + }); + + it('should set the projectName', () => { + assert.strictEqual(bigtable.projectName, 'projects/' + PROJECT_ID); + }); + + it('should set the appProfileId', () => { + const options = { + appProfileId: 'app-profile-id-12345', + }; + + const bigtable = new Bigtable(options); + + assert.strictEqual(bigtable.appProfileId, 'app-profile-id-12345'); + }); + }); + + describe('createInstance', () => { + const INSTANCE_ID = 'my-instance'; + const CLUSTER = { + id: 'my-cluster', + location: 'us-central2-d', + nodes: 3, + storage: 'ssd', + }; + const OPTIONS = { + clusters: [CLUSTER], + }; + + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'createInstance'); + assert.strictEqual(config.reqOpts.parent, bigtable.projectName); + assert.strictEqual(config.reqOpts.instanceId, INSTANCE_ID); + assert.strictEqual(config.reqOpts.instance.displayName, INSTANCE_ID); + assert.strictEqual(config.gaxOpts, undefined); + done(); + }; + bigtable.createInstance(INSTANCE_ID, OPTIONS, assert.ifError); + }); + + it('should provide the proper request options asynchronously', async () => { + let currentRequestInput = null; + (bigtable.request as Function) = (config: RequestOptions) => { + currentRequestInput = config; + }; + const instanceOptionsList: InstanceOptions[] = createClusterOptionsList + .map(options => Object.assign({}, options, {id: 'my-cluster'})) + .map(options => { + return { + clusters: options, + }; + }); + for (const options of instanceOptionsList) { + await bigtable.createInstance(INSTANCE_ID, options, assert.ifError); + snapshot({ + input: { + id: INSTANCE_ID, + options: options, + }, + output: { + config: currentRequestInput, + }, + }); + } + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + const options = Object.assign({}, OPTIONS, {gaxOptions}); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + bigtable.createInstance(INSTANCE_ID, options, assert.ifError); + }); + + it('should respect the displayName option', done => { + const options = Object.assign( + {}, + { + displayName: 'robocop', + }, + OPTIONS, + ); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtable.request = (config: any) => { + assert.strictEqual( + config.reqOpts.instance.displayName, + options.displayName, + ); + done(); + }; + bigtable.createInstance(INSTANCE_ID, options, assert.ifError); + }); + + it('should respect the type option', done => { + const options = Object.assign({}, {type: 'development'}, OPTIONS); + const fakeTypeType = 99; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + FakeInstance.getTypeType_ = (type: string) => { + assert.strictEqual(type, options.type); + return fakeTypeType; + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtable.request = (config: any) => { + assert.deepStrictEqual(config.reqOpts.instance.type, fakeTypeType); + done(); + }; + bigtable.createInstance(INSTANCE_ID, options, assert.ifError); + }); + + it('should respect the labels option', done => { + const options = Object.assign( + {}, + { + labels: { + env: 'prod', + }, + }, + OPTIONS, + ); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtable.request = (config: any) => { + assert.deepStrictEqual(config.reqOpts.instance.labels, options.labels); + done(); + }; + bigtable.createInstance(INSTANCE_ID, options, assert.ifError); + }); + + it('should respect the clusters option', done => { + const fakeLocation = Cluster.getLocation_( + PROJECT_ID, + OPTIONS.clusters[0].location, + ); + const fakeStorage = 20; + FakeCluster.getStorageType_ = (storage: {}) => { + assert.strictEqual(storage, OPTIONS.clusters[0].storage); + return fakeStorage; + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtable.request = (config: any) => { + assert.deepStrictEqual(config.reqOpts.clusters, { + 'my-cluster': { + location: fakeLocation, + serveNodes: OPTIONS.clusters[0].nodes, + defaultStorageType: fakeStorage, + }, + }); + + done(); + }; + + bigtable.createInstance(INSTANCE_ID, OPTIONS, assert.ifError); + }); + + it('should handle clusters with a CMEK key', done => { + const key = 'kms-key-name'; + + FakeCluster.getLocation_ = () => {}; + FakeCluster.getStorageType_ = () => {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtable.request = (config: any) => { + assert.deepStrictEqual( + config.reqOpts.clusters['my-cluster'].encryptionConfig, + { + kmsKeyName: key, + }, + ); + done(); + }; + + bigtable.createInstance( + INSTANCE_ID, + { + clusters: [ + { + id: 'my-cluster', + key, + nodes: 3, + }, + ], + }, + assert.ifError, + ); + }); + + it('should handle clusters with an encryption object', done => { + const key = 'kms-key-name'; + + FakeCluster.getLocation_ = () => {}; + FakeCluster.getStorageType_ = () => {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtable.request = (config: any) => { + assert.deepStrictEqual( + config.reqOpts.clusters['my-cluster'].encryptionConfig, + { + kmsKeyName: key, + }, + ); + done(); + }; + + bigtable.createInstance( + INSTANCE_ID, + { + clusters: [ + { + id: 'my-cluster', + encryption: { + kmsKeyName: key, + }, + nodes: 2, + }, + ], + }, + assert.ifError, + ); + }); + + it('should throw if both an encryption object and a key are provided', () => { + const key = 'kms-key-name'; + + FakeCluster.getLocation_ = () => {}; + FakeCluster.getStorageType_ = () => {}; + + assert.throws(() => { + bigtable.createInstance( + INSTANCE_ID, + { + clusters: [ + { + id: 'my-cluster', + encryption: { + kmsKeyName: key, + }, + key, + }, + ], + }, + assert.ifError, + ); + }, /A cluster was provided with both `encryption` and `key` defined\./); + }); + + it('should return an error to the callback', done => { + const error = new Error('err'); + bigtable.request = (config: {}, callback: Function) => { + callback(error); + }; + bigtable.createInstance( + INSTANCE_ID, + OPTIONS, + (err: Error, instance: Instance, operation: gax.Operation) => { + assert.strictEqual(err, error); + assert.strictEqual(instance, undefined); + assert.strictEqual(operation, undefined); + done(); + }, + ); + }); + + it('should return an instance to the callback', done => { + const response = { + name: 'my-operation', + }; + const responseArg2 = {}; + const responseArg3 = {}; + const fakeInstance = {}; + bigtable.instance = (id: string) => { + assert.strictEqual(id, INSTANCE_ID); + return fakeInstance; + }; + bigtable.request = (config: {}, callback: Function) => { + callback(null, response, responseArg2, responseArg3); + }; + bigtable.createInstance( + INSTANCE_ID, + OPTIONS, + (err: Error, instance: Instance, ...args: Array<{}>) => { + assert.ifError(err); + assert.strictEqual(instance, fakeInstance); + assert.strictEqual(args[0], response); + assert.strictEqual(args[1], responseArg2); + assert.strictEqual(args[2], responseArg3); + done(); + }, + ); + }); + + it('should throw an error if cluster id not provided.', () => { + const options = { + displayName: 'my-sweet-instance', + labels: {env: 'prod'}, + clusters: [ + { + nodes: 3, + location: 'us-central2-d', + storage: 'ssd', + }, + ], + }; + assert.throws(() => { + bigtable.createInstance(INSTANCE_ID, options); + }, /A cluster was provided without an `id` property defined\./); + }); + + it('should throw an error if configuration object is not provided', () => { + assert.throws(() => { + bigtable.createInstance(INSTANCE_ID, assert.ifError); + }, /A configuration object is required to create an instance\./); + }); + + it('should throw an error if cluster configuration is not provided', () => { + assert.throws(() => { + bigtable.createInstance(INSTANCE_ID, {}, assert.ifError); + }, /At least one cluster configuration object is required to create an instance\./); + }); + }); + + describe('getInstances', () => { + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'listInstances'); + assert.deepStrictEqual(config.reqOpts, { + parent: bigtable.projectName, + }); + assert.deepStrictEqual(config.gaxOpts, {}); + done(); + }; + bigtable.getInstances(assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + bigtable.getInstances(gaxOptions, assert.ifError); + }); + + it('should return an error to the callback', done => { + const error = new Error('err'); + bigtable.request = (config: {}, callback: Function) => { + callback(error); + }; + bigtable.getInstances((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return an array of instance objects and failed locations', done => { + const response = { + instances: [ + { + name: 'a', + }, + { + name: 'b', + }, + ], + failedLocations: ['projects//locations/'], + }; + const fakeInstances = [{}, {}]; + bigtable.request = (config: {}, callback: Function) => { + callback(null, response); + }; + let instanceCount = 0; + bigtable.instance = (name: string) => { + assert.strictEqual(name, response.instances[instanceCount].name); + return fakeInstances[instanceCount++]; + }; + + bigtable.getInstances( + ( + err: Error, + instances: Instance[], + failedLocations: string[], + apiResponse: {}, + ) => { + assert.ifError(err); + assert.strictEqual(instances[0], fakeInstances[0]); + assert.strictEqual(instances[0].metadata, response.instances[0]); + assert.strictEqual(instances[1], fakeInstances[1]); + assert.strictEqual(instances[1].metadata, response.instances[1]); + assert.strictEqual(failedLocations, response.failedLocations); + assert.strictEqual(apiResponse, response); + done(); + }, + ); + }); + }); + + describe('instance', () => { + const INSTANCE_ID = 'my-instance'; + + it('should return an Instance object', () => { + const instance = bigtable.instance(INSTANCE_ID); + const args = instance.calledWith_; + + assert(instance instanceof FakeInstance); + assert.strictEqual(args[0], bigtable); + assert.strictEqual(args[1], INSTANCE_ID); + }); + }); + + describe('request', () => { + const CONFIG = { + client: 'client', + method: 'method', + reqOpts: { + a: 'b', + c: 'd', + }, + gaxOpts: {}, + }; + + const gapicStreamingMethods = [ + 'listTablesStream', + 'listBackupsStream', + 'listAppProfilesStream', + ]; + + beforeEach(() => { + bigtable.getProjectId_ = (callback: Function) => { + callback(null, PROJECT_ID); + }; + bigtable.api[CONFIG.client] = { + [CONFIG.method]: noop, + }; + }); + + describe('prepareGaxRequest', () => { + it('should get the project ID', done => { + bigtable.getProjectId_ = () => { + done(); + }; + bigtable.request(CONFIG, assert.ifError); + }); + + it('should return error if getting project ID failed', done => { + const error = new Error('Error.'); + bigtable.getProjectId_ = (callback: Function) => { + callback(error); + }; + bigtable.request(CONFIG, (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should initiate and cache the client', () => { + const fakeClient = { + [CONFIG.method]: noop, + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (fakeV2 as any)[CONFIG.client] = function (options: any) { + assert.strictEqual(options, bigtable.options[CONFIG.client]); + return fakeClient; + }; + bigtable.api = {}; + bigtable.request(CONFIG, assert.ifError); + assert.strictEqual(bigtable.api[CONFIG.client], fakeClient); + }); + + it('should use the cached client', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (fakeV2 as any)[CONFIG.client] = function () { + done(new Error('Should not re-instantiate a GAX client.')); + }; + bigtable.request(CONFIG); + done(); + }); + + it('should not call replace project ID token', done => { + replaceProjectIdTokenOverride = sinon.spy(); + bigtable.api[CONFIG.client][CONFIG.method] = { + bind() { + assert(!(replaceProjectIdTokenOverride as sn.SinonSpy).called); + setImmediate(done); + return noop; + }, + }; + bigtable.request(CONFIG, assert.ifError); + }); + }); + + describe('replace projectID token', () => { + beforeEach(() => { + bigtable = new Bigtable(); + bigtable.getProjectId_ = (callback: Function) => { + callback(null, PROJECT_ID); + }; + bigtable.api[CONFIG.client] = { + [CONFIG.method]: noop, + }; + }); + + it('should replace the project ID token', done => { + const replacedReqOpts = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replaceProjectIdTokenOverride = (reqOpts: any, projectId: string) => { + assert.notStrictEqual(reqOpts, CONFIG.reqOpts); + assert.deepStrictEqual(reqOpts, CONFIG.reqOpts); + assert.strictEqual(projectId, PROJECT_ID); + return replacedReqOpts; + }; + bigtable.api[CONFIG.client][CONFIG.method] = { + bind(gaxClient: {}, reqOpts: {}) { + assert.strictEqual(reqOpts, replacedReqOpts); + setImmediate(done); + return noop; + }, + }; + bigtable.request(CONFIG, assert.ifError); + }); + + it('should not replace token when project ID not detected', done => { + replaceProjectIdTokenOverride = () => { + throw new Error('Should not have tried to replace token.'); + }; + bigtable.getProjectId_ = (callback: Function) => { + callback(null, PROJECT_ID_TOKEN); + }; + bigtable.api[CONFIG.client][CONFIG.method] = { + bind(gaxClient: {}, reqOpts: {}) { + assert.deepStrictEqual(reqOpts, CONFIG.reqOpts); + setImmediate(done); + return noop; + }, + }; + bigtable.request(CONFIG, assert.ifError); + }); + }); + + describe('makeRequestCallback', () => { + it('should prepare the request', done => { + bigtable.api[CONFIG.client][CONFIG.method] = { + bind(gaxClient: {}, reqOpts: {}, gaxOpts: {}) { + assert.strictEqual(gaxClient, bigtable.api[CONFIG.client]); + assert.deepStrictEqual(reqOpts, CONFIG.reqOpts); + assert.strictEqual(gaxOpts, CONFIG.gaxOpts); + setImmediate(done); + return noop; + }, + }; + + bigtable.request(CONFIG, assert.ifError); + }); + + it('should execute callback with error', done => { + const error = new Error('Error.'); + bigtable.api[CONFIG.client][CONFIG.method] = (...args: Array<{}>) => { + const callback: Function = [].slice.call(args).pop()!; + callback(error); + }; + bigtable.request(CONFIG, (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should execute the request function', () => { + bigtable.api[CONFIG.client][CONFIG.method] = (...args: Array<{}>) => { + const callback: Function = [].slice.call(args).pop()!; + callback(null, args[0]); // so it ends the test + }; + bigtable.request(CONFIG, assert.ifError); + }); + }); + + describe('makeRequestStream', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let GAX_STREAM: any; + + beforeEach(() => { + GAX_STREAM = new PassThrough(); + bigtable.api[CONFIG.client][CONFIG.method] = { + bind() { + return () => { + return GAX_STREAM; + }; + }, + }; + }); + + // TODO: retry request options are currently ignored + // Re-enable after retry logic is fixed in gax / retry-request + // it('should pass retryRequestOptions', done => { + // const expectedRetryRequestOptions = { + // currentRetryAttempt: 0, + // noResponseRetries: 0, + // objectMode: true, + // shouldRetryFn: shouldRetryRequest, + // }; + + // bigtable.api[CONFIG.client] = { + // [CONFIG.method]: (reqOpts: {}, options: gax.CallOptions) => { + // assert.deepStrictEqual( + // options.retryRequestOptions, + // expectedRetryRequestOptions + // ); + // done(); + // }, + // }; + + // const requestStream = bigtable.request(CONFIG); + // requestStream.emit('reading'); + // }); + + // TODO: retry request options are currently ignored + // Re-enable after retry logic is fixed in gax / retry-request + // it('should set gaxOpts.retryRequestOptions when gaxOpts undefined', done => { + // const expectedRetryRequestOptions = { + // currentRetryAttempt: 0, + // noResponseRetries: 0, + // objectMode: true, + // shouldRetryFn: shouldRetryRequest, + // }; + + // bigtable.api[CONFIG.client] = { + // [CONFIG.method]: (reqOpts: {}, options: gax.CallOptions) => { + // assert.deepStrictEqual( + // options.retryRequestOptions, + // expectedRetryRequestOptions + // ); + // done(); + // }, + // }; + + // const config = Object.assign({}, CONFIG); + // delete config.gaxOpts; + // const requestStream = bigtable.request(config); + // requestStream.emit('reading'); + // }); + + it('should expose an abort function', done => { + GAX_STREAM.cancel = done; + + const requestStream = bigtable.request(CONFIG); + requestStream.emit('reading'); + requestStream.abort(); + }); + + it('should prepare the request once reading', done => { + bigtable.api[CONFIG.client][CONFIG.method] = { + bind(gaxClient: {}, reqOpts: {}, gaxOpts: {}) { + assert.strictEqual(gaxClient, bigtable.api[CONFIG.client]); + assert.deepStrictEqual(reqOpts, CONFIG.reqOpts); + assert.strictEqual(gaxOpts, CONFIG.gaxOpts); + setImmediate(done); + return () => { + return GAX_STREAM; + }; + }, + }; + + const requestStream = bigtable.request(CONFIG); + requestStream.emit('reading'); + }); + + it('should destroy the stream with prepare error', done => { + const error = new Error('Error.'); + bigtable.getProjectId_ = (callback: Function) => { + callback(error); + }; + const requestStream = bigtable.request(CONFIG); + requestStream.emit('reading'); + requestStream.on('error', (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should destroy the stream with GAX error', done => { + const error = new Error('Error.'); + const requestStream = bigtable.request(CONFIG); + requestStream.emit('reading'); + GAX_STREAM.emit('error', error); + requestStream.on('error', (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should re-emit request event from gax-stream', done => { + const requestStream = bigtable.request(CONFIG); + requestStream.emit('reading'); + requestStream.on('request', done); + GAX_STREAM.emit('request'); + }); + }); + + gapicStreamingMethods.forEach(method => { + describe('makeGapicStreamRequest', () => { + describe(method, () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let GAX_STREAM: any; + const config = { + client: 'client', + method: method, + reqOpts: { + a: 'b', + c: 'd', + }, + gaxOpts: {}, + }; + + beforeEach(() => { + GAX_STREAM = new PassThrough(); + bigtable.api[config.client][config.method] = { + bind() { + return () => { + return GAX_STREAM; + }; + }, + }; + }); + + it('should expose an abort function', done => { + GAX_STREAM.cancel = done; + + const requestStream = bigtable.request(config); + requestStream.emit('reading'); + requestStream.abort(); + }); + + it('should prepare the request once reading', done => { + bigtable.api[config.client][config.method] = { + bind(gaxClient: {}, reqOpts: {}, gaxOpts: {}) { + assert.strictEqual(gaxClient, bigtable.api[config.client]); + assert.deepStrictEqual(reqOpts, config.reqOpts); + assert.strictEqual(gaxOpts, config.gaxOpts); + setImmediate(done); + return () => { + return GAX_STREAM; + }; + }, + }; + + const requestStream = bigtable.request(config); + requestStream.emit('reading'); + }); + + it('should destroy the stream with prepare error', done => { + const error = new Error('Error.'); + bigtable.getProjectId_ = (callback: Function) => { + callback(error); + }; + const requestStream = bigtable.request(config); + requestStream.emit('reading'); + requestStream.on('error', (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should destroy the stream with GAX error', done => { + const error = new Error('Error.'); + const requestStream = bigtable.request(config); + requestStream.emit('reading'); + GAX_STREAM.emit('error', error); + requestStream.on('error', (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should emit response from GAX stream', done => { + const response = {}; + const requestStream = bigtable.request(config); + requestStream.emit('reading'); + requestStream.on('response', (resp: {}) => { + assert.strictEqual(resp, response); + done(); + }); + GAX_STREAM.emit('response', response); + }); + }); + }); + }); + }); + + describe('getProjectId_', () => { + beforeEach(() => { + bigtable.auth = { + getProjectId(callback: Function) { + callback(null, PROJECT_ID); + }, + }; + }); + + it('should return the provided project ID', done => { + const providedProjectId = 'provided-project-id'; + bigtable.auth.getProjectId = () => { + throw new Error('Auth client should not be called.'); + }; + bigtable.projectId = providedProjectId; + bigtable.getProjectId_((err: Error, projectId: string) => { + assert.ifError(err); + assert.strictEqual(projectId, providedProjectId); + done(); + }); + }); + + it('should return any project ID if in custom endpoint', done => { + bigtable.auth.getProjectId = () => { + throw new Error('Auth client should not be called.'); + }; + bigtable.projectId = PROJECT_ID_TOKEN; + bigtable.customEndpoint = 'custom-endpoint'; + bigtable.getProjectId_((err: Error, projectId: string) => { + assert.ifError(err); + assert.strictEqual(projectId, PROJECT_ID_TOKEN); + done(); + }); + }); + + it('should return error if project ID detection failed', done => { + const error = new Error('Error.'); + bigtable.auth.getProjectId = (callback: Function) => { + callback(error); + }; + bigtable.projectId = PROJECT_ID_TOKEN; + bigtable.getProjectId_((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should get and cache the project ID if not provided', done => { + const detectedProjectId = 'detected-project-id'; + bigtable.auth.getProjectId = (callback: Function) => { + callback(null, detectedProjectId); + }; + bigtable.projectId = PROJECT_ID_TOKEN; + bigtable.getProjectId_((err: Error, projectId: string) => { + assert.ifError(err); + assert.strictEqual(projectId, detectedProjectId); + assert.strictEqual(bigtable.projectId, detectedProjectId); + done(); + }); + }); + }); + describe('close', () => { + it('should have failed request after close is called', done => { + bigtable.close().then(() => { + bigtable.getInstances((err: Error) => { + if (err) { + done(); + } else { + assert.fail( + 'The request did not fail, but it should have because the connection is closed', + ); + } + }); + }); + }); + }); +}); diff --git a/handwritten/bigtable/test/instance.ts b/handwritten/bigtable/test/instance.ts new file mode 100644 index 00000000000..3692632a349 --- /dev/null +++ b/handwritten/bigtable/test/instance.ts @@ -0,0 +1,3394 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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 promisify from '@google-cloud/promisify'; +import * as assert from 'assert'; +import {before, beforeEach, afterEach, describe, it} from 'mocha'; +import * as sinon from 'sinon'; +import * as proxyquire from 'proxyquire'; +import {ServiceError} from 'google-gax'; +import * as snapshot from 'snap-shot-it'; +import {Readable} from 'stream'; +import * as inst from '../src/instance'; +import {AppProfile, AppProfileOptions} from '../src/app-profile'; +import {Cluster, CreateClusterOptions} from '../src/cluster'; +import {Family} from '../src/family'; +import { + Policy, + Table, + GetIamPolicyOptions, + GetTablesOptions, +} from '../src/table'; +import {Bigtable, RequestOptions} from '../src'; +import {PassThrough} from 'stream'; +import * as pumpify from 'pumpify'; +import {FakeCluster} from '../system-test/common'; +import { + BigtableDate, + BigtableMap, + QueryResultRow, + SqlValue, + Struct, +} from '../src/execute-query/values'; +import * as SqlTypes from '../src/execute-query/types'; +import {RestoreTableConfig} from '../src/backup'; +import {Options} from './cluster'; +import {createClusterOptionsList} from './constants/cluster'; +import {google} from '../protos/protos'; +import {PreciseDate} from '@google-cloud/precise-date'; +import Long = require('long'); +import { + createMetadata, + createPreparedStatement, + createPrepareQueryResponse, + createProtoRows, + pbType, +} from './utils/proto-bytes'; +import {PreparedStatement} from '../src/execute-query/preparedstatement'; +import * as SqlValues from '../src/execute-query/values'; + +const concat = require('concat-stream'); + +const sandbox = sinon.createSandbox(); + +let promisified = false; +const fakePromisify = Object.assign({}, promisify, { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + promisifyAll(klass: Function, options: any) { + if (klass.name !== 'Instance') { + return; + } + promisified = true; + assert.deepStrictEqual(options.exclude, [ + 'appProfile', + 'cluster', + 'table', + 'getBackupsStream', + 'getTablesStream', + 'getAppProfilesStream', + 'view', + ]); + }, +}); + +class FakeAppProfile extends AppProfile { + calledWith_: Array<{}>; + constructor(...args: [inst.Instance, string]) { + super(args[0], args[1]); + this.calledWith_ = args; + } +} + +class FakeBackup {} + +class FakeFamily extends Family { + calledWith_: Array<{}>; + constructor(...args: [Table, string]) { + super(args[0], args[1]); + this.calledWith_ = args; + } +} + +class FakeTable extends Table { + calledWith_: Array<{}>; + VIEWS?: {[index: string]: number}; + constructor(...args: [inst.Instance, string]) { + super(args[0], args[1]); + this.calledWith_ = args; + } +} + +// convenience function for ExecuteQuery tests +function executeQueryResultWithMetadata( + instance: any, + preparedStatement: PreparedStatement | null, + callback: (...args: any[]) => void, +): void { + const stream = instance.createExecuteQueryStream({preparedStatement}); + stream.on('error', callback!).pipe( + concat((rows: QueryResultRow[]) => { + const metadata = stream.getMetadata(); + if (metadata === null) { + callback!(new Error('Server error - did not receive metadata.')); + } else { + callback!(null, rows, metadata); + } + }), + ); +} + +describe('Bigtable/Instance', () => { + const INSTANCE_ID = 'my-instance'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const BIGTABLE = { + projectName: 'projects/my-project', + projectId: 'my-project', + request: () => {}, + } as Bigtable; + const INSTANCE_NAME = `${BIGTABLE.projectName}/instances/${INSTANCE_ID}`; + const APP_PROFILE_ID = 'my-app-profile'; + const CLUSTER_ID = 'my-cluster'; + let Instance: typeof inst.Instance; + let instance: inst.Instance; + + before(() => { + Instance = proxyquire('../src/instance.js', { + '@google-cloud/promisify': fakePromisify, + './app-profile.js': {AppProfile: FakeAppProfile}, + './backup.js': {Backup: FakeBackup}, + './cluster.js': {Cluster: FakeCluster}, + './family.js': {Family: FakeFamily}, + './table.js': {Table: FakeTable}, + pumpify, + }).Instance; + }); + + beforeEach(() => { + instance = new Instance(BIGTABLE, INSTANCE_ID); + }); + + afterEach(() => sandbox.restore()); + + describe('instantiation', () => { + it('should promisify all the things', () => { + assert(promisified); + }); + + it('should localize Bigtable instance', () => { + assert.strictEqual(instance.bigtable, BIGTABLE); + }); + + it('should create full ID from name', () => { + assert.strictEqual(instance.name, INSTANCE_NAME); + }); + + it('should localize name', () => { + assert.strictEqual(instance.id, INSTANCE_ID); + }); + + it('should leave full instance name unaltered and localize the id from the name', () => { + const instance = new Instance(BIGTABLE, INSTANCE_NAME); + assert.strictEqual(instance.name, INSTANCE_NAME); + assert.strictEqual(instance.id, INSTANCE_ID); + }); + + it('should throw if instance id in wrong format', () => { + const id = `instances/${INSTANCE_ID}`; + assert.throws(() => { + new Instance(BIGTABLE, id); + }, Error); + }); + }); + + describe('getTypeType_', () => { + const types = { + unspecified: 0, + production: 1, + development: 2, + } as {[index: string]: number}; + + it('should default to unspecified', () => { + assert.strictEqual(Instance.getTypeType_(), types.unspecified); + assert.strictEqual( + Instance.getTypeType_('not-real-type'), + types.unspecified, + ); + }); + + it('should lowercase a type', () => { + assert.strictEqual(Instance.getTypeType_('PRODUCTION'), types.production); + }); + + Object.keys(types).forEach(type => { + it(`should get the storage type for "${type}"`, () => { + assert.strictEqual(Instance.getTypeType_(type), types[type]); + }); + }); + }); + + describe('create', () => { + it('should call createInstance from bigtable', done => { + const options = {} as inst.InstanceOptions; + (instance.bigtable.createInstance as Function) = ( + id: string, + options_: {}, + callback: Function, + ) => { + assert.strictEqual(id, instance.id); + assert.strictEqual(options_, options); + callback(); // done() + }; + instance.create(options, done); + }); + }); + + describe('createAppProfile', () => { + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'createAppProfile'); + assert.strictEqual(config.reqOpts.parent, INSTANCE_NAME); + assert.strictEqual(config.reqOpts.appProfileId, APP_PROFILE_ID); + assert.strictEqual(config.gaxOpts, undefined); + done(); + }; + instance.createAppProfile( + APP_PROFILE_ID, + {routing: 'any'}, + assert.ifError, + ); + }); + + it('should throw if the routing option is not provided', () => { + assert.throws( + instance.createAppProfile.bind(null, APP_PROFILE_ID, assert.ifError), + /An app profile must contain a routing policy\./, + ); + }); + + it('should accept gaxOptions', done => { + const options = { + routing: 'any', + gaxOptions: {}, + } as AppProfileOptions; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.gaxOpts, options.gaxOptions); + done(); + }; + instance.createAppProfile(APP_PROFILE_ID, options, assert.ifError); + }); + + describe('should respect the routing option with', () => { + const cluster = new FakeCluster({} as inst.Instance, CLUSTER_ID); + + it("an 'any' value", done => { + const options = { + routing: 'any', + } as AppProfileOptions; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual( + config.reqOpts.appProfile.multiClusterRoutingUseAny, + {}, + ); + done(); + }; + instance.createAppProfile(APP_PROFILE_ID, options, assert.ifError); + }); + + it('a cluster value', done => { + const options = {routing: cluster}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual( + config.reqOpts.appProfile.singleClusterRouting, + {clusterId: CLUSTER_ID}, + ); + done(); + }; + instance.createAppProfile(APP_PROFILE_ID, options, assert.ifError); + }); + + it('a set of cluster objects', done => { + const clusterIds = ['my-cluster1', 'my-cluster2']; + const clusters = clusterIds.map( + cluster => new FakeCluster(instance, cluster), + ); + const options = {routing: new Set(clusters)}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual( + config.reqOpts.appProfile.multiClusterRoutingUseAny, + {clusterIds: clusterIds}, + ); + done(); + }; + instance.createAppProfile(APP_PROFILE_ID, options, assert.ifError); + }); + }); + + it('should respect the allowTransactionalWrites option', done => { + const cluster = instance.cluster(CLUSTER_ID); + const options = { + routing: cluster, + allowTransactionalWrites: true, + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual( + config.reqOpts.appProfile.singleClusterRouting + .allowTransactionalWrites, + true, + ); + done(); + }; + instance.createAppProfile(APP_PROFILE_ID, options, assert.ifError); + }); + + it('should respect the description option', done => { + const options = { + routing: 'any', + description: 'My App Profile', + } as AppProfileOptions; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual( + config.reqOpts.appProfile.description, + options.description, + ); + done(); + }; + instance.createAppProfile(APP_PROFILE_ID, options, assert.ifError); + }); + + it('should respect the ignoreWarnings option', done => { + const options = { + routing: 'any', + ignoreWarnings: true, + } as AppProfileOptions; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual(config.reqOpts.ignoreWarnings, true); + done(); + }; + instance.createAppProfile(APP_PROFILE_ID, options, assert.ifError); + }); + + it('should execute callback with arguments from GAPIC', done => { + const response = {}; + sandbox + .stub(instance.bigtable, 'request') + .callsArgWith(1, null, response); + const fakeAppProfile = {}; + (instance.appProfile as Function) = (id: string) => { + assert.strictEqual(id, APP_PROFILE_ID); + return fakeAppProfile; + }; + instance.createAppProfile( + APP_PROFILE_ID, + {routing: 'any'}, + (err, appProfile, apiResponse) => { + assert.ifError(err); + assert.strictEqual(appProfile, fakeAppProfile); + assert.strictEqual(apiResponse, response); + done(); + }, + ); + }); + }); + + describe('createCluster', () => { + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'createCluster'); + assert.strictEqual(config.reqOpts.parent, INSTANCE_NAME); + assert.strictEqual(config.reqOpts.clusterId, CLUSTER_ID); + assert.strictEqual( + config.reqOpts.cluster.location, + 'projects/my-project/locations/us-central2-d', + ); + assert.strictEqual(config.gaxOpts, undefined); + done(); + }; + instance.createCluster( + CLUSTER_ID, + {nodes: 2, location: 'us-central2-d'}, + assert.ifError, + ); + }); + + it('should provide the proper request options asynchronously', async () => { + let currentRequestInput = null; + (instance.bigtable.request as Function) = (config: RequestOptions) => { + currentRequestInput = config; + }; + const optionsList = createClusterOptionsList; + for (const options of optionsList) { + await instance.createCluster(CLUSTER_ID, options); + snapshot({ + input: { + id: CLUSTER_ID, + options: options, + }, + output: { + config: currentRequestInput, + }, + }); + } + }); + + it('should accept gaxOptions', done => { + const options = { + nodes: 2, + gaxOptions: {}, + } as CreateClusterOptions; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.gaxOpts, options.gaxOptions); + done(); + }; + instance.createCluster(CLUSTER_ID, options, assert.ifError); + }); + + it('should respect the location option', done => { + const options = { + location: 'us-central2-d', + nodes: 2, + } as CreateClusterOptions; + const fakeLocation = Cluster.getLocation_( + BIGTABLE.projectId, + options.location, + ); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.reqOpts.cluster.location, fakeLocation); + done(); + }; + instance.createCluster(CLUSTER_ID, options, assert.ifError); + }); + + it('should respect the nodes option', done => { + const options = { + nodes: 3, + location: 'us-central2-c', + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.reqOpts.cluster.serveNodes, options.nodes); + done(); + }; + instance.createCluster(CLUSTER_ID, options, assert.ifError); + }); + + it('should respect the storage option', done => { + const options = { + storage: 'ssd', + nodes: 2, + } as CreateClusterOptions; + const fakeStorageType = 2; + sandbox.stub(FakeCluster, 'getStorageType_').callsFake(type => { + assert.strictEqual(type, options.storage); + return fakeStorageType; + }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual( + config.reqOpts.cluster.defaultStorageType, + fakeStorageType, + ); + done(); + }; + instance.createCluster(CLUSTER_ID, options, assert.ifError); + }); + + it('should respect the key option', done => { + const key = 'kms-key-name'; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual(config.reqOpts.cluster.encryptionConfig, { + kmsKeyName: key, + }); + done(); + }; + + instance.createCluster( + CLUSTER_ID, + {key, nodes: 2} as CreateClusterOptions, + assert.ifError, + ); + }); + + it('should handle clusters with an encryption object', done => { + const key = 'kms-key-name'; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual(config.reqOpts.cluster.encryptionConfig, { + kmsKeyName: key, + }); + done(); + }; + + instance.createCluster( + CLUSTER_ID, + {encryption: {kmsKeyName: key}, nodes: 2} as CreateClusterOptions, + assert.ifError, + ); + }); + + it('should throw if both an encryption object and a key are provided', () => { + const key = 'kms-key-name'; + + assert.throws(() => { + instance.createCluster( + CLUSTER_ID, + { + encryption: {kmsKeyName: key}, + key, + nodes: 2, + } as CreateClusterOptions, + assert.ifError, + ); + }, /The cluster cannot have both `encryption` and `key` defined\./); + }); + + it('should execute callback with arguments from GAPIC', done => { + const response = {}; + sandbox + .stub(instance.bigtable, 'request') + .callsArgWith(1, null, response); + const fakeCluster = {}; + (instance.cluster as Function) = (name: string) => { + assert.strictEqual(name, CLUSTER_ID); + return fakeCluster; + }; + (instance.createCluster as Function)( + CLUSTER_ID, + {nodes: 2}, + (err: Error, cluster: {}, apiResponse: {}) => { + assert.ifError(err); + assert.strictEqual(cluster, fakeCluster); + assert.strictEqual(apiResponse, response); + done(); + }, + ); + }); + }); + + describe('createTable', () => { + const TABLE_ID = 'my-table'; + const TABLE_NAME = + 'projects/my-project/instances/my-instance/tables/my-table'; + + it('should throw if an id is not provided', () => { + assert.throws(() => { + (instance.createTable as Function)(); + }, /An id is required to create a table\./); + }); + + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'createTable'); + assert.strictEqual(config.reqOpts.parent, INSTANCE_NAME); + assert.strictEqual(config.reqOpts.tableId, TABLE_ID); + assert.deepStrictEqual(config.reqOpts.table, {granularity: 0}); + assert.strictEqual(config.gaxOpts, undefined); + done(); + }; + instance.createTable(TABLE_ID, assert.ifError); + }); + + it('should accept gaxOptions', done => { + const options = { + gaxOptions: {}, + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.gaxOpts, options.gaxOptions); + done(); + }; + instance.createTable(TABLE_ID, options, assert.ifError); + }); + + it('should set the initial split keys', done => { + const options = { + splits: ['a', 'b'], + }; + const expectedSplits = [{key: 'a'}, {key: 'b'}]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual(config.reqOpts.initialSplits, expectedSplits); + done(); + }; + instance.createTable(TABLE_ID, options, assert.ifError); + }); + + describe('creating column families', () => { + it('should accept a family name', done => { + const options = { + families: ['a', 'b'], + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual(config.reqOpts.table.columnFamilies, { + a: {}, + b: {}, + }); + done(); + }; + instance.createTable(TABLE_ID, options, assert.ifError); + }); + + it('should accept a garbage collection object', done => { + const options = { + families: [ + { + name: 'e', + rule: {}, + }, + ], + }; + const fakeRule = {a: 'b'}; + (FakeFamily.formatRule_ as Function) = (rule: {}) => { + assert.strictEqual(rule, options.families[0].rule); + return fakeRule; + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual(config.reqOpts.table.columnFamilies, { + e: { + gcRule: fakeRule, + }, + }); + done(); + }; + instance.createTable(TABLE_ID, options, assert.ifError); + }); + }); + + it('should return a Table object', done => { + const response = { + name: TABLE_NAME, + }; + const fakeTable = {} as Table; + sandbox.stub(instance, 'table').callsFake(id => { + assert.strictEqual(id, response.name.split('/').pop()); + return fakeTable; + }); + sandbox + .stub(instance.bigtable, 'request') + .callsArgWith(1, null, response); + instance.createTable(TABLE_ID, (err, table, apiResponse) => { + assert.ifError(err); + assert.strictEqual(table, fakeTable); + assert.strictEqual(table!.metadata, response); + assert.strictEqual(apiResponse, response); + done(); + }); + }); + }); + + describe('createTableFromBackup', () => { + it('should throw if a table is not provided', () => { + assert.throws(() => { + (instance.createTableFromBackup as Function)({}); + }, /A table id is required to restore from a backup\./); + }); + + it('should restore from a provided Backup instance', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const backup = new FakeBackup() as any; + const table = 'table'; + + backup.restoreTo = (config: RestoreTableConfig, callback: Function) => { + assert.strictEqual(config.tableId, table); + assert.strictEqual(config.instance, instance); + assert.strictEqual(typeof config.gaxOptions, 'undefined'); + callback(); // done() + }; + + instance.createTableFromBackup( + { + table, + backup, + }, + done, + ); + }); + + it('should create a Backup using the provided name', done => { + const clusterId = 'my-cluster'; + const backupId = 'my-backup'; + const backup = `instances/${instance.id}/clusters/${clusterId}/backups/${backupId}`; + const table = 'table'; + + (instance.cluster as Function) = (id: string) => { + assert.strictEqual(id, clusterId); + return { + backup: (id: string) => { + assert.strictEqual(id, backup); + return { + restoreTo: (config: RestoreTableConfig, callback: Function) => { + assert.strictEqual(config.tableId, table); + assert.strictEqual(config.instance, instance); + assert.strictEqual(typeof config.gaxOptions, 'undefined'); + callback(); // done() + }, + }; + }, + }; + }; + + instance.createTableFromBackup( + { + table, + backup, + }, + done, + ); + }); + + it('should respect a Backup from a different instance', done => { + const diffInstanceId = 'diff-instance'; + const clusterId = 'my-cluster'; + const backupId = 'my-backup'; + const backup = `instances/${diffInstanceId}/clusters/${clusterId}/backups/${backupId}`; + const table = 'table'; + + (instance.bigtable.instance as Function) = (id: string) => { + assert.strictEqual(id, diffInstanceId); + return { + cluster: (id: string) => { + assert.strictEqual(id, clusterId); + return { + backup: (id: string) => { + assert.strictEqual(id, backup); + return { + restoreTo: ( + config: RestoreTableConfig, + callback: Function, + ) => { + assert.strictEqual(config.tableId, table); + assert.strictEqual(config.instance, instance); + assert.strictEqual(typeof config.gaxOptions, 'undefined'); + callback(); // done() + }, + }; + }, + }; + }, + }; + }; + + instance.createTableFromBackup( + { + table, + backup, + }, + done, + ); + }); + + it('should throw if an unformatted backup name is provided', () => { + const backup = 'backup-id'; + const table = 'table'; + + assert.throws(() => { + instance.createTableFromBackup( + { + table, + backup, + }, + assert.ifError, + ); + }, /A complete backup name \(path\) is required or a Backup object\./); + }); + + it('should accept gaxOptions', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const backup = new FakeBackup() as any; + const table = 'table'; + const gaxOptions = {}; + + backup.restoreTo = (config: RestoreTableConfig) => { + assert.strictEqual(config.gaxOptions, gaxOptions); + done(); + }; + + instance.createTableFromBackup( + { + table, + backup, + gaxOptions, + }, + assert.ifError, + ); + }); + }); + + describe('cluster', () => { + it('should return a Cluster object', () => { + const cluster = instance.cluster(CLUSTER_ID); + assert(cluster instanceof FakeCluster); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const args = (cluster as any).calledWith_; + assert.strictEqual(args[0], instance); + assert.strictEqual(args[1], CLUSTER_ID); + }); + }); + + describe('delete', () => { + it('should make the correct request', done => { + (instance.bigtable.request as Function) = ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + config: any, + callback: Function, + ) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'deleteInstance'); + assert.deepStrictEqual(config.reqOpts, { + name: instance.name, + }); + assert.deepStrictEqual(config.gaxOpts, {}); + callback(); // done() + }; + instance.delete(done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + instance.delete(gaxOptions, assert.ifError); + }); + }); + + describe('exists', () => { + it('should not require gaxOptions', done => { + (instance.getMetadata as Function) = (gaxOptions: {}) => { + assert.deepStrictEqual(gaxOptions, {}); + done(); + }; + instance.exists(assert.ifError); + }); + + it('should pass gaxOptions to getMetadata', done => { + const gaxOptions = {}; + (instance.getMetadata as Function) = (gaxOptions_: {}) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }; + instance.exists(gaxOptions, assert.ifError); + }); + + it('should return false if error code is 5', done => { + const error = new Error('Error.') as ServiceError; + error.code = 5; + sandbox.stub(instance, 'getMetadata').callsArgWith(1, error); + instance.exists((err, exists) => { + assert.ifError(err); + assert.strictEqual(exists, false); + done(); + }); + }); + + it('should return error if code is not 5', done => { + const error = new Error('Error.') as ServiceError; + error.code = 'NOT-5' as {} as number; + sandbox.stub(instance, 'getMetadata').callsArgWith(1, error); + instance.exists(err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return true if no error', done => { + sandbox.stub(instance, 'getMetadata').callsArgWith(1, null, {}); + instance.exists((err, exists) => { + assert.ifError(err); + assert.strictEqual(exists, true); + done(); + }); + }); + }); + + describe('get', () => { + it('should call getMetadata', done => { + const gaxOptions = {}; + (instance.getMetadata as Function) = (gaxOptions_: {}) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }; + instance.get(gaxOptions, assert.ifError); + }); + + it('should not require gaxOptions', done => { + (instance.getMetadata as Function) = (gaxOptions: {}) => { + assert.deepStrictEqual(gaxOptions, {}); + done(); + }; + instance.get(assert.ifError); + }); + + it('should return an error from getMetadata', done => { + const error = new Error('Error.'); + sandbox.stub(instance, 'getMetadata').callsArgWith(1, error); + instance.get(err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return self and API response', done => { + const metadata = {}; + sandbox.stub(instance, 'getMetadata').callsArgWith(1, null, metadata); + instance.get((err, instance_, metadata_) => { + assert.ifError(err); + assert.strictEqual(instance_, instance); + assert.strictEqual(metadata_, metadata); + done(); + }); + }); + }); + + describe('getAppProfiles', () => { + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'listAppProfiles'); + assert.deepStrictEqual(config.reqOpts, { + parent: INSTANCE_NAME, + }); + assert.deepStrictEqual(config.gaxOpts, {}); + done(); + }; + instance.getAppProfiles(assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual(config.gaxOpts, gaxOptions); + done(); + }; + instance.getAppProfiles(gaxOptions, assert.ifError); + }); + + it('should pass pageToken from gaxOptions into reqOpts', done => { + const pageToken = 'token'; + const gaxOptions = {pageToken, timeout: 1000}; + const expectedGaxOpts = {timeout: 1000}; + const expectedReqOpts: Options = Object.assign( + {}, + {gaxOptions}, + {parent: instance.name}, + {pageToken: gaxOptions.pageToken}, + ); + delete expectedReqOpts.gaxOptions; + + (instance.bigtable.request as Function) = (config: RequestOptions) => { + assert.deepStrictEqual(config.reqOpts, expectedReqOpts); + assert.notStrictEqual(config.gaxOpts, gaxOptions); + assert.notDeepStrictEqual(config.gaxOpts, gaxOptions); + assert.deepStrictEqual(config.gaxOpts, expectedGaxOpts); + done(); + }; + instance.getAppProfiles(gaxOptions, assert.ifError); + }); + + it('should pass pageSize from gaxOptions into reqOpts', done => { + const pageSize = 3; + const gaxOptions = {pageSize, timeout: 1000}; + const expectedGaxOpts = {timeout: 1000}; + const expectedReqOpts: Options = Object.assign( + {}, + {gaxOptions}, + {parent: instance.name}, + {pageSize: gaxOptions.pageSize}, + ); + delete expectedReqOpts.gaxOptions; + + (instance.bigtable.request as Function) = (config: RequestOptions) => { + assert.deepStrictEqual(config.reqOpts, expectedReqOpts); + assert.notStrictEqual(config.gaxOpts, gaxOptions); + assert.notDeepStrictEqual(config.gaxOpts, gaxOptions); + assert.deepStrictEqual(config.gaxOpts, expectedGaxOpts); + done(); + }; + instance.getAppProfiles(gaxOptions, assert.ifError); + }); + + it('should return error from gapic', done => { + const error = new Error('Error.'); + sandbox.stub(instance.bigtable, 'request').callsArgWith(1, error); + instance.getAppProfiles(err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return an array of AppProfile objects', done => { + const response = [{name: 'a'}, {name: 'b'}]; + sandbox + .stub(instance.bigtable, 'request') + .callsArgWith(1, null, response); + instance.getAppProfiles((err, appProfiles, apiResponse) => { + assert.ifError(err); + assert.strictEqual(appProfiles![0].id, 'a'); + assert.deepStrictEqual(appProfiles![0].metadata, response[0]); + assert.strictEqual(appProfiles![1].id, 'b'); + assert.deepStrictEqual(appProfiles![1].metadata, response[1]); + assert.strictEqual(apiResponse, response); + done(); + }); + }); + }); + + describe('getAppProfilesStream', () => { + let returnStream: PassThrough; + beforeEach(() => { + returnStream = new PassThrough({ + objectMode: true, + }); + }); + + it('should provide the proper request options', done => { + const stub = sandbox.stub(pumpify, 'obj'); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'listAppProfilesStream'); + assert.deepStrictEqual(config.reqOpts, { + parent: INSTANCE_NAME, + }); + assert.deepStrictEqual(config.gaxOpts, {}); + setImmediate(done); + return returnStream; + }; + instance.getAppProfilesStream(); + assert.strictEqual(stub.getCall(0).args[0][0], returnStream); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {timeout: 1000}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual(config.gaxOpts, gaxOptions); + setImmediate(done); + return returnStream; + }; + instance.getAppProfilesStream(gaxOptions); + }); + + it('should pass pageToken from gaxOptions into reqOpts', done => { + const pageToken = 'token'; + const gaxOptions = {pageToken, timeout: 1000}; + const expectedGaxOpts = {timeout: 1000}; + const expectedReqOpts: Options = Object.assign( + {}, + {gaxOptions}, + {parent: instance.name}, + {pageToken: gaxOptions.pageToken}, + ); + delete expectedReqOpts.gaxOptions; + + (instance.bigtable.request as Function) = (config: RequestOptions) => { + assert.deepStrictEqual(config.reqOpts, expectedReqOpts); + assert.notStrictEqual(config.gaxOpts, gaxOptions); + assert.notDeepStrictEqual(config.gaxOpts, gaxOptions); + assert.deepStrictEqual(config.gaxOpts, expectedGaxOpts); + setImmediate(done); + return returnStream; + }; + instance.getAppProfilesStream(gaxOptions); + }); + + it('should pass pageSize from gaxOptions into reqOpts', done => { + const pageSize = 3; + const gaxOptions = {pageSize, timeout: 1000}; + const expectedGaxOpts = {timeout: 1000}; + const expectedReqOpts: Options = Object.assign( + {}, + {gaxOptions}, + {parent: instance.name}, + {pageSize: gaxOptions.pageSize}, + ); + delete expectedReqOpts.gaxOptions; + + (instance.bigtable.request as Function) = (config: RequestOptions) => { + assert.deepStrictEqual(config.reqOpts, expectedReqOpts); + assert.notStrictEqual(config.gaxOpts, gaxOptions); + assert.notDeepStrictEqual(config.gaxOpts, gaxOptions); + assert.deepStrictEqual(config.gaxOpts, expectedGaxOpts); + setImmediate(done); + return returnStream; + }; + instance.getAppProfilesStream(gaxOptions); + }); + + it('should return error from gapic', done => { + const error = new Error('Error.'); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = () => { + return returnStream; + }; + setImmediate(() => { + returnStream.destroy(error); + }); + + instance.getAppProfilesStream().on('error', err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return a decorated error with failedLocations list', done => { + let counter = 0; + let failedLocations: string[] = []; + const pages = [ + { + appProfiles: [ + { + name: '/projects/p/instances/i/appProfiles/profile-a', + }, + { + name: '/projects/p/instances/i/appProfiles/profile-b', + }, + ], + response: {failedLocations: []}, + }, + { + appProfiles: [ + { + name: '/projects/p/instances/i/appProfiles/profile-c', + }, + { + name: '/projects/p/instances/i/appProfiles/profile-d', + }, + ], + response: {failedLocations: ['us-east1-a']}, + }, + + { + appProfiles: [ + { + name: '/projects/p/instances/i/appProfiles/profile-e', + }, + { + name: '/projects/p/instances/i/appProfiles/profile-f', + }, + ], + response: {failedLocations: ['us-west1-b', 'us-west1-c']}, + }, + ]; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = () => { + return returnStream; + }; + + setImmediate(() => { + pages.forEach(p => { + failedLocations = failedLocations.concat(p.response.failedLocations); + returnStream.emit('response', p.response); + p.appProfiles.forEach(a => { + returnStream.push(a); + counter++; + }); + }); + returnStream.push(null); + }); + const appProfiles: AppProfile[] = []; + instance + .getAppProfilesStream() + .on('error', err => { + assert.strictEqual(appProfiles.length, counter); + assert.deepStrictEqual( + err, + new Error( + `Resources from the following locations are currently not available\n${JSON.stringify( + failedLocations, + )}`, + ), + ); + done(); + }) + .on('data', appProfile => { + assert(appProfile instanceof FakeAppProfile); + appProfiles.push(appProfile); + }) + .on('end', () => { + done(); + }); + }); + + it('should return an array of AppProfile objects', done => { + const response = [ + { + name: '/projects/my-project/instances/my-instance/appProfiles/my-appProfile-a', + }, + { + name: '/projects/my-project/instances/my-instance/appProfiles/my-appProfile-a', + }, + ]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = () => { + return returnStream; + }; + setImmediate(() => { + response.forEach(r => { + returnStream.push(r); + }); + returnStream.push(null); + }); + + const appProfiles: AppProfile[] = []; + instance + .getAppProfilesStream() + .on('error', assert.ifError) + .on('data', appProfile => { + assert(appProfile instanceof FakeAppProfile); + appProfiles.push(appProfile); + }) + .on('end', () => { + assert.strictEqual( + appProfiles[0].id, + response[0].name.split('/').pop(), + ); + assert.deepStrictEqual(appProfiles[0].metadata, response[0]); + assert.strictEqual( + appProfiles[1].id, + response[1].name.split('/').pop(), + ); + assert.deepStrictEqual(appProfiles[1].metadata, response[1]); + done(); + }); + }); + }); + + describe('getBackups', () => { + it('should correctly call Cluster#getBackups', done => { + const options = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance as any).cluster = (name: string) => { + assert.strictEqual(name, '-'); + return { + getBackups: (_options: {}, callback: Function) => { + assert.strictEqual(_options, options); + callback(); // done() + }, + }; + }; + + instance.getBackups(options, done); + }); + }); + + describe('getBackupsStream', () => { + it('should correctly call Cluster#getBackupsStream', () => { + const options = {}; + const getBackupsStream = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance as any).cluster = (name: string) => { + assert.strictEqual(name, '-'); + return { + getBackupsStream: (_options: {}) => { + assert.strictEqual(_options, options); + return getBackupsStream; + }, + }; + }; + + instance.getBackupsStream(options); + }); + }); + + describe('getClusters', () => { + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'listClusters'); + assert.deepStrictEqual(config.reqOpts, { + parent: INSTANCE_NAME, + }); + assert.deepStrictEqual(config.gaxOpts, {}); + done(); + }; + instance.getClusters(assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + instance.getClusters(gaxOptions, assert.ifError); + }); + + it('should return error from gapic', done => { + const error = new Error('Error.'); + sandbox.stub(instance.bigtable, 'request').callsArgWith(1, error); + instance.getClusters(err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return an array of cluster objects', done => { + const response = { + clusters: [ + { + name: 'a', + }, + { + name: 'b', + }, + ], + }; + const fakeClusters = [{}, {}]; + sandbox + .stub(instance.bigtable, 'request') + .callsArgWith(1, null, response); + let clusterCount = 0; + (instance.cluster as Function) = (name: string) => { + assert.strictEqual(name, response.clusters[clusterCount].name); + return fakeClusters[clusterCount++]; + }; + instance.getClusters((err, clusters, apiResponse) => { + assert.ifError(err); + assert.strictEqual(clusters![0], fakeClusters[0]); + assert.strictEqual(clusters![0].metadata, response.clusters[0]); + assert.strictEqual(clusters![1], fakeClusters[1]); + assert.strictEqual(clusters![1].metadata, response.clusters[1]); + assert.strictEqual(apiResponse, response); + done(); + }); + }); + }); + + describe('getIamPolicy', () => { + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'getIamPolicy'); + assert.strictEqual(config.reqOpts.resource, instance.name); + assert.strictEqual(config.reqOpts.requestedPolicyVersion, undefined); + assert.strictEqual(config.gaxOpt, undefined); + done(); + }; + (instance.getIamPolicy as Function)(assert.ifError); + }); + + it('should accept options', done => { + const requestedPolicyVersion = 0; + const gaxOptions = {}; + const options: GetIamPolicyOptions = {gaxOptions, requestedPolicyVersion}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + assert.strictEqual( + config.reqOpts.options.requestedPolicyVersion, + requestedPolicyVersion, + ); + done(); + }; + instance.getIamPolicy(options, assert.ifError); + }); + + it('should return error', done => { + const error = new Error('error'); + sandbox.stub(instance.bigtable, 'request').callsArgWith(1, error); + (instance.getIamPolicy as Function)((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should call decodePolicyEtag', () => { + sandbox.stub(instance.bigtable, 'request').callsArgWith(1, null, {}); + const spy = sinon.stub(Table, 'decodePolicyEtag'); + (instance.getIamPolicy as Function)(assert.ifError); + assert.strictEqual(spy.calledOnce, true); + spy.restore(); + }); + }); + + describe('getMetadata', () => { + it('should make correct request', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'getInstance'); + assert.deepStrictEqual(config.reqOpts, { + name: instance.name, + }); + assert.deepStrictEqual(config.gaxOpts, {}); + done(); + }; + instance.getMetadata(assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + instance.getMetadata(gaxOptions, assert.ifError); + }); + + it('should update metadata', done => { + const metadata = {}; + sandbox + .stub(instance.bigtable, 'request') + .callsArgWith(1, null, metadata); + instance.getMetadata(() => { + assert.strictEqual(instance.metadata, metadata); + done(); + }); + }); + + it('should execute callback with original arguments', done => { + const args = [{}, {}, {}]; + (instance.bigtable.request as Function) = ( + config: {}, + callback: Function, + ) => { + callback(...args); + }; + instance.getMetadata((...args) => { + assert.deepStrictEqual([].slice.call(args), args); + done(); + }); + }); + }); + + describe('getTables', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const views = ((FakeTable as any).VIEWS = { + unspecified: 0, + name: 1, + schema: 2, + full: 4, + }); + + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'listTables'); + assert.strictEqual(config.reqOpts.parent, INSTANCE_NAME); + assert.strictEqual(config.reqOpts.view, views.unspecified); + assert.deepStrictEqual(config.gaxOpts, {}); + done(); + }; + instance.getTables(assert.ifError); + }); + + it('should accept gaxOptions', done => { + const options = { + gaxOptions: {}, + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual(config.gaxOpts, options.gaxOptions); + done(); + }; + instance.getTables(options, assert.ifError); + }); + + it('should pass pageSize and pageToken from gaxOptions into reqOpts', done => { + const pageSize = 3; + const pageToken = 'token'; + const gaxOptions = {pageSize, pageToken, timeout: 1000}; + const expectedGaxOpts = {timeout: 1000}; + const expectedReqOpts: Options = Object.assign( + {}, + {gaxOptions}, + { + parent: instance.name, + view: Table.VIEWS['unspecified'], + }, + {pageSize: gaxOptions.pageSize, pageToken: gaxOptions.pageToken}, + ); + delete expectedReqOpts.gaxOptions; + + (instance.bigtable.request as Function) = (config: RequestOptions) => { + assert.deepStrictEqual(config.reqOpts, expectedReqOpts); + assert.notStrictEqual(config.gaxOpts, gaxOptions); + assert.notDeepStrictEqual(config.gaxOpts, gaxOptions); + assert.deepStrictEqual(config.gaxOpts, expectedGaxOpts); + done(); + }; + instance.getTables({gaxOptions}, assert.ifError); + }); + + it('pageSize and pageToken in options should take precedence over gaxOptions', done => { + const pageSize = 3; + const pageToken = 'token'; + const gaxOptions = {pageSize, pageToken, timeout: 1000}; + const expectedGaxOpts = {timeout: 1000}; + + const optionsPageSize = 5; + const optionsPageToken = 'optionsToken'; + const options = Object.assign( + {}, + { + pageSize: optionsPageSize, + pageToken: optionsPageToken, + gaxOptions, + }, + ); + const expectedReqOpts = Object.assign( + {}, + { + parent: instance.name, + view: Table.VIEWS['unspecified'], + pageSize: optionsPageSize, + pageToken: optionsPageToken, + }, + ); + + (instance.bigtable.request as Function) = (config: RequestOptions) => { + assert.deepStrictEqual(config.reqOpts, expectedReqOpts); + assert.notStrictEqual(config.gaxOpts, gaxOptions); + assert.notDeepStrictEqual(config.gaxOpts, gaxOptions); + assert.deepStrictEqual(config.gaxOpts, expectedGaxOpts); + done(); + }; + + instance.getTables(options, assert.ifError); + }); + + Object.keys(views).forEach(view => { + it('should set the "' + view + '" view', done => { + const options = { + view, + } as GetTablesOptions; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.reqOpts.view, views[view as 'unspecified']); + done(); + }; + instance.getTables(options, assert.ifError); + }); + }); + + it('should return an array of table objects', done => { + const response = [ + { + name: '/projects/my-project/instances/my-instance/tables/my-table-a', + }, + { + name: '/projects/my-project/instances/my-instance/tables/my-table-b', + }, + ]; + + const fakeTables = [{}, {}]; + sandbox + .stub(instance.bigtable, 'request') + .callsArgWith(1, null, response); + let tableCount = 0; + (instance.table as Function) = (id: string) => { + assert.strictEqual(id, response[tableCount].name.split('/').pop()); + return fakeTables[tableCount++]; + }; + + instance.getTables((err, tables) => { + assert.ifError(err); + assert.strictEqual(tables![0], fakeTables[0]); + assert.strictEqual(tables![0].metadata, response[0]); + assert.strictEqual(tables![1], fakeTables[1]); + assert.strictEqual(tables![1].metadata, response[1]); + done(); + }); + }); + + it('should return original GAPIC response arguments', done => { + const response = [{}, null, {}, {}]; + (instance.bigtable.request as Function) = ( + config: {}, + callback: Function, + ) => { + callback(...response); + }; + instance.getTables((...args) => { + assert.strictEqual(args[0], response[0]); + assert.strictEqual(args[2], response[2]); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + assert.strictEqual((args as any)[3], response[3]); + done(); + }); + }); + + it('should return error', done => { + const error = new Error('Error'); + (instance.bigtable.request as Function) = ( + config: {}, + callback: Function, + ) => { + callback(error); + }; + instance.getTables(err => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('getTablesStream', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const views = ((FakeTable as any).VIEWS = { + unspecified: 0, + name: 1, + schema: 2, + full: 4, + }); + let returnStream: PassThrough; + beforeEach(() => { + returnStream = new PassThrough({ + objectMode: true, + }); + }); + + it('should provide the proper request options', done => { + const stub = sandbox.stub(pumpify, 'obj'); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'listTablesStream'); + assert.strictEqual(config.reqOpts.parent, INSTANCE_NAME); + assert.strictEqual(config.reqOpts.view, views.unspecified); + assert.deepStrictEqual(config.gaxOpts, {}); + setImmediate(done); + return returnStream; + }; + instance.getTablesStream(); + assert.strictEqual(stub.getCall(0).args[0][0], returnStream); + }); + + it('should accept gaxOptions', done => { + const options = { + gaxOptions: {}, + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual(config.gaxOpts, options.gaxOptions); + setImmediate(done); + return returnStream; + }; + instance.getTablesStream(options); + }); + + Object.keys(views).forEach(view => { + it('should set the "' + view + '" view', done => { + const options = { + view, + } as GetTablesOptions; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.reqOpts.view, views[view as 'unspecified']); + setImmediate(done); + return returnStream; + }; + instance.getTablesStream(options); + }); + }); + + it('should return an error from gapic', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = () => { + return returnStream; + }; + const error = new Error('Error'); + setImmediate(() => { + returnStream.destroy(error); + }); + instance.getTablesStream().on('error', err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return an array of table objects', done => { + const response = [ + { + name: '/projects/my-project/instances/my-instance/tables/my-table-a', + }, + { + name: '/projects/my-project/instances/my-instance/tables/my-table-b', + }, + ]; + + const fakeTables = [{}, {}]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = () => { + return returnStream; + }; + let tableCount = 0; + (instance.table as Function) = (id: string) => { + assert.strictEqual(id, response[tableCount].name.split('/').pop()); + return fakeTables[tableCount++]; + }; + setImmediate(() => { + response.forEach(r => { + returnStream.push(r); + }); + returnStream.push(null); + }); + + const tables: Table[] = []; + instance + .getTablesStream() + .on('error', assert.ifError) + .on('data', table => { + tables.push(table); + }) + .on('end', () => { + assert.strictEqual(tables[0], fakeTables[0]); + assert.deepStrictEqual(tables[0].metadata, response[0]); + assert.strictEqual(tables[1], fakeTables[1]); + assert.deepStrictEqual(tables[1].metadata, response[1]); + done(); + }); + }); + + it('should transform into Table objects', done => { + const returnStream = new PassThrough({ + objectMode: true, + }); + const response = [ + { + name: '/projects/my-project/instances/my-instance/tables/my-table-a', + }, + ]; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = () => { + return returnStream; + }; + setImmediate(() => { + returnStream.end(response[0]); + }); + + const tables: Table[] = []; + instance + .getTablesStream() + .on('error', assert.ifError) + .on('data', table => { + assert(table instanceof FakeTable); + tables.push(table); + }) + .on('end', () => { + assert(tables.length > 0); + done(); + }); + }); + }); + + describe('setIamPolicy', () => { + const policy = {} as Policy; + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'setIamPolicy'); + assert.strictEqual(config.reqOpts.resource, instance.name); + assert.strictEqual(config.reqOpts.policy, policy); + assert.strictEqual(config.gaxOpt, undefined); + done(); + }; + instance.setIamPolicy(policy, assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + instance.setIamPolicy(policy, gaxOptions, assert.ifError); + }); + + it('should pass policy to bigtable.request', done => { + const policy: Policy = { + bindings: [ + { + role: 'roles/bigtable.viewer', + members: ['user:mike@example.com', 'group:admins@example.com'], + condition: { + title: 'expirable access', + description: 'Does not grant access after Sep 2020', + expression: "request.time { + assert.strictEqual(config.reqOpts.policy, policy); + done(); + }; + instance.setIamPolicy(policy, assert.ifError); + }); + + it('should encode policy etag', done => { + const policy = {etag: 'ABS'}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual( + config.reqOpts.policy.etag, + Buffer.from(policy.etag), + ); + done(); + }; + instance.setIamPolicy(policy, assert.ifError); + }); + + it('should return error', done => { + const error = new Error('error'); + sandbox.stub(instance.bigtable, 'request').callsArgWith(1, error); + instance.setIamPolicy(policy, err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should call decodePolicyEtag', () => { + sandbox.stub(instance.bigtable, 'request').callsArgWith(1, null, {}); + const spy = sinon.stub(Table, 'decodePolicyEtag'); + instance.setIamPolicy(policy, assert.ifError); + assert.strictEqual(spy.calledOnce, true); + spy.restore(); + }); + }); + + describe('setMetadata', () => { + it('should provide the proper request options', done => { + const metadata = {displayName: 'updateDisplayName'}; + const expectedMetadata = { + instance: {name: instance.name, displayName: 'updateDisplayName'}, + updateMask: {paths: ['display_name']}, + }; + (instance.bigtable.request as Function) = ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + config: any, + callback: Function, + ) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'partialUpdateInstance'); + assert.deepStrictEqual(config.reqOpts, expectedMetadata); + callback(); // done() + }; + instance.setMetadata(metadata, done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + instance.setMetadata({}, gaxOptions, assert.ifError); + }); + + it('should update metadata property with API response', done => { + const response = {}; + sandbox + .stub(instance.bigtable, 'request') + .callsArgWith(1, null, response); + instance.setMetadata({}, err => { + assert.ifError(err); + assert.strictEqual(instance.metadata, response); + done(); + }); + }); + + it('should execute callback with all arguments', done => { + const args = [{}, {}, {}]; + (instance.bigtable.request as Function) = ( + config: {}, + callback: Function, + ) => { + callback(...args); + }; + instance.setMetadata({}, (...args) => { + assert.deepStrictEqual([].slice.call(args), args); + done(); + }); + }); + }); + + describe('table', () => { + const TABLE_ID = 'table-id'; + + it('should return a table instance', () => { + const table = instance.table(TABLE_ID); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const args = (table as any).calledWith_; + assert(table instanceof FakeTable); + assert.strictEqual(args[0], instance); + assert.strictEqual(args[1], TABLE_ID); + }); + }); + + describe('testIamPermissions', () => { + const permissions = 'bigtable.tables.get'; + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableInstanceAdminClient'); + assert.strictEqual(config.method, 'testIamPermissions'); + assert.strictEqual(config.reqOpts.resource, instance.name); + assert.deepStrictEqual(config.reqOpts.permissions, [permissions]); + assert.strictEqual(config.gaxOpt, undefined); + done(); + }; + instance.testIamPermissions(permissions, assert.ifError); + }); + + it('should accept permissions as array', done => { + const permissions = ['bigtable.tables.get', 'bigtable.tables.list']; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.deepStrictEqual(config.reqOpts.permissions, permissions); + done(); + }; + instance.testIamPermissions(permissions, assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (instance.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + instance.testIamPermissions(permissions, gaxOptions, assert.ifError); + }); + + it('should unpack permissions from resp object', done => { + const testPermissions = ['bigtable.tables.get', 'bigtable.tables.list']; + (instance.bigtable.request as Function) = ( + config: {}, + callback: Function, + ) => { + callback(null, {permissions: testPermissions}); + }; + instance.testIamPermissions(testPermissions, (err, permissions) => { + assert.ifError(err); + assert.strictEqual(Array.isArray(permissions), true); + assert.deepStrictEqual(permissions, testPermissions); + done(); + }); + }); + + it('should return error', done => { + const permission = 'bigtable.tables.get'; + const error = new Error('error'); + sandbox.stub(instance.bigtable, 'request').callsArgWith(1, error); + instance.testIamPermissions(permission, err => { + assert.strictEqual(err, error); + done(); + }); + }); + }); +}); + +describe('Bigtable/ExecuteQueryInstance', () => { + // Create an array of Response objects + + const responsesRef = { + responses: [] as google.bigtable.v2.ExecuteQueryResponse[], + + setResponses(values: google.bigtable.v2.ExecuteQueryResponse[]) { + responsesRef.responses = values; + }, + }; + + let requests: any[] = []; + + const INSTANCE_ID = 'my-instance'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const BIGTABLE = { + projectName: 'projects/my-project', + projectId: 'my-project', + request: (config?: any) => { + requests.push(config); + const result: any = Readable.from(responsesRef.responses); + result.abort = () => {}; + return result; + }, + } as Bigtable; + let Instance: typeof inst.Instance; + let instance: inst.Instance; + let checksumValidStub: any; + let checksumIsValid = true; + + before(() => { + Instance = proxyquire('../src/instance.js', { + '@google-cloud/promisify': fakePromisify, + './app-profile.js': {AppProfile: FakeAppProfile}, + './backup.js': {Backup: FakeBackup}, + './cluster.js': {Cluster: FakeCluster}, + './family.js': {Family: FakeFamily}, + './table.js': {Table: FakeTable}, + pumpify, + }).Instance; + }); + + beforeEach(() => { + responsesRef.responses = []; + requests = []; + instance = new Instance(BIGTABLE, INSTANCE_ID); + checksumIsValid = true; + checksumValidStub = sinon + .stub(SqlValues, 'checksumValid') + .callsFake(() => checksumIsValid); + }); + + afterEach(() => { + sandbox.restore(); + checksumValidStub.restore(); + }); + + describe('execute', () => { + it('parses non-composite types', done => { + const preparedStatement = createPreparedStatement( + ['int64', pbType({int64Type: {}})], + ['float64', pbType({float64Type: {}})], + ['string', pbType({stringType: {}})], + ['bytes', pbType({bytesType: {}})], + ['date', pbType({dateType: {}})], + ['timestamp', pbType({timestampType: {}})], + ['bool', pbType({boolType: {}})], + ); + + responsesRef.setResponses([ + createProtoRows( + 'token1', + 111, + undefined, + {intValue: 1}, + {floatValue: 2.5}, + {stringValue: '3'}, + {bytesValue: new Uint8Array([4, 5, 6])}, + {dateValue: new google.type.Date({year: 2024, month: 0, day: 1})}, + { + timestampValue: new google.protobuf.Timestamp({ + seconds: 1234, + nanos: 5678, + }), + }, + {boolValue: true}, + ), + ]); + executeQueryResultWithMetadata( + instance, + preparedStatement, + (err, result, metadata) => { + assert.strictEqual(metadata!.get(0).type, 'int64'); + assert.strictEqual(metadata!.get(1).type, 'float64'); + assert.strictEqual(metadata!.get(2).type, 'string'); + assert.strictEqual(metadata!.get(3).type, 'bytes'); + assert.strictEqual(metadata!.get(4).type, 'date'); + assert.strictEqual(metadata!.get(5).type, 'timestamp'); + assert.strictEqual(metadata!.get(6).type, 'bool'); + + assert.strictEqual(result![0].get(0), BigInt(1)); + assert.strictEqual(result![0].get(1), 2.5); + assert.strictEqual(result![0].get(2), '3'); + assert.deepEqual(result![0].get(3), new Uint8Array([4, 5, 6])); + assert.deepEqual(result![0].get(4), new BigtableDate(2024, 0, 1)); + assert.deepEqual(result![0].get(5), new PreciseDate([1234, 5678])); + assert.strictEqual(result![0].get(6), true); + done(); + }, + ); + }); + + it('parses multiple rows', done => { + const preparedStatement = createPreparedStatement([ + 'f1', + pbType({int64Type: {}}), + ]); + + responsesRef.setResponses([ + createProtoRows('token1', 111, undefined, {intValue: 1}), + createProtoRows('token2', 111, undefined, {intValue: 2}), + createProtoRows('token3', 111, undefined, {intValue: 3}), + ]); + executeQueryResultWithMetadata( + instance, + preparedStatement, + (err, result, metadata) => { + assert.strictEqual(metadata!.get(0), metadata!.get('f1')); + assert.strictEqual(metadata!.get(0).type, 'int64'); + + assert.strictEqual(result![0].get(0), BigInt(1)); + assert.strictEqual(result![1].get(0), BigInt(2)); + assert.strictEqual(result![2].get(0), BigInt(3)); + done(); + }, + ); + }); + + it('handles nulls properly', done => { + const preparedStatement = createPreparedStatement( + ['f1', pbType({int64Type: {}})], + ['f2', pbType({int64Type: {}})], + ); + + responsesRef.setResponses([ + createProtoRows(undefined, undefined, undefined, {intValue: 1}), + createProtoRows('token1', 111, undefined, {}), + createProtoRows(undefined, undefined, undefined, {}), + createProtoRows('token2', 111, undefined, {intValue: 2}), + createProtoRows(undefined, undefined, undefined, {}), + createProtoRows(undefined, undefined, undefined, {intValue: 3}), + createProtoRows('token3', 111, undefined), + createProtoRows(undefined, undefined, undefined, {}), + createProtoRows(undefined, undefined, undefined, {}), + createProtoRows('token4', 111, undefined), + createProtoRows(undefined, undefined, undefined, {intValue: 4}), + createProtoRows(undefined, undefined, undefined, {intValue: 5}), + createProtoRows('token5', 111, undefined), + ]); + executeQueryResultWithMetadata( + instance, + preparedStatement, + (err, result, metadata) => { + assert.strictEqual(result?.length, 5); + + assert.strictEqual(result![0].get(0), BigInt(1)); + assert.strictEqual(result![0].get(1), null); + + assert.strictEqual(result![1].get(0), null); + assert.strictEqual(result![1].get(1), BigInt(2)); + + assert.strictEqual(result![2].get(0), null); + assert.strictEqual(result![2].get(1), BigInt(3)); + + assert.strictEqual(result![3].get(0), null); + assert.strictEqual(result![3].get(1), null); + + assert.strictEqual(result![4].get(0), BigInt(4)); + assert.strictEqual(result![4].get(1), BigInt(5)); + + done(); + }, + ); + }); + + it('handles nulls for all types', done => { + const preparedStatement = createPreparedStatement( + ['int64', pbType({int64Type: {}})], + ['float64', pbType({float64Type: {}})], + ['string', pbType({stringType: {}})], + ['bytes', pbType({bytesType: {}})], + ['date', pbType({dateType: {}})], + ['timestamp', pbType({timestampType: {}})], + ['bool', pbType({boolType: {}})], + ['array', pbType({arrayType: {elementType: pbType({int64Type: {}})}})], + [ + 'map', + pbType({ + mapType: { + keyType: pbType({int64Type: {}}), + valueType: pbType({int64Type: {}}), + }, + }), + ], + [ + 'struct', + pbType({ + structType: { + fields: [{fieldName: 'f1', type: pbType({int64Type: {}})}], + }, + }), + ], + [ + 'arrayWithNulls', + pbType({arrayType: {elementType: pbType({int64Type: {}})}}), + ], + [ + 'mapWithNulls', + pbType({ + mapType: { + keyType: pbType({int64Type: {}}), + valueType: pbType({stringType: {}}), + }, + }), + ], + [ + 'structWithNulls', + pbType({ + structType: { + fields: [ + {fieldName: 'f1', type: pbType({int64Type: {}})}, + {fieldName: null, type: pbType({float64Type: {}})}, + {fieldName: 'f3', type: pbType({stringType: {}})}, + ], + }, + }), + ], + ); + responsesRef.setResponses([ + createProtoRows( + 'token1', + 111, + undefined, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + // arrayWithNulls + { + arrayValue: { + values: [{intValue: 1}, {}, {intValue: 3}], + }, + }, + // mapWithNulls + { + arrayValue: { + values: [ + { + arrayValue: { + values: [{intValue: 1}, {}], + }, + }, + { + arrayValue: { + values: [{intValue: 2}, {}], + }, + }, + { + arrayValue: { + values: [{intValue: 3}, {stringValue: 'c'}], + }, + }, + ], + }, + }, + //structWithNulls + { + arrayValue: { + values: [{intValue: 1}, {}, {}], + }, + }, + ), + ]); + executeQueryResultWithMetadata( + instance, + preparedStatement, + (err, result, metadata) => { + assert.strictEqual(result![0].get(0), null); + assert.strictEqual(result![0].get(1), null); + assert.strictEqual(result![0].get(2), null); + assert.strictEqual(result![0].get(3), null); + assert.strictEqual(result![0].get(4), null); + assert.strictEqual(result![0].get(5), null); + assert.strictEqual(result![0].get(6), null); + assert.strictEqual(result![0].get(7), null); + assert.strictEqual(result![0].get(8), null); + assert.strictEqual(result![0].get(9), null); + + const arrayWithNulls = result![0].get(10) as SqlValue[]; + assert.strictEqual(arrayWithNulls[0], BigInt(1)); + assert.strictEqual(arrayWithNulls[1], null); + assert.strictEqual(arrayWithNulls[2], BigInt(3)); + + const mapWithNulls = result![0].get(11) as BigtableMap; + assert.strictEqual(mapWithNulls.size, 3); + assert.strictEqual(mapWithNulls.get(BigInt(1)), null); + assert.strictEqual(mapWithNulls.get(BigInt(2)), null); + assert.strictEqual(mapWithNulls.get(BigInt(3)), 'c'); + + const structWithNulls = result![0].get(12) as Struct; + assert.strictEqual(structWithNulls.get('f1'), BigInt(1)); + assert.strictEqual(structWithNulls.get(1), null); + assert.strictEqual(structWithNulls.get('f3'), null); + + done(); + }, + ); + }); + + it('parses multiple rows in one batch', done => { + const preparedStatement = createPreparedStatement( + ['f1', pbType({int64Type: {}})], + ['f2', pbType({int64Type: {}})], + ); + responsesRef.setResponses([ + createProtoRows( + undefined, + undefined, + undefined, + {intValue: 1}, + {intValue: 2}, + ), + createProtoRows( + undefined, + undefined, + undefined, + {intValue: 3}, + {intValue: 4}, + ), + createProtoRows('token1', 111, undefined, {intValue: 5}, {intValue: 6}), + ]); + executeQueryResultWithMetadata( + instance, + preparedStatement, + (err, result, metadata) => { + assert.strictEqual(metadata!.get(0), metadata!.get('f1')); + assert.strictEqual(metadata!.get(1), metadata!.get('f2')); + assert.strictEqual(metadata!.get(0).type, 'int64'); + assert.strictEqual(metadata!.get(1).type, 'int64'); + + assert.strictEqual(result![0].get(0), BigInt(1)); + assert.strictEqual(result![0].get('f1'), BigInt(1)); + assert.strictEqual(result![0].get(1), BigInt(2)); + assert.strictEqual(result![0].get('f2'), BigInt(2)); + + assert.strictEqual(result![1].get(0), BigInt(3)); + assert.strictEqual(result![1].get('f1'), BigInt(3)); + assert.strictEqual(result![1].get(1), BigInt(4)); + assert.strictEqual(result![1].get('f2'), BigInt(4)); + + assert.strictEqual(result![2].get(0), BigInt(5)); + assert.strictEqual(result![2].get('f1'), BigInt(5)); + assert.strictEqual(result![2].get(1), BigInt(6)); + assert.strictEqual(result![2].get('f2'), BigInt(6)); + done(); + }, + ); + }); + + it('parses an array of ints', done => { + const preparedStatement = createPreparedStatement([ + 'f1', + pbType({arrayType: {elementType: pbType({int64Type: {}})}}), + ]); + responsesRef.setResponses([ + createProtoRows('token1', 111, undefined, { + arrayValue: { + values: [{intValue: 1}, {intValue: 2}, {intValue: 3}], + }, + }), + ]); + executeQueryResultWithMetadata( + instance, + preparedStatement, + (err, result, metadata) => { + assert.strictEqual(metadata!.get(0), metadata!.get('f1')); + assert.strictEqual(metadata!.get(0).type, 'array'); + const arrayType = metadata!.get(0); + assert(arrayType.type === 'array'); + assert.strictEqual(arrayType.elementType.type, 'int64'); + + const structResult = result![0].get('f1') as SqlValue[]; + assert.strictEqual(structResult[0], BigInt(1)); + assert.strictEqual(structResult[1], BigInt(2)); + assert.strictEqual(structResult[2], BigInt(3)); + done(); + }, + ); + }); + + it('parses a struct', done => { + const preparedStatement = createPreparedStatement( + ['f1', pbType({int64Type: {}})], + [ + 'f2', + pbType({ + structType: { + fields: [ + {fieldName: 'f1', type: pbType({int64Type: {}})}, + {fieldName: null, type: pbType({float64Type: {}})}, + {fieldName: 'f3', type: pbType({stringType: {}})}, + ], + }, + }), + ], + ); + responsesRef.setResponses([ + createProtoRows( + 'token1', + 111, + undefined, + {intValue: 1}, + { + arrayValue: { + values: [{intValue: 1}, {floatValue: 2.5}, {stringValue: '3'}], + }, + }, + ), + ]); + executeQueryResultWithMetadata( + instance, + preparedStatement, + (err, result, metadata) => { + assert.strictEqual(metadata!.get(0), metadata!.get('f1')); + assert.strictEqual(metadata!.get(1), metadata!.get('f2')); + assert.strictEqual(metadata!.get(0).type, 'int64'); + const structType = metadata!.get(1); + assert.strictEqual(structType.type, 'struct'); + assert.strictEqual(structType.get('f1').type, 'int64'); + assert.strictEqual(structType.get(1).type, 'float64'); + assert.strictEqual(structType.get('f3').type, 'string'); + + assert.strictEqual(result![0].get(0), BigInt(1)); + assert.strictEqual(result![0].get('f1'), BigInt(1)); + const structResult = result![0].get(1) as Struct; + assert.strictEqual(structResult.get('f1'), structResult.get(0)); + assert.strictEqual(structResult.get('f3'), structResult.get(2)); + + assert.strictEqual(structResult.get(0), BigInt(1)); + assert.strictEqual(structResult.get(1), 2.5); + assert.strictEqual(structResult.get(2), '3'); + done(); + }, + ); + }); + + it('parses a map', done => { + const preparedStatement = createPreparedStatement([ + 'f1', + pbType({ + mapType: { + keyType: pbType({int64Type: {}}), + valueType: pbType({stringType: {}}), + }, + }), + ]); + responsesRef.setResponses([ + createProtoRows(undefined, undefined, undefined, { + arrayValue: { + values: [ + { + arrayValue: { + values: [{intValue: 1}, {stringValue: 'a'}], + }, + }, + { + arrayValue: { + values: [{intValue: 2}, {stringValue: 'b'}], + }, + }, + { + arrayValue: { + values: [{intValue: 3}, {stringValue: 'c'}], + }, + }, + ], + }, + }), + createProtoRows('token2', 111, undefined, { + arrayValue: { + values: [ + { + arrayValue: { + values: [{intValue: 4}, {stringValue: 'd'}], + }, + }, + { + arrayValue: { + values: [{intValue: 5}, {stringValue: 'e'}], + }, + }, + { + arrayValue: { + values: [{intValue: 6}, {stringValue: 'f'}], + }, + }, + ], + }, + }), + ]); + executeQueryResultWithMetadata( + instance, + preparedStatement, + (err, result, metadata) => { + const mapType = metadata!.get(0); + assert.strictEqual(mapType.type, 'map'); + assert.strictEqual(mapType.keyType.type, 'int64'); + assert.strictEqual(mapType.valueType.type, 'string'); + + assert.strictEqual(result?.length, 2); + + const mapResult0 = result![0].get('f1') as BigtableMap; + assert.strictEqual(mapResult0.size, 3); + assert.strictEqual(mapResult0.get(BigInt(1)), 'a'); + assert.strictEqual(mapResult0.get(BigInt(2)), 'b'); + assert.strictEqual(mapResult0.get(BigInt(3)), 'c'); + + const mapResult1 = result![1].get('f1') as BigtableMap; + assert.strictEqual(mapResult1.size, 3); + assert.strictEqual(mapResult1.get(BigInt(4)), 'd'); + assert.strictEqual(mapResult1.get(BigInt(5)), 'e'); + assert.strictEqual(mapResult1.get(BigInt(6)), 'f'); + done(); + }, + ); + }); + + it('map retains last encountered value for duplicate key', done => { + const preparedStatement = createPreparedStatement([ + 'f1', + pbType({ + mapType: { + keyType: pbType({int64Type: {}}), + valueType: pbType({stringType: {}}), + }, + }), + ]); + responsesRef.setResponses([ + createProtoRows('token1', 111, undefined, { + arrayValue: { + values: [ + { + arrayValue: { + values: [{intValue: 1}, {stringValue: 'a'}], + }, + }, + { + arrayValue: { + values: [{intValue: 2}, {stringValue: 'b'}], + }, + }, + { + arrayValue: { + values: [{intValue: 1}, {stringValue: 'c'}], + }, + }, + ], + }, + }), + ]); + executeQueryResultWithMetadata( + instance, + preparedStatement, + (err, result, metadata) => { + const mapType = metadata!.get(0); + assert.strictEqual(mapType.type, 'map'); + assert.strictEqual(mapType.keyType.type, 'int64'); + assert.strictEqual(mapType.valueType.type, 'string'); + + assert.strictEqual(result?.length, 1); + + const mapResult0 = result![0].get('f1') as BigtableMap; + assert.strictEqual(mapResult0.size, 2); + assert.strictEqual(mapResult0.get(BigInt(1)), 'c'); + assert.strictEqual(mapResult0.get(BigInt(2)), 'b'); + done(); + }, + ); + }); + + it('accessing duplicated struct field throws', done => { + const preparedStatement = createPreparedStatement([ + 'structColumn', + pbType({ + structType: { + fields: [ + {fieldName: 'f1', type: pbType({int64Type: {}})}, + {fieldName: null, type: pbType({float64Type: {}})}, + {fieldName: 'f1', type: pbType({stringType: {}})}, + ], + }, + }), + ]); + responsesRef.setResponses([ + createProtoRows('token1', 111, undefined, { + arrayValue: { + values: [{intValue: 1}, {floatValue: 2.5}, {stringValue: '3'}], + }, + }), + ]); + executeQueryResultWithMetadata( + instance, + preparedStatement, + (err, result, metadata) => { + assert.strictEqual(metadata!.get(0).type, 'struct'); + + const struct = result![0].get(0) as Struct; + assert.strictEqual(struct.get(0), BigInt(1)); + assert.strictEqual(struct.get(1), 2.5); + assert.strictEqual(struct.get(2), '3'); + + assert.throws(() => { + result![0].get('f1'); + }, Error); + done(); + }, + ); + }); + + it('unsupported kind in metadata is detected', done => { + const type = {kind: 'unknown-type'}; + const BIGTABLE2 = { + projectName: 'projects/my-project2', + projectId: 'my-project2', + request: (req, cb: any) => { + cb!( + null, + createPrepareQueryResponse( + ['f1', pbType({int64Type: {}})], + ['f2', type as any], + ), + ); + }, + } as Bigtable; + const instance2 = new Instance(BIGTABLE2, INSTANCE_ID); + + instance2.prepareStatement('query', (err, result) => { + assert.notStrictEqual(err, null); + assert.ok(err instanceof Error); + done(); + }); + }); + + it('unsupported map key type throws', done => { + const BIGTABLE2 = { + projectName: 'projects/my-project2', + projectId: 'my-project2', + request: (req, cb: any) => { + cb!( + null, + createPrepareQueryResponse([ + 'map', + pbType({ + mapType: { + keyType: pbType({dateType: {}}), + valueType: pbType({int64Type: {}}), + }, + }), + ]), + ); + }, + } as Bigtable; + const instance2 = new Instance(BIGTABLE2, INSTANCE_ID); + instance2.prepareStatement('query', (err, result) => { + assert.notStrictEqual(err, null); + done(); + }); + }); + + it('map with null key is rejected', done => { + const preparedStatement = createPreparedStatement([ + 'map', + pbType({ + mapType: { + keyType: pbType({int64Type: {}}), + valueType: pbType({int64Type: {}}), + }, + }), + ]); + responsesRef.setResponses([ + createProtoRows('token1', 111, undefined, { + arrayValue: { + values: [ + { + arrayValue: { + values: [{}, {intValue: 1}], + }, + }, + ], + }, + }), + ]); + instance.executeQuery(preparedStatement, (err, result) => { + assert.strictEqual(result?.length, 1); + done(); + }); + }); + + it('map with null value is ok', done => { + const preparedStatement = createPreparedStatement([ + 'map', + pbType({ + mapType: { + keyType: pbType({int64Type: {}}), + valueType: pbType({int64Type: {}}), + }, + }), + ]); + responsesRef.setResponses([ + createProtoRows('token1', 111, undefined, { + arrayValue: { + values: [ + { + arrayValue: { + values: [{intValue: 1}, {}], + }, + }, + ], + }, + }), + ]); + instance.executeQuery(preparedStatement, (err, result) => { + assert.strictEqual(result?.length, 1); + done(); + }); + }); + + it('bigints are correctly converted to longs', done => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + Object.fromEntries( + Array.from({length: 11}, (_, i) => [ + String.fromCharCode(97 + i), + SqlTypes.Int64(), + ]), + ), // parameter types: {a:INT64, b:INT64, ... } + ); + responsesRef.setResponses([ + createProtoRows('token1', 111, undefined, {intValue: 1}), + ]); + instance.executeQuery( + { + preparedStatement, + parameters: { + a: BigInt(1), + b: BigInt(-1), + c: BigInt(0), + d: BigInt(Number.MAX_SAFE_INTEGER), + e: BigInt(Number.MIN_SAFE_INTEGER), + f: BigInt('9007199254740992'), // MAX_SAFE_INTEGER + 1 + g: BigInt('-9007199254740992'), // MIN_SAFE_INTEGER - 1 + h: BigInt('1152921504606846976'), // 2^60 + i: BigInt('-1152921504606846976'), // - 2^60 + j: BigInt('9223372036854775807'), // 2^63 - 1 + k: BigInt('-9223372036854775808'), // - 2^63 + }, + } as any, + err => { + assert.equal(err, null); + assert.strictEqual(requests.length, 1); + const reqOpts = requests[0] + .reqOpts as google.bigtable.v2.IExecuteQueryRequest; + + assert.deepEqual(reqOpts.params!['a'].intValue, Long.fromInt(1)); + assert.deepEqual(reqOpts.params!['b'].intValue, Long.fromInt(-1)); + assert.deepEqual(reqOpts.params!['c'].intValue, Long.fromInt(0)); + assert.deepEqual( + reqOpts.params!['d'].intValue, + Long.fromNumber(Number.MAX_SAFE_INTEGER), + ); + assert.deepEqual( + reqOpts.params!['e'].intValue, + Long.fromNumber(Number.MIN_SAFE_INTEGER), + ); + assert.deepEqual( + reqOpts.params!['f'].intValue, + Long.fromString('9007199254740992'), + ); + assert.deepEqual( + reqOpts.params!['g'].intValue, + Long.fromString('-9007199254740992'), + ); + assert.deepEqual( + reqOpts.params!['h'].intValue, + Long.fromString('1152921504606846976'), + ); + assert.deepEqual( + reqOpts.params!['i'].intValue, + Long.fromString('-1152921504606846976'), + ); + assert.deepEqual( + reqOpts.params!['j'].intValue, + Long.fromString('9223372036854775807'), + ); + assert.deepEqual( + reqOpts.params!['k'].intValue, + Long.fromString('-9223372036854775808'), + ); + done(); + }, + ); + }); + + it('value not matching provided type is rejected', () => { + assert.throws( + () => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + {a: SqlTypes.Int64()}, + ); + instance.executeQuery( + { + preparedStatement, + parameters: {a: 'a'}, + } as any, + () => {}, + ); + }, + {message: 'Value a cannot be converted to int64.'}, + ); + assert.throws( + () => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + {a: SqlTypes.Float64()}, + ); + instance.executeQuery( + { + preparedStatement, + parameters: {a: BigInt(1)}, + } as any, + () => {}, + ); + }, + {message: 'Value 1 cannot be converted to float64.'}, + ); + assert.throws( + () => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + {a: SqlTypes.String()}, + ); + instance.executeQuery( + { + preparedStatement, + parameters: {a: 1}, + } as any, + () => {}, + ); + }, + {message: 'Value 1 cannot be converted to string.'}, + ); + assert.throws( + () => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + {a: SqlTypes.Bytes()}, + ); + instance.executeQuery( + { + preparedStatement, + parameters: {a: 1}, + } as any, + () => {}, + ); + }, + {message: 'Value 1 cannot be converted to bytes.'}, + ); + assert.throws( + () => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + {a: SqlTypes.Bool()}, + ); + instance.executeQuery( + { + preparedStatement, + parameters: {a: 1}, + } as any, + () => {}, + ); + }, + {message: 'Value 1 cannot be converted to boolean.'}, + ); + assert.throws( + () => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + {a: SqlTypes.Timestamp()}, + ); + instance.executeQuery( + { + preparedStatement, + parameters: {a: 1}, + } as any, + () => {}, + ); + }, + { + message: + 'Value 1 cannot be converted to timestamp, please use PreciseDate instead.', + }, + ); + assert.throws( + () => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + {a: SqlTypes.Date()}, + ); + instance.executeQuery( + { + preparedStatement, + parameters: {a: 1}, + } as any, + () => {}, + ); + }, + {message: 'Value 1 cannot be converted to date.'}, + ); + assert.throws( + () => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + {a: SqlTypes.Array(SqlTypes.Int64())}, + ); + instance.executeQuery( + { + preparedStatement, + parameters: {a: 1}, + } as any, + () => {}, + ); + }, + {message: 'Value 1 cannot be converted to an array.'}, + ); + assert.throws( + () => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + {a: SqlTypes.Array(SqlTypes.Int64())}, + ); + instance.executeQuery( + { + preparedStatement, + parameters: {a: [1, 'a']}, + } as any, + () => {}, + ); + }, + { + message: + 'Error while converting element 0 of an array: Value 1 cannot be converted to int64 - argument of type INT64 should by passed as BigInt.', + }, + ); + // TS does not permit passing a Struct or a Map as parameters, + // but we want to check it throws an error + assert.throws( + () => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + {a: SqlTypes.Map(SqlTypes.Int64(), SqlTypes.Int64())}, + ); + instance.executeQuery( + { + preparedStatement, + parameters: { + a: new Map([ + [BigInt(1), 2], + [BigInt(3), 'a'] as any as [bigint, number], + ]), + }, + } as any, + () => {}, + ); + }, + {message: 'Map is not a supported query param type'}, + ); + assert.throws( + () => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + { + a: SqlTypes.Struct({ + name: 'f1', + type: SqlTypes.Int64(), + }), + }, + ); + instance.executeQuery( + { + preparedStatement, + parameters: { + a: SqlTypes.Struct({ + name: 'f1', + type: SqlTypes.Int64(), + }), + }, + } as any, + () => {}, + ); + }, + {message: 'Struct is not a supported query param type'}, + ); + }); + + it('null value is accepted', done => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + { + a: SqlTypes.Int64(), + }, + ); + responsesRef.setResponses([ + createProtoRows('token1', 111, undefined, {intValue: 1}), + ]); + instance.executeQuery( + { + preparedStatement, + parameters: {a: null}, + } as any, + () => { + assert.strictEqual(requests.length, 1); + const reqOpts = requests[0] + .reqOpts as google.bigtable.v2.IExecuteQueryRequest; + + assert.notStrictEqual(reqOpts.params!['a'].type!.int64Type, null); + done(); + }, + ); + }); + + it('parameter type is used for null', done => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + { + a: SqlTypes.Int64(), + b: SqlTypes.Float64(), + c: SqlTypes.Bool(), + d: SqlTypes.Bytes(), + e: SqlTypes.String(), + f: SqlTypes.Date(), + g: SqlTypes.Timestamp(), + h: SqlTypes.Array(SqlTypes.Int64()), + }, + ); + responsesRef.setResponses([ + createProtoRows('token1', 111, undefined, {intValue: 1}), + ]); + instance.executeQuery( + { + preparedStatement, + parameters: { + a: null, + b: null, + c: null, + d: null, + e: null, + f: null, + g: null, + h: null, + }, + } as any, + () => { + assert.strictEqual(requests.length, 1); + const reqOpts = requests[0] + .reqOpts as google.bigtable.v2.IExecuteQueryRequest; + + assert.notStrictEqual(reqOpts.params!['a'].type!.int64Type, null); + assert.notStrictEqual(reqOpts.params!['b'].type!.float64Type, null); + assert.notStrictEqual(reqOpts.params!['c'].type!.boolType, null); + assert.notStrictEqual(reqOpts.params!['d'].type!.bytesType, null); + assert.notStrictEqual(reqOpts.params!['e'].type!.stringType, null); + assert.notStrictEqual(reqOpts.params!['f'].type!.dateType, null); + assert.notStrictEqual(reqOpts.params!['g'].type!.timestampType, null); + assert.notStrictEqual(reqOpts.params!['h'].type!.arrayType, null); + assert.notStrictEqual( + reqOpts.params!['h'].type!.arrayType?.elementType, + null, + ); + done(); + }, + ); + }); + + it('large bigints are rejected', () => { + const preparedStatement = new PreparedStatement( + BIGTABLE, + createPrepareQueryResponse(['f', pbType({int64Type: {}})]), + {} as any, + {a: SqlTypes.Int64()}, + ); + assert.throws( + () => { + instance.executeQuery( + { + preparedStatement, + parameters: {a: BigInt('-9223372036854775809')}, + } as any, + () => {}, + ); + }, + { + message: + 'Value -9223372036854775809 cannot be converted to int64 - it is out of range.', + }, + ); + assert.throws( + () => { + instance.executeQuery( + { + preparedStatement, + parameters: {a: BigInt('9223372036854775808')}, + } as any, + () => {}, + ); + }, + { + message: + 'Value 9223372036854775808 cannot be converted to int64 - it is out of range.', + }, + ); + }); + + it('duplicate struct field names are not accessible by name', done => { + const preparedStatement = createPreparedStatement([ + 's', + pbType({ + structType: { + fields: [ + {fieldName: 'f1', type: pbType({int64Type: {}})}, + {fieldName: 'f2', type: pbType({int64Type: {}})}, + {fieldName: 'f1', type: pbType({stringType: {}})}, + ], + }, + }), + ]); + responsesRef.setResponses([ + createProtoRows('token1', 111, undefined, { + arrayValue: { + values: [{intValue: 1}, {intValue: 2}, {stringValue: '3'}], + }, + }), + ]); + instance.executeQuery(preparedStatement, (err, rows) => { + const struct = rows![0].get('s')! as Struct; + assert.strictEqual(struct.get(0), BigInt(1)); + assert.strictEqual(struct.get(1), BigInt(2)); + assert.strictEqual(struct.get(2), '3'); + + assert.throws(() => { + struct.get('f1'); + }, Error); + done(); + }); + }); + + it('duplicate row field names are not accessible by name', done => { + const preparedStatement = createPreparedStatement( + ['f1', pbType({int64Type: {}})], + ['f2', pbType({int64Type: {}})], + ['f1', pbType({int64Type: {}})], + ); + responsesRef.setResponses([ + createProtoRows( + 'token1', + 111, + undefined, + {intValue: 1}, + {intValue: 2}, + {intValue: 3}, + ), + ]); + executeQueryResultWithMetadata( + instance, + preparedStatement, + (err, rows, metadata) => { + const row = rows![0]; + assert.strictEqual(row.get(0), BigInt(1)); + assert.strictEqual(row.get(1), BigInt(2)); + assert.strictEqual(row.get(2), BigInt(3)); + assert.strictEqual(row.get('f2'), BigInt(2)); + + assert.throws(() => { + row.get('f1'); + }, Error); + + assert.strictEqual(metadata!.get(0).type, 'int64'); + assert.strictEqual(metadata!.get(1).type, 'int64'); + assert.strictEqual(metadata!.get(2).type, 'int64'); + assert.strictEqual(metadata!.get('f2').type, 'int64'); + + assert.throws(() => { + metadata!.get('f1'); + }, Error); + + done(); + }, + ); + }); + + it('unfinished batch is detected', done => { + const preparedStatement = createPreparedStatement( + ['f1', pbType({int64Type: {}})], + ['f2', pbType({int64Type: {}})], + ); + responsesRef.setResponses([ + createProtoRows(undefined, undefined, undefined, {intValue: 3}), + ]); + instance.executeQuery(preparedStatement, (err, result) => { + assert.notStrictEqual(err, null); + assert.ok(err instanceof Error); + done(); + }); + }); + + it('token without batch ending detected', done => { + const preparedStatement = createPreparedStatement( + ['f1', pbType({int64Type: {}})], + ['f2', pbType({int64Type: {}})], + ); + responsesRef.setResponses([ + createProtoRows('token', undefined, undefined, {intValue: 3}), + ]); + instance.executeQuery(preparedStatement, (err, result) => { + assert.notStrictEqual(err, null); + assert.ok(err instanceof Error); + done(); + }); + }); + + it('reset works', done => { + const preparedStatement = createPreparedStatement( + ['f1', pbType({int64Type: {}})], + ['f2', pbType({int64Type: {}})], + ); + + const respWithReset1 = createProtoRows(undefined, undefined, undefined, { + intValue: 1, + }); + respWithReset1.results!.reset = true; + + const respWithReset2 = createProtoRows( + undefined, + 111, + undefined, + {intValue: 3}, + {intValue: 4}, + ); + respWithReset2.results!.reset = true; + + responsesRef.setResponses([ + createProtoRows( + undefined, + undefined, + undefined, + {intValue: 1}, + {intValue: 2}, + ), + respWithReset1, + respWithReset2, + createProtoRows('token', 222, undefined, {intValue: 5}, {intValue: 6}), + ]); + instance.executeQuery(preparedStatement, (err, result) => { + assert.equal(err, null); + assert.strictEqual(result![0].get(0), BigInt(3)); + assert.strictEqual(result![0].get(1), BigInt(4)); + assert.strictEqual(result![1].get(0), BigInt(5)); + assert.strictEqual(result![1].get(1), BigInt(6)); + done(); + }); + }); + + it('partial row after token detected', done => { + const preparedStatement = createPreparedStatement( + ['f1', pbType({int64Type: {}})], + ['f2', pbType({int64Type: {}})], + ); + responsesRef.setResponses([ + createProtoRows( + 'token1', + 111, + undefined, + {intValue: 1}, + {intValue: 2}, + {intValue: 3}, + ), + ]); + instance.executeQuery(preparedStatement, (err, result) => { + assert.notStrictEqual(err, null); + assert.ok(err instanceof Error); + done(); + }); + }); + + it('partial row after batch checksum detected', done => { + const preparedStatement = createPreparedStatement( + ['f1', pbType({int64Type: {}})], + ['f2', pbType({int64Type: {}})], + ); + responsesRef.setResponses([ + createProtoRows( + undefined, + 111, + undefined, + {intValue: 1}, + {intValue: 2}, + {intValue: 3}, + ), + createProtoRows('token1', 222, undefined, {intValue: 4}), + ]); + instance.executeQuery(preparedStatement, (err, result) => { + assert.notStrictEqual(err, null); + assert.ok(err instanceof Error); + done(); + }); + }); + + it('cheksum fail detected', done => { + checksumIsValid = false; + const preparedStatement = createPreparedStatement( + ['f1', pbType({int64Type: {}})], + ['f2', pbType({int64Type: {}})], + ); + responsesRef.setResponses([ + createProtoRows( + undefined, + 111, + undefined, + {intValue: 1}, + {intValue: 2}, + ), + createProtoRows('token1', 222, undefined, {intValue: 3}, {intValue: 4}), + ]); + instance.executeQuery(preparedStatement, (err, result) => { + assert.notStrictEqual(err, null); + assert.ok(err instanceof Error); + done(); + }); + }); + }); +}); diff --git a/handwritten/bigtable/test/metric-service-client-credentials.ts b/handwritten/bigtable/test/metric-service-client-credentials.ts new file mode 100644 index 00000000000..b05caa470f6 --- /dev/null +++ b/handwritten/bigtable/test/metric-service-client-credentials.ts @@ -0,0 +1,121 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import * as proxyquire from 'proxyquire'; +import {ClientOptions, grpc} from 'google-gax'; +import * as assert from 'assert'; +import {MetricServiceClient} from '@google-cloud/monitoring'; + +describe('Bigtable/MetricServiceClientCredentials', () => { + it('should pass the credentials and universe domain to the exporter', done => { + const clientOptions = { + metricsEnabled: true, + sslCreds: grpc.credentials.createInsecure(), + universeDomain: 'some-universe-domain.com', + }; + class FakeExporter { + constructor(options: ClientOptions) { + try { + assert.deepStrictEqual(options, clientOptions); + done(); + } catch (e) { + done(e); + } + } + } + const FakeCGPMetricsHandler = proxyquire( + '../src/client-side-metrics/gcp-metrics-handler.js', + { + './exporter': { + CloudMonitoringExporter: FakeExporter, + }, + }, + ).GCPMetricsHandler; + const FakeBigtable = proxyquire('../src/index.js', { + './client-side-metrics/gcp-metrics-handler': { + GCPMetricsHandler: FakeCGPMetricsHandler, + }, + }).Bigtable; + new FakeBigtable(clientOptions); + }); + it('should use second project for the metric service client', async () => { + const SECOND_PROJECT_ID = 'second-project-id'; + const clientOptions = {metricsEnabled: true, projectId: SECOND_PROJECT_ID}; + let savedOptions: ClientOptions = {}; + class FakeExporter { + constructor(options: ClientOptions) { + savedOptions = options; + } + } + const FakeCGPMetricsHandler = proxyquire( + '../src/client-side-metrics/gcp-metrics-handler.js', + { + './exporter': { + CloudMonitoringExporter: FakeExporter, + }, + }, + ).GCPMetricsHandler; + const FakeBigtable = proxyquire('../src/index.js', { + './client-side-metrics/gcp-metrics-handler': { + GCPMetricsHandler: FakeCGPMetricsHandler, + }, + }).Bigtable; + new FakeBigtable(clientOptions); + // savedOptions are the options passed down to the exporter + // we want to ensure that when the second project id is provided to the + // fake client that this sends savedOptions to the exporter that then + // fetches the right projectId when the saved options are provided to the + // MetricsServiceClient as this is required to save the metrics to the right + // project. + const client = new MetricServiceClient(savedOptions); + const projectIdUsed = await client.getProjectId(); + assert.strictEqual(projectIdUsed, SECOND_PROJECT_ID); + }); + it('should pass the credentials and universe domain to the metric service client', done => { + const clientOptions = { + metricsEnabled: true, + sslCreds: grpc.credentials.createInsecure(), + universeDomain: 'some-universe-domain.com', + }; + class FakeMetricServiceClient { + constructor(options: ClientOptions) { + try { + assert.deepStrictEqual(options, clientOptions); + done(); + } catch (e) { + done(e); + } + } + } + const FakeExporter = proxyquire('../src/client-side-metrics/exporter.js', { + '@google-cloud/monitoring': { + MetricServiceClient: FakeMetricServiceClient, + }, + }).CloudMonitoringExporter; + const FakeCGPMetricsHandler = proxyquire( + '../src/client-side-metrics/gcp-metrics-handler.js', + { + './exporter': { + CloudMonitoringExporter: FakeExporter, + }, + }, + ).GCPMetricsHandler; + const FakeBigtable = proxyquire('../src/index.js', { + './client-side-metrics/gcp-metrics-handler': { + GCPMetricsHandler: FakeCGPMetricsHandler, + }, + }).Bigtable; + new FakeBigtable(clientOptions); + }); +}); diff --git a/handwritten/bigtable/test/metrics-collector/gcp-metrics-handler.ts b/handwritten/bigtable/test/metrics-collector/gcp-metrics-handler.ts new file mode 100644 index 00000000000..0e1d06039b8 --- /dev/null +++ b/handwritten/bigtable/test/metrics-collector/gcp-metrics-handler.ts @@ -0,0 +1,174 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {describe} from 'mocha'; +import {ResourceMetrics} from '@opentelemetry/sdk-metrics'; +import { + ExportResult, + metricsToRequest, +} from '../../src/client-side-metrics/exporter'; +import {MetricExporter} from '@google-cloud/opentelemetry-cloud-monitoring-exporter'; +import {expectedRequestsHandled} from '../../test-common/metrics-handler-fixture'; +import { + OnAttemptCompleteData, + OnOperationCompleteData, +} from '../../src/client-side-metrics/metrics-handler'; +import { + expectedOtelExportConvertedValue, + expectedOtelExportInput, +} from '../../test-common/expected-otel-export-input'; +import * as assert from 'assert'; +import {replaceTimestamps} from '../../test-common/replace-timestamps'; +import * as proxyquire from 'proxyquire'; + +/** + * Cleans a ResourceMetrics object by replacing client UUIDs with a placeholder. + * + * This function creates a deep copy of the input ResourceMetrics object and + * then iterates through its metrics, replacing any existing client_uid attribute + * in the data points with the string 'fake-uuid'. This is primarily used in + * testing to ensure consistent metric output by removing the variability of + * randomly generated client UUIDs. + * + * @param {ResourceMetrics} metrics The ResourceMetrics object to clean. + * @returns {ResourceMetrics} A new ResourceMetrics object with client UUIDs replaced by 'fake-uuid'. + */ +function cleanMetrics(metrics: ResourceMetrics): ResourceMetrics { + const newMetrics = JSON.parse(JSON.stringify(metrics)); // Deep copy to avoid modifying the original object + + newMetrics.scopeMetrics.forEach((scopeMetric: any) => { + scopeMetric.metrics.forEach((metric: any) => { + if (metric.dataPoints) { + metric.dataPoints.forEach((dataPoint: any) => { + if (dataPoint.attributes && dataPoint.attributes.client_uid) { + dataPoint.attributes.client_uid = 'fake-uuid'; + } + }); + } + }); + }); + + return newMetrics; +} + +describe('Bigtable/GCPMetricsHandler', () => { + it('Should export a value ready for sending to the CloudMonitoringExporter', function (done) { + this.timeout(600000); + (async () => { + /* + We need to create a timeout here because if we don't then mocha shuts down + the test as it is sleeping before the GCPMetricsHandler has a chance to + export the data. + */ + const timeout = setTimeout(() => {}, 120000); + /* + The exporter is called every x seconds, but we only want to test the value + it receives once. Since done cannot be called multiple times in mocha, + exporter ensures we only test the value export receives one time. + */ + let exported = false; + + class TestExporter extends MetricExporter { + constructor() { + super(); + } + + export( + metrics: ResourceMetrics, + resultCallback: (result: ExportResult) => void, + ): void { + if (!exported) { + exported = true; + try { + metrics = cleanMetrics(metrics); + replaceTimestamps( + metrics as unknown as typeof expectedOtelExportInput, + [123, 789], + [456, 789], + ); + const parsedExportInput: ResourceMetrics = JSON.parse( + JSON.stringify(metrics), + ); + assert.deepStrictEqual( + parsedExportInput.scopeMetrics[0].metrics.length, + expectedOtelExportInput.scopeMetrics[0].metrics.length, + ); + for ( + let index = 0; + index < parsedExportInput.scopeMetrics[0].metrics.length; + index++ + ) { + // We need to compare pointwise because mocha truncates to an 8192 character limit. + assert.deepStrictEqual( + parsedExportInput.scopeMetrics[0].metrics[index], + expectedOtelExportInput.scopeMetrics[0].metrics[index], + ); + } + assert.deepStrictEqual( + JSON.parse(JSON.stringify(metrics)), + expectedOtelExportInput, + ); + const convertedRequest = metricsToRequest(parsedExportInput); + assert.deepStrictEqual( + convertedRequest.timeSeries.length, + expectedOtelExportConvertedValue.timeSeries.length, + ); + for ( + let index = 0; + index < convertedRequest.timeSeries.length; + index++ + ) { + // We need to compare pointwise because mocha truncates to an 8192 character limit. + assert.deepStrictEqual( + convertedRequest.timeSeries[index], + expectedOtelExportConvertedValue.timeSeries[index], + ); + } + clearTimeout(timeout); + resultCallback({code: 0}); + done(); + } catch (e) { + done(e); + } + } else { + // The test suite will not complete if unanswered callbacks + // remain on subsequent export calls. + resultCallback({code: 0}); + } + } + } + const stubs = { + './exporter': { + CloudMonitoringExporter: TestExporter, + }, + }; + const FakeMetricsHandler = proxyquire( + '../../src/client-side-metrics/gcp-metrics-handler.js', + stubs, + ).GCPMetricsHandler; + + const handler = new FakeMetricsHandler('my-project'); + + for (const request of expectedRequestsHandled) { + if (request.attemptLatency) { + handler.onAttemptComplete(request as OnAttemptCompleteData); + } else { + handler.onOperationComplete(request as OnOperationCompleteData); + } + } + })().catch(err => { + throw err; + }); + }); +}); diff --git a/handwritten/bigtable/test/metrics-collector/metrics-collector.ts b/handwritten/bigtable/test/metrics-collector/metrics-collector.ts new file mode 100644 index 00000000000..0436c48702f --- /dev/null +++ b/handwritten/bigtable/test/metrics-collector/metrics-collector.ts @@ -0,0 +1,186 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {describe} from 'mocha'; +import * as assert from 'assert'; +import * as fs from 'fs'; +import {TestMetricsHandler} from '../../test-common/test-metrics-handler'; +import { + MethodName, + StreamingState, +} from '../../src/client-side-metrics/client-side-metrics-attributes'; +import {grpc} from 'google-gax'; +import {expectedRequestsHandled} from '../../test-common/metrics-handler-fixture'; +import * as path from 'path'; // Import the 'path' module +import * as gax from 'google-gax'; +import * as proxyquire from 'proxyquire'; +import {GCPMetricsHandler} from '../../src/client-side-metrics/gcp-metrics-handler'; +const protoPath = path.join( + __dirname, + '../../protos/google/bigtable/v2/response_params.proto', +); +const root = gax.protobuf.loadSync(protoPath); +const ResponseParams = root.lookupType('ResponseParams'); + +const projectId = 'my-project'; + +/** + * A fake implementation of the Bigtable client for testing purposes. Provides a + * metricsTracerFactory and a stubbed projectId method. + */ +class FakeBigtable { + appProfileId?: string; + projectId = projectId; +} + +/** + * A fake implementation of a Bigtable instance for testing purposes. Provides only an ID. + */ +class FakeInstance { + /** + * The ID of the fake instance. + */ + id = 'fakeInstanceId'; +} + +const logger = {value: ''}; +const testHandler = new TestMetricsHandler(); +testHandler.projectId = projectId; +testHandler.messages = logger; + +describe('Bigtable/MetricsCollector', () => { + class FakeHRTime { + startTime = BigInt(0); + bigint() { + this.startTime += BigInt(1000000000); + logger.value += `getDate call returns ${Number(this.startTime / BigInt(1000000))} ms\n`; + return this.startTime; + } + } + + const stubs = { + 'node:process': { + hrtime: new FakeHRTime(), + }, + './gcp-metrics-handler': { + GCPMetricsHandler: testHandler, + }, + }; + const FakeOperationsMetricsCollector = proxyquire( + '../../src/client-side-metrics/operation-metrics-collector.js', + stubs, + ).OperationMetricsCollector; + + it('should record the right metrics with a typical method call', async () => { + class FakeTable { + id = 'fakeTableId'; + instance = new FakeInstance(); + bigtable = new FakeBigtable(); + + async fakeMethod(): Promise { + class FakeUserStream { + getTotalDurationMs() { + return 1256; + } + } + const userStream = new FakeUserStream(); + function createMetadata(duration: string) { + return { + internalRepr: new Map([ + ['server-timing', [`gfet4t7; dur=${duration}`]], + ]), + options: {}, + }; + } + if (this.bigtable.projectId) { + const status = { + metadata: { + internalRepr: new Map([ + [ + 'x-goog-ext-425905942-bin', + [ + ResponseParams.encode({ + zoneId: 'us-west1-c', + clusterId: 'fake-cluster3', + }).finish(), + ], + ], + ]), + options: {}, + }, + }; + const metricsCollector = new FakeOperationsMetricsCollector( + this, + MethodName.READ_ROWS, + StreamingState.STREAMING, + [testHandler as unknown as GCPMetricsHandler], + ); + // In this method we simulate a series of events that might happen + // when a user calls one of the Table methods. + // Here is an example of what might happen in a method call: + logger.value += '1. The operation starts\n'; + metricsCollector.onOperationStart(); + logger.value += '2. The attempt starts.\n'; + metricsCollector.onAttemptStart(); + logger.value += '3. Client receives status information.\n'; + metricsCollector.onStatusMetadataReceived(status); + logger.value += '4. Client receives metadata.\n'; + metricsCollector.onMetadataReceived(createMetadata('101')); + logger.value += '5. Client receives first row.\n'; + metricsCollector.onResponse(this.bigtable.projectId); + logger.value += '6. User receives first row.\n'; + logger.value += '7. Client receives metadata.\n'; + metricsCollector.onMetadataReceived(createMetadata('102')); + logger.value += '8. Client receives second row.\n'; + metricsCollector.onResponse(this.bigtable.projectId); + logger.value += '9. User receives second row.\n'; + logger.value += '10. A transient error occurs.\n'; + metricsCollector.onAttemptComplete(grpc.status.DEADLINE_EXCEEDED); + logger.value += '11. After a timeout, the second attempt is made.\n'; + metricsCollector.onAttemptStart(); + logger.value += '12. Client receives status information.\n'; + metricsCollector.onStatusMetadataReceived(status); + logger.value += '13. Client receives metadata.\n'; + metricsCollector.onMetadataReceived(createMetadata('103')); + logger.value += '14. Client receives third row.\n'; + metricsCollector.onResponse(this.bigtable.projectId); + logger.value += '15. User receives third row.\n'; + logger.value += '16. Client receives metadata.\n'; + metricsCollector.onMetadataReceived(createMetadata('104')); + logger.value += '17. Client receives fourth row.\n'; + metricsCollector.onResponse(this.bigtable.projectId); + logger.value += '18. User receives fourth row.\n'; + logger.value += '19. User reads row 1\n'; + logger.value += '20. Stream ends, operation completes\n'; + metricsCollector.onOperationComplete( + grpc.status.OK, + userStream.getTotalDurationMs(), + ); + } + } + } + const table = new FakeTable(); + await table.fakeMethod(); + const expectedOutput = fs.readFileSync( + './test/metrics-collector/typical-method-call.txt', + 'utf8', + ); + // Ensure events occurred in the right order here: + assert.strictEqual(logger.value, expectedOutput.replace(/\r/g, '')); + assert.deepStrictEqual( + testHandler.requestsHandled, + expectedRequestsHandled, + ); + }); +}); diff --git a/handwritten/bigtable/test/metrics-collector/metricsToRequest.ts b/handwritten/bigtable/test/metrics-collector/metricsToRequest.ts new file mode 100644 index 00000000000..0e36f91b14a --- /dev/null +++ b/handwritten/bigtable/test/metrics-collector/metricsToRequest.ts @@ -0,0 +1,42 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import * as assert from 'assert'; +import {describe} from 'mocha'; +import {metricsToRequest} from '../../src/client-side-metrics/exporter'; +import { + expectedOtelExportConvertedValue, + expectedOtelExportInput, +} from '../../test-common/expected-otel-export-input'; +import {ResourceMetrics} from '@opentelemetry/sdk-metrics'; + +describe('Bigtable/metricsToRequest', () => { + it('Converts an otel request to a request ready for the metric service client', () => { + const convertedValue = metricsToRequest( + expectedOtelExportInput as unknown as ResourceMetrics, + ); + assert.deepStrictEqual( + convertedValue.timeSeries.length, + expectedOtelExportConvertedValue.timeSeries.length, + ); + for (let index = 0; index < convertedValue.timeSeries.length; index++) { + // We need to compare pointwise because mocha truncates to an 8192 character limit. + assert.deepStrictEqual( + convertedValue.timeSeries[index], + expectedOtelExportConvertedValue.timeSeries[index], + ); + } + assert.strictEqual(convertedValue.name, 'projects/my-project'); + }); +}); diff --git a/handwritten/bigtable/test/metrics-collector/typical-method-call.txt b/handwritten/bigtable/test/metrics-collector/typical-method-call.txt new file mode 100644 index 00000000000..34c2c4ba5e2 --- /dev/null +++ b/handwritten/bigtable/test/metrics-collector/typical-method-call.txt @@ -0,0 +1,33 @@ +1. The operation starts +getDate call returns 1000 ms +2. The attempt starts. +getDate call returns 2000 ms +3. Client receives status information. +4. Client receives metadata. +5. Client receives first row. +getDate call returns 3000 ms +6. User receives first row. +7. Client receives metadata. +8. Client receives second row. +9. User receives second row. +10. A transient error occurs. +getDate call returns 4000 ms +Recording parameters for onAttemptComplete: +{"metricsCollectorData":{"instanceId":"fakeInstanceId","table":"fakeTableId","cluster":"fake-cluster3","zone":"us-west1-c","method":"Bigtable.ReadRows","projectId":"my-project"},"attemptLatency":2000,"serverLatency":101,"connectivityErrorCount":0,"streaming":"true","status":"DEADLINE_EXCEEDED","client_name":"nodejs-bigtable"} +11. After a timeout, the second attempt is made. +getDate call returns 5000 ms +12. Client receives status information. +13. Client receives metadata. +14. Client receives third row. +15. User receives third row. +16. Client receives metadata. +17. Client receives fourth row. +18. User receives fourth row. +19. User reads row 1 +20. Stream ends, operation completes +getDate call returns 6000 ms +Recording parameters for onAttemptComplete: +{"metricsCollectorData":{"instanceId":"fakeInstanceId","table":"fakeTableId","cluster":"fake-cluster3","zone":"us-west1-c","method":"Bigtable.ReadRows","projectId":"my-project"},"attemptLatency":1000,"serverLatency":103,"connectivityErrorCount":0,"streaming":"true","status":"OK","client_name":"nodejs-bigtable"} +getDate call returns 7000 ms +Recording parameters for onOperationComplete: +{"metricsCollectorData":{"instanceId":"fakeInstanceId","table":"fakeTableId","cluster":"fake-cluster3","zone":"us-west1-c","method":"Bigtable.ReadRows","projectId":"my-project"},"status":"OK","streaming":"true","client_name":"nodejs-bigtable","operationLatency":6000,"retryCount":1,"firstResponseLatency":2000,"applicationLatency":1256} diff --git a/handwritten/bigtable/test/metrics-collector/version/get-version-script.js b/handwritten/bigtable/test/metrics-collector/version/get-version-script.js new file mode 100644 index 00000000000..2950deaca99 --- /dev/null +++ b/handwritten/bigtable/test/metrics-collector/version/get-version-script.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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'); +const fs = require('fs'); +const { + ClientSideMetricsConfigManager, +} = require('../../../build/src/client-side-metrics/metrics-config-manager.js'); // eslint-disable-line +const {Bigtable} = require('../../../build/src'); // eslint-disable-line + +async function main() { + /** + * A test implementation of the IMetricsHandler interface. Used for testing purposes. + * It logs the metrics and attributes received by the onOperationComplete and onAttemptComplete methods. + * Doesn't replace the name of the client like the other testing class. + */ + class TestMetricsHandlerKeepName { + constructor() { + this.messages = {value: ''}; + this.projectId = 'projectId'; + this.requestsHandled = []; + } + /** + * Logs the metrics and attributes received for an operation completion. + * @param {OnOperationCompleteData} data Metrics related to the completed operation. + */ + onOperationComplete(data) { + const dataWithProject = Object.assign({projectId: this.projectId}, data); + this.requestsHandled.push(dataWithProject); + this.messages.value += 'Recording parameters for onOperationComplete:\n'; + this.messages.value += `${JSON.stringify(dataWithProject)}\n`; + } + + /** + * Logs the metrics and attributes received for an attempt completion. + * @param {OnOperationCompleteData} data Metrics related to the completed attempt. + */ + onAttemptComplete(data) { + const dataWithProject = Object.assign({projectId: this.projectId}, data); + this.requestsHandled.push(dataWithProject); + this.messages.value += 'Recording parameters for onAttemptComplete:\n'; + this.messages.value += `${JSON.stringify(dataWithProject)}\n`; + } + } + + const packagePath = path.join(__dirname, '../../../package.json'); + + // Read the file using the absolute path + const packageJSON = fs.readFileSync(packagePath); + const expectedVersion = JSON.parse(packageJSON.toString()).version; + + const fakeBigtable = new Bigtable(); + const testMetricsHandler = new TestMetricsHandlerKeepName(); + fakeBigtable._metricsConfigManager = new ClientSideMetricsConfigManager([ + testMetricsHandler, + ]); + + const instance = fakeBigtable.instance('fake-instance-id'); + const table = instance.table('fake-table-id'); + try { + await table.getRows(); + } catch (e) { + // Suppress the error. + // We just made this call so that the test metrics handler would + // collect grpc response data. + } + if ( + testMetricsHandler.requestsHandled[0].client_name !== + `nodejs-bigtable/${expectedVersion}` + ) { + throw Error('The wrong version is being recorded'); + } +} +main(); diff --git a/handwritten/bigtable/test/metrics-collector/version/package.json b/handwritten/bigtable/test/metrics-collector/version/package.json new file mode 100644 index 00000000000..278e241e9a3 --- /dev/null +++ b/handwritten/bigtable/test/metrics-collector/version/package.json @@ -0,0 +1,7 @@ +{ + "version": "fake-version-number", + "private": true, + "engines": { + "node": ">=18" + } +} diff --git a/handwritten/bigtable/test/metrics-collector/version/version.ts b/handwritten/bigtable/test/metrics-collector/version/version.ts new file mode 100644 index 00000000000..06bf9d61a1d --- /dev/null +++ b/handwritten/bigtable/test/metrics-collector/version/version.ts @@ -0,0 +1,23 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +// eslint-disable-next-line n/no-extraneous-import +import {describe} from 'mocha'; +import {execSync} from 'node:child_process'; + +describe('Bigtable/CSMVersion', () => { + it('Fetches the right client side metrics version', async () => { + execSync('cd test/metrics-collector/version && node get-version-script'); + }); +}); diff --git a/handwritten/bigtable/test/mutation.ts b/handwritten/bigtable/test/mutation.ts new file mode 100644 index 00000000000..c0f67e730ff --- /dev/null +++ b/handwritten/bigtable/test/mutation.ts @@ -0,0 +1,524 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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 assert from 'assert'; +import {beforeEach, describe, it, afterEach} from 'mocha'; +import * as Long from 'long'; +import * as sinon from 'sinon'; + +import {IMutateRowRequest, Mutation, IMutation} from '../src/mutation.js'; + +const sandbox = sinon.createSandbox(); + +describe('Bigtable/Mutation', () => { + afterEach(() => { + sandbox.restore(); + }); + + describe('instantiation', () => { + const fakeData = { + key: 'a', + method: 'b', + data: 'c', + }; + + it('should localize all the mutation properties', () => { + const mutation = new Mutation(fakeData); + + assert.strictEqual(mutation.key, fakeData.key); + assert.strictEqual(mutation.method, fakeData.method); + assert.strictEqual(mutation.data, fakeData.data); + }); + }); + + describe('convertFromBytes', () => { + describe('isPossibleNumber', () => { + it('should convert a base64 encoded number when true', () => { + const num = 10; + const encoded = Buffer.from(Long.fromNumber(num).toBytesBE()).toString( + 'base64', + ); + const decoded = Mutation.convertFromBytes(encoded, { + isPossibleNumber: true, + }); + + assert.strictEqual(num, decoded); + }); + + it('should convert a base64 encoded MIN_SAFE_INTEGER number when true', () => { + const num = Number.MIN_SAFE_INTEGER; + const encoded = Buffer.from(Long.fromNumber(num).toBytesBE()).toString( + 'base64', + ); + const decoded = Mutation.convertFromBytes(encoded, { + isPossibleNumber: true, + }); + + assert.strictEqual(num, decoded); + }); + + it('should convert a base64 encoded MAX_SAFE_INTEGER number when true', () => { + const num = Number.MAX_SAFE_INTEGER; + const encoded = Buffer.from(Long.fromNumber(num).toBytesBE()).toString( + 'base64', + ); + const decoded = Mutation.convertFromBytes(encoded, { + isPossibleNumber: true, + }); + + assert.strictEqual(num, decoded); + }); + + it('should not convert a base64 encoded smaller than MIN_SAFE_INTEGER number when true', () => { + const num = Number.MIN_SAFE_INTEGER - 100; + const encoded = Buffer.from(Long.fromNumber(num).toBytesBE()).toString( + 'base64', + ); + const decoded = Mutation.convertFromBytes(encoded, { + isPossibleNumber: true, + }); + + assert.notStrictEqual(num, decoded); + }); + + it('should not convert a base64 encoded larger than MAX_SAFE_INTEGER number when true', () => { + const num = Number.MAX_SAFE_INTEGER + 100; + const encoded = Buffer.from(Long.fromNumber(num).toBytesBE()).toString( + 'base64', + ); + const decoded = Mutation.convertFromBytes(encoded, { + isPossibleNumber: true, + }); + + assert.notStrictEqual(num, decoded); + }); + + it('should not convert a base64 encoded number when false', () => { + const num = 10; + const encoded = Buffer.from(Long.fromNumber(num).toBytesBE()).toString( + 'base64', + ); + const decoded = Mutation.convertFromBytes(encoded); + + assert.notStrictEqual(num, decoded); + }); + }); + + it('should convert a base64 encoded string', () => { + const message = 'Hello!'; + const encoded = Buffer.from(message).toString('base64'); + const decoded = Mutation.convertFromBytes(encoded); + + assert.strictEqual(message, decoded); + }); + + it('should allow using a custom encoding scheme', () => { + const message = 'æ'; + const encoded = Buffer.from(message, 'binary').toString('base64'); + const decoded = Mutation.convertFromBytes(encoded, { + userOptions: {encoding: 'binary'}, + }); + + assert.strictEqual(message, decoded); + }); + + it('should return a buffer if decode is set to false', () => { + const message = 'Hello!'; + const encoded = Buffer.from(message).toString('base64'); + const userOptions = {decode: false}; + const decoded = Mutation.convertFromBytes(encoded, { + userOptions, + }); + + assert(decoded instanceof Buffer); + assert.strictEqual(decoded.toString(), message); + }); + + it('should not create a new Buffer needlessly', function () { + if (process.platform === 'win32') { + // stubbing Buffer.from does not work on Windows since sinon 15.1.0 + // TODO(@alexander-fenster): investigate and report or fix + this.skip(); + } + const message = 'Hello!'; + const encoded = Buffer.from(message); + const stub = sandbox.stub(Buffer, 'from'); + const decoded = Mutation.convertFromBytes(encoded); + assert.strictEqual(stub.called, false); + assert.strictEqual(decoded.toString(), message); + }); + }); + + describe('convertToBytes', () => { + it('should not re-wrap buffers', () => { + const buf = Buffer.from('hello'); + const encoded = Mutation.convertToBytes(buf); + + assert.strictEqual(buf, encoded); + }); + + it('should pack numbers into int64 values', () => { + const num = 10; + const encoded = Mutation.convertToBytes(num); + const decoded = Long.fromBytes(encoded as number[]).toNumber(); + + assert.strictEqual(num, decoded); + }); + + it('should wrap the value in a buffer', () => { + const message = 'Hello!'; + const encoded = Mutation.convertToBytes(message); + + assert(encoded instanceof Buffer); + assert.strictEqual(encoded.toString(), message); + }); + + it('should simply return the value if it cannot wrap it', () => { + const message = true; + const notEncoded = Mutation.convertToBytes(message); + + assert(!(notEncoded instanceof Buffer)); + assert.strictEqual(message, notEncoded); + }); + }); + + describe('createTimeRange', () => { + it('should create a time range', () => { + const timestamp = Date.now(); + const dateObj = new Date(timestamp); + const range = Mutation.createTimeRange(dateObj, dateObj); + assert.strictEqual(range.startTimestampMicros, timestamp * 1000); + assert.strictEqual(range.endTimestampMicros, timestamp * 1000); + }); + }); + + describe('encodeSetCell', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let convertCalls: any[]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const fakeTime = new Date('2018-1-1') as any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const realTimestamp = new Date() as any; + + beforeEach(() => { + sandbox.stub(global, 'Date').returns(fakeTime); + convertCalls = []; + sandbox.stub(Mutation, 'convertToBytes').callsFake(value => { + convertCalls.push(value); + return value; + }); + }); + + it('should encode a setCell mutation', () => { + const fakeMutation = { + follows: { + gwashington: 1, + alincoln: 1, + }, + }; + + const cells = Mutation.encodeSetCell(fakeMutation); + + assert.strictEqual(cells.length, 2); + + assert.deepStrictEqual(cells, [ + { + setCell: { + familyName: 'follows', + columnQualifier: 'gwashington', + timestampMicros: fakeTime * 1000, // Convert ms to μs + value: 1, + }, + }, + { + setCell: { + familyName: 'follows', + columnQualifier: 'alincoln', + timestampMicros: fakeTime * 1000, // Convert ms to μs + value: 1, + }, + }, + ]); + + assert.strictEqual(convertCalls.length, 4); + assert.deepStrictEqual(convertCalls, ['gwashington', 1, 'alincoln', 1]); + }); + + it('should optionally accept a timestamp', () => { + const fakeMutation = { + follows: { + gwashington: { + value: 1, + timestamp: realTimestamp, + }, + }, + }; + + const cells = Mutation.encodeSetCell(fakeMutation); + + assert.deepStrictEqual(cells, [ + { + setCell: { + familyName: 'follows', + columnQualifier: 'gwashington', + timestampMicros: realTimestamp * 1000, // Convert ms to μs + value: 1, + }, + }, + ]); + + assert.strictEqual(convertCalls.length, 2); + assert.deepStrictEqual(convertCalls, ['gwashington', 1]); + }); + + it('should accept buffers', () => { + const val = Buffer.from('hello'); + const fakeMutation = { + follows: { + gwashington: val, + }, + }; + + const cells = Mutation.encodeSetCell(fakeMutation); + + assert.deepStrictEqual(cells, [ + { + setCell: { + familyName: 'follows', + columnQualifier: 'gwashington', + timestampMicros: fakeTime * 1000, // Convert ms to μs + value: val, + }, + }, + ]); + + assert.strictEqual(convertCalls.length, 2); + assert.deepStrictEqual(convertCalls, ['gwashington', val]); + }); + }); + + describe('encodeDelete', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let convertCalls: any[] = []; + + beforeEach(() => { + convertCalls = []; + sandbox.stub(Mutation, 'convertToBytes').callsFake(value => { + convertCalls.push(value); + return value; + }); + }); + + it('should create a delete row mutation', () => { + const mutation = Mutation.encodeDelete(); + assert.deepStrictEqual(mutation, [ + { + deleteFromRow: {}, + }, + ]); + }); + + it('should array-ify the input', () => { + const fakeKey = 'follows'; + const mutation = Mutation.encodeDelete(fakeKey); + + assert.deepStrictEqual(mutation, [ + { + deleteFromFamily: { + familyName: fakeKey, + }, + }, + ]); + }); + + it('should create a delete family mutation', () => { + const fakeColumnName = { + family: 'followed', + qualifier: null, + }; + sandbox.stub(Mutation, 'parseColumnName').returns(fakeColumnName); + const mutation = Mutation.encodeDelete(['follows']); + assert.deepStrictEqual(mutation, [ + { + deleteFromFamily: { + familyName: fakeColumnName.family, + }, + }, + ]); + }); + + it('should create a delete column mutation', () => { + const mutation = Mutation.encodeDelete(['follows:gwashington']); + assert.deepStrictEqual(mutation, [ + { + deleteFromColumn: { + familyName: 'follows', + columnQualifier: 'gwashington', + timeRange: undefined, + }, + }, + ]); + + assert.strictEqual(convertCalls.length, 1); + assert.strictEqual(convertCalls[0], 'gwashington'); + }); + + it('should optionally accept a timerange for column requests', () => { + const createTimeRange = Mutation.createTimeRange; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const timeCalls: any[] = []; + const fakeTimeRange = {a: 'a'}; + + const fakeMutationData = { + column: 'follows:gwashington', + time: { + start: 1, + end: 2, + }, + }; + + Mutation.createTimeRange = (start, end) => { + timeCalls.push({ + start, + end, + }); + return fakeTimeRange; + }; + + const mutation = Mutation.encodeDelete(fakeMutationData); + + assert.deepStrictEqual(mutation, [ + { + deleteFromColumn: { + familyName: 'follows', + columnQualifier: 'gwashington', + timeRange: fakeTimeRange, + }, + }, + ]); + + assert.strictEqual(timeCalls.length, 1); + assert.deepStrictEqual(timeCalls[0], fakeMutationData.time); + + Mutation.createTimeRange = createTimeRange; + }); + }); + + describe('parse', () => { + let toProtoCalled = false; + const fakeData = {a: 'a'} as IMutateRowRequest; + + beforeEach(() => { + sandbox.stub(Mutation.prototype, 'toProto').callsFake(() => { + toProtoCalled = true; + return fakeData; + }); + }); + + it('should create a new mutation object and parse it', () => { + const fakeMutationData = { + key: 'a', + method: 'b', + data: 'c', + } as Mutation; + const mutation = Mutation.parse(fakeMutationData); + assert.strictEqual(toProtoCalled, true); + assert.strictEqual(mutation, fakeData); + }); + + it('should parse a pre-existing mutation object', () => { + const data = new Mutation({ + key: 'a', + method: 'b', + data: [], + }); + + const mutation = Mutation.parse(data); + + assert.strictEqual(toProtoCalled, true); + assert.strictEqual(mutation, fakeData); + }); + }); + + describe('parseColumnName', () => { + it('should parse a column name', () => { + const parsed = Mutation.parseColumnName('a:b'); + + assert.strictEqual(parsed.family, 'a'); + assert.strictEqual(parsed.qualifier, 'b'); + }); + + it('should parse a family name', () => { + const parsed = Mutation.parseColumnName('a'); + + assert.strictEqual(parsed.family, 'a'); + assert.strictEqual(parsed.qualifier, undefined); + }); + + it('should parse a qualifier name with colons', () => { + const parsed = Mutation.parseColumnName('a:b:c'); + + assert.strictEqual(parsed.family, 'a'); + assert.strictEqual(parsed.qualifier, 'b:c'); + }); + }); + + describe('toProto', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let convertCalls: any[] = []; + + beforeEach(() => { + sandbox.stub(Mutation, 'convertToBytes').callsFake(value => { + convertCalls.push(value); + return value; + }); + convertCalls = []; + }); + + it('should encode set cell mutations when method is insert', () => { + const fakeEncoded = [{a: 'a'}]; + const data = { + key: 'a', + method: 'insert', + data: [], + }; + const mutation = new Mutation(data); + sandbox.stub(Mutation, 'encodeSetCell').callsFake(_data => { + assert.strictEqual(_data, data.data); + return fakeEncoded; + }); + const mutationProto = mutation.toProto(); + assert.strictEqual(mutationProto.mutations, fakeEncoded); + assert.strictEqual(mutationProto.rowKey, data.key); + assert.strictEqual(convertCalls[0], data.key); + }); + + it('should encode delete mutations when method is delete', () => { + const fakeEncoded = [{b: 'b'}] as {} as IMutation[]; + const data = { + key: 'b', + method: 'delete', + data: [], + }; + sandbox.stub(Mutation, 'encodeDelete').callsFake(_data => { + assert.strictEqual(_data, data.data); + return fakeEncoded; + }); + const mutation = new Mutation(data).toProto(); + assert.strictEqual(mutation.mutations, fakeEncoded); + assert.strictEqual(mutation.rowKey, data.key); + assert.strictEqual(convertCalls[0], data.key); + }); + }); +}); diff --git a/handwritten/bigtable/test/readrows.ts b/handwritten/bigtable/test/readrows.ts new file mode 100644 index 00000000000..1d5d2e3da8a --- /dev/null +++ b/handwritten/bigtable/test/readrows.ts @@ -0,0 +1,511 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {before, describe, it} from 'mocha'; +import {Bigtable, Row, Table} from '../src'; +import * as assert from 'assert'; +import {Transform, PassThrough, pipeline} from 'stream'; + +import {GoogleError} from 'google-gax'; +import {MockServer} from '../src/util/mock-servers/mock-server'; +import {BigtableClientMockService} from '../src/util/mock-servers/service-implementations/bigtable-client-mock-service'; +import {MockService} from '../src/util/mock-servers/mock-service'; +import {ReadRowsImpl} from '../test-common/utils/readRowsImpl'; + +import { + ReadRowsServiceParameters, + ReadRowsWritableStream, +} from '../test/utils/readRowsServiceParameters'; +import * as mocha from 'mocha'; + +const DEBUG = process.env.BIGTABLE_TEST_DEBUG === 'true'; + +function debugLog(text: string) { + if (DEBUG) { + console.log(text); + } +} + +// Define parameters for a standard Bigtable Mock service +const VALUE_SIZE = 1024 * 1024; +// we want each row to be split into 2 chunks of different sizes +const CHUNK_SIZE = 1023 * 1024 - 1; +const CHUNKS_PER_RESPONSE = 10; +const STANDARD_KEY_FROM = 0; +// 1000 rows must be enough to reproduce issues with losing the data and to create backpressure +const STANDARD_KEY_TO = 1000; +const STANDARD_SERVICE_WITHOUT_ERRORS: ReadRowsServiceParameters = { + keyFrom: STANDARD_KEY_FROM, + keyTo: STANDARD_KEY_TO, + valueSize: VALUE_SIZE, + chunkSize: CHUNK_SIZE, + chunksPerResponse: CHUNKS_PER_RESPONSE, + debugLog, +}; + +type PromiseVoid = Promise; +interface ServerImplementationInterface { + (server: ReadRowsWritableStream): PromiseVoid; +} + +describe('Bigtable/ReadRows', () => { + let server: MockServer; + let service: MockService; + let bigtable: Bigtable; + let table: Table; + + before(async () => { + // make sure we have everything initialized before starting tests + const port = await new Promise(resolve => { + server = new MockServer(resolve); + }); + bigtable = new Bigtable({ + apiEndpoint: `localhost:${port}`, + }); + table = bigtable.instance('fake-instance').table('fake-table'); + service = new BigtableClientMockService(server); + }); + + // helper function because some tests run slower + // on Windows and need a longer timeout + function setWindowsTestTimeout(test: mocha.Context) { + if (process.platform === 'win32') { + test.timeout(60000); // it runs much slower on Windows! + } + } + + it('should create read stream and read synchronously', function (done) { + setWindowsTestTimeout(this); + + service.setService({ + ReadRows: ReadRowsImpl.createService( + STANDARD_SERVICE_WITHOUT_ERRORS, + ) as ServerImplementationInterface, + }); + + let receivedRowCount = 0; + let lastKeyReceived: number | undefined; + + const readStream = table.createReadStream(); + readStream.on('error', (err: GoogleError) => { + done(err); + }); + readStream.on('data', (row: Row) => { + ++receivedRowCount; + const key = parseInt(row.id); + if (lastKeyReceived && key <= lastKeyReceived) { + done(new Error('Test error: keys are not in order')); + } + lastKeyReceived = key; + debugLog(`received row key ${key}`); + }); + readStream.on('end', () => { + assert.strictEqual(receivedRowCount, STANDARD_KEY_TO - STANDARD_KEY_FROM); + assert.strictEqual(lastKeyReceived, STANDARD_KEY_TO - 1); + done(); + }); + }); + + it('should create read stream and read synchronously using Transform stream', done => { + service.setService({ + ReadRows: ReadRowsImpl.createService( + STANDARD_SERVICE_WITHOUT_ERRORS, + ) as ServerImplementationInterface, + }); + + let receivedRowCount = 0; + let lastKeyReceived: number | undefined; + + // BigTable stream + const readStream = table.createReadStream(); + + // Transform stream + const transform = new Transform({ + objectMode: true, + transform: (row, _encoding, callback) => { + callback(null, row); + }, + }); + + // Final stream + const passThrough = new PassThrough({ + objectMode: true, + }); + + passThrough.on('error', (err: GoogleError) => { + done(err); + }); + passThrough.on('data', (row: Row) => { + ++receivedRowCount; + const key = parseInt(row.id); + if (lastKeyReceived && key <= lastKeyReceived) { + done(new Error('Test error: keys are not in order')); + } + lastKeyReceived = key; + debugLog(`received row key ${key}`); + }); + passThrough.on('end', () => { + assert.strictEqual(receivedRowCount, STANDARD_KEY_TO - STANDARD_KEY_FROM); + assert.strictEqual(lastKeyReceived, STANDARD_KEY_TO - 1); + done(); + }); + + pipeline(readStream, transform, passThrough, () => {}); + }); + + it('should create read stream and read asynchronously using Transform stream', function (done) { + setWindowsTestTimeout(this); + service.setService({ + ReadRows: ReadRowsImpl.createService( + STANDARD_SERVICE_WITHOUT_ERRORS, + ) as ServerImplementationInterface, + }); + + let receivedRowCount = 0; + let lastKeyReceived: number | undefined; + + // BigTable stream + const readStream = table.createReadStream(); + + // Transform stream + const transform = new Transform({ + objectMode: true, + transform: (row, _encoding, callback) => { + setTimeout(() => { + callback(null, row); + }, 0); + }, + }); + + // Final stream + const passThrough = new PassThrough({ + objectMode: true, + }); + + passThrough.on('error', (err: GoogleError) => { + done(err); + }); + passThrough.on('data', (row: Row) => { + ++receivedRowCount; + const key = parseInt(row.id); + if (lastKeyReceived && key <= lastKeyReceived) { + done(new Error('Test error: keys are not in order')); + } + lastKeyReceived = key; + debugLog(`received row key ${key}`); + }); + passThrough.on('end', () => { + assert.strictEqual(receivedRowCount, STANDARD_KEY_TO - STANDARD_KEY_FROM); + assert.strictEqual(lastKeyReceived, STANDARD_KEY_TO - 1); + done(); + }); + + pipeline(readStream, transform, passThrough, () => {}); + }); + + it('should be able to stop reading from the read stream', done => { + // pick any key to stop after + const stopAfter = 42; + + service.setService({ + ReadRows: ReadRowsImpl.createService( + STANDARD_SERVICE_WITHOUT_ERRORS, + ) as ServerImplementationInterface, + }); + + let receivedRowCount = 0; + let lastKeyReceived: number | undefined; + + const readStream = table.createReadStream(); + readStream.on('error', (err: GoogleError) => { + done(err); + }); + readStream.on('data', (row: Row) => { + ++receivedRowCount; + const key = parseInt(row.id); + if (lastKeyReceived && key <= lastKeyReceived) { + done(new Error('Test error: keys are not in order')); + } + lastKeyReceived = key; + debugLog(`received row key ${key}`); + + if (receivedRowCount === stopAfter) { + debugLog(`requesting to stop after receiving key ${key}`); + readStream.end(); + } + }); + readStream.on('end', () => { + assert.strictEqual(receivedRowCount, stopAfter); + assert.strictEqual(lastKeyReceived, stopAfter - 1); + done(); + }); + }); + + // TODO: enable after https://github.com/googleapis/nodejs-bigtable/issues/1286 is fixed + it('should be able to stop reading from the read stream when reading asynchronously', function (done) { + setWindowsTestTimeout(this); + // pick any key to stop after + const stopAfter = 420; + + service.setService({ + ReadRows: ReadRowsImpl.createService( + STANDARD_SERVICE_WITHOUT_ERRORS, + ) as ServerImplementationInterface, + }); + + let receivedRowCount = 0; + let lastKeyReceived: number | undefined; + + // BigTable stream + const readStream = table.createReadStream(); + + // Transform stream + const transform = new Transform({ + objectMode: true, + writableHighWaterMark: 0, + transform: (row, _encoding, callback) => { + setTimeout(() => { + callback(null, row); + }, 0); + }, + }); + + // Final stream + const passThrough = new PassThrough({ + objectMode: true, + }); + + passThrough.on('error', (err: GoogleError) => { + done(err); + }); + passThrough.on('data', (row: Row) => { + ++receivedRowCount; + const key = parseInt(row.id); + if (lastKeyReceived && key <= lastKeyReceived) { + done(new Error('Test error: keys are not in order')); + } + lastKeyReceived = key; + debugLog(`received row key ${key}`); + + if (receivedRowCount === stopAfter) { + debugLog(`requesting to stop after receiving key ${key}`); + readStream.end(); + } + }); + passThrough.on('end', () => { + assert.strictEqual(receivedRowCount, stopAfter); + assert.strictEqual(lastKeyReceived, stopAfter - 1); + done(); + }); + + pipeline(readStream, transform, passThrough, () => {}); + }); + + describe('should silently resume after server or network error', () => { + function runTest(done: Mocha.Done, errorAfterChunkNo: number) { + service.setService({ + ReadRows: ReadRowsImpl.createService({ + keyFrom: STANDARD_KEY_FROM, + keyTo: STANDARD_KEY_TO, + valueSize: VALUE_SIZE, + chunkSize: CHUNK_SIZE, + chunksPerResponse: CHUNKS_PER_RESPONSE, + errorAfterChunkNo, + debugLog, + }) as ServerImplementationInterface, + }); + let receivedRowCount = 0; + let lastKeyReceived: number | undefined; + + const readStream = table.createReadStream(); + readStream.on('error', (err: GoogleError) => { + done(err); + }); + readStream.on('data', (row: Row) => { + ++receivedRowCount; + const key = parseInt(row.id); + if (lastKeyReceived && key <= lastKeyReceived) { + done(new Error('Test error: keys are not in order')); + } + lastKeyReceived = key; + debugLog(`received row key ${key}`); + }); + readStream.on('end', () => { + assert.strictEqual( + receivedRowCount, + STANDARD_KEY_TO - STANDARD_KEY_FROM, + ); + assert.strictEqual(lastKeyReceived, STANDARD_KEY_TO - 1); + done(); + }); + } + it('with an error at a fixed position', function (done) { + setWindowsTestTimeout(this); + // Emits an error after enough chunks have been pushed to create back pressure + runTest(done, 423); + }); + it('with an error at a random position', function (done) { + this.timeout(200000); + // Emits an error after a random number of chunks. + const errorAfterChunkNo = Math.floor(500 + Math.random() * 500); + runTest(done, errorAfterChunkNo); + }); + }); + it('should return row data in the right order', function (done) { + setWindowsTestTimeout(this); + const dataResults = []; + + // keyTo and keyFrom are not provided so they will be determined from + // the request that is passed in. + service.setService({ + ReadRows: ReadRowsImpl.createService({ + errorAfterChunkNo: 100, // the server will error after sending this chunk (not row) + valueSize: 1, + chunkSize: 1, + chunksPerResponse: 1, + debugLog, + }) as ServerImplementationInterface, + }); + const sleep = (ms: number) => { + return new Promise(resolve => setTimeout(resolve, ms)); + }; + (async () => { + try { + // 150 rows must be enough to reproduce issues with losing the data and to create backpressure + const stream = table.createReadStream({ + start: '00000000', + end: '00000150', + }); + + for await (const row of stream) { + dataResults.push(row.id); + await sleep(50); + } + const expectedResults = Array.from(Array(150).keys()) + .map(i => '00000000' + i.toString()) + .map(i => i.slice(-8)); + assert.deepStrictEqual(dataResults, expectedResults); + done(); + } catch (error) { + done(error); + } + })().catch(err => { + throw err; + }); + }); + it('should return row data in the right order with a predictable sleep function', function (done) { + this.timeout(600000); + const keyFrom = undefined; + const keyTo = undefined; + // the server will error after sending this chunk (not row) + const errorAfterChunkNo = 100; + const dataResults = []; + + // keyTo and keyFrom are not provided so they will be determined from + // the request that is passed in. + service.setService({ + ReadRows: ReadRowsImpl.createService({ + errorAfterChunkNo: 100, // the server will error after sending this chunk (not row) + valueSize: 1, + chunkSize: 1, + chunksPerResponse: 1, + debugLog, + }) as ServerImplementationInterface, + }); + const sleep = (ticks: number) => { + // Adds an event to the end of the event loop `ticks` times + // This creates a predictable delay using the event loop and + // allows the streams to create a predictable amount of back pressure. + return new Promise(resolve => { + const nextEventLoop = () => { + if (ticks > 0) { + ticks = ticks - 1; + setImmediate(nextEventLoop); + } else { + resolve(ticks); + } + }; + nextEventLoop(); + }); + }; + (async () => { + try { + // 150 rows must be enough to reproduce issues with losing the data and to create backpressure + const stream = table.createReadStream({ + start: '00000000', + end: '00000150', + }); + + for await (const row of stream) { + dataResults.push(row.id); + // sleep parameter needs to be high enough to produce backpressure. + await sleep(4000); + } + const expectedResults = Array.from(Array(150).keys()) + .map(i => '00000000' + i.toString()) + .map(i => i.slice(-8)); + assert.deepStrictEqual(dataResults, expectedResults); + done(); + } catch (error) { + done(error); + } + })().catch(err => { + throw err; + }); + }); + + it.skip('pitfall: should not request full table scan during a retry on a transient error', async () => { + const requests = []; + + const TRANSIENT_ERROR_SERVICE: ReadRowsServiceParameters = { + chunkSize: CHUNK_SIZE, + valueSize: VALUE_SIZE, + chunksPerResponse: CHUNKS_PER_RESPONSE, + keyFrom: STANDARD_KEY_FROM, + keyTo: STANDARD_KEY_TO, + deadlineExceededError: true, + hook: request => { + requests.push(request); + }, + debugLog, + }; + + async function readRowsWithDeadline() { + service.setService({ + ReadRows: ReadRowsImpl.createService( + TRANSIENT_ERROR_SERVICE, + ) as ServerImplementationInterface, + }); + + const rows = await table.getRows(); + return rows; + } + + try { + await readRowsWithDeadline(); + assert.fail('Should have thrown error'); + } catch (err) { + if (err instanceof GoogleError) { + assert.equal(err.code, 'DEADLINE_EXCEEDED'); + } + + // Assert that no retry attempted. + assert.strictEqual(requests.length, 1); + } + }); + + after(async () => { + server.shutdown(() => {}); + }); +}); diff --git a/handwritten/bigtable/test/row.ts b/handwritten/bigtable/test/row.ts new file mode 100644 index 00000000000..ca1f444cfb6 --- /dev/null +++ b/handwritten/bigtable/test/row.ts @@ -0,0 +1,1604 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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 promisify from '@google-cloud/promisify'; +import * as assert from 'assert'; +import {afterEach, beforeEach, describe, it} from 'mocha'; +import * as proxyquire from 'proxyquire'; +import * as sinon from 'sinon'; +import {Mutation} from '../src/mutation.js'; +import * as rw from '../src/row'; +import { + Table, + Entry, + GetRowsOptions, + GetRowsCallback, + GetRowsResponse, + MutateOptions, + MutateCallback, +} from '../src/table.js'; +import {Chunk} from '../src/chunktransformer.js'; +import {CallOptions, ServiceError} from 'google-gax'; +import {ClientSideMetricsConfigManager} from '../src/client-side-metrics/metrics-config-manager'; +import {Bigtable} from '../src/'; +import {getRowsInternal} from '../src/utils/getRowsInternal'; +import {TabularApiSurface} from '../src/tabular-api-surface'; +import * as pumpify from 'pumpify'; +import {OperationMetricsCollector} from '../src/client-side-metrics/operation-metrics-collector'; + +const sandbox = sinon.createSandbox(); + +let promisified = false; +const fakePromisify = Object.assign({}, promisify, { + promisifyAll(klass: Function) { + if (klass.name === 'Row') { + promisified = true; + } + }, +}); + +const ROW_ID = 'my-row'; +const CONVERTED_ROW_ID = 'my-converted-row'; +const TABLE = { + bigtable: {}, + name: '/projects/project/instances/my-instance/tables/my-table', +} as Table; + +const FakeMutation = { + methods: Mutation.methods, + convertToBytes: sandbox.spy(value => { + if (value === ROW_ID) { + return CONVERTED_ROW_ID; + } + return value; + }), + convertFromBytes: sandbox.spy(value => { + return value; + }), + parseColumnName: sandbox.spy(column => { + return Mutation.parseColumnName(column); + }), + parse: sandbox.spy(entry => { + return { + mutations: entry, + }; + }), +}; + +const FakeFilter = { + parse: sandbox.spy(filter => { + return filter; + }), +}; + +const FakeRowDataUtil = proxyquire('../src/row-data-utils.js', { + './mutation.js': {Mutation: FakeMutation}, + './filter.js': {Filter: FakeFilter}, +}).RowDataUtils; + +describe('Bigtable/Row', () => { + let Row: typeof rw.Row; + let RowError: typeof rw.RowError; + let row: rw.Row; + + function getFakeMutateRow( + fn: ( + table: TabularApiSurface, + metricsCollector: OperationMetricsCollector, + entry: Entry | Entry[], + gaxOptions_: MutateOptions | MutateCallback, + callback: Function, + ) => void | Promise, + ) { + const Fake = proxyquire('../src/row.js', { + '../src/utils/mutateInternal': { + mutateInternal: fn, + }, + }); + return Fake; + } + + function getFakeRow( + getRowsInternal: ( + table: TabularApiSurface, + singleRow: boolean, + optionsOrCallback?: GetRowsOptions | GetRowsCallback, + cb?: GetRowsCallback, + ) => void | Promise, + ) { + const Fake = proxyquire('../src/row.js', { + '@google-cloud/promisify': fakePromisify, + './mutation.js': {Mutation: FakeMutation}, + './filter.js': {Filter: FakeFilter}, + './row-data-utils.js': {RowDataUtils: FakeRowDataUtil}, + './utils/getRowsInternal': { + getRowsInternal, + }, + }); + RowError = Fake.RowError; + return Fake; + } + + before(() => { + const Fake = getFakeRow(() => {}); + Row = Fake.Row; + }); + + beforeEach(() => { + row = new Row(TABLE, ROW_ID); + row.table.bigtable._metricsConfigManager = + new ClientSideMetricsConfigManager([]); + }); + + afterEach(() => { + sandbox.restore(); + Object.keys(FakeMutation).forEach(spy => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if ((FakeMutation as any)[spy].resetHistory) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (FakeMutation as any)[spy].resetHistory(); + } + }); + }); + + describe('instantiation', () => { + it('should promisify all the things', () => { + assert(promisified); + }); + + it('should localize Bigtable instance', () => { + assert.strictEqual(row.bigtable, TABLE.bigtable); + }); + + it('should localize Table instance', () => { + assert.strictEqual(row.table, TABLE); + }); + + it('should localize ID', () => { + assert.strictEqual(row.id, ROW_ID); + }); + + it('should create an empty data object', () => { + assert.deepStrictEqual(row.data, {}); + }); + }); + + describe('formatChunks_', () => { + let convert = FakeMutation.convertFromBytes; + + beforeEach(() => { + convert = FakeMutation.convertFromBytes; + FakeMutation.convertFromBytes = sandbox.spy(val => { + return val.replace('unconverted', 'converted'); + }); + }); + + afterEach(() => { + FakeMutation.convertFromBytes = convert; + }); + + it('should format the chunks', () => { + const timestamp = Date.now(); + const chunks = [ + { + rowKey: 'unconvertedKey', + familyName: { + value: 'familyName', + }, + qualifier: { + value: 'unconvertedQualifier', + }, + value: 'unconvertedValue', + labels: ['label'], + timestampMicros: timestamp, + valueSize: 0, + commitRow: false, + resetRow: false, + }, + { + commitRow: true, + }, + ] as Chunk[]; + + const rows = Row.formatChunks_(chunks); + + assert.deepStrictEqual(rows, [ + { + key: 'convertedKey', + data: { + familyName: { + convertedQualifier: [ + { + value: 'convertedValue', + labels: ['label'], + timestamp, + size: 0, + }, + ], + }, + }, + }, + ]); + }); + + it('should inherit the row key', () => { + const chunks = [ + { + rowKey: 'unconvertedKey', + }, + { + rowKey: null, + familyName: { + value: 'familyName', + }, + commitRow: true, + }, + { + rowKey: 'unconvertedKey2', + }, + { + rowKey: null, + familyName: { + value: 'familyName2', + }, + commitRow: true, + }, + ] as {} as Chunk[]; + + const rows = Row.formatChunks_(chunks); + + assert.deepStrictEqual(rows, [ + { + key: 'convertedKey', + data: { + familyName: {}, + }, + }, + { + key: 'convertedKey2', + data: { + familyName2: {}, + }, + }, + ]); + }); + + it('should inherit the family name', () => { + const chunks = [ + { + rowKey: 'unconvertedKey', + familyName: { + value: 'familyName', + }, + }, + { + qualifier: { + value: 'unconvertedQualifier', + }, + }, + { + qualifier: { + value: 'unconvertedQualifier2', + }, + }, + { + commitRow: true, + }, + ] as Chunk[]; + + const rows = Row.formatChunks_(chunks); + + assert.deepStrictEqual(rows, [ + { + key: 'convertedKey', + data: { + familyName: { + convertedQualifier: [], + convertedQualifier2: [], + }, + }, + }, + ]); + }); + + it('should inherit the qualifier', () => { + const timestamp1 = 123; + const timestamp2 = 345; + + const chunks = [ + { + rowKey: 'unconvertedKey', + familyName: { + value: 'familyName', + }, + qualifier: { + value: 'unconvertedQualifier', + }, + }, + { + value: 'unconvertedValue', + labels: ['label'], + timestampMicros: timestamp1, + valueSize: 0, + }, + { + value: 'unconvertedValue2', + labels: ['label2'], + timestampMicros: timestamp2, + valueSize: 2, + }, + { + commitRow: true, + }, + ] as Chunk[]; + + const rows = Row.formatChunks_(chunks); + + assert.deepStrictEqual(rows, [ + { + key: 'convertedKey', + data: { + familyName: { + convertedQualifier: [ + { + value: 'convertedValue', + labels: ['label'], + timestamp: timestamp1, + size: 0, + }, + { + value: 'convertedValue2', + labels: ['label2'], + timestamp: timestamp2, + size: 2, + }, + ], + }, + }, + }, + ]); + }); + + it('should not decode values when applicable', () => { + const formatOptions = { + decode: false, + }; + + (FakeMutation.convertFromBytes as Function) = sandbox.spy( + (val, options) => { + assert.deepStrictEqual(options, {userOptions: formatOptions}); + return val.replace('unconverted', 'converted'); + }, + ); + + const timestamp1 = 123; + const timestamp2 = 345; + + const chunks = [ + { + rowKey: 'unconvertedKey', + familyName: { + value: 'familyName', + }, + qualifier: { + value: 'unconvertedQualifier', + }, + }, + { + value: 'unconvertedValue', + labels: ['label'], + timestampMicros: timestamp1, + valueSize: 0, + }, + { + value: 'unconvertedValue2', + labels: ['label2'], + timestampMicros: timestamp2, + valueSize: 2, + }, + { + commitRow: true, + }, + ] as Chunk[]; + + const rows = Row.formatChunks_(chunks, formatOptions); + + assert.deepStrictEqual(rows, [ + { + key: 'convertedKey', + data: { + familyName: { + convertedQualifier: [ + { + value: 'convertedValue', + labels: ['label'], + timestamp: timestamp1, + size: 0, + }, + { + value: 'convertedValue2', + labels: ['label2'], + timestamp: timestamp2, + size: 2, + }, + ], + }, + }, + }, + ]); + + // 0 === row key + // 1 === qualifier + // 2 === value + const args = FakeMutation.convertFromBytes.getCall(2).args; + assert.deepStrictEqual((args as string[])[1], { + userOptions: formatOptions, + }); + }); + + it('should use the encoding scheme provided', () => { + const formatOptions = { + encoding: 'binary' as BufferEncoding, + }; + + (FakeMutation.convertFromBytes as Function) = sandbox.spy( + (val, options) => { + assert.deepStrictEqual(options, {userOptions: formatOptions}); + return val.toString(formatOptions.encoding); + }, + ); + + const chunks = [ + { + rowKey: Buffer.from('ø', 'binary'), + familyName: { + value: 'familyName', + }, + qualifier: { + value: 'qualifier', + }, + value: 'value', + valueSize: 0, + labels: ['label'], + timestampMicros: 123, + commitRow: true, + }, + ] as Chunk[]; + + const rows = Row.formatChunks_(chunks, formatOptions); + + assert.deepStrictEqual(rows, [ + { + key: 'ø', + data: { + familyName: { + qualifier: [ + { + value: 'value', + size: 0, + labels: ['label'], + timestamp: 123, + }, + ], + }, + }, + }, + ]); + + // 0 === row key + // 1 === qualifier + // 2 === value + const args: string[] = FakeMutation.convertFromBytes.getCall(2).args; + assert.deepStrictEqual(args[1], {userOptions: formatOptions}); + }); + + it('should discard old data when reset row is found', () => { + const chunks = [ + { + rowKey: 'unconvertedKey', + familyName: { + value: 'familyName', + }, + qualifier: { + value: 'unconvertedQualifier', + }, + value: 'unconvertedValue', + labels: ['label'], + valueSize: 0, + timestampMicros: 123, + }, + { + resetRow: true, + }, + { + rowKey: 'unconvertedKey2', + familyName: { + value: 'familyName2', + }, + qualifier: { + value: 'unconvertedQualifier2', + }, + value: 'unconvertedValue2', + labels: ['label2'], + valueSize: 2, + timestampMicros: 345, + }, + { + commitRow: true, + }, + ] as {} as Chunk[]; + + const rows = Row.formatChunks_(chunks); + + assert.deepStrictEqual(rows, [ + { + key: 'convertedKey2', + data: { + familyName2: { + convertedQualifier2: [ + { + value: 'convertedValue2', + labels: ['label2'], + size: 2, + timestamp: 345, + }, + ], + }, + }, + }, + ]); + }); + }); + + describe('formatFamilies_', () => { + const timestamp = Date.now(); + + const families = [ + { + name: 'test-family', + columns: [ + { + qualifier: 'test-column', + cells: [ + { + value: 'test-value', + timestampMicros: timestamp, + labels: [], + }, + ], + }, + ], + }, + ]; + + const formattedRowData = { + 'test-family': { + 'test-column': [ + { + value: 'test-value', + timestamp, + labels: [], + }, + ], + }, + }; + + it('should format the families into a user-friendly format', () => { + const formatted = Row.formatFamilies_(families); + assert.deepStrictEqual(formatted, formattedRowData); + const convertStpy = FakeMutation.convertFromBytes; + assert.strictEqual(convertStpy.callCount, 2); + assert.strictEqual(convertStpy.getCall(0).args[0], 'test-column'); + assert.strictEqual(convertStpy.getCall(1).args[0], 'test-value'); + }); + + it('should optionally not decode the value', () => { + const formatted = Row.formatFamilies_(families, { + decode: false, + }); + assert.deepStrictEqual(formatted, formattedRowData); + const convertStpy = FakeMutation.convertFromBytes; + assert.strictEqual(convertStpy.callCount, 1); + assert.strictEqual(convertStpy.getCall(0).args[0], 'test-column'); + }); + }); + + describe('create', () => { + it('should provide the proper request options', done => { + (row.table.mutate as Function) = (entry: Entry, gaxOptions: {}) => { + assert.strictEqual(entry.key, row.id); + assert.strictEqual(entry.data, undefined); + assert.strictEqual(entry.method, Mutation.methods.INSERT); + assert.strictEqual(gaxOptions, undefined); + done(); + }; + row.create(assert.ifError); + }); + + it('should accept data to populate the row', done => { + const options = { + entry: { + a: 'a', + b: 'b', + }, + }; + (row.table.mutate as Function) = (entry: Entry) => { + assert.strictEqual(entry.data, options.entry); + done(); + }; + row.create(options, assert.ifError); + }); + + it('should accept options when inserting data', done => { + const options = { + gaxOptions: {}, + }; + (row.table.mutate as Function) = (entry: Entry, gaxOptions: {}) => { + assert.strictEqual(gaxOptions, options.gaxOptions); + done(); + }; + row.create(options, assert.ifError); + }); + + it('should return an error to the callback', done => { + const err = new Error('err'); + const response = {}; + sandbox.stub(row.table, 'mutate').callsArgWith(2, err, response); + row.create((err_, row, apiResponse) => { + assert.strictEqual(err, err_); + assert.strictEqual(row, null); + assert.strictEqual(response, apiResponse); + done(); + }); + }); + + it('should return the Row instance', done => { + const response = {}; + sandbox.stub(row.table, 'mutate').callsArgWith(2, null, response); + row.create((err, row_, apiResponse) => { + assert.ifError(err); + assert.strictEqual(row, row_); + assert.strictEqual(response, apiResponse); + done(); + }); + }); + }); + + describe('createRules', () => { + const rules = [ + { + column: 'a:b', + append: 'c', + increment: 1, + }, + ]; + + it('should throw if a rule is not provided', () => { + assert.throws(() => { + (row.createRules as Function)(); + }, /At least one rule must be provided\./); + }); + + it('should read/modify/write rules', done => { + (row.bigtable.request as Function) = ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + config: any, + callback: Function, + ) => { + assert.strictEqual(config.client, 'BigtableClient'); + assert.strictEqual(config.method, 'readModifyWriteRow'); + assert.strictEqual(config.reqOpts.tableName, TABLE.name); + assert.strictEqual(config.reqOpts.rowKey, CONVERTED_ROW_ID); + assert.deepStrictEqual(config.reqOpts.rules, [ + { + familyName: 'a', + columnQualifier: 'b', + appendValue: 'c', + incrementAmount: 1, + }, + ]); + const spy = FakeMutation.convertToBytes; + assert.strictEqual(spy.getCall(0).args[0], 'b'); + assert.strictEqual(spy.getCall(1).args[0], 'c'); + assert.strictEqual(spy.getCall(2).args[0], ROW_ID); + callback(); // done() + }; + row.createRules(rules, done); + }); + + it('should use an appProfileId', done => { + const bigtableInstance = row.bigtable; + bigtableInstance.appProfileId = 'app-profile-id-12345'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (bigtableInstance.request as Function) = (config: any) => { + assert.strictEqual( + config.reqOpts.appProfileId, + bigtableInstance.appProfileId, + ); + done(); + }; + row.createRules(rules, assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (row.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + row.createRules(rules, gaxOptions, assert.ifError); + }); + }); + + describe('delete', () => { + it('should provide the proper request options', done => { + (row.table.mutate as Function) = ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + mutation: any, + gaxOptions: {}, + callback: Function, + ) => { + assert.strictEqual(mutation.key, ROW_ID); + assert.strictEqual(mutation.method, FakeMutation.methods.DELETE); + assert.deepStrictEqual(gaxOptions, {}); + callback(); // done() + }; + row.delete(done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + (row.table.mutate as Function) = (mutation: {}, gaxOptions_: {}) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }; + row.delete(gaxOptions, done); + }); + + it('should remove existing data', done => { + const gaxOptions = {}; + (row.table.mutate as Function) = (mutation: {}, gaxOptions_: {}) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }; + row.delete(gaxOptions, done); + assert.strictEqual(row.data, undefined); + }); + }); + + describe('deleteCells', () => { + const columns = ['a:b', 'c']; + + it('should provide the proper request options', done => { + (row.table.mutate as Function) = ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + mutation: any, + gaxOptions: {}, + callback: Function, + ) => { + assert.strictEqual(mutation.key, ROW_ID); + assert.strictEqual(mutation.data, columns); + assert.strictEqual(mutation.method, FakeMutation.methods.DELETE); + assert.deepStrictEqual(gaxOptions, {}); + callback(); // done() + }; + row.deleteCells(columns, done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + sandbox.stub(row.table, 'mutate').callsFake((mutation, gaxOptions_) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }); + row.deleteCells(columns, gaxOptions, done); + }); + + it('should remove existing data', done => { + sandbox.stub(row.table, 'mutate').callsArg(2); + row.deleteCells(columns, done); + assert.strictEqual(row.data, undefined); + }); + }); + + describe('exists', () => { + it('should not require gaxOptions', done => { + sandbox.stub(row, 'getMetadata').callsFake(gaxOptions => { + assert.deepStrictEqual(gaxOptions, { + filter: [ + { + row: { + cellLimit: 1, + }, + }, + { + value: { + strip: true, + }, + }, + ], + }); + done(); + }); + row.exists(assert.ifError); + }); + + it('should add filter to the read row options', done => { + const gaxOptions = {}; + sandbox.stub(row, 'getMetadata').callsFake(gaxOptions_ => { + assert.deepStrictEqual(gaxOptions_, { + filter: [ + { + row: { + cellLimit: 1, + }, + }, + { + value: { + strip: true, + }, + }, + ], + }); + done(); + }); + row.exists(gaxOptions, assert.ifError); + }); + + it('should pass gaxOptions to getMetadata', done => { + const gaxOptions = { + testProperty: true, + } as CallOptions; + + sandbox.stub(row, 'getMetadata').callsFake(gaxOptions_ => { + assert.strictEqual( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (gaxOptions_ as any).testProperty, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (gaxOptions as any).testProperty, + ); + done(); + }); + + row.exists(gaxOptions, assert.ifError); + }); + + it('should return false if error is RowError', done => { + const error = new RowError('Error.'); + sandbox.stub(row, 'getMetadata').callsArgWith(1, error); + row.exists((err, exists) => { + assert.ifError(err); + assert.strictEqual(exists, false); + done(); + }); + }); + + it('should return error if not RowError', done => { + const error = new Error('Error.'); + sandbox.stub(row, 'getMetadata').callsArgWith(1, error); + row.exists(err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return true if no error', done => { + sandbox.stub(row, 'getMetadata').callsArgWith(1, null, {}); + row.exists((err, exists) => { + assert.ifError(err); + assert.strictEqual(exists, true); + done(); + }); + }); + }); + + describe('filter', () => { + const mutations = [ + { + method: 'insert', + data: { + a: 'a', + }, + }, + ] as {} as rw.FilterConfigOption[]; + + const fakeMutations = { + mutations: [ + { + a: 'b', + }, + ], + } as {} as {mutations: rw.FilterConfigOption}; + + beforeEach(() => { + FakeMutation.parse.resetHistory(); + FakeFilter.parse.resetHistory(); + }); + + it('should provide the proper request options', done => { + const filter = { + column: 'a', + }; + + const fakeParsedFilter = { + column: 'b', + }; + + (FakeFilter.parse as Function) = sandbox.spy(() => { + return fakeParsedFilter; + }); + + (FakeMutation.parse as Function) = sandbox.spy(() => { + return fakeMutations; + }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (row.bigtable.request as Function) = (config: any) => { + assert.strictEqual(config.client, 'BigtableClient'); + assert.strictEqual(config.method, 'checkAndMutateRow'); + assert.strictEqual(config.reqOpts.tableName, TABLE.name); + assert.strictEqual(config.reqOpts.rowKey, CONVERTED_ROW_ID); + assert.deepStrictEqual( + config.reqOpts.predicateFilter, + fakeParsedFilter, + ); + assert.deepStrictEqual( + config.reqOpts.trueMutations, + fakeMutations.mutations, + ); + assert.deepStrictEqual( + config.reqOpts.falseMutations, + fakeMutations.mutations, + ); + config.gaxOpts.otherArgs.options.interceptors = []; + assert.deepStrictEqual(config.gaxOpts, { + otherArgs: { + options: { + interceptors: [], + }, + }, + }); + assert.strictEqual(FakeMutation.parse.callCount, 2); + assert.strictEqual(FakeMutation.parse.getCall(0).args[0], mutations[0]); + assert.strictEqual(FakeMutation.parse.getCall(1).args[0], mutations[0]); + assert.strictEqual(FakeFilter.parse.callCount, 1); + assert(FakeFilter.parse.calledWithExactly(filter)); + done(); + }; + + row.filter( + filter, + { + onMatch: mutations, + onNoMatch: mutations, + }, + assert.ifError, + ); + }); + + it('should accept gaxOptions', done => { + const filter = { + column: 'a', + }; + const gaxOptions = {}; + sandbox.stub(row.bigtable, 'request').callsFake(config => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }); + row.filter(filter, {gaxOptions}, assert.ifError); + }); + + it('should use an appProfileId', done => { + const filter = { + column: 'a', + }; + const bigtableInstance = row.bigtable; + bigtableInstance.appProfileId = 'app-profile-id-12345'; + sandbox.stub(bigtableInstance, 'request').callsFake(config => { + assert.strictEqual( + config.reqOpts.appProfileId, + bigtableInstance.appProfileId, + ); + done(); + }); + row.filter(filter, assert.ifError); + }); + + it('should return an error to the callback', done => { + const err = new Error('err'); + const response = {}; + sandbox.stub(row.bigtable, 'request').callsArgWith(1, err, response); + (row.filter as Function)( + {}, + mutations, + (err_: Error, matched: boolean, apiResponse: {}) => { + assert.strictEqual(err, err_); + assert.strictEqual(matched, null); + assert.strictEqual(response, apiResponse); + done(); + }, + ); + }); + + it('should return a matched flag', done => { + const response = { + predicateMatched: true, + }; + sandbox.stub(row.bigtable, 'request').callsArgWith(1, null, response); + (row.filter as Function)( + {}, + mutations, + (err: Error, matched: boolean, apiResponse: {}) => { + assert.ifError(err); + assert(matched); + assert.strictEqual(response, apiResponse); + done(); + }, + ); + }); + }); + + describe('get', () => { + function getRowInstance( + fn: (reqOpts: any) => void | Promise, + ) { + const getRowsInternal = ( + table: TabularApiSurface, + singleRow: boolean, + optionsOrCallback?: GetRowsOptions | GetRowsCallback, + cb?: GetRowsCallback, + ) => { + return fn(optionsOrCallback); + }; + const Fake = getFakeRow(getRowsInternal); + Row = Fake.Row; + row = new Row(TABLE, ROW_ID); + return row; + } + + function getRowInstanceForErrResp(err: ServiceError | null, resp?: any[]) { + const getRowsInternal = ( + table: TabularApiSurface, + singleRow: boolean, + optionsOrCallback?: GetRowsOptions | GetRowsCallback, + cb?: GetRowsCallback, + ) => { + if (cb) { + cb(err, resp); + } + }; + const Fake = getFakeRow(getRowsInternal); + Row = Fake.Row; + row = new Row(TABLE, ROW_ID); + return row; + } + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const fn = (reqOpts: any) => { + assert.strictEqual(reqOpts.keys[0], ROW_ID); + assert.strictEqual(reqOpts.filter, undefined); + assert.strictEqual(FakeMutation.parseColumnName.callCount, 0); + done(); + }; + const row = getRowInstance(fn); + row.get(assert.ifError); + }); + + it('should create a filter for a single column', done => { + const keys = ['a:b']; + + const expectedFilter = [ + { + family: 'a', + }, + { + column: 'b', + }, + ]; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const fn = (reqOpts: any) => { + assert.deepStrictEqual(reqOpts.filter, expectedFilter); + assert.strictEqual(FakeMutation.parseColumnName.callCount, 1); + assert(FakeMutation.parseColumnName.calledWith(keys[0])); + done(); + }; + const row = getRowInstance(fn); + row.get(keys, assert.ifError); + }); + + it('should create a filter for multiple columns', done => { + const keys = ['a:b', 'c:d']; + + const expectedFilter = [ + { + interleave: [ + [ + { + family: 'a', + }, + { + column: 'b', + }, + ], + [ + { + family: 'c', + }, + { + column: 'd', + }, + ], + ], + }, + ]; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const fn = (reqOpts: any) => { + assert.deepStrictEqual(reqOpts.filter, expectedFilter); + + const spy = FakeMutation.parseColumnName; + + assert.strictEqual(spy.callCount, 2); + assert.strictEqual(spy.getCall(0).args[0], keys[0]); + assert.strictEqual(spy.getCall(1).args[0], keys[1]); + done(); + }; + const row = getRowInstance(fn); + + row.get(keys, assert.ifError); + }); + + it('should respect supplying only family names', done => { + const keys = ['a']; + + const expectedFilter = [ + { + family: 'a', + }, + ]; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const fn = (reqOpts: any) => { + assert.deepStrictEqual(reqOpts.filter, expectedFilter); + assert.strictEqual(FakeMutation.parseColumnName.callCount, 1); + assert(FakeMutation.parseColumnName.calledWith(keys[0])); + done(); + }; + const row = getRowInstance(fn); + + row.get(keys, assert.ifError); + }); + + it('should respect the options object', done => { + const keys = ['a:b']; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const options: any = { + filter: [ + { + column: { + cellLimit: 1, + }, + }, + ], + descode: false, + }; + + const expectedFilter = [ + { + family: 'a', + }, + { + column: 'b', + }, + { + column: { + cellLimit: 1, + }, + }, + ]; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const fn = (reqOpts: any) => { + assert.deepStrictEqual(reqOpts.filter, expectedFilter); + assert.strictEqual(FakeMutation.parseColumnName.callCount, 1); + assert(FakeMutation.parseColumnName.calledWith(keys[0])); + assert.strictEqual(reqOpts.decode, options.decode); + done(); + }; + const row = getRowInstance(fn); + + row.get(keys, options, assert.ifError); + }); + + it('should respect the options object with filter for multiple columns', done => { + const keys = ['a:b', 'c:d']; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const options: any = { + filter: [ + { + column: { + cellLimit: 1, + }, + }, + ], + }; + + const expectedFilter = [ + { + interleave: [ + [ + { + family: 'a', + }, + { + column: 'b', + }, + ], + [ + { + family: 'c', + }, + { + column: 'd', + }, + ], + ], + }, + { + column: { + cellLimit: 1, + }, + }, + ]; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const fn = (reqOpts: any) => { + assert.deepStrictEqual(reqOpts.filter, expectedFilter); + assert.strictEqual(FakeMutation.parseColumnName.callCount, 2); + assert(FakeMutation.parseColumnName.calledWith(keys[0])); + assert.strictEqual(reqOpts.decode, options.decode); + done(); + }; + const row = getRowInstance(fn); + + row.get(keys, options, assert.ifError); + }); + + it('should respect filter in options object', done => { + const keys = [] as string[]; + + const options = { + decode: false, + filter: [{column: 'abc'}], + }; + const expectedFilter = options.filter; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const fn = (reqOpts: any) => { + assert.deepStrictEqual(reqOpts.filter, expectedFilter); + done(); + }; + const row = getRowInstance(fn); + + row.get(keys, options, assert.ifError); + }); + + it('should accept options without keys', done => { + const options = { + decode: false, + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const fn = (reqOpts: any) => { + assert.strictEqual(reqOpts.decode, options.decode); + assert(!reqOpts.filter); + done(); + }; + const row = getRowInstance(fn); + + row.get(options, assert.ifError); + }); + + it('should return an error to the callback', done => { + const error = new Error('err'); + const row = getRowInstanceForErrResp(error as ServiceError); + row.get((err, row) => { + assert.strictEqual(error, err); + assert.strictEqual(row, undefined); + done(); + }); + }); + + it('should return a custom error if the row is not found', done => { + const row = getRowInstanceForErrResp(null, []); + row.get((err, row_) => { + assert(err instanceof RowError); + assert.strictEqual(err!.message, 'Unknown row: ' + row.id + '.'); + assert.deepStrictEqual(row_, undefined); + done(); + }); + }); + + it('should update the row data upon success', done => { + const fakeRow = new Row(TABLE, ROW_ID); + fakeRow.data = { + a: 'a', + b: 'b', + }; + const row = getRowInstanceForErrResp(null, [fakeRow]); + row.get((err, row_) => { + assert.ifError(err); + assert.strictEqual(row_, row); + assert.deepStrictEqual(row.data, fakeRow.data); + done(); + }); + }); + + it('should return only data for the keys provided', done => { + const fakeRow = new Row(TABLE, ROW_ID); + + fakeRow.data = { + a: 'a', + b: 'b', + }; + + const keys = ['a', 'b']; + const row = getRowInstanceForErrResp(null, [fakeRow]); + + row.data = { + c: 'c', + }; + row.get(keys, (err, data) => { + assert.ifError(err); + assert.deepStrictEqual(Object.keys(data), keys); + done(); + }); + }); + }); + + describe('getMetadata', () => { + it('should return an error to the callback', done => { + const error = new Error('err'); + sandbox.stub(row, 'get').callsArgWith(1, error); + row.getMetadata((err, metadata) => { + assert.strictEqual(error, err); + assert.strictEqual(metadata, undefined); + done(); + }); + }); + + it('should return metadata to the callback', done => { + const fakeMetadata = { + a: 'a', + b: 'b', + }; + sandbox.stub(row, 'get').callsArgWith(1, null, row); + row.metadata = fakeMetadata; + row.getMetadata((err, metadata) => { + assert.ifError(err); + assert.strictEqual(metadata, fakeMetadata); + done(); + }); + }); + + it('should accept an options object', done => { + const fakeMetadata = {}; + const fakeOptions = { + decode: false, + }; + (row.get as Function) = (options: {}, callback: Function) => { + assert.strictEqual(options, fakeOptions); + callback(null, row); + }; + row.metadata = fakeMetadata; + row.getMetadata(fakeOptions, (err, metadata) => { + assert.ifError(err); + assert.strictEqual(metadata, fakeMetadata); + done(); + }); + }); + }); + + describe('increment', () => { + const COLUMN_NAME = 'a:b'; + let formatFamiliesSpy: sinon.SinonSpy; + + beforeEach(() => { + formatFamiliesSpy = sandbox + .stub(FakeRowDataUtil, 'formatFamilies_Util') + .returns({ + a: { + b: [ + { + value: 10, + }, + ], + }, + }); + }); + + afterEach(() => { + formatFamiliesSpy.restore(); + }); + + it('should provide the proper request options', done => { + sandbox + .stub(FakeRowDataUtil, 'createRulesUtil') + .callsFake((reqOpts, properties, gaxOptions, cb) => { + assert.strictEqual((reqOpts as rw.Rule).column, COLUMN_NAME); + assert.strictEqual((reqOpts as rw.Rule).increment, 1); + assert.deepStrictEqual(gaxOptions, {}); + done(); + }); + row.increment(COLUMN_NAME, assert.ifError); + }); + + it('should optionally accept an increment amount', done => { + const increment = 10; + sandbox.stub(FakeRowDataUtil, 'createRulesUtil').callsFake(reqOpts => { + assert.strictEqual((reqOpts as rw.Rule).increment, increment); + done(); + }); + row.increment(COLUMN_NAME, increment, assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + sandbox + .stub(FakeRowDataUtil, 'createRulesUtil') + .callsFake((reqOpts, properties, gaxOptions_) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }); + row.increment(COLUMN_NAME, gaxOptions, assert.ifError); + }); + + it('should accept increment amount and gaxOptions', done => { + const increment = 10; + const gaxOptions = {}; + sandbox + .stub(FakeRowDataUtil, 'createRulesUtil') + .callsFake((reqOpts, properties, gaxOptions_) => { + assert.strictEqual((reqOpts as rw.Rule).increment, increment); + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }); + row.increment(COLUMN_NAME, increment, gaxOptions, assert.ifError); + }); + + it('should return an error to the callback', done => { + const error = new Error('err'); + const response = {}; + sandbox + .stub(FakeRowDataUtil, 'createRulesUtil') + .callsArgWith(3, error, response); + row.increment(COLUMN_NAME, (err, value, apiResponse) => { + assert.strictEqual(err, error); + assert.strictEqual(value, null); + assert.strictEqual(apiResponse, response); + done(); + }); + }); + + it('should pass back the updated value to the callback', done => { + const fakeValue = 10; + const response = { + row: { + families: [ + { + name: 'a', + columns: [ + { + qualifier: 'b', + cells: [ + { + timestampMicros: Date.now(), + value: fakeValue, + labels: [], + }, + ], + }, + ], + }, + ], + }, + }; + + sandbox + .stub(FakeRowDataUtil, 'createRulesUtil') + .callsArgWith(3, null, response); + row.increment(COLUMN_NAME, (err, value, apiResponse) => { + assert.ifError(err); + assert.strictEqual(value, fakeValue); + assert.strictEqual(apiResponse, response); + assert.strictEqual(formatFamiliesSpy.callCount, 1); + assert(formatFamiliesSpy.calledWithExactly(response.row.families)); + done(); + }); + }); + }); + + describe('save', () => { + const data = { + a: { + b: 'c', + }, + }; + + it('should insert an object', done => { + const fn = ( + table: TabularApiSurface, + metricsCollector: OperationMetricsCollector, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + entry: Entry | Entry[], + gaxOptions: {}, + callback: Function, + ) => { + assert.strictEqual(entry.data, data); + callback(); // done() + }; + const SavedRow = getFakeMutateRow(fn).Row; + const savedRow = new SavedRow(TABLE, ROW_ID); + savedRow.save(data, done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + const fn = ( + table: TabularApiSurface, + metricsCollector: OperationMetricsCollector, + entry: Entry | Entry[], + gaxOptions_: MutateOptions | MutateCallback, + ) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }; + const SavedRow = getFakeMutateRow(fn).Row; + const savedRow = new SavedRow(TABLE, ROW_ID); + savedRow.save(data, gaxOptions, assert.ifError); + }); + + it('should remove existing data', done => { + const gaxOptions = {}; + const fn = ( + table: TabularApiSurface, + metricsCollector: OperationMetricsCollector, + entry: Entry | Entry[], + gaxOptions_: MutateOptions | MutateCallback, + ) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }; + const SavedRow = getFakeMutateRow(fn).Row; + const savedRow = new SavedRow(TABLE, ROW_ID); + savedRow.save(data, gaxOptions, assert.ifError); + assert.strictEqual(row.data, undefined); + }); + }); + + describe('RowError', () => { + it('should supply the correct message', () => { + const error = new RowError('test'); + assert.strictEqual(error.message, 'Unknown row: test.'); + }); + + it('should supply a 404 error code', () => { + const error = new RowError('test'); + assert.strictEqual(error.code, 404); + }); + }); +}); diff --git a/handwritten/bigtable/test/table.ts b/handwritten/bigtable/test/table.ts new file mode 100644 index 00000000000..c10e89145d4 --- /dev/null +++ b/handwritten/bigtable/test/table.ts @@ -0,0 +1,3393 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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 promisify from '@google-cloud/promisify'; +import * as assert from 'assert'; +import {afterEach, before, beforeEach, describe, it} from 'mocha'; +import * as proxyquire from 'proxyquire'; +import * as pumpify from 'pumpify'; +import * as sinon from 'sinon'; +import {PassThrough, Writable, Duplex} from 'stream'; +import {ServiceError} from 'google-gax'; + +import * as inst from '../src/instance'; +import {ChunkTransformer} from '../src/chunktransformer.js'; +import {Family} from '../src/family.js'; +import {Mutation} from '../src/mutation.js'; +import {Row} from '../src/row.js'; +import * as tblTypes from '../src/table'; +import {Bigtable, RequestOptions} from '../src'; +import {EventEmitter} from 'events'; +import {TableUtils} from '../src/utils/table'; +import {ClientSideMetricsConfigManager} from '../src/client-side-metrics/metrics-config-manager'; +import {OperationMetricsCollector} from '../src/client-side-metrics/operation-metrics-collector'; +import {SinonSpy} from 'sinon'; +import {TabularApiSurface} from '../src/tabular-api-surface'; +import {GetRowsOptions} from '../src/table'; +import {mutateInternal} from '../src/utils/mutateInternal'; + +const sandbox = sinon.createSandbox(); +const noop = () => {}; + +let promisified = false; +const fakePromisify = Object.assign({}, promisify, { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + promisifyAll(klass: Function, options: any) { + if (klass.name !== 'Table') { + return; + } + promisified = true; + assert.deepStrictEqual(options.exclude, ['family', 'row']); + }, +}); + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function createFake(klass: any) { + return class Fake extends klass { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + calledWith_: any[]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + constructor(...args: any[]) { + super(...args); + this.calledWith_ = args; + } + }; +} + +class FakeMetricsCollector { + onOperationStart() {} + onOperationComplete() {} + onResponse() {} + onAttemptStart() {} + onAttemptComplete() {} + onMetadataReceived() {} + wrapRequest() {} + onStatusMetadataReceived() {} + onRowReachesUser() {} +} + +class FakeMetricsConfigManager extends ClientSideMetricsConfigManager { + createOperation() { + return new FakeMetricsCollector() as unknown as OperationMetricsCollector; + } +} + +const FakeFamily = createFake(Family); +FakeFamily.formatRule_ = sinon.spy(rule => rule); + +const FakeRow = createFake(Row); + +FakeRow.formatChunks_ = sinon.spy(chunks => { + return chunks; +}); + +const FakeChunkTransformer = createFake(ChunkTransformer); +FakeChunkTransformer.prototype._transform = function ( + rows: Row[], + enc: {}, + next: Function, +) { + rows.forEach(row => this.push(row)); + next(); +}; + +const FakeMutation = { + methods: Mutation.methods, + convertToBytes: sinon.spy(value => { + return value; + }), + convertFromBytes: sinon.spy(value => { + return value; + }), + parse: sinon.spy(value => { + return value; + }), +}; + +const FakeFilter = { + parse: sinon.spy(value => { + return value; + }), + createRange: () => { + return {}; + }, +}; + +function getTableMock( + createReadStreamInternal: ( + table: TabularApiSurface, + singleRow: boolean, + opts?: GetRowsOptions, + ) => PassThrough, +) { + const FakeGetRows = proxyquire('../src/utils/getRowsInternal.js', { + './createReadStreamInternal': { + createReadStreamInternal: createReadStreamInternal, + }, + }); + const FakeMutateInternal = proxyquire('../src/utils/mutateInternal.js', { + '../row.js': {Row: FakeRow}, + '../chunktransformer.js': {ChunkTransformer: FakeChunkTransformer}, + '../filter.js': {Filter: FakeFilter}, + '../mutation.js': {Mutation: FakeMutation}, + pumpify, + }).mutateInternal; + const FakeTabularApiSurface = proxyquire('../src/tabular-api-surface.js', { + '@google-cloud/promisify': fakePromisify, + './family.js': {Family: FakeFamily}, + './mutation.js': {Mutation: FakeMutation}, + './filter.js': {Filter: FakeFilter}, + pumpify, + './row.js': {Row: FakeRow}, + './chunktransformer.js': {ChunkTransformer: FakeChunkTransformer}, + './utils/createReadStreamInternal': { + createReadStreamInternal, + }, + './utils/mutateInternal': { + mutateInternal: FakeMutateInternal, + }, + './utils/getRowsInternal': { + getRowsInternal: FakeGetRows.getRowsInternal, + }, + }).TabularApiSurface; + const Table = proxyquire('../src/table.js', { + '@google-cloud/promisify': fakePromisify, + './family.js': {Family: FakeFamily}, + './mutation.js': {Mutation: FakeMutation}, + './row.js': {Row: FakeRow}, + './tabular-api-surface': {TabularApiSurface: FakeTabularApiSurface}, + }).Table; + return Table; +} + +describe('Bigtable/Table', () => { + const TABLE_ID = 'my-table'; + let INSTANCE: inst.Instance; + let TABLE_NAME: string; + + let Table: typeof tblTypes.Table; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let table: any; + + before(() => { + const FakeCreateReadStreamInternal = proxyquire( + '../src/utils/createReadStreamInternal.js', + { + '../row.js': {Row: FakeRow}, + '../chunktransformer.js': {ChunkTransformer: FakeChunkTransformer}, + '../filter.js': {Filter: FakeFilter}, + '../mutation.js': {Mutation: FakeMutation}, + pumpify, + }, + ).createReadStreamInternal; + Table = getTableMock(FakeCreateReadStreamInternal); + }); + + beforeEach(() => { + INSTANCE = { + bigtable: { + _metricsConfigManager: new FakeMetricsConfigManager( + [], + ) as ClientSideMetricsConfigManager, + } as Bigtable, + name: 'a/b/c/d', + } as inst.Instance; + TABLE_NAME = INSTANCE.name + '/tables/' + TABLE_ID; + table = new Table(INSTANCE, TABLE_ID); + }); + + afterEach(() => { + Object.keys(FakeMutation).forEach(spy => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if ((FakeMutation as any)[spy].reset) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (FakeMutation as any)[spy].resetHistory(); + } + }); + FakeFilter.parse.resetHistory(); + sandbox.restore(); + }); + + describe('instantiation', () => { + it('should promisify all the things', () => { + assert(promisified); + }); + + it('should localize Bigtable instance', () => { + assert.strictEqual(table.bigtable, INSTANCE.bigtable); + }); + + it('should localize Instance instance', () => { + assert.strictEqual(table.instance, INSTANCE); + }); + + it('should localize ID', () => { + assert.strictEqual(table.id, TABLE_ID); + }); + + it('should localize table name', () => { + assert.strictEqual(table.name, TABLE_NAME); + }); + it('should leave full table name unaltered and localize the id from the name', () => { + const table = new Table(INSTANCE, TABLE_NAME); + assert.strictEqual(table.name, TABLE_NAME); + assert.strictEqual(table.id, TABLE_ID); + }); + + it('should throw if table id in wrong format', () => { + const id = `tables/${TABLE_ID}`; + assert.throws(() => { + new Table(INSTANCE, id); + }, Error); + }); + }); + + describe('VIEWS', () => { + const views = { + unspecified: 0, + name: 1, + schema: 2, + replication: 3, + full: 4, + }; + + it('should export the table views', () => { + assert.deepStrictEqual(views, Table.VIEWS); + }); + }); + + describe('formatName_', () => { + it('should format the table name to include the cluster name', () => { + const tableName = Table.formatName_(INSTANCE.name, TABLE_ID); + assert.strictEqual(tableName, TABLE_NAME); + }); + + it('should not re-format the table name', () => { + const tableName = Table.formatName_(INSTANCE.id, TABLE_NAME); + assert.strictEqual(tableName, TABLE_NAME); + }); + }); + + describe('create', () => { + it('should call createTable from instance', done => { + const options = {}; + + table.instance.createTable = ( + id: string, + options_: {}, + callback: Function, + ) => { + assert.strictEqual(id, table.id); + assert.strictEqual(options_, options); + callback(); // done() + }; + + table.create(options, done); + }); + + it('should not require options', done => { + table.instance.createTable = ( + id: string, + options: {}, + callback: Function, + ) => { + assert.deepStrictEqual(options, {}); + callback(); // done() + }; + + table.create(done); + }); + }); + + describe('createBackup', () => { + const BACKUP_ID = 'backup-id'; + const CONFIG = {a: 'b'}; + + const READY_CLUSTER_ID = 'cluster-id'; + const REPLICATION_STATES = new Map(); + REPLICATION_STATES.set('a', {replicationState: 'NOT_READY'}); + REPLICATION_STATES.set(READY_CLUSTER_ID, {replicationState: 'READY'}); + + it('should throw if an id is not provided', () => { + assert.throws(() => { + table.createBackup(); + }, /An id is required to create a backup\./); + }); + + it('should throw if a configuration object is not provided', () => { + assert.throws(() => { + table.createBackup(BACKUP_ID); + }, /A configuration object is required\./); + }); + + it('should get replication states', done => { + table.getReplicationStates = () => { + done(); + }; + + table.createBackup(BACKUP_ID, CONFIG, assert.ifError); + }); + + it('should pass gaxOptions when getting replication states', done => { + const config = {gaxOptions: {}}; + + table.getReplicationStates = (gaxOptions: {}) => { + assert.strictEqual(gaxOptions, config.gaxOptions); + done(); + }; + + table.createBackup(BACKUP_ID, config, assert.ifError); + }); + + it('should execute callback with error if getting replication states fails', done => { + const error = new Error('Error.'); + + table.getReplicationStates = (gaxOptions: {}, callback: Function) => { + callback(error); + }; + + table.createBackup(BACKUP_ID, CONFIG, (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should create a Cluster with the id of the first available cluster', done => { + table.instance.cluster = (id: string) => { + assert.strictEqual(id, READY_CLUSTER_ID); + setImmediate(done); + return {createBackup: () => {}}; + }; + + table.getReplicationStates = (gaxOptions: {}, callback: Function) => { + callback(null, REPLICATION_STATES); + }; + + table.createBackup(BACKUP_ID, CONFIG, assert.ifError); + }); + + it('should accept READY_OPTIMIZING status', done => { + const readyClusterId = 'unique-cluster-id'; + const replicationStates = new Map(); + replicationStates.set('a', {replicationState: 'NOT_READY'}); + replicationStates.set(readyClusterId, { + replicationState: 'READY_OPTIMIZING', + }); + + table.instance.cluster = (id: string) => { + assert.strictEqual(id, readyClusterId); + setImmediate(done); + return {createBackup: () => {}}; + }; + + table.getReplicationStates = (gaxOptions: {}, callback: Function) => { + callback(null, replicationStates); + }; + + table.createBackup(BACKUP_ID, CONFIG, assert.ifError); + }); + + it('should return error if no clusters are available', done => { + const replicationStates = new Map(); + replicationStates.set('a', {replicationState: 'NOT_READY'}); + replicationStates.set('b', {replicationState: 'NOT_READY'}); + + table.getReplicationStates = (gaxOptions: {}, callback: Function) => { + callback(null, replicationStates); + }; + + table.createBackup(BACKUP_ID, CONFIG, (err: Error) => { + assert.strictEqual( + err.message, + 'No ready clusters eligible for backup.', + ); + done(); + }); + }); + + it('should correctly create a Backup from the Cluster', done => { + table.instance.cluster = () => { + return { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + createBackup: (id: string, config: any, callback: Function) => { + assert.strictEqual(id, BACKUP_ID); + assert.deepStrictEqual(config, { + table: table.name, + ...CONFIG, + }); + callback(); // done() + }, + }; + }; + + table.getReplicationStates = (gaxOptions: {}, callback: Function) => { + callback(null, REPLICATION_STATES); + }; + + table.createBackup(BACKUP_ID, CONFIG, done); + }); + }); + + describe('createPrefixRange', () => { + it('should create a range from the prefix', () => { + assert.deepStrictEqual(Table.createPrefixRange('start'), { + start: 'start', + end: { + value: 'staru', + inclusive: false, + }, + }); + + assert.deepStrictEqual(Table.createPrefixRange('X\xff'), { + start: 'X\xff', + end: { + value: 'Y', + inclusive: false, + }, + }); + + assert.deepStrictEqual(Table.createPrefixRange('xoo\xff'), { + start: 'xoo\xff', + end: { + value: 'xop', + inclusive: false, + }, + }); + + assert.deepStrictEqual(Table.createPrefixRange('a\xffb'), { + start: 'a\xffb', + end: { + value: 'a\xffc', + inclusive: false, + }, + }); + + assert.deepStrictEqual(Table.createPrefixRange('com.google.'), { + start: 'com.google.', + end: { + value: 'com.google/', + inclusive: false, + }, + }); + }); + + it('should create an inclusive bound when the prefix is empty', () => { + assert.deepStrictEqual(Table.createPrefixRange('\xff'), { + start: '\xff', + end: { + value: '', + inclusive: true, + }, + }); + + assert.deepStrictEqual(Table.createPrefixRange(''), { + start: '', + end: { + value: '', + inclusive: true, + }, + }); + }); + }); + + describe('createFamily', () => { + const COLUMN_ID = 'my-column'; + const FAMILY_ID = 'test-family'; + + it('should throw if a id is not provided', () => { + assert.throws(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (table as any).createFamily(); + }, /An id is required to create a family\./); + }); + + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'modifyColumnFamilies'); + + assert.strictEqual(config.reqOpts.name, TABLE_NAME); + assert.deepStrictEqual(config.reqOpts.modifications, [ + { + id: COLUMN_ID, + create: {}, + }, + ]); + + assert.strictEqual(config.gaxOpts, undefined); + + done(); + }; + + table.createFamily(COLUMN_ID, assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + table.createFamily(COLUMN_ID, {gaxOptions}, assert.ifError); + }); + + it('should respect the gc rule option', done => { + const rule = { + a: 'a', + b: 'b', + }; + const convertedRule = { + c: 'c', + d: 'd', + }; + + const spy = (FakeFamily.formatRule_ = sinon.spy(() => { + return convertedRule; + })); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + const modification = config.reqOpts.modifications[0]; + + assert.strictEqual(modification.create.gcRule, convertedRule); + assert.strictEqual(spy.callCount, 1); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + assert.strictEqual((spy as any).getCall(0).args[0], rule); + done(); + }; + + table.createFamily(COLUMN_ID, {rule}, assert.ifError); + }); + + it('should return an error to the callback', done => { + const error = new Error('err'); + const response = {}; + table.bigtable.request = (config: {}, callback: Function) => { + callback(error, response); + }; + table.createFamily( + COLUMN_ID, + (err: Error, family: Family, apiResponse: {}) => { + assert.strictEqual(error, err); + assert.strictEqual(family, null); + assert.strictEqual(response, apiResponse); + done(); + }, + ); + }); + + it('should return a Family object', done => { + const response = { + name: 'response-family-name', + }; + const fakeFamily = {} as Family; + table.bigtable.request = (config: {}, callback: Function) => { + callback(null, response); + }; + sandbox.stub(table, 'family').callsFake(id => { + assert.strictEqual(id, FAMILY_ID); + return fakeFamily; + }); + table.createFamily( + FAMILY_ID, + (err: Error, family: Family, apiResponse: {}) => { + assert.ifError(err); + assert.strictEqual(family, fakeFamily); + assert.strictEqual(family.metadata, response); + assert.strictEqual(apiResponse, response); + done(); + }, + ); + }); + }); + + describe('createReadStream', () => { + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableClient'); + assert.strictEqual(config.method, 'readRows'); + assert.strictEqual(config.reqOpts.tableName, TABLE_NAME); + assert.strictEqual(config.reqOpts.appProfileId, undefined); + assert.deepStrictEqual(config.gaxOpts, { + otherArgs: {headers: {'bigtable-attempt': 0}}, + }); + done(); + }; + table.createReadStream(); + }); + + it('should use an appProfileId', done => { + const bigtableInstance = table.bigtable; + bigtableInstance.appProfileId = 'app-profile-id-12345'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtableInstance.request = (config: any) => { + assert.strictEqual( + config.reqOpts.appProfileId, + bigtableInstance.appProfileId, + ); + done(); + }; + table.createReadStream(); + }); + + it('should abort request on end', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = () => { + const requestStream = new PassThrough({ + objectMode: true, + }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (requestStream as any).abort = () => { + done(); + }; + + return requestStream; + }; + + table.createReadStream().end(); + }); + + describe('options', () => { + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + table.createReadStream({gaxOptions}); + }); + + it('should retrieve a range of rows', done => { + const options = { + start: 'gwashington', + end: 'alincoln', + }; + + const fakeRange = { + start: 'a', + end: 'b', + }; + + const formatSpy = (FakeFilter.createRange = sinon.spy(() => { + return fakeRange; + })); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.deepStrictEqual(config.reqOpts.rows.rowRanges[0], fakeRange); + assert.strictEqual(formatSpy.callCount, 1); + assert.deepStrictEqual(formatSpy.getCall(0).args, [ + options.start, + options.end, + 'Key', + ]); + done(); + }; + + table.createReadStream(options); + }); + + it('should retrieve multiple rows', done => { + const options = { + keys: ['gwashington', 'alincoln'], + }; + const convertedKeys = ['a', 'b']; + + const convertSpy = (FakeMutation.convertToBytes = sinon.spy(key => { + const keyIndex = options.keys.indexOf(key); + return convertedKeys[keyIndex]; + })); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.deepStrictEqual(config.reqOpts.rows.rowKeys, convertedKeys); + assert.strictEqual(convertSpy.callCount, 2); + assert.strictEqual(convertSpy.getCall(0).args[0], options.keys[0]); + assert.strictEqual(convertSpy.getCall(1).args[0], options.keys[1]); + done(); + }; + + table.createReadStream(options); + }); + + it('should retrieve multiple ranges', done => { + const options = { + ranges: [ + { + start: 'a', + end: 'b', + }, + { + start: 'c', + end: 'd', + }, + ], + }; + + const fakeRanges = [ + { + start: 'e', + end: 'f', + }, + { + start: 'g', + end: 'h', + }, + ]; + + const formatSpy = (FakeFilter.createRange = sinon.spy(() => { + return fakeRanges[formatSpy.callCount - 1]; + })) as sinon.SinonSpy; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.deepStrictEqual(config.reqOpts.rows.rowRanges, fakeRanges); + assert.strictEqual(formatSpy.callCount, 2); + assert.deepStrictEqual(formatSpy.getCall(0).args, [ + options.ranges[0].start, + options.ranges[0].end, + 'Key', + ]); + assert.deepStrictEqual(formatSpy.getCall(1).args, [ + options.ranges[1].start, + options.ranges[1].end, + 'Key', + ]); + done(); + }; + table.createReadStream(options); + }); + + it('should parse a filter object', done => { + const options = { + filter: [{}], + }; + const fakeFilter = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const parseSpy = ((FakeFilter as any).parse = sinon.spy(() => { + return fakeFilter; + })); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.reqOpts.filter, fakeFilter); + assert.strictEqual(parseSpy.callCount, 1); + assert.strictEqual( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (parseSpy as any).getCall(0).args[0], + options.filter, + ); + done(); + }; + table.createReadStream(options); + }); + + it('should allow setting a row limit', done => { + const options = { + limit: 10, + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.reqOpts.rowsLimit, options.limit); + done(); + }; + table.createReadStream(options); + }); + + it('should throw if ranges and start is set together', () => { + const options = { + ranges: [ + { + start: 'a', + end: 'b', + }, + { + start: 'c', + end: 'd', + }, + ], + start: 'a', + }; + assert.throws(() => { + table.createReadStream(options, assert.ifError); + }, /start\/end should be used exclusively to ranges\/prefix\/prefixes\./); + }); + + it('should throw if ranges and end is set together', () => { + const options = { + ranges: [ + { + start: 'a', + end: 'b', + }, + { + start: 'c', + end: 'd', + }, + ], + end: 'a', + }; + assert.throws(() => { + table.createReadStream(options, assert.ifError); + }, /start\/end should be used exclusively to ranges\/prefix\/prefixes\./); + }); + + it('should throw if ranges and prefix is set together', () => { + const options = { + ranges: [ + { + start: 'a', + end: 'b', + }, + { + start: 'c', + end: 'd', + }, + ], + prefix: 'a', + }; + assert.throws(() => { + table.createReadStream(options, assert.ifError); + }, /prefix should be used exclusively to ranges\/start\/end\/prefixes\./); + }); + + it('should throw if ranges and prefixes is set together', () => { + const options = { + ranges: [ + { + start: 'a', + end: 'b', + }, + { + start: 'c', + end: 'd', + }, + ], + prefixes: [{prefix: 'a'}], + }; + assert.throws(() => { + table.createReadStream(options, assert.ifError); + }, /prefixes should be used exclusively to ranges\/start\/end\/prefix\./); + }); + + it('should throw if prefix and start is set together', () => { + const options = { + start: 'a', + prefix: 'a', + }; + assert.throws(() => { + table.createReadStream(options, assert.ifError); + }, /start\/end should be used exclusively to ranges\/prefix\/prefixes\./); + }); + + describe('prefixes', () => { + beforeEach(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (FakeFilter as any).createRange = noop; + }); + + afterEach(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (TableUtils as any).createPrefixRange.restore(); + }); + + it('should transform the prefix into a range', done => { + const fakeRange = {}; + const fakePrefixRange = { + start: 'a', + end: 'b', + } as {} as tblTypes.PrefixRange; + + const fakePrefix = 'abc'; + + const prefixSpy = sandbox + .stub(TableUtils, 'createPrefixRange') + .returns(fakePrefixRange); + + const rangeSpy = sandbox + .stub(FakeFilter, 'createRange') + .returns(fakeRange); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(prefixSpy.getCall(0).args[0], fakePrefix); + assert.deepStrictEqual(config.reqOpts.rows.rowRanges, [fakeRange]); + + assert.deepStrictEqual(rangeSpy.getCall(0).args, [ + fakePrefixRange.start, + fakePrefixRange.end, + 'Key', + ]); + + done(); + }; + + table.createReadStream({prefix: fakePrefix}); + }); + + it('should accept multiple prefixes', done => { + const prefixes = ['abc', 'def']; + const prefixRanges = [ + {start: 'abc', end: 'abd'}, + {start: 'def', end: 'deg'}, + ] as {} as tblTypes.PrefixRange[]; + const prefixSpy = sandbox + .stub(TableUtils, 'createPrefixRange') + .callsFake(() => { + const callIndex = prefixSpy.callCount - 1; + return prefixRanges[callIndex]; + }); + + const ranges = [{}, {}]; + const rangeSpy = sandbox + .stub(FakeFilter, 'createRange') + .callsFake(() => { + const callIndex = rangeSpy.callCount - 1; + return ranges[callIndex]; + }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(prefixSpy.callCount, 2); + + prefixes.forEach((prefix, i) => { + const prefixRange = prefixRanges[i]; + + assert.deepStrictEqual(prefixSpy.getCall(i).args, [prefix]); + assert.deepStrictEqual(rangeSpy.getCall(i).args, [ + prefixRange.start, + prefixRange.end, + 'Key', + ]); + assert.strictEqual(config.reqOpts.rows.rowRanges[i], ranges[i]); + }); + + done(); + }; + + table.createReadStream({prefixes}); + }); + }); + }); + + describe('success', () => { + const fakeChunks = { + chunks: [ + { + rowKey: 'a', + }, + { + commitRow: true, + }, + { + rowKey: 'b', + }, + { + commitRow: true, + }, + ], + }; + + const formattedRows = [ + {key: 'c', data: {}}, + {key: 'd', data: {}}, + ]; + + beforeEach(() => { + sinon.stub(table, 'row').callsFake((...args: unknown[]) => { + return { + id: args[0] as string, + table: table, + bigtable: table.bigtable, + data: {}, + } as Row; + }); + FakeChunkTransformer.prototype._transform = function ( + chunks: Array<{}>, + enc: {}, + next: Function, + ) { + formattedRows.forEach(row => this.push(row)); + next(); + }; + FakeChunkTransformer.prototype._flush = (cb: Function) => { + cb(); + }; + + table.bigtable.request = () => { + const stream = new PassThrough({ + objectMode: true, + }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (stream as any).abort = () => {}; + + setImmediate(() => { + stream.push(fakeChunks); + stream.push(null); + }); + + return stream; + }; + }); + + it('should stream Row objects', done => { + const rows: Row[] = []; + + table + .createReadStream() + .on('error', done) + .on('data', (row: Row) => { + rows.push(row); + }) + .on('end', () => { + const rowSpy = table.row; + assert.strictEqual(rows.length, formattedRows.length); + assert.strictEqual(rowSpy.callCount, formattedRows.length); + assert.strictEqual(rowSpy.getCall(0).args[0], formattedRows[0].key); + assert.strictEqual(rows[0].data, formattedRows[0].data); + assert.strictEqual(rowSpy.getCall(1).args[0], formattedRows[1].key); + assert.strictEqual(rows[1].data, formattedRows[1].data); + done(); + }); + }); + + it('should allow a stream to end early', done => { + const rows: Row[] = []; + const stream = table + .createReadStream() + .on('error', noop) + .on('data', (row: Row) => { + rows.push(row); + stream.end(); + }) + .on('end', () => { + assert.strictEqual(rows.length, 1); + done(); + }); + }); + }); + + describe('error', () => { + const error = new Error('err'); + const fakeChunks = { + chunks: [ + { + rowKey: 'a', + }, + { + commitRow: true, + }, + { + rowKey: 'b', + }, + { + commitRow: true, + }, + ], + }; + + // beforeEach(() => { + // table.bigtable.request = () => { + // let stream = new PassThrough({ + // objectMode: true, + // }); + + // setImmediate(() => { + // stream.emit('error', error); + // }); + + // return stream; + // }; + // }); + + it('should emit an error event', done => { + table.bigtable.request = () => { + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + stream.emit('error', error); + }); + + return stream; + }; + table + .createReadStream() + .on('error', (err: Error) => { + assert.strictEqual(error, err); + done(); + }) + .on('data', done); + }); + it('should emit an error event when chunk format returns error', done => { + table.bigtable.request = () => { + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + stream.push(fakeChunks); + stream.push(null); + }); + + return stream; + }; + FakeChunkTransformer.prototype._transform = ( + chunks: {}, + enc: {}, + next: Function, + ) => { + next(error); + }; + table + .createReadStream() + .on('error', (err: Error) => { + assert.strictEqual(error, err); + done(); + }) + .on('data', done); + }); + it('should emit an error event when chunktransformer returns error on flush end', done => { + table.bigtable.request = () => { + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + stream.push(null); + }); + + return stream; + }; + FakeChunkTransformer.prototype._flush = (next: Function) => { + next(error); + }; + table + .createReadStream() + .on('error', (err: Error) => { + assert.strictEqual(error, err); + done(); + }) + .on('data', done); + }); + }); + it('Should respect the timeout parameter passed in for UNAVAILABLE error', done => { + // The timeout is 2 seconds, but the error is received after 3 seconds + // so the client doesn't retry because more than 2 seconds have elapsed. + const requestSpy = (table.bigtable.request = sinon.spy(() => { + const stream = new PassThrough({ + objectMode: true, + }); + (stream as any).abort = () => {}; + setTimeout(() => { + const error = new Error('retry me!') as ServiceError; + error.code = 14; + stream.emit('error', error); + }, 3000); + return stream; + })); + const stream = table.createReadStream({gaxOptions: {timeout: 2000}}); + stream.on('error', (error: ServiceError) => { + assert.strictEqual(error.code, 14); + assert.strictEqual(error.message, 'retry me!'); + assert.strictEqual(requestSpy.callCount, 1); // Ensures the client has not retried. + done(); + }); + }); + it('Should respect the timeout parameter passed in for DEADLINE_EXCEEDED error', done => { + // The timeout is 2 seconds, but the error is received after 3 seconds + // so the client doesn't retry because more than 2 seconds have elapsed. + const requestSpy = (table.bigtable.request = sinon.spy(() => { + const stream = new PassThrough({ + objectMode: true, + }); + (stream as any).abort = () => {}; + setTimeout(() => { + const error = new Error('retry me!') as ServiceError; + error.code = 4; + stream.emit('error', error); + }, 3000); + return stream; + })); + const stream = table.createReadStream({gaxOptions: {timeout: 2000}}); + stream.on('error', (error: ServiceError) => { + assert.strictEqual(error.code, 4); + assert.strictEqual(error.message, 'retry me!'); + assert.strictEqual(requestSpy.callCount, 1); // Ensures the client has not retried. + done(); + }); + }); + describe('retries', () => { + let callCreateReadStream: Function; + let emitters: EventEmitter[] | null; // = [((stream: Writable) => { stream.push([{ key: 'a' }]); + // stream.end(); }, ...]; + let makeRetryableError: Function; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let reqOptsCalls: any[]; + let setTimeoutSpy: sinon.SinonSpy; + + /* + setImmediate is required here to correctly mock events as they will + come in from the request function. It is required for tests to pass, + but it is not a problem that it is required because we never expect + a single Node event to emit data and then emit an error. That is, + a mock without setImmediate around the last error represents a scenario + that will never happen. + */ + function emitRetriableError(stream: Duplex) { + setImmediate(() => { + stream.emit('error', makeRetryableError()); + }); + } + + beforeEach(() => { + FakeChunkTransformer.prototype._transform = function ( + rows: Row[], + enc: {}, + next: Function, + ) { + rows.forEach(row => this.push(row)); + this.lastRowKey = rows[rows.length - 1].key; + next(); + }; + + FakeChunkTransformer.prototype._flush = (cb: Function) => { + cb(); + }; + + callCreateReadStream = (options: {}, verify: Function) => { + table.createReadStream(options).on('end', verify).resume(); // The stream starts paused unless it has a `.data()` + // callback. + }; + + emitters = null; // This needs to be assigned in each test case. + + makeRetryableError = () => { + const error = new Error('retry me!') as ServiceError; + error.code = 4; + return error; + }; + + (sandbox.stub(FakeFilter, 'createRange') as sinon.SinonStub).callsFake( + (start, end) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const range: any = {}; + if (start) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + range.start = (start as any).value || start; + range.startInclusive = + // eslint-disable-next-line @typescript-eslint/no-explicit-any + typeof start === 'object' ? (start as any).inclusive : true; + } + if (end) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + range.end = (end as any).value || end; + } + return range; + }, + ); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (FakeMutation as any).convertToBytes = (value: string) => { + return Buffer.from(value); + }; + + reqOptsCalls = []; + + setTimeoutSpy = sandbox + .stub(global, 'setTimeout') + .callsFake(fn => (fn as Function)()); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + reqOptsCalls.push(config.reqOpts); + + const stream = new PassThrough({ + objectMode: true, + }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (stream as any).abort = () => {}; + + setImmediate(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (emitters!.shift() as any)(stream); + }); + return stream; + }; + }); + + afterEach(() => { + if (setTimeoutSpy) { + setTimeoutSpy.restore(); + } + }); + + it('should do a retry the stream is interrupted', done => { + emitters = [ + ((stream: Writable) => { + stream.emit('error', makeRetryableError()); + stream.end(); + }) as {} as EventEmitter, + ((stream: Writable) => { + stream.end(); + }) as {} as EventEmitter, + ]; + callCreateReadStream(null, () => { + assert.strictEqual(reqOptsCalls.length, 2); + done(); + }); + }); + + it('should not retry CANCELLED errors', done => { + emitters = [ + ((stream: Writable) => { + const cancelledError = new Error( + 'do not retry me!', + ) as ServiceError; + cancelledError.code = 1; + stream.emit('error', cancelledError); + stream.end(); + }) as {} as EventEmitter, + ]; + callCreateReadStream(null, () => { + assert.strictEqual(reqOptsCalls.length, 1); + done(); + }); + }); + + it('should not retry over maxRetries', done => { + const error = new Error('retry me!') as ServiceError; + error.code = 4; + + emitters = [ + ((stream: Writable) => { + stream.emit('error', error); + stream.end(); + }) as {} as EventEmitter, + ]; + + table.maxRetries = 0; + table + .createReadStream() + .on('error', (err: ServiceError) => { + assert.strictEqual(err, error); + assert.strictEqual(reqOptsCalls.length, 1); + done(); + }) + .on('end', done) + .resume(); + }); + + it('should have a range which starts after the last read key', done => { + emitters = [ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ((stream: any) => { + stream.push([{key: 'a'}]); + emitRetriableError(stream); + }) as {} as EventEmitter, + ((stream: Writable) => { + stream.end(); + }) as {} as EventEmitter, + ]; + + const fullScan = {rowKeys: [], rowRanges: [{}]}; + + callCreateReadStream(null, () => { + assert.deepStrictEqual(reqOptsCalls[0].rows, fullScan); + assert.deepStrictEqual(reqOptsCalls[1].rows, { + rowKeys: [], + rowRanges: [{start: 'a', startInclusive: false}], + }); + done(); + }); + }); + + it('should move the active range start to after the last read key', done => { + emitters = [ + ((stream: Duplex) => { + stream.push([{key: 'a'}]); + emitRetriableError(stream); + }) as {} as EventEmitter, + ((stream: Writable) => { + stream.end(); + }) as {} as EventEmitter, + ]; + + callCreateReadStream({ranges: [{start: 'a'}]}, () => { + assert.deepStrictEqual(reqOptsCalls[0].rows, { + rowKeys: [], + rowRanges: [{start: 'a', startInclusive: true}], + }); + assert.deepStrictEqual(reqOptsCalls[1].rows, { + rowKeys: [], + rowRanges: [{start: 'a', startInclusive: false}], + }); + done(); + }); + }); + + it('should remove ranges which were already read', done => { + emitters = [ + ((stream: Duplex) => { + stream.push([{key: 'a'}]); + stream.push([{key: 'b'}]); + emitRetriableError(stream); + }) as {} as EventEmitter, + ((stream: Duplex) => { + stream.push([{key: 'c'}]); + stream.end(); + }) as {} as EventEmitter, + ]; + + const options = { + ranges: [{start: 'a', end: 'b'}, {start: 'c'}], + }; + + callCreateReadStream(options, () => { + const allRanges = [ + {start: 'a', end: 'b', startInclusive: true}, + {start: 'c', startInclusive: true}, + ]; + assert.deepStrictEqual(reqOptsCalls[0].rows, { + rowKeys: [], + rowRanges: allRanges, + }); + assert.deepStrictEqual(reqOptsCalls[1].rows, { + rowKeys: [], + rowRanges: allRanges.slice(1), + }); + done(); + }); + }); + + it('should remove the keys which were already read', done => { + emitters = [ + ((stream: Duplex) => { + stream.push([{key: 'a'}]); + emitRetriableError(stream); + }) as {} as EventEmitter, + ((stream: Duplex) => { + stream.end([{key: 'c'}]); + }) as {} as EventEmitter, + ]; + + callCreateReadStream({keys: ['a', 'b']}, () => { + assert.strictEqual(reqOptsCalls[0].rows.rowKeys.length, 2); + assert.strictEqual(reqOptsCalls[1].rows.rowKeys.length, 1); + done(); + }); + }); + + it('should not retry if limit is reached', done => { + emitters = [ + ((stream: Duplex) => { + stream.push([{key: 'a'}]); + stream.push([{key: 'b'}]); + emitRetriableError(stream); + }) as {} as EventEmitter, + ]; + + const options = { + ranges: [{start: 'a', end: 'c'}], + limit: 2, + }; + + callCreateReadStream(options, () => { + assert.strictEqual(reqOptsCalls.length, 1); + done(); + }); + }); + + it('should not retry if all the keys are read', done => { + emitters = [ + ((stream: Duplex) => { + stream.push([{key: 'a'}]); + emitRetriableError(stream); + }) as {} as EventEmitter, + ]; + + callCreateReadStream({keys: ['a']}, () => { + assert.strictEqual(reqOptsCalls.length, 1); + done(); + }); + }); + + it('shouldn not retry if all the ranges are read', done => { + emitters = [ + ((stream: Duplex) => { + stream.push([{key: 'c'}]); + emitRetriableError(stream); + }) as {} as EventEmitter, + ]; + + const options = { + ranges: [{start: 'a', end: 'c', endInclusive: true}], + }; + + callCreateReadStream(options, () => { + assert.strictEqual(reqOptsCalls.length, 1); + assert.deepStrictEqual(reqOptsCalls[0].rows, { + rowKeys: [], + rowRanges: [{start: 'a', end: 'c', startInclusive: true}], + }); + done(); + }); + }); + + it('shouldn not retry with keys and ranges that are read', done => { + emitters = [ + ((stream: Duplex) => { + stream.push([{key: 'a1'}]); + stream.push([{key: 'd'}]); + emitRetriableError(stream); + }) as {} as EventEmitter, + ]; + + const options = { + ranges: [{start: 'a', end: 'b'}], + keys: ['c', 'd'], + }; + + callCreateReadStream(options, () => { + assert.strictEqual(reqOptsCalls.length, 1); + done(); + }); + }); + + it('should retry received rst stream errors', done => { + const rstStreamError = new Error('Received Rst_stream') as ServiceError; + rstStreamError.code = 13; + emitters = [ + ((stream: Duplex) => { + stream.emit('error', rstStreamError); + }) as {} as EventEmitter, + ((stream: Duplex) => { + stream.end([{key: 'a'}]); + }) as {} as EventEmitter, + ]; + + const options = { + keys: ['a'], + }; + + callCreateReadStream(options, () => { + assert.strictEqual(reqOptsCalls.length, 2); + done(); + }); + }); + }); + }); + + describe('delete', () => { + it('should make the correct request', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any, callback: Function) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'deleteTable'); + + assert.deepStrictEqual(config.reqOpts, { + name: table.name, + }); + + assert.deepStrictEqual(config.gaxOpts, {}); + + callback(); // done() + }; + + table.delete(done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + table.delete(gaxOptions, assert.ifError); + }); + }); + + describe('deleteRows', () => { + const prefix = 'a'; + + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any, callback: Function) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'dropRowRange'); + assert.strictEqual(config.reqOpts.name, TABLE_NAME); + assert.deepStrictEqual(config.gaxOpts, {}); + callback(); + }; + + table.deleteRows(prefix, done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + table.deleteRows(prefix, gaxOptions, assert.ifError); + }); + + it('should respect the row key prefix option', done => { + const fakePrefix = 'b'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const spy = ((FakeMutation as any).convertToBytes = sinon.spy( + () => fakePrefix, + )); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.reqOpts.rowKeyPrefix, fakePrefix); + assert.strictEqual(spy.callCount, 1); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + assert.strictEqual((spy as any).getCall(0).args[0], prefix); + done(); + }; + + table.deleteRows(prefix, assert.ifError); + }); + + it('should throw if prefix is not provided', () => { + assert.throws(() => { + table.deleteRows(assert.ifError); + }, /A prefix is required for deleteRows\./); + }); + }); + + describe('exists', () => { + it('should not require gaxOptions', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.getMetadata = (options_: any) => { + assert.deepStrictEqual(options_.gaxOptions, {}); + done(); + }; + table.exists(assert.ifError); + }); + + it('should pass gaxOptions to getMetadata', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.getMetadata = (options_: any) => { + assert.strictEqual(options_.gaxOptions, gaxOptions); + done(); + }; + table.exists(gaxOptions, assert.ifError); + }); + + it('should pass view = name to getMetadata', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.getMetadata = (options_: any) => { + assert.strictEqual(options_.view, 'name'); + done(); + }; + table.exists(gaxOptions, assert.ifError); + }); + + it('should return false if error code is 5', done => { + const error = new Error('Error.') as ServiceError; + error.code = 5; + table.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(error); + }; + table.exists((err: Error, exists: boolean) => { + assert.ifError(err); + assert.strictEqual(exists, false); + done(); + }); + }); + + it('should return error if code is not 5', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const error: any = new Error('Error.'); + error.code = 'NOT-5'; + table.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(error); + }; + table.exists((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return true if no error', done => { + table.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(null, {}); + }; + table.exists((err: Error, exists: boolean) => { + assert.ifError(err); + assert.strictEqual(exists, true); + done(); + }); + }); + }); + + describe('family', () => { + const FAMILY_ID = 'test-family'; + + it('should throw if an id is not provided', () => { + assert.throws(() => { + table.family(); + }, /A family id must be provided\./); + }); + + it('should create a family with the proper arguments', () => { + const family = table.family(FAMILY_ID); + assert(family instanceof FakeFamily); + assert.strictEqual(family.calledWith_[0], table); + assert.strictEqual(family.calledWith_[1], FAMILY_ID); + }); + }); + + describe('get', () => { + it('should call getMetadata', done => { + const options = { + gaxOptions: {}, + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.getMetadata = (options_: any) => { + assert.strictEqual(options_.gaxOptions, options.gaxOptions); + done(); + }; + table.get(options, assert.ifError); + }); + + it('should not require an options object', done => { + table.getMetadata = (options: {}) => { + assert.deepStrictEqual(options, {gaxOptions: undefined}); + done(); + }; + table.get(assert.ifError); + }); + + it('should auto create with error code 5', done => { + const error = new Error('Error.') as ServiceError; + error.code = 5; + + const options = { + autoCreate: true, + gaxOptions: {}, + }; + + table.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(error); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.create = (options_: any, callback: Function) => { + assert.strictEqual(options_.gaxOptions, options.gaxOptions); + callback(); // done() + }; + + table.get(options, done); + }); + + it('should not auto create without error code 5', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const error: any = new Error('Error.'); + error.code = 'NOT-5'; + + const options = { + autoCreate: true, + }; + + table.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(error); + }; + + table.create = () => { + throw new Error('Should not create.'); + }; + + table.get(options, (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should not auto create unless requested', done => { + const error = new Error('Error.') as ServiceError; + error.code = 5; + + table.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(error); + }; + + table.create = () => { + throw new Error('Should not create.'); + }; + + table.get((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return an error from getMetadata', done => { + const error = new Error('Error.'); + table.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(error); + }; + table.get((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return self and API response', done => { + const apiResponse = {}; + table.getMetadata = (gaxOptions: {}, callback: Function) => { + callback(null, apiResponse); + }; + table.get((err: Error, table_: {}, apiResponse_: {}) => { + assert.ifError(err); + assert.strictEqual(table_, table); + assert.strictEqual(apiResponse_, apiResponse); + done(); + }); + }); + }); + + describe('getIamPolicy', () => { + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'getIamPolicy'); + assert.strictEqual(config.reqOpts.resource, table.name); + assert.strictEqual(config.reqOpts.requestedPolicyVersion, undefined); + assert.strictEqual(config.gaxOpt, undefined); + done(); + }; + table.getIamPolicy(assert.ifError); + }); + + it('should accept options', done => { + const requestedPolicyVersion = 0; + const gaxOptions = {}; + const options = {gaxOptions, requestedPolicyVersion}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + assert.strictEqual( + config.reqOpts.options.requestedPolicyVersion, + requestedPolicyVersion, + ); + done(); + }; + table.getIamPolicy(options, assert.ifError); + }); + + it('should return error', done => { + const error = new Error('error'); + table.bigtable.request = (config: {}, callback: Function) => { + callback(error); + }; + table.getIamPolicy((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should call decodePolicyEtag', () => { + table.bigtable.request = (config: {}, callback: Function) => { + callback(null, {}); + }; + const spy = sandbox.stub(Table, 'decodePolicyEtag'); + table.getIamPolicy(assert.ifError); + assert.strictEqual(spy.calledOnce, true); + spy.restore(); + }); + }); + + describe('getReplicationStates', () => { + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.getMetadata = (options: any) => { + assert.strictEqual(options.gaxOptions, gaxOptions); + done(); + }; + + table.getReplicationStates(gaxOptions, assert.ifError); + }); + + it('should return an error to the callback', done => { + const error = new Error('err'); + const response = {}; + table.getMetadata = (options: {}, callback: Function) => { + callback(error, response); + }; + table.getReplicationStates((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return a map of cluster states', done => { + const response = { + clusterStates: { + cluster1: 'READY', + cluster2: 'INITIALIZING', + }, + }; + table.getMetadata = (options: {}, callback: Function) => { + callback(null, response); + }; + table.getReplicationStates( + (err: Error, clusterStates: Map) => { + assert.ifError(err); + assert(clusterStates instanceof Map); + assert.strictEqual(clusterStates.size, 2); + assert.strictEqual(clusterStates.get('cluster1'), 'READY'); + assert.strictEqual(clusterStates.get('cluster2'), 'INITIALIZING'); + done(); + }, + ); + }); + }); + + describe('getFamilies', () => { + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.getMetadata = (options: any) => { + assert.strictEqual(options.gaxOptions, gaxOptions); + done(); + }; + + table.getFamilies(gaxOptions, assert.ifError); + }); + + it('should return an error to the callback', done => { + const error = new Error('err'); + const response = {}; + table.getMetadata = (options: {}, callback: Function) => { + callback(error, response); + }; + table.getFamilies((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should return an array of Family objects', done => { + const metadata = { + a: 'b', + }; + + const response = { + columnFamilies: { + test: metadata, + }, + }; + + const fakeFamily = {} as Family; + + table.getMetadata = (options: {}, callback: Function) => { + callback(null, response); + }; + sandbox.stub(table, 'family').callsFake(id => { + assert.strictEqual(id, 'test'); + return fakeFamily; + }); + table.getFamilies((err: Error, families: Family[], apiResponse: {}) => { + assert.ifError(err); + const family = families[0]; + assert.strictEqual(family, fakeFamily); + assert.strictEqual(family.metadata, metadata); + assert.strictEqual(apiResponse, response.columnFamilies); + done(); + }); + }); + }); + + describe('waitForReplication', () => { + it('should return the error to the callback', done => { + const error = new Error('err'); + + table.bigtable.request = (config: {}, callback: Function) => { + callback(error); + }; + + table.waitForReplication((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should call checkConsistency', done => { + const consistencyToken = 'sample-token12345'; + + table.generateConsistencyToken = (callback: Function) => { + callback(null, consistencyToken); + }; + + table.checkConsistency = (token: string, callback: Function) => { + assert.strictEqual(token, consistencyToken); + callback(null, true); + }; + + table.waitForReplication(done); + }); + + describe('retries', () => { + let clock: sinon.SinonFakeTimers; + let setTimeoutSpy: sinon.SinonSpy; + let clearTimeoutSpy: sinon.SinonSpy; + let checkConsistencySpy: sinon.SinonSpy; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let responses: any[] = []; + + beforeEach(() => { + clock = sinon.useFakeTimers({ + toFake: ['setTimeout', 'clearTimeout'], + }); + setTimeoutSpy = sinon.spy(global, 'setTimeout'); + clearTimeoutSpy = sinon.spy(global, 'clearTimeout'); + checkConsistencySpy = sinon.spy(table, 'checkConsistency'); + + table.bigtable.request = (config: {}, callback: Function) => { + responses.shift()(config, callback); + }; + }); + + afterEach(() => { + clock.restore(); + }); + + it('should return true if token is consistent', done => { + responses = [ + (config: {}, callback: Function) => + callback(null, {consistencyToken: 'sample-token12345'}), + (config: {}, callback: Function) => + callback(null, {consistent: true}), + ]; + + table.waitForReplication((err: Error, res: {}) => { + // Checks that a 10 minute timer was set. + setTimeoutSpy.calledWith(sinon.match.func, 10 * 60 * 1000); + + // check checkConsistencySpy called for first time + assert.strictEqual(checkConsistencySpy.callCount, 1); + + // Checks that clearInterval was called. + assert.strictEqual(clearTimeoutSpy.callCount, 1); + + assert.strictEqual(res, true); + assert.ifError(err); + done(); + }); + + clock.runAll(); + }); + + it('should retry checkConsistency', done => { + responses = [ + (config: {}, callback: Function) => + callback(null, {consistencyToken: 'sample-token12345'}), + (config: {}, callback: Function) => + callback(null, {consistent: false}), + (config: {}, callback: Function) => + callback(null, {consistent: true}), + ]; + + table.waitForReplication((err: Error, response: {}) => { + // Checks that a 10 minute timer was set. + setTimeoutSpy.calledWith(sinon.match.func, 10 * 60 * 1000); + + // check checkConsistencySpy called for first time + //checkConsistencySpy.callOnce; + + setTimeoutSpy.calledWith(sinon.match.func, 5000); + + // check checkConsistencySpy called twice after 5seconds + clock.tick(5010); + assert.strictEqual(checkConsistencySpy.callCount, 2); + + // Checks that clearInterval was called. + assert.ok(setTimeoutSpy.called); + assert.ifError(err); + assert.strictEqual(response, true); + done(); + }); + + clock.runAll(); + }); + + it('should return false after 10 min if inconsistency repeats', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any, callback: Function) => { + if (config.method === 'generateConsistencyToken') { + return callback(null, {consistencyToken: 'sample-token12345'}); + } + if (config.method === 'checkConsistency') { + return callback(null, {consistent: false}); + } + }; + + table.waitForReplication((err: Error, response: {}) => { + assert.ifError(err); + assert.ok(setTimeoutSpy.called); + assert.strictEqual(response, false); + done(); + }); + + clock.runAll(); + }); + + it('should return error if checkonsistency returns error', done => { + const error = new Error('consistency-check error'); + + responses = [ + (config: {}, callback: Function) => + callback(null, {consistencyToken: 'sample-token12345'}), + (config: {}, callback: Function) => callback(error), + ]; + + table.waitForReplication((err: Error, res: {}) => { + assert.ok(clearTimeoutSpy.called); + assert.strictEqual(checkConsistencySpy.callCount, 1); + assert.strictEqual(err, error); + assert.strictEqual(res, undefined); + done(); + }); + }); + }); + }); + + describe('generateConsistencyToken', () => { + it('should provide proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'generateConsistencyToken'); + assert.strictEqual(config.reqOpts.name, table.name); + done(); + }; + table.generateConsistencyToken(assert.ifError); + }); + + it('should return a consistencyToken', done => { + const cToken = 'sample-token-123456'; + const response = { + consistencyToken: cToken, + }; + + table.bigtable.request = (config: {}, callback: Function) => { + callback(null, response); + }; + + table.generateConsistencyToken((err: Error, token: string) => { + assert.ifError(err); + assert.strictEqual(token, cToken); + done(); + }); + }); + + it('should return error', done => { + const error = new Error('err'); + table.bigtable.request = (config: {}, callback: Function) => { + callback(error); + }; + + table.generateConsistencyToken((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('checkConsistency', () => { + it('should provide the proper request options', done => { + const cToken = 'consistency-token-123'; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'checkConsistency'); + assert.strictEqual(config.reqOpts.name, table.name); + assert.strictEqual(config.reqOpts.consistencyToken, cToken); + done(); + }; + + table.checkConsistency(cToken, assert.ifError); + }); + + describe('error', () => { + const error = new Error('err'); + + it('should return the error to the callback', done => { + table.bigtable.request = (config: {}, callback: Function) => { + callback(error); + }; + + table.checkConsistency('cToken', (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('success', () => { + it('should return true if consistent', done => { + table.bigtable.request = (config: {}, callback: Function) => { + callback(null, {consistent: true}); + }; + + table.checkConsistency('', (err: Error, resp: {}) => { + assert.ifError(err); + assert.strictEqual(resp, true); + done(); + }); + }); + + it('should return false if not consistent', done => { + table.bigtable.request = (config: {}, callback: Function) => { + callback(null, {consistent: false}); + }; + table.checkConsistency('', (err: Error, resp: {}) => { + assert.ifError(err); + assert.strictEqual(resp, false); + done(); + }); + }); + }); + }); + + describe('getMetadata', () => { + const views = { + unspecified: 0, + name: 1, + schema: 2, + full: 4, + } as {[index: string]: number}; + beforeEach(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (Table as any).VIEWS = views; + }); + + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'getTable'); + + assert.strictEqual(config.reqOpts.name, table.name); + assert.strictEqual(config.reqOpts.view, views.unspecified); + + assert.strictEqual(config.gaxOpts, undefined); + + done(); + }; + + table.getMetadata(assert.ifError); + }); + + it('should accept gaxOptions', done => { + const options = { + gaxOptions: {}, + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, options.gaxOptions); + done(); + }; + + table.getMetadata(options, assert.ifError); + }); + + Object.keys(views).forEach(view => { + it('should set the "' + view + '" view', done => { + const options = { + view, + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.reqOpts.view, views[view]); + done(); + }; + table.getMetadata(options, assert.ifError); + }); + }); + + it('should update the metadata', done => { + const response = {}; + table.bigtable.request = (config: {}, callback: Function) => { + callback(null, response); + }; + table.getMetadata((err: Error, metadata: {}) => { + assert.ifError(err); + assert.strictEqual(metadata, response); + assert.strictEqual(table.metadata, response); + done(); + }); + }); + + it('should execute callback with original arguments', done => { + const args = [{}, {}, {}]; + table.bigtable.request = (config: {}, callback: Function) => { + callback(...args); + }; + table.getMetadata((...args: Array<{}>) => { + assert.deepStrictEqual([].slice.call(args), args); + done(); + }); + }); + }); + + describe('getRows', () => { + describe('success', () => { + let createReadStreamInternal: SinonSpy<[], PassThrough>; + const fakeRows = [ + {key: 'c', data: {}}, + {key: 'd', data: {}}, + ]; + + beforeEach(() => { + createReadStreamInternal = sinon.spy(() => { + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + fakeRows.forEach(row => { + stream.push(row); + }); + + stream.push(null); + }); + + return stream; + }); + Table = getTableMock(createReadStreamInternal); + INSTANCE = { + bigtable: { + _metricsConfigManager: new FakeMetricsConfigManager( + [], + ) as ClientSideMetricsConfigManager, + } as Bigtable, + name: 'a/b/c/d', + } as inst.Instance; + TABLE_NAME = INSTANCE.name + '/tables/' + TABLE_ID; + table = new Table(INSTANCE, TABLE_ID); + }); + + it('should return the rows to the callback', done => { + const options = {}; + + table.getRows(options, (err: Error, rows: Row[]) => { + assert.ifError(err); + assert.deepStrictEqual(rows, fakeRows); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const spy = createReadStreamInternal.getCall(0); + assert.strictEqual((spy.args as any)[2], options); + done(); + }); + }); + + it('should optionally accept options', done => { + table.getRows((err: Error, rows: Row[]) => { + assert.ifError(err); + assert.deepStrictEqual(rows, fakeRows); + done(); + }); + }); + }); + + describe('error', () => { + let createReadStreamInternal: SinonSpy<[], PassThrough>; + const error = new Error('err'); + + beforeEach(() => { + createReadStreamInternal = sinon.spy(() => { + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + stream.emit('error', error); + }); + + return stream; + }); + Table = getTableMock(createReadStreamInternal); + INSTANCE = { + bigtable: { + _metricsConfigManager: new FakeMetricsConfigManager( + [], + ) as ClientSideMetricsConfigManager, + } as Bigtable, + name: 'a/b/c/d', + } as inst.Instance; + TABLE_NAME = INSTANCE.name + '/tables/' + TABLE_ID; + table = new Table(INSTANCE, TABLE_ID); + }); + + it('should return the error to the callback', done => { + table.getRows((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + }); + + describe('insert', () => { + it('should create an "insert" mutation', done => { + const fakeEntries = [ + { + key: 'a', + data: {}, + }, + { + key: 'b', + data: {}, + }, + ]; + + table.mutate = (entries: Array<{}>, options: {}, callback: Function) => { + assert.deepStrictEqual(entries[0], { + key: fakeEntries[0].key, + data: fakeEntries[0].data, + method: FakeMutation.methods.INSERT, + }); + + assert.deepStrictEqual(entries[1], { + key: fakeEntries[1].key, + data: fakeEntries[1].data, + method: FakeMutation.methods.INSERT, + }); + + callback(); + }; + + table.insert(fakeEntries, done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.mutate = (entries: {}, options: any) => { + assert.strictEqual(options.gaxOptions, gaxOptions); + done(); + }; + table.insert([], gaxOptions, assert.ifError); + }); + }); + + describe('mutate', () => { + const entries = [{}, {}]; + const fakeEntries = [{}, {}]; + let parseSpy: sinon.SinonSpy; + + beforeEach(() => { + parseSpy = FakeMutation.parse = sinon.spy(value => { + const entryIndex = entries.indexOf(value); + return fakeEntries[entryIndex]; + }); + }); + + it('should provide the proper request options', done => { + const stream = new PassThrough({objectMode: true}); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableClient'); + assert.strictEqual(config.method, 'mutateRows'); + + assert.strictEqual(config.reqOpts.tableName, TABLE_NAME); + assert.strictEqual(config.reqOpts.appProfileId, undefined); + assert.deepStrictEqual(config.reqOpts.entries, fakeEntries); + + assert.strictEqual(parseSpy.callCount, 2); + assert.strictEqual(parseSpy.getCall(0).args[0], entries[0]); + assert.strictEqual(parseSpy.getCall(1).args[0], entries[1]); + + setImmediate(done); + + return stream; + }; + + table.mutate(entries, assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + table.mutate(entries, {gaxOptions}, assert.ifError); + }); + + it('should use an appProfileId', done => { + const bigtableInstance = table.bigtable; + bigtableInstance.appProfileId = 'app-profile-id-12345'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtableInstance.request = (config: any) => { + assert.strictEqual( + config.reqOpts.appProfileId, + bigtableInstance.appProfileId, + ); + done(); + }; + table.mutate(done); + }); + + it('should parse the mutations', done => { + table.bigtable.request = () => { + assert.strictEqual(FakeMutation.parse.called, true); + done(); + }; + table.mutate(entries, done); + }); + + it('should allow raw mutations', done => { + table.bigtable.request = () => { + assert.strictEqual(FakeMutation.parse.called, false); + done(); + }; + table.mutate(entries, {rawMutation: true}, done); + }); + + describe('error', () => { + describe('pre-request errors', () => { + const error = new Error('Error.'); + + beforeEach(() => { + table.bigtable.request = () => { + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + stream.emit('error', error); + }); + + return stream; + }; + }); + + it('should return error', done => { + table.mutate(entries, (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('API errors', () => { + const error = new Error('err'); + + beforeEach(() => { + table.bigtable.request = () => { + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + stream.emit('error', error); + }); + + return stream; + }; + }); + + it('should return the error to the callback', done => { + table.maxRetries = 0; + table.mutate(entries, (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('mutation errors', () => { + const fakeStatuses = [ + { + index: 0, + status: { + code: 1, + message: 'CANCELLED', + }, + }, + { + index: 1, + status: { + code: 3, + message: 'INVALID_ARGUMENT', + }, + }, + ]; + + beforeEach(() => { + table.bigtable.request = () => { + const stream = new PassThrough({objectMode: true}); + stream.push({entries: fakeStatuses}); + setImmediate(() => { + stream.end(); + }); + return stream; + }; + }); + + it('should return a PartialFailureError', done => { + const newEntries = [ + { + key: 'a', + }, + { + key: 'b', + }, + ]; + table.mutate(newEntries, (err: Error) => { + assert.strictEqual(err.name, 'PartialFailureError'); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + assert.deepStrictEqual((err as any).errors, [ + Object.assign({ + entry: newEntries[0], + code: fakeStatuses[0].status.code, + message: fakeStatuses[0].status.message, + }), + Object.assign({ + entry: newEntries[1], + code: fakeStatuses[1].status.code, + message: fakeStatuses[1].status.message, + }), + ]); + + done(); + }); + }); + }); + }); + + describe('success', () => { + const fakeStatuses = [ + { + status: { + code: 0, + }, + }, + { + status: { + code: 0, + }, + }, + ]; + + beforeEach(() => { + table.bigtable.request = () => { + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + stream.end({entries: fakeStatuses}); + }); + + return stream; + }; + }); + + it('should execute callback', done => { + table.maxRetries = 0; + table.mutate(entries, done); + }); + }); + + describe('retries', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let fakeStatuses: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let entryRequests: any; + const requestArgs: RequestOptions[] = []; + + beforeEach(() => { + entryRequests = []; + fakeStatuses = [ + [ + { + index: 0, + status: { + code: 0, + }, + }, + { + index: 1, + status: { + code: 4, + }, + }, + ], + [ + { + index: 0, + status: { + code: 0, + }, + }, + ], + ]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + requestArgs.push(JSON.parse(JSON.stringify(config))); + entryRequests.push(config.reqOpts.entries); + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + stream.end({entries: fakeStatuses.shift()}); + }); + + return stream; + }; + }); + + it('should send attempt header', done => { + table.mutate(entries, () => { + assert.strictEqual(requestArgs.length, 2); + assert.strictEqual( + (requestArgs[0].gaxOpts as any)['otherArgs']['headers'][ + 'bigtable-attempt' + ], + 0, + ); + assert.strictEqual( + (requestArgs[1].gaxOpts as any)['otherArgs']['headers'][ + 'bigtable-attempt' + ], + 1, + ); + done(); + }); + }); + + it('should succeed after a retry', done => { + table.maxRetries = 1; + table.mutate(entries, done); + }); + + it('should retry the same failed entry', done => { + table.maxRetries = 1; + table.mutate(entries, () => { + assert.strictEqual(entryRequests[0].length, 2); + assert.strictEqual(entryRequests[1].length, 1); + assert.strictEqual(entryRequests[0][1], entryRequests[1][0]); + done(); + }); + }); + }); + + describe('rpc level retries', () => { + let emitters: EventEmitter[]; // = [((stream: Writable) => { stream.push([{ key: 'a' }]); + let requestArgs: RequestOptions[] = []; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let entryRequests: any; + + beforeEach(() => { + emitters = []; // This needs to be assigned in each test case. + + requestArgs = []; + entryRequests = []; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + requestArgs.push(JSON.parse(JSON.stringify(config))); + entryRequests.push(config.reqOpts.entries); + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + (emitters!.shift() as any)(stream); + }); + + return stream; + }; + }); + + it('should send back errors for each pending entry', done => { + const mutateEntries = [ + { + key: 'a', + method: 'insert', + data: {}, + }, + { + key: 'b', + method: 'insert', + data: {}, + }, + ]; + const unretriableError = new Error('not retryable') as ServiceError; + unretriableError.code = 3; // INVALID_ARGUMENT + emitters = [ + ((stream: Writable) => { + stream.emit('data', { + entries: [ + { + index: 0, + status: { + details: [], + code: 0, + message: 'Received data', + }, + }, + ], + }); + stream.emit('error', unretriableError); + }) as {} as EventEmitter, + ]; + table.maxRetries = 3; + table.mutate( + mutateEntries, + (err: ServiceError & {errors?: ServiceError[]}) => { + try { + assert.strictEqual(err.code, 3); + assert.strictEqual(err.message, 'not retryable'); + assert(err.errors); + assert.strictEqual(err.errors.length, 1); + assert.strictEqual(err.errors[0].code, 3); + assert.strictEqual(err.errors[0].message, 'not retryable'); + done(); + } catch (e) { + done(e); + } + }, + ); + }); + it('should not retry unretriable errors', done => { + const unretriableError = new Error('not retryable') as ServiceError; + unretriableError.code = 3; // INVALID_ARGUMENT + emitters = [ + ((stream: Writable) => { + stream.emit('error', unretriableError); + }) as {} as EventEmitter, + ]; + table.maxRetries = 1; + table.mutate(entries, () => { + assert.strictEqual(entryRequests.length, 1); + done(); + }); + }); + + it('should retry retryable errors', done => { + const error = new Error('retryable') as ServiceError; + error.code = 14; // Unavailable + emitters = [ + ((stream: Writable) => { + stream.emit('error', error); + }) as {} as EventEmitter, + ((stream: Writable) => { + stream.end(); + }) as {} as EventEmitter, + ]; + table.maxRetries = 1; + table.mutate(entries, () => { + assert.strictEqual(entryRequests.length, 2); + done(); + }); + }); + + it('should not retry more than maxRetries times', done => { + const error = new Error('retryable') as ServiceError; + error.code = 14; // Unavailable + emitters = [ + ((stream: Writable) => { + stream.emit('error', error); + }) as {} as EventEmitter, + ((stream: Writable) => { + stream.emit('error', error); + }) as {} as EventEmitter, + ((stream: Writable) => { + stream.end(); + }) as {} as EventEmitter, + ]; + table.maxRetries = 1; + table.mutate(entries, () => { + assert.strictEqual(entryRequests.length, 2); + done(); + }); + }); + + it('should send attempt header', done => { + const error = new Error('retryable') as ServiceError; + error.code = 14; // Unavailable + emitters = [ + ((stream: Writable) => { + stream.emit('error', error); + }) as {} as EventEmitter, + ((stream: Writable) => { + stream.end(); + }) as {} as EventEmitter, + ]; + table.maxRetries = 1; + table.mutate(entries, () => { + assert.strictEqual(requestArgs.length, 2); + assert.strictEqual( + (requestArgs[0].gaxOpts as any)['otherArgs']['headers'][ + 'bigtable-attempt' + ], + 0, + ); + assert.strictEqual( + (requestArgs[1].gaxOpts as any)['otherArgs']['headers'][ + 'bigtable-attempt' + ], + 1, + ); + done(); + }); + }); + }); + }); + + describe('row', () => { + const KEY = 'test-row'; + + it('should throw if a key is not provided', () => { + assert.throws(() => { + table.row(); + }, /A row key must be provided\./); + }); + + it('should return a Row object', () => { + const row = table.row(KEY); + assert(row instanceof FakeRow); + assert.strictEqual(row.calledWith_[0], table); + assert.strictEqual(row.calledWith_[1], KEY); + }); + }); + + describe('sampleRowKeys', () => { + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + table.sampleRowKeysStream = (gaxOptions_: {}) => { + assert.strictEqual(gaxOptions_, gaxOptions); + done(); + }; + + table.sampleRowKeys(gaxOptions); + }); + + describe('success', () => { + const fakeKeys = [ + { + key: 'a', + offset: 10, + }, + { + key: 'b', + offset: 20, + }, + ]; + + beforeEach(() => { + table.sampleRowKeysStream = sinon.spy(() => { + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + fakeKeys.forEach(key => { + stream.push(key); + }); + + stream.push(null); + }); + + return stream; + }); + }); + + it('should return the keys to the callback', done => { + table.sampleRowKeys((err: Error, keys: {}) => { + assert.ifError(err); + assert.deepStrictEqual(keys, fakeKeys); + done(); + }); + }); + }); + + describe('error', () => { + const error = new Error('err'); + + beforeEach(() => { + table.sampleRowKeysStream = sinon.spy(() => { + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + stream.emit('error', error); + }); + + return stream; + }); + }); + + it('should return the error to the callback', done => { + table.sampleRowKeys((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + }); + + describe('sampleRowKeysStream', () => { + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableClient'); + assert.strictEqual(config.method, 'sampleRowKeys'); + assert.strictEqual(config.reqOpts.tableName, TABLE_NAME); + assert.deepStrictEqual(config.gaxOpts, {}); + + setImmediate(done); + + return new PassThrough({ + objectMode: true, + }); + }; + + table.sampleRowKeysStream(); + }); + + it('should use an appProfileId', done => { + const bigtableInstance = table.bigtable; + bigtableInstance.appProfileId = 'app-profile-id-12345'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + bigtableInstance.request = (config: any) => { + assert.strictEqual( + config.reqOpts.appProfileId, + bigtableInstance.appProfileId, + ); + done(); + }; + + table.sampleRowKeysStream(done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.deepStrictEqual(config.gaxOpts, gaxOptions); + + setImmediate(done); + + return new PassThrough({ + objectMode: true, + }); + }; + + table.sampleRowKeysStream(gaxOptions); + }); + + describe('success', () => { + const fakeKeys = [ + { + rowKey: 'a', + offsetBytes: 10, + }, + { + rowKey: 'b', + offsetByte: 20, + }, + ]; + + beforeEach(() => { + table.bigtable.request = () => { + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + fakeKeys.forEach(key => { + stream.push(key); + }); + + stream.push(null); + }); + + return stream; + }; + }); + + it('should stream key objects', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const keys: any[] = []; + + table + .sampleRowKeysStream() + .on('error', done) + .on('data', (key: {}) => { + keys.push(key); + }) + .on('end', () => { + assert.strictEqual(keys[0].key, fakeKeys[0].rowKey); + assert.strictEqual(keys[0].offset, fakeKeys[0].offsetBytes); + assert.strictEqual(keys[1].key, fakeKeys[1].rowKey); + assert.strictEqual(keys[1].offset, fakeKeys[1].offsetBytes); + done(); + }); + }); + }); + + describe('error', () => { + const error = new Error('err'); + + beforeEach(() => { + table.bigtable.request = () => { + const stream = new PassThrough({ + objectMode: true, + }); + + setImmediate(() => { + stream.emit('error', error); + }); + + return stream; + }; + }); + + it('should emit an error event', done => { + table + .sampleRowKeysStream() + .on('error', (err: Error) => { + assert.strictEqual(err, error); + done(); + }) + .on('data', done); + }); + }); + }); + + describe('setIamPolicy', () => { + const policy = {}; + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'setIamPolicy'); + assert.strictEqual(config.reqOpts.resource, table.name); + assert.strictEqual(config.reqOpts.policy, policy); + assert.strictEqual(config.gaxOpt, undefined); + done(); + }; + table.setIamPolicy(policy, assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + table.setIamPolicy(policy, gaxOptions, assert.ifError); + }); + + it('should pass policy to bigtable.request', done => { + const policy: tblTypes.Policy = { + bindings: [ + { + role: 'roles/bigtable.viewer', + members: ['user:mike@example.com', 'group:admins@example.com'], + condition: { + title: 'expirable access', + description: 'Does not grant access after Sep 2020', + expression: "request.time { + assert.strictEqual(config.reqOpts.policy, policy); + done(); + }; + table.setIamPolicy(policy, assert.ifError); + }); + + it('should encode policy etag', done => { + const policy = {etag: 'ABS'}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.deepStrictEqual( + config.reqOpts.policy.etag, + Buffer.from(policy.etag), + ); + done(); + }; + table.setIamPolicy(policy, assert.ifError); + }); + + it('should return error', done => { + const error = new Error('error'); + table.bigtable.request = (config: {}, callback: Function) => { + callback(error); + }; + table.setIamPolicy(policy, (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should call decodePolicyEtag', () => { + table.bigtable.request = (config: {}, callback: Function) => { + callback(null, {}); + }; + const spy = sandbox.stub(Table, 'decodePolicyEtag'); + table.setIamPolicy(policy, assert.ifError); + assert.strictEqual(spy.calledOnce, true); + }); + }); + + describe('testIamPermissions', () => { + const permissions = 'bigtable.tables.get'; + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'testIamPermissions'); + assert.strictEqual(config.reqOpts.resource, table.name); + assert.deepStrictEqual(config.reqOpts.permissions, [permissions]); + assert.strictEqual(config.gaxOpt, undefined); + done(); + }; + table.testIamPermissions(permissions, assert.ifError); + }); + + it('should accept permissions as array', done => { + const permissions = ['bigtable.tables.get', 'bigtable.tables.list']; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.deepStrictEqual(config.reqOpts.permissions, permissions); + done(); + }; + table.testIamPermissions(permissions, assert.ifError); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + table.testIamPermissions(permissions, gaxOptions, assert.ifError); + }); + + it('should unpack permissions from resp object', done => { + const testPermissions = ['bigtable.tables.get', 'bigtable.tables.list']; + table.bigtable.request = (config: {}, callback: Function) => { + callback(null, {permissions: testPermissions}); + }; + table.testIamPermissions( + testPermissions, + (err: Error, permissions: {}) => { + assert.ifError(err); + assert.strictEqual(Array.isArray(permissions), true); + assert.deepStrictEqual(permissions, testPermissions); + done(); + }, + ); + }); + + it('should return error', done => { + const permission = 'bigtable.tables.get'; + const error = new Error('error'); + table.bigtable.request = (config: {}, callback: Function) => { + callback(error); + }; + table.testIamPermissions(permission, (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('decodePolicyEtag', () => { + it('should return policy with etag decoded to string', () => { + const etagString = 'ABC'; + const policy = { + etag: Buffer.from(etagString), + }; + assert.strictEqual(Table.decodePolicyEtag(policy).etag, etagString); + }); + }); + + describe('truncate', () => { + it('should provide the proper request options', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any, callback: Function) => { + assert.strictEqual(config.client, 'BigtableTableAdminClient'); + assert.strictEqual(config.method, 'dropRowRange'); + assert.strictEqual(config.reqOpts.name, TABLE_NAME); + assert.strictEqual(config.reqOpts.deleteAllDataFromTable, true); + assert.deepStrictEqual(config.gaxOpts, {}); + callback(); + }; + + table.truncate(done); + }); + + it('should accept gaxOptions', done => { + const gaxOptions = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table.bigtable.request = (config: any) => { + assert.strictEqual(config.gaxOpts, gaxOptions); + done(); + }; + + table.truncate(gaxOptions, assert.ifError); + }); + }); +}); diff --git a/handwritten/bigtable/test/test-proxy/checkAndMutateRowService.ts b/handwritten/bigtable/test/test-proxy/checkAndMutateRowService.ts new file mode 100644 index 00000000000..f4a2408568a --- /dev/null +++ b/handwritten/bigtable/test/test-proxy/checkAndMutateRowService.ts @@ -0,0 +1,186 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import * as assert from 'assert'; + +import {describe} from 'mocha'; +import {protos} from '../../src'; +import {BigtableClient} from '../../src/v2'; +import type {Callback, CallOptions} from 'google-gax'; +import {checkAndMutateRow} from '../../testproxy/services/check-and-mutate-row'; +import {createClient} from '../../testproxy/services/create-client'; + +describe('TestProxy/CheckAndMutateRow', () => { + const testCases: protos.google.bigtable.v2.ICheckAndMutateRowRequest[] = [ + { + tableName: 'projects/projectId/instances/instance/tables/test-table', + appProfileId: 'test-app-profile', + rowKey: Buffer.from('test-row-key'), + predicateFilter: null, + trueMutations: [ + { + setCell: { + familyName: 'cf1', + timestampMicros: 1000007, + columnQualifier: Buffer.from('cq1'), + value: Buffer.from('value1'), + }, + }, + { + setCell: { + familyName: 'cf2', + timestampMicros: 1000007, + columnQualifier: Buffer.from('cq2'), + value: Buffer.from('value2'), + }, + }, + ], + falseMutations: [ + { + setCell: { + familyName: 'cf1', + timestampMicros: 1000007, + columnQualifier: Buffer.from('cq1'), + value: Buffer.from('value1'), + }, + }, + { + setCell: { + familyName: 'cf2', + timestampMicros: 1000007, + columnQualifier: Buffer.from('cq2'), + value: Buffer.from('value2'), + }, + }, + ], + }, + { + tableName: 'projects/projectId/instances/instance/tables/test-table', + appProfileId: 'test-app-profile', + rowKey: Buffer.from('test-row-key'), + predicateFilter: null, + trueMutations: [ + { + setCell: { + familyName: '', + timestampMicros: 1000007, + columnQualifier: Buffer.from(''), + value: Buffer.from(''), + }, + }, + { + setCell: { + familyName: '', + timestampMicros: 1000007, + columnQualifier: Buffer.from(''), + value: Buffer.from(''), + }, + }, + ], + falseMutations: [], + }, + ]; + describe('Ensure the proper request is passed to the Gapic Layer', () => { + const clientId = 'TestCheckAndMutateRow_NoRetry_TransientError'; + testCases.forEach((checkAndMutateRowRequest, index) => { + it(`Run test ${index}`, done => { + (async () => { + const clientMap = new Map(); + const createClientFunction = createClient({clientMap}); + await new Promise((resolve, reject) => { + createClientFunction( + { + request: { + clientId, + dataTarget: 'localhost:1234', + projectId: 'projectId', + instanceId: 'instance', + appProfileId: '', + }, + }, + (error: Error | null, response: {} | null) => { + if (error) { + reject(error); + } + resolve(response); + }, + ); + }); + { + // Mock out the Gapic layer so we can see requests coming into it + const bigtable = clientMap.get(clientId); + const bigtableClient = new BigtableClient( + bigtable.options.BigtableClient, + ); + bigtable.api['BigtableClient'] = bigtableClient; + bigtableClient.checkAndMutateRow = ( + request?: protos.google.bigtable.v2.ICheckAndMutateRowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.v2.ICheckAndMutateRowResponse, + | protos.google.bigtable.v2.ICheckAndMutateRowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.v2.ICheckAndMutateRowResponse, + | protos.google.bigtable.v2.ICheckAndMutateRowRequest + | null + | undefined, + {} | null | undefined + >, + ) => { + try { + // If the Gapic request is correct then the test passes. + assert.deepStrictEqual(request, checkAndMutateRowRequest); + } catch (e) { + // If the Gapic request is incorrect then the test fails with an error. + done(e); + } + if (callback) { + callback(null, {}); + } + return new Promise(resolve => { + const response: protos.google.bigtable.v2.ICheckAndMutateRowResponse = + {}; + resolve([response, {}, undefined]); + }); + }; + } + await new Promise((resolve, reject) => { + checkAndMutateRow({clientMap})( + { + request: { + clientId, + request: checkAndMutateRowRequest, + }, + }, + (error: Error | null, response: {} | null) => { + if (error) { + reject(error); + } + resolve(response); + }, + ); + }); + done(); + })().catch(err => { + throw err; + }); + }); + }); + }); +}); diff --git a/handwritten/bigtable/test/test-proxy/mutationParseInverse.ts b/handwritten/bigtable/test/test-proxy/mutationParseInverse.ts new file mode 100644 index 00000000000..0bc4ca38607 --- /dev/null +++ b/handwritten/bigtable/test/test-proxy/mutationParseInverse.ts @@ -0,0 +1,46 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import * as assert from 'assert'; +import {Mutation} from '../../src/mutation'; +import {mutationParseInverse} from '../../testproxy/services/utils/request/mutateInverse'; + +describe('Check mutation parse and mutationParseInverse are inverses', () => { + it('should invert mutations properly', () => { + const gapicLayerRequest = { + mutations: [ + { + setCell: { + familyName: 'cf1', + timestampMicros: 1000007, + columnQualifier: Buffer.from('cq1'), + value: Buffer.from('value1'), + }, + }, + { + setCell: { + familyName: 'cf2', + timestampMicros: 1000007, + columnQualifier: Buffer.from('cq2'), + value: Buffer.from('value2'), + }, + }, + ], + }; + assert.deepStrictEqual( + Mutation.parse(mutationParseInverse(gapicLayerRequest)), + gapicLayerRequest, + ); + }); +}); diff --git a/handwritten/bigtable/test/test-proxy/readModifyWriteRow.ts b/handwritten/bigtable/test/test-proxy/readModifyWriteRow.ts new file mode 100644 index 00000000000..e29a8923a6d --- /dev/null +++ b/handwritten/bigtable/test/test-proxy/readModifyWriteRow.ts @@ -0,0 +1,98 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import { + getRMWRRequest, + getRMWRRequestInverse, +} from '../../testproxy/services/utils/request/readModifyWriteRow'; +import * as protos from '../../protos/protos'; +import * as assert from 'assert'; + +describe('Check getRMWRRequest and getRMWRRequestInverse are inverses', () => { + const testCases: protos.google.bigtable.v2.IReadModifyWriteRowRequest[] = [ + { + tableName: 'test-table', + rowKey: Buffer.from('test-row-key'), + rules: [ + { + familyName: 'cf1', + columnQualifier: Buffer.from('cq1'), + appendValue: Buffer.from('append-val'), + }, + { + familyName: 'cf2', + columnQualifier: Buffer.from('cq2'), + incrementAmount: 10, + }, + ], + }, + { + authorizedViewName: 'test-authorized-view', + rowKey: Buffer.from('test-row-key'), + rules: [ + { + familyName: 'cf1', + columnQualifier: Buffer.from('cq1'), + appendValue: Buffer.from('append-val'), + }, + { + familyName: 'cf2', + columnQualifier: Buffer.from('cq2'), + incrementAmount: 10, + }, + ], + }, + { + tableName: 'another-table', + rowKey: Buffer.from('row-key-2'), + rules: [ + { + familyName: 'cf3', + columnQualifier: Buffer.from('cq3'), + incrementAmount: -5, + }, + ], + }, + { + tableName: 'test-table-4', + rowKey: Buffer.from('test-row-key-4'), + rules: [ + { + familyName: 'cf1', + columnQualifier: Buffer.from('cq1'), + appendValue: Buffer.from('append-val1'), + }, + { + familyName: 'cf2', + columnQualifier: Buffer.from('cq2'), + incrementAmount: 11, + }, + { + familyName: 'cf3', + columnQualifier: Buffer.from('cq3'), + appendValue: Buffer.from('append-val2'), + }, + ], + appProfileId: 'my-app-profile', + }, // appProfileId + // Add more test cases with different combinations of fields + ]; + testCases.forEach((test, index) => { + it(`Run test ${index}`, () => { + const inverseResult = getRMWRRequestInverse(test); + const result = getRMWRRequest(inverseResult); + assert.deepStrictEqual(result, test); + }); + }); +}); diff --git a/handwritten/bigtable/test/test-proxy/readModifyWriteRowService.ts b/handwritten/bigtable/test/test-proxy/readModifyWriteRowService.ts new file mode 100644 index 00000000000..e7e529165e0 --- /dev/null +++ b/handwritten/bigtable/test/test-proxy/readModifyWriteRowService.ts @@ -0,0 +1,138 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import * as assert from 'assert'; + +import {describe} from 'mocha'; +import {protos} from '../../src'; +import {BigtableClient} from '../../src/v2'; +import type {Callback, CallOptions} from 'google-gax'; +import {readModifyWriteRow} from '../../testproxy/services/read-modify-write-row'; +import {createClient} from '../../testproxy/services/create-client'; + +describe('TestProxy/ReadModifyWriteRow', () => { + const testCases: protos.google.bigtable.v2.IReadModifyWriteRowRequest[] = [ + { + tableName: 'projects/projectId/instances/instance/tables/test-table', + appProfileId: 'test-app-profile', + rowKey: Buffer.from('test-row-key'), + rules: [ + { + familyName: 'cf1', + columnQualifier: Buffer.from('cq1'), + appendValue: Buffer.from('append-val'), + }, + { + familyName: 'cf2', + columnQualifier: Buffer.from('cq2'), + incrementAmount: 10, + }, + ], + }, + ]; + describe('Ensure the proper request is passed to the Gapic Layer', () => { + testCases.forEach((readModifyWriteRowRequest, index) => { + it(`Run test ${index}`, done => { + (async () => { + const clientMap = new Map(); + const createClientFunction = createClient({clientMap}); + await new Promise((resolve, reject) => { + createClientFunction( + { + request: { + clientId: 'TestReadModifyWriteRow_NoRetry_TransientError', + dataTarget: 'localhost:1234', + projectId: 'projectId', + instanceId: 'instance', + appProfileId: '', + }, + }, + (...args: any) => { + if (args[0]) { + reject(args[0]); + } + resolve(args[1]); + }, + ); + }); + const bigtable = clientMap.get( + 'TestReadModifyWriteRow_NoRetry_TransientError', + ); + // Mock out the Gapic layer so we can see requests coming into it + const bigtableClient = new BigtableClient( + bigtable.options.BigtableClient, + ); + bigtable.api['BigtableClient'] = bigtableClient; + bigtableClient.readModifyWriteRow = ( + request?: protos.google.bigtable.v2.IReadModifyWriteRowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.bigtable.v2.IReadModifyWriteRowResponse, + | protos.google.bigtable.v2.IReadModifyWriteRowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.bigtable.v2.IReadModifyWriteRowResponse, + | protos.google.bigtable.v2.IReadModifyWriteRowRequest + | null + | undefined, + {} | null | undefined + >, + ) => { + try { + // If the Gapic request is correct then the test passes. + assert.deepStrictEqual(request, readModifyWriteRowRequest); + } catch (e) { + // If the Gapic request is incorrect then the test fails with an error. + done(e); + } + if (callback) { + callback(null, {}); + } + return new Promise(resolve => { + const response: protos.google.bigtable.v2.IReadModifyWriteRowResponse = + {}; + resolve([response, {}, undefined]); + }); + }; + const readModifyWriteRowFunction = readModifyWriteRow({ + clientMap, + }); + await new Promise((resolve, reject) => { + readModifyWriteRowFunction( + { + request: { + clientId: 'TestReadModifyWriteRow_NoRetry_TransientError', + request: readModifyWriteRowRequest, + }, + }, + (...args: any) => { + if (args[0]) { + reject(args[0]); + } + resolve(args[1]); + }, + ); + }); + done(); + })().catch(err => { + throw err; + }); + }); + }); + }); +}); diff --git a/handwritten/bigtable/test/timed-stream.ts b/handwritten/bigtable/test/timed-stream.ts new file mode 100644 index 00000000000..7c278142ffa --- /dev/null +++ b/handwritten/bigtable/test/timed-stream.ts @@ -0,0 +1,354 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {describe, it} from 'mocha'; +import {PassThrough, Readable} from 'stream'; +import {TimedStream} from '../src/timed-stream'; +import * as assert from 'assert'; + +// set up streams +function* numberGenerator(n: number) { + for (let i = 0; i < n; i++) { + yield String(i) + '\n'; + } +} + +class UserStream extends TimedStream { + constructor() { + super({ + transformHook(event, _encoding, callback) { + callback(null, event); + }, + }); + } +} + +describe('Bigtable/TimedStream', () => { + describe('with handlers', () => { + describe('with no delay from server', () => { + it('should measure the total time accurately for a series of 30 rows with a synchronous call', function (done) { + this.timeout(200000); + const sourceStream = Readable.from(numberGenerator(30)); + const timedStream = new UserStream(); + // @ts-ignore + sourceStream.pipe(timedStream as unknown as WritableStream); + // iterate stream + timedStream.on('data', async (chunk: any) => { + // Simulate 1 second of busy work + const startTime = Date.now(); + while (Date.now() - startTime < 1000) { + /* empty */ + } + }); + timedStream.on('end', () => { + const totalMilliseconds = timedStream.getTotalDurationMs(); + try { + assert(totalMilliseconds > 29000); + assert(totalMilliseconds < 31000); + done(); + } catch (e) { + done(e); + } + }); + }); + it('should measure the total time accurately for a series of 30 rows with an async call', function (done) { + this.timeout(200000); + const sourceStream = Readable.from(numberGenerator(30)); + const timedStream = new UserStream(); + // @ts-ignore + sourceStream.pipe(timedStream as unknown as WritableStream); + // iterate stream + timedStream.on('data', async (chunk: any) => { + // Simulate 1 second of busy work + const sleep = (ms: number) => + new Promise(resolve => setTimeout(resolve, ms)); + await sleep(1000); + }); + timedStream.on('end', () => { + const totalMilliseconds = timedStream.getTotalDurationMs(); + try { + assert(totalMilliseconds < 500); + done(); + } catch (e) { + done(e); + } + }); + }); + it('should measure the total time accurately for a series of 30 rows with a sync then an async call', function (done) { + this.timeout(200000); + const sourceStream = Readable.from(numberGenerator(30)); + const timedStream = new UserStream(); + // @ts-ignore + sourceStream.pipe(timedStream as unknown as WritableStream); + // iterate stream + timedStream.on('data', async (chunk: any) => { + const startTime = Date.now(); + // Simulate 1 second of busy work + while (Date.now() - startTime < 1000) { + /* empty */ + } + const sleep = (ms: number) => + new Promise(resolve => setTimeout(resolve, ms)); + await sleep(1000); + }); + timedStream.on('end', () => { + const totalMilliseconds = timedStream.getTotalDurationMs(); + try { + assert(totalMilliseconds < 32000); + assert(totalMilliseconds > 28000); + done(); + } catch (e) { + done(e); + } + }); + }); + it('should measure the total time accurately for a series of 30 rows with an async call then a sync call', function (done) { + this.timeout(200000); + const sourceStream = Readable.from(numberGenerator(30)); + const timedStream = new UserStream(); + // @ts-ignore + sourceStream.pipe(timedStream as unknown as WritableStream); + // iterate stream + timedStream.on('data', async (chunk: any) => { + const startTime = Date.now(); + // Simulate 1 second of busy work + const sleep = (ms: number) => + new Promise(resolve => setTimeout(resolve, ms)); + await sleep(1000); + // Simulate 1 second of busy work + while (Date.now() - startTime < 1000) { + /* empty */ + } + }); + timedStream.on('end', () => { + const totalMilliseconds = timedStream.getTotalDurationMs(); + try { + assert(totalMilliseconds < 500); + done(); + } catch (e) { + done(e); + } + }); + }); + }); + describe('with delay from server', () => { + it('should measure the total time accurately for a series of 10 rows', function (done) { + this.timeout(200000); + const dataEvents = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(i => + i.toString(), + ); + const sourceStream = new PassThrough(); + const timedStream = new UserStream(); + // @ts-ignore + sourceStream.pipe(timedStream); + + setTimeout(async () => { + // iterate stream + timedStream.on('data', async (chunk: any) => { + // Simulate 1 second of busy work + const startTime = Date.now(); + while (Date.now() - startTime < 1000) { + /* empty */ + } + }); + timedStream.on('end', () => { + clearInterval(interval); + // print results + try { + const totalMilliseconds = timedStream.getTotalDurationMs(); + // totalMilliseconds should be around 10 seconds, 1 per row + assert(totalMilliseconds > 9000); + assert(totalMilliseconds < 11000); + done(); + } catch (e) { + done(e); + } + }); + }, 500); + + const interval = setInterval(() => { + if (dataEvents.length > 0) { + const dataEvent = dataEvents.shift(); + sourceStream.write(dataEvent); + } else { + sourceStream.emit('end'); + } + }, 5000); + }); + it('should measure the total time accurately for a series of 30 rows with backpressure and a delay', function (done) { + this.timeout(200000); + const eventNumbers = []; + for (let i = 0; i < 40; i++) { + eventNumbers.push(i); + } + const dataEvents = eventNumbers.map(i => i.toString()); + const sourceStream = new PassThrough(); + const timedStream = new UserStream(); + // @ts-ignore + sourceStream.pipe(timedStream as unknown as WritableStream); + // iterate stream + timedStream.on('data', async (chunk: any) => { + // Simulate 1 second of busy work + const startTime = Date.now(); + while (Date.now() - startTime < 1000) { + /* empty */ + } + }); + timedStream.on('end', () => { + clearInterval(interval); + const totalMilliseconds = timedStream.getTotalDurationMs(); + try { + assert(totalMilliseconds > 38000); + assert(totalMilliseconds < 42000); + done(); + } catch (e) { + done(e); + } + }); + // First load the stream with events. + for (let i = 0; i < 20; i++) { + const dataEvent = dataEvents.shift(); + sourceStream.write(dataEvent); + } + // Then rows get sent every 5 seconds. + const interval = setInterval(() => { + if (dataEvents.length > 0) { + const dataEvent = dataEvents.shift(); + sourceStream.write(dataEvent); + } else { + sourceStream.emit('end'); + } + }, 5000); + }); + }); + }); + describe('while iterating through a stream loop', () => { + describe('with no delay from server', () => { + it('should measure the total time accurately for a series of 30 rows', async function () { + this.timeout(200000); + const sourceStream = Readable.from(numberGenerator(30)); + const timedStream = new UserStream(); + // @ts-ignore + sourceStream.pipe(timedStream as unknown as WritableStream); + // iterate stream + for await (const chunk of timedStream as unknown as PassThrough) { + // Simulate 1 second of busy work + const startTime = Date.now(); + while (Date.now() - startTime < 1000) { + /* empty */ + } + } + const totalMilliseconds = timedStream.getTotalDurationMs(); + assert(totalMilliseconds > 29000); + assert(totalMilliseconds < 31000); + }); + it('should measure the total time accurately for a series of 30 rows with an async call', async function () { + this.timeout(200000); + const sourceStream = Readable.from(numberGenerator(30)); + const timedStream = new UserStream(); + // @ts-ignore + sourceStream.pipe(timedStream as unknown as WritableStream); + // iterate stream + for await (const chunk of timedStream as unknown as PassThrough) { + // Simulate 1 second of busy work + const sleep = (ms: number) => + new Promise(resolve => setTimeout(resolve, ms)); + await sleep(1000); + } + const totalMilliseconds = timedStream.getTotalDurationMs(); + assert(totalMilliseconds < 500); + }); + }); + describe('with delay from server', () => { + it('should measure the total time accurately for a series of 10 rows', function (done) { + this.timeout(200000); + const dataEvents = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(i => + i.toString(), + ); + const sourceStream = new PassThrough(); + const timedStream = new UserStream(); + // @ts-ignore + sourceStream.pipe(timedStream); + + setTimeout(async () => { + try { + // iterate stream + for await (const chunk of timedStream as unknown as PassThrough) { + // Simulate 1 second of busy work + const startTime = Date.now(); + while (Date.now() - startTime < 1000) { + /* empty */ + } + } + clearInterval(interval); + const totalMilliseconds = timedStream.getTotalDurationMs(); + // totalMilliseconds should be around 10 seconds, 1 per row + assert(totalMilliseconds > 9000); + assert(totalMilliseconds < 11000); + done(); + } catch (e) { + done(e); + } + }, 500); + + const interval = setInterval(() => { + if (dataEvents.length > 0) { + const dataEvent = dataEvents.shift(); + sourceStream.write(dataEvent); + } else { + sourceStream.emit('end'); + } + }, 5000); + }); + it('should measure the total time accurately for a series of 40 rows with backpressure and a delay', async function () { + this.timeout(200000); + const eventNumbers = []; + for (let i = 0; i < 40; i++) { + eventNumbers.push(i); + } + const dataEvents = eventNumbers.map(i => i.toString()); + const sourceStream = new PassThrough(); + const timedStream = new UserStream(); + // @ts-ignore + sourceStream.pipe(timedStream as unknown as WritableStream); + // First load the stream with events. + for (let i = 0; i < 20; i++) { + const dataEvent = dataEvents.shift(); + sourceStream.write(dataEvent); + } + // Then rows get sent every 5 seconds. + const interval = setInterval(() => { + if (dataEvents.length > 0) { + const dataEvent = dataEvents.shift(); + sourceStream.write(dataEvent); + } else { + sourceStream.emit('end'); + } + }, 5000); + // iterate stream + for await (const chunk of timedStream as unknown as PassThrough) { + // Simulate 1 second of busy work + const startTime = Date.now(); + while (Date.now() - startTime < 1000) { + /* empty */ + } + } + clearInterval(interval); + const totalMilliseconds = timedStream.getTotalDurationMs(); + assert(totalMilliseconds > 37000); + assert(totalMilliseconds < 43000); + }); + }); + }); +}); diff --git a/handwritten/bigtable/test/util/mock-server.ts b/handwritten/bigtable/test/util/mock-server.ts new file mode 100644 index 00000000000..5ea039ec07f --- /dev/null +++ b/handwritten/bigtable/test/util/mock-server.ts @@ -0,0 +1,57 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {describe, it} from 'mocha'; +import {MockServer} from '../../src/util/mock-servers/mock-server'; +import * as assert from 'assert'; + +const tcpPortUsed = require('tcp-port-used'); + +describe('Bigtable/Mock-Server', () => { + const inputPort = '1234'; + let server: MockServer; + async function checkPort(port: string, inUse: boolean, callback: () => void) { + const isInUse: boolean = await tcpPortUsed.check( + parseInt(port), + 'localhost', + ); + assert.strictEqual(isInUse, inUse); + callback(); + } + describe('Ensure server shuts down properly when destroyed', () => { + it('should start a mock server', done => { + server = new MockServer(port => { + checkPort(port, true, done).catch(err => { + throw err; + }); + }, inputPort); + }); + }); + after(done => { + checkPort(server.port, true, () => { + server.shutdown((err?: Error) => { + assert.deepStrictEqual(err, undefined); + checkPort(server.port, false, done).catch(err => { + throw err; + }); + }); + }).catch(err => { + throw err; + }); + }); +}); diff --git a/handwritten/bigtable/test/utils/cluster.ts b/handwritten/bigtable/test/utils/cluster.ts new file mode 100644 index 00000000000..4c18dd1d6c4 --- /dev/null +++ b/handwritten/bigtable/test/utils/cluster.ts @@ -0,0 +1,93 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {describe, it} from 'mocha'; +import {ClusterUtils} from '../../src/utils/cluster'; +import * as assert from 'assert'; + +describe('Bigtable/Utils/Cluster', () => { + describe('getRequestFromMetadata', () => { + it('should translate metadata for a full set of parameters', () => { + const metadata = { + nodes: 1, + location: 'projects/{{projectId}}/locations/us-east4-b', + minServeNodes: 2, + maxServeNodes: 3, + cpuUtilizationPercent: 50, + }; + const name = 'cluster1'; + const reqOpts = ClusterUtils.getRequestFromMetadata(metadata, name); + assert.deepStrictEqual(reqOpts, { + cluster: { + name, + location: metadata.location, + serveNodes: metadata.nodes, + clusterConfig: { + clusterAutoscalingConfig: { + autoscalingLimits: { + minServeNodes: metadata.minServeNodes, + maxServeNodes: metadata.maxServeNodes, + }, + autoscalingTargets: { + cpuUtilizationPercent: metadata.cpuUtilizationPercent, + }, + }, + }, + }, + updateMask: { + paths: [ + 'serve_nodes', + 'cluster_config.cluster_autoscaling_config.autoscaling_limits.min_serve_nodes', + 'cluster_config.cluster_autoscaling_config.autoscaling_limits.max_serve_nodes', + 'cluster_config.cluster_autoscaling_config.autoscaling_targets.cpu_utilization_percent', + ], + }, + }); + }); + it('should translate metadata for autoscaling parameters', () => { + const metadata = { + location: 'projects/{{projectId}}/locations/us-east4-b', + minServeNodes: 2, + maxServeNodes: 3, + cpuUtilizationPercent: 50, + }; + const name = 'cluster1'; + const reqOpts = ClusterUtils.getRequestFromMetadata(metadata, name); + assert.deepStrictEqual(reqOpts, { + cluster: { + name, + location: metadata.location, + clusterConfig: { + clusterAutoscalingConfig: { + autoscalingLimits: { + minServeNodes: metadata.minServeNodes, + maxServeNodes: metadata.maxServeNodes, + }, + autoscalingTargets: { + cpuUtilizationPercent: metadata.cpuUtilizationPercent, + }, + }, + }, + }, + updateMask: { + paths: [ + 'cluster_config.cluster_autoscaling_config.autoscaling_limits.min_serve_nodes', + 'cluster_config.cluster_autoscaling_config.autoscaling_limits.max_serve_nodes', + 'cluster_config.cluster_autoscaling_config.autoscaling_targets.cpu_utilization_percent', + ], + }, + }); + }); + }); +}); diff --git a/handwritten/bigtable/test/utils/proto-bytes.ts b/handwritten/bigtable/test/utils/proto-bytes.ts new file mode 100644 index 00000000000..031ade17723 --- /dev/null +++ b/handwritten/bigtable/test/utils/proto-bytes.ts @@ -0,0 +1,144 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. +import {Readable} from 'stream'; +import {google} from '../../protos/protos'; +import {PreparedStatement} from '../../src/execute-query/preparedstatement'; + +export const createMetadata = ( + ...values: [string | null, google.bigtable.v2.Type][] +): google.bigtable.v2.ExecuteQueryResponse => { + return google.bigtable.v2.ExecuteQueryResponse.create({ + metadata: { + protoSchema: { + columns: values.map(v => + google.bigtable.v2.ColumnMetadata.create({ + name: v[0], + type: v[1], + }), + ), + }, + }, + }); +}; + +export const createPreparedStatement = ( + ...values: [string | null, google.bigtable.v2.Type][] +): PreparedStatement => { + const metadataPB = createMetadata(...values).metadata!; + const prepareQueryResponse = google.bigtable.v2.PrepareQueryResponse.create({ + metadata: metadataPB, + preparedQuery: 'xd', + validUntil: null, + }); + return new PreparedStatement( + undefined as any, + prepareQueryResponse, + {} as any, + {}, + ); +}; + +export const createPrepareQueryResponse = ( + ...values: [string | null, google.bigtable.v2.Type][] +): google.bigtable.v2.PrepareQueryResponse => { + const metadataPB = createMetadata(...values).metadata!; + return google.bigtable.v2.PrepareQueryResponse.create({ + metadata: metadataPB, + preparedQuery: 'xd', + validUntil: null, + }); +}; + +export const pbType = ( + value: google.bigtable.v2.IType, +): google.bigtable.v2.Type => { + return google.bigtable.v2.Type.create(value); +}; + +export const createProtoRows = ( + resumeToken?: string, + batchChecksum?: number, + reset?: boolean, + ...values: google.bigtable.v2.IValue[] +): google.bigtable.v2.ExecuteQueryResponse => { + const bytes = google.bigtable.v2.ProtoRows.encode( + google.bigtable.v2.ProtoRows.create({ + values: values.map(v => google.bigtable.v2.Value.create(v)), + }), + ).finish(); + + return { + response: 'results', + results: { + protoRowsBatch: values.length > 0 ? {batchData: bytes} : undefined, + resumeToken: resumeToken ? Buffer.from(resumeToken) : undefined, + batchChecksum: batchChecksum, + reset: reset || false, + }, + } as google.bigtable.v2.ExecuteQueryResponse; +}; + +interface BigtableError { + status: any; + message: any; + code: any; +} + +interface CustomCallback { + callback: any; +} + +type DataObject = + | BigtableError + | google.bigtable.v2.ExecuteQueryResponse + | CustomCallback; + +export class ArrayReadableStream extends Readable { + private data: DataObject[]; + private index: number; + private aborted: boolean; + + constructor(data: DataObject[]) { + super({objectMode: true, highWaterMark: 0}); + this.data = data; + this.index = 0; + this.aborted = false; + } + + _read() { + if (!this.aborted && this.index < this.data.length) { + const item = this.data[this.index]; + this.index++; + if ((item as BigtableError).code !== undefined) { + this.emit('error', item as BigtableError); + } else if ((item as CustomCallback).callback !== undefined) { + (item as CustomCallback).callback(); + this._read(); + } else { + this.push(item as google.bigtable.v2.ExecuteQueryResponse); + } + } else { + this.push(null); // No more data + } + } + + abort() { + this.aborted = true; + super.destroy(); + } + + end() { + super.destroy(); + } +} diff --git a/handwritten/bigtable/test/utils/readRowsServiceParameters.ts b/handwritten/bigtable/test/utils/readRowsServiceParameters.ts new file mode 100644 index 00000000000..53955ce659a --- /dev/null +++ b/handwritten/bigtable/test/utils/readRowsServiceParameters.ts @@ -0,0 +1,47 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {ServerWritableStream} from '@grpc/grpc-js'; +import {protos} from '../../src'; + +/** + * This file contains the parameters for the readRowsService. + */ + +interface SharedReadRowsParameters { + chunkSize: number; // The size of each chunk that the server pushes back + valueSize: number; // An upper bound on the amount of data included in the chunks +} + +export type DebugLog = (message: string) => void; + +export interface ReadRowsServiceParameters extends SharedReadRowsParameters { + deadlineExceededError?: boolean; // Send deadline exceeded transient error + errorAfterChunkNo?: number; // The chunk that the error should come after + keyFrom?: number; // The key the data coming from the service will start from + keyTo?: number; // The key the data coming from the service will end at + chunksPerResponse: number; // The total number of chunks the server should send + debugLog: DebugLog; + hook?: (request: protos.google.bigtable.v2.IReadRowsRequest) => void; +} + +export interface ChunkGeneratorParameters extends SharedReadRowsParameters { + keyFrom: number; // The first row in the generated chunks will start with this key + keyTo: number; // The last row in the generated chunks will start with this key +} + +export type ReadRowsWritableStream = ServerWritableStream< + protos.google.bigtable.v2.IReadRowsRequest, + protos.google.bigtable.v2.IReadRowsResponse +>; diff --git a/handwritten/bigtable/testproxy/.gitignore b/handwritten/bigtable/testproxy/.gitignore new file mode 100644 index 00000000000..b828f98deaf --- /dev/null +++ b/handwritten/bigtable/testproxy/.gitignore @@ -0,0 +1,2 @@ +# Exclude temp log files to make sure they don't get committed. +*.txt diff --git a/handwritten/bigtable/testproxy/README.md b/handwritten/bigtable/testproxy/README.md new file mode 100644 index 00000000000..3b8e30c178a --- /dev/null +++ b/handwritten/bigtable/testproxy/README.md @@ -0,0 +1,39 @@ +# Test Proxy + +This is a **Test Proxy** implementation meant to be used in conjuction with the +[Test Framework for Cloud Bigtable Client Libraries](https://github.com/googleapis/cloud-bigtable-clients-test). + +## Setup + +Dependencies are installed as part of the main project using **npm**: + +```console +$ npm install +``` + +## Running + +In order to start the **Test Proxy** server, run: + +```console +$ npm run testproxy +``` + +This will start the proxy server that will listen to port `9999` by default +and enable [running tests from the main go mock test implementation](https://github.com/googleapis/cloud-bigtable-clients-test#test-execution) +against the JavaScript library implementation. + +## Options + +### Using a different port + +By default the **Test Proxy** will listen to port `9999`, in order to change +the value use the `PORT` environment variable, e.g: + +```console +$ PORT=1337 npm run testproxy +``` + +## Exclusions + +Some tests are testing things that the library doesn't support; these would require feature work, and are in `known_unsupported.txt`. Some of them are simply known failures that need to be fixed, but are not vital to the operation of the library, and are in `known_failures.txt`. Ideally these would all be complete, but until they are, they're listed in those files. Items in both files are excluded during "mandatory conformance", and items unsupported items are excluded during "conformance". diff --git a/handwritten/bigtable/testproxy/compile-protos.sh b/handwritten/bigtable/testproxy/compile-protos.sh new file mode 100644 index 00000000000..6fa52e37087 --- /dev/null +++ b/handwritten/bigtable/testproxy/compile-protos.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Run from the project root. +echo "Running from $(pwd)" + +# Remove previous generated files and make sure the directory exists. +rm -f testproxy/protos/protos.d.ts testproxy/protos/protos.js testproxy/protos/protos.json +mkdir -p testproxy/protos + +# We have to move the existing main files out of the way to build the version +# with the proxy interface. The reason for this is that the standard +# compileProtos script can't currently set a destination location, and owlbot will +# just overwrite our updated protos if we do include the proxy protos +# (and realistically, we don't want it in there anyway). +# +# This whole shuffle should be removed when we add destination support to +# the compileProtos util. +mkdir tmp +mv protos/protos.* tmp/ + +# Build the full protos with the proxy. +npx compileProtos src testproxy + +# Move them to the testproxy and put the originals back. +mv protos/protos.d.ts protos/protos.js protos/protos.json testproxy/protos/ +mv tmp/* protos/ +rmdir tmp diff --git a/handwritten/bigtable/testproxy/index.ts b/handwritten/bigtable/testproxy/index.ts new file mode 100644 index 00000000000..fc29c3f96c5 --- /dev/null +++ b/handwritten/bigtable/testproxy/index.ts @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {dirname, resolve} from 'node:path'; + +import * as grpc from '@grpc/grpc-js'; +import * as protoLoader from '@grpc/proto-loader'; + +import {getServicesImplementation} from './services'; + +const GAX_PROTOS_DIR = resolve( + dirname(require.resolve('google-gax')), + '../protos', +); +const PROTOS_DIR = resolve(__dirname, '../protos'); +const PROTO_PATH = resolve(PROTOS_DIR, 'test_proxy.proto'); +const port = parseInt(process.env.PORT ?? '9999', 10); + +async function loadDescriptor() { + const packageDefinition = await protoLoader.load(PROTO_PATH, { + keepCase: false, + longs: String, + enums: String, + defaults: true, + oneofs: true, + includeDirs: [PROTOS_DIR, GAX_PROTOS_DIR], + }); + return grpc.loadPackageDefinition(packageDefinition); +} + +function startServer( + service: grpc.ServiceDefinition, +) { + const server = new grpc.Server(); + server.addService(service, getServicesImplementation()); + + return server.bindAsync( + `0.0.0.0:${port}`, + grpc.ServerCredentials.createInsecure(), + () => { + console.log(`grpc server started on port: ${port}`); + }, + ); +} + +async function main() { + const descriptor = await loadDescriptor(); + const testproxy = ( + (descriptor.google as grpc.GrpcObject).bigtable as grpc.GrpcObject + ).testproxy as grpc.GrpcObject; + const service = ( + testproxy.CloudBigtableV2TestProxy as grpc.ServiceClientConstructor + ).service; + startServer(service); +} + +main().catch(e => { + console.error('error during tests', e); + process.exitCode = 1; +}); diff --git a/handwritten/bigtable/testproxy/known_failures.txt b/handwritten/bigtable/testproxy/known_failures.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/handwritten/bigtable/testproxy/known_unsupported.txt b/handwritten/bigtable/testproxy/known_unsupported.txt new file mode 100644 index 00000000000..da27548e081 --- /dev/null +++ b/handwritten/bigtable/testproxy/known_unsupported.txt @@ -0,0 +1,13 @@ +TestMutateRows_Retry_WithRoutingCookie\| +TestReadRow_Retry_WithRetryInfo\| +TestReadRow_Retry_WithRoutingCookie\| +TestReadRow_Retry_WithRetryInfo\| +TestReadRows_ReverseScans_FeatureFlag_Enabled\| +TestReadRows_NoRetry_OutOfOrderError_Reverse\| +TestReadRows_Retry_LastScannedRow_Reverse\| +TestReadRows_Retry_WithRoutingCookie\| +TestReadRows_Retry_WithRoutingCookie_MultipleErrorResponses\| +TestReadRows_Retry_WithRetryInfo\| +TestReadRows_Retry_WithRetryInfo_MultipleErrorResponse\| +TestSampleRowKeys_Retry_WithRoutingCookie\| +TestSampleRowKeys_Retry_WithRetryInfo diff --git a/handwritten/bigtable/testproxy/protos/protos.d.ts b/handwritten/bigtable/testproxy/protos/protos.d.ts new file mode 100644 index 00000000000..f477a74c922 --- /dev/null +++ b/handwritten/bigtable/testproxy/protos/protos.d.ts @@ -0,0 +1,44803 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace bigtable. */ + namespace bigtable { + + /** Namespace admin. */ + namespace admin { + + /** Namespace v2. */ + namespace v2 { + + /** Represents a BigtableInstanceAdmin */ + class BigtableInstanceAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new BigtableInstanceAdmin 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 BigtableInstanceAdmin 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): BigtableInstanceAdmin; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.bigtable.admin.v2.ICreateInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.bigtable.admin.v2.ICreateInstanceRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.bigtable.admin.v2.IGetInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.bigtable.admin.v2.IGetInstanceRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.bigtable.admin.v2.IListInstancesRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.bigtable.admin.v2.IListInstancesRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request Instance message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public updateInstance(request: google.bigtable.admin.v2.IInstance, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request Instance message or plain object + * @returns Promise + */ + public updateInstance(request: google.bigtable.admin.v2.IInstance): Promise; + + /** + * Calls PartialUpdateInstance. + * @param request PartialUpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public partialUpdateInstance(request: google.bigtable.admin.v2.IPartialUpdateInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateInstanceCallback): void; + + /** + * Calls PartialUpdateInstance. + * @param request PartialUpdateInstanceRequest message or plain object + * @returns Promise + */ + public partialUpdateInstance(request: google.bigtable.admin.v2.IPartialUpdateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteInstance(request: google.bigtable.admin.v2.IDeleteInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.bigtable.admin.v2.IDeleteInstanceRequest): Promise; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCluster(request: google.bigtable.admin.v2.ICreateClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateClusterCallback): void; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @returns Promise + */ + public createCluster(request: google.bigtable.admin.v2.ICreateClusterRequest): Promise; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Cluster + */ + public getCluster(request: google.bigtable.admin.v2.IGetClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetClusterCallback): void; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @returns Promise + */ + public getCluster(request: google.bigtable.admin.v2.IGetClusterRequest): Promise; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClustersResponse + */ + public listClusters(request: google.bigtable.admin.v2.IListClustersRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListClustersCallback): void; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @returns Promise + */ + public listClusters(request: google.bigtable.admin.v2.IListClustersRequest): Promise; + + /** + * Calls UpdateCluster. + * @param request Cluster message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCluster(request: google.bigtable.admin.v2.ICluster, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateClusterCallback): void; + + /** + * Calls UpdateCluster. + * @param request Cluster message or plain object + * @returns Promise + */ + public updateCluster(request: google.bigtable.admin.v2.ICluster): Promise; + + /** + * Calls PartialUpdateCluster. + * @param request PartialUpdateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public partialUpdateCluster(request: google.bigtable.admin.v2.IPartialUpdateClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateClusterCallback): void; + + /** + * Calls PartialUpdateCluster. + * @param request PartialUpdateClusterRequest message or plain object + * @returns Promise + */ + public partialUpdateCluster(request: google.bigtable.admin.v2.IPartialUpdateClusterRequest): Promise; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCluster(request: google.bigtable.admin.v2.IDeleteClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteClusterCallback): void; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @returns Promise + */ + public deleteCluster(request: google.bigtable.admin.v2.IDeleteClusterRequest): Promise; + + /** + * Calls CreateAppProfile. + * @param request CreateAppProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AppProfile + */ + public createAppProfile(request: google.bigtable.admin.v2.ICreateAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateAppProfileCallback): void; + + /** + * Calls CreateAppProfile. + * @param request CreateAppProfileRequest message or plain object + * @returns Promise + */ + public createAppProfile(request: google.bigtable.admin.v2.ICreateAppProfileRequest): Promise; + + /** + * Calls GetAppProfile. + * @param request GetAppProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AppProfile + */ + public getAppProfile(request: google.bigtable.admin.v2.IGetAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetAppProfileCallback): void; + + /** + * Calls GetAppProfile. + * @param request GetAppProfileRequest message or plain object + * @returns Promise + */ + public getAppProfile(request: google.bigtable.admin.v2.IGetAppProfileRequest): Promise; + + /** + * Calls ListAppProfiles. + * @param request ListAppProfilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAppProfilesResponse + */ + public listAppProfiles(request: google.bigtable.admin.v2.IListAppProfilesRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListAppProfilesCallback): void; + + /** + * Calls ListAppProfiles. + * @param request ListAppProfilesRequest message or plain object + * @returns Promise + */ + public listAppProfiles(request: google.bigtable.admin.v2.IListAppProfilesRequest): Promise; + + /** + * Calls UpdateAppProfile. + * @param request UpdateAppProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateAppProfile(request: google.bigtable.admin.v2.IUpdateAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateAppProfileCallback): void; + + /** + * Calls UpdateAppProfile. + * @param request UpdateAppProfileRequest message or plain object + * @returns Promise + */ + public updateAppProfile(request: google.bigtable.admin.v2.IUpdateAppProfileRequest): Promise; + + /** + * Calls DeleteAppProfile. + * @param request DeleteAppProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAppProfile(request: google.bigtable.admin.v2.IDeleteAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteAppProfileCallback): void; + + /** + * Calls DeleteAppProfile. + * @param request DeleteAppProfileRequest message or plain object + * @returns Promise + */ + public deleteAppProfile(request: google.bigtable.admin.v2.IDeleteAppProfileRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls ListHotTablets. + * @param request ListHotTabletsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListHotTabletsResponse + */ + public listHotTablets(request: google.bigtable.admin.v2.IListHotTabletsRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListHotTabletsCallback): void; + + /** + * Calls ListHotTablets. + * @param request ListHotTabletsRequest message or plain object + * @returns Promise + */ + public listHotTablets(request: google.bigtable.admin.v2.IListHotTabletsRequest): Promise; + + /** + * Calls CreateLogicalView. + * @param request CreateLogicalViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createLogicalView(request: google.bigtable.admin.v2.ICreateLogicalViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateLogicalViewCallback): void; + + /** + * Calls CreateLogicalView. + * @param request CreateLogicalViewRequest message or plain object + * @returns Promise + */ + public createLogicalView(request: google.bigtable.admin.v2.ICreateLogicalViewRequest): Promise; + + /** + * Calls GetLogicalView. + * @param request GetLogicalViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogicalView + */ + public getLogicalView(request: google.bigtable.admin.v2.IGetLogicalViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetLogicalViewCallback): void; + + /** + * Calls GetLogicalView. + * @param request GetLogicalViewRequest message or plain object + * @returns Promise + */ + public getLogicalView(request: google.bigtable.admin.v2.IGetLogicalViewRequest): Promise; + + /** + * Calls ListLogicalViews. + * @param request ListLogicalViewsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListLogicalViewsResponse + */ + public listLogicalViews(request: google.bigtable.admin.v2.IListLogicalViewsRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListLogicalViewsCallback): void; + + /** + * Calls ListLogicalViews. + * @param request ListLogicalViewsRequest message or plain object + * @returns Promise + */ + public listLogicalViews(request: google.bigtable.admin.v2.IListLogicalViewsRequest): Promise; + + /** + * Calls UpdateLogicalView. + * @param request UpdateLogicalViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateLogicalView(request: google.bigtable.admin.v2.IUpdateLogicalViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateLogicalViewCallback): void; + + /** + * Calls UpdateLogicalView. + * @param request UpdateLogicalViewRequest message or plain object + * @returns Promise + */ + public updateLogicalView(request: google.bigtable.admin.v2.IUpdateLogicalViewRequest): Promise; + + /** + * Calls DeleteLogicalView. + * @param request DeleteLogicalViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteLogicalView(request: google.bigtable.admin.v2.IDeleteLogicalViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteLogicalViewCallback): void; + + /** + * Calls DeleteLogicalView. + * @param request DeleteLogicalViewRequest message or plain object + * @returns Promise + */ + public deleteLogicalView(request: google.bigtable.admin.v2.IDeleteLogicalViewRequest): Promise; + + /** + * Calls CreateMaterializedView. + * @param request CreateMaterializedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createMaterializedView(request: google.bigtable.admin.v2.ICreateMaterializedViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateMaterializedViewCallback): void; + + /** + * Calls CreateMaterializedView. + * @param request CreateMaterializedViewRequest message or plain object + * @returns Promise + */ + public createMaterializedView(request: google.bigtable.admin.v2.ICreateMaterializedViewRequest): Promise; + + /** + * Calls GetMaterializedView. + * @param request GetMaterializedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MaterializedView + */ + public getMaterializedView(request: google.bigtable.admin.v2.IGetMaterializedViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetMaterializedViewCallback): void; + + /** + * Calls GetMaterializedView. + * @param request GetMaterializedViewRequest message or plain object + * @returns Promise + */ + public getMaterializedView(request: google.bigtable.admin.v2.IGetMaterializedViewRequest): Promise; + + /** + * Calls ListMaterializedViews. + * @param request ListMaterializedViewsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMaterializedViewsResponse + */ + public listMaterializedViews(request: google.bigtable.admin.v2.IListMaterializedViewsRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListMaterializedViewsCallback): void; + + /** + * Calls ListMaterializedViews. + * @param request ListMaterializedViewsRequest message or plain object + * @returns Promise + */ + public listMaterializedViews(request: google.bigtable.admin.v2.IListMaterializedViewsRequest): Promise; + + /** + * Calls UpdateMaterializedView. + * @param request UpdateMaterializedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateMaterializedView(request: google.bigtable.admin.v2.IUpdateMaterializedViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateMaterializedViewCallback): void; + + /** + * Calls UpdateMaterializedView. + * @param request UpdateMaterializedViewRequest message or plain object + * @returns Promise + */ + public updateMaterializedView(request: google.bigtable.admin.v2.IUpdateMaterializedViewRequest): Promise; + + /** + * Calls DeleteMaterializedView. + * @param request DeleteMaterializedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteMaterializedView(request: google.bigtable.admin.v2.IDeleteMaterializedViewRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteMaterializedViewCallback): void; + + /** + * Calls DeleteMaterializedView. + * @param request DeleteMaterializedViewRequest message or plain object + * @returns Promise + */ + public deleteMaterializedView(request: google.bigtable.admin.v2.IDeleteMaterializedViewRequest): Promise; + } + + namespace BigtableInstanceAdmin { + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Instance) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Instance) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|partialUpdateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type PartialUpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteInstance}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getCluster}. + * @param error Error, if any + * @param [response] Cluster + */ + type GetClusterCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Cluster) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse + */ + type ListClustersCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListClustersResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|partialUpdateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type PartialUpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteCluster}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteClusterCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createAppProfile}. + * @param error Error, if any + * @param [response] AppProfile + */ + type CreateAppProfileCallback = (error: (Error|null), response?: google.bigtable.admin.v2.AppProfile) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getAppProfile}. + * @param error Error, if any + * @param [response] AppProfile + */ + type GetAppProfileCallback = (error: (Error|null), response?: google.bigtable.admin.v2.AppProfile) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listAppProfiles}. + * @param error Error, if any + * @param [response] ListAppProfilesResponse + */ + type ListAppProfilesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListAppProfilesResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateAppProfile}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateAppProfileCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteAppProfile}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAppProfileCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listHotTablets}. + * @param error Error, if any + * @param [response] ListHotTabletsResponse + */ + type ListHotTabletsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListHotTabletsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createLogicalView}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateLogicalViewCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getLogicalView}. + * @param error Error, if any + * @param [response] LogicalView + */ + type GetLogicalViewCallback = (error: (Error|null), response?: google.bigtable.admin.v2.LogicalView) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listLogicalViews}. + * @param error Error, if any + * @param [response] ListLogicalViewsResponse + */ + type ListLogicalViewsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListLogicalViewsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateLogicalView}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateLogicalViewCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteLogicalView}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteLogicalViewCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createMaterializedView}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateMaterializedViewCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getMaterializedView}. + * @param error Error, if any + * @param [response] MaterializedView + */ + type GetMaterializedViewCallback = (error: (Error|null), response?: google.bigtable.admin.v2.MaterializedView) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listMaterializedViews}. + * @param error Error, if any + * @param [response] ListMaterializedViewsResponse + */ + type ListMaterializedViewsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListMaterializedViewsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateMaterializedView}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateMaterializedViewCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteMaterializedView}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteMaterializedViewCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.bigtable.admin.v2.IInstance|null); + + /** CreateInstanceRequest clusters */ + clusters?: ({ [k: string]: google.bigtable.admin.v2.ICluster }|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.bigtable.admin.v2.IInstance|null); + + /** CreateInstanceRequest clusters. */ + public clusters: { [k: string]: google.bigtable.admin.v2.ICluster }; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateInstanceRequest): google.bigtable.admin.v2.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetInstanceRequest): google.bigtable.admin.v2.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListInstancesRequest): google.bigtable.admin.v2.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.bigtable.admin.v2.IInstance[]|null); + + /** ListInstancesResponse failedLocations */ + failedLocations?: (string[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.bigtable.admin.v2.IInstance[]; + + /** ListInstancesResponse failedLocations. */ + public failedLocations: string[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListInstancesResponse): google.bigtable.admin.v2.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartialUpdateInstanceRequest. */ + interface IPartialUpdateInstanceRequest { + + /** PartialUpdateInstanceRequest instance */ + instance?: (google.bigtable.admin.v2.IInstance|null); + + /** PartialUpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a PartialUpdateInstanceRequest. */ + class PartialUpdateInstanceRequest implements IPartialUpdateInstanceRequest { + + /** + * Constructs a new PartialUpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IPartialUpdateInstanceRequest); + + /** PartialUpdateInstanceRequest instance. */ + public instance?: (google.bigtable.admin.v2.IInstance|null); + + /** PartialUpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new PartialUpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PartialUpdateInstanceRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IPartialUpdateInstanceRequest): google.bigtable.admin.v2.PartialUpdateInstanceRequest; + + /** + * Encodes the specified PartialUpdateInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateInstanceRequest.verify|verify} messages. + * @param message PartialUpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IPartialUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartialUpdateInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateInstanceRequest.verify|verify} messages. + * @param message PartialUpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IPartialUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartialUpdateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartialUpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.PartialUpdateInstanceRequest; + + /** + * Decodes a PartialUpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartialUpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.PartialUpdateInstanceRequest; + + /** + * Verifies a PartialUpdateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartialUpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartialUpdateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.PartialUpdateInstanceRequest; + + /** + * Creates a plain object from a PartialUpdateInstanceRequest message. Also converts values to other types if specified. + * @param message PartialUpdateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.PartialUpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartialUpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartialUpdateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteInstanceRequest): google.bigtable.admin.v2.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClusterRequest. */ + interface ICreateClusterRequest { + + /** CreateClusterRequest parent */ + parent?: (string|null); + + /** CreateClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateClusterRequest cluster */ + cluster?: (google.bigtable.admin.v2.ICluster|null); + } + + /** Represents a CreateClusterRequest. */ + class CreateClusterRequest implements ICreateClusterRequest { + + /** + * Constructs a new CreateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateClusterRequest); + + /** CreateClusterRequest parent. */ + public parent: string; + + /** CreateClusterRequest clusterId. */ + public clusterId: string; + + /** CreateClusterRequest cluster. */ + public cluster?: (google.bigtable.admin.v2.ICluster|null); + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateClusterRequest): google.bigtable.admin.v2.CreateClusterRequest; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateClusterRequest; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateClusterRequest; + + /** + * Verifies a CreateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateClusterRequest; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @param message CreateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetClusterRequest. */ + interface IGetClusterRequest { + + /** GetClusterRequest name */ + name?: (string|null); + } + + /** Represents a GetClusterRequest. */ + class GetClusterRequest implements IGetClusterRequest { + + /** + * Constructs a new GetClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetClusterRequest); + + /** GetClusterRequest name. */ + public name: string; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClusterRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetClusterRequest): google.bigtable.admin.v2.GetClusterRequest; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetClusterRequest; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetClusterRequest; + + /** + * Verifies a GetClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetClusterRequest; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @param message GetClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersRequest. */ + interface IListClustersRequest { + + /** ListClustersRequest parent */ + parent?: (string|null); + + /** ListClustersRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListClustersRequest. */ + class ListClustersRequest implements IListClustersRequest { + + /** + * Constructs a new ListClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListClustersRequest); + + /** ListClustersRequest parent. */ + public parent: string; + + /** ListClustersRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListClustersRequest): google.bigtable.admin.v2.ListClustersRequest; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListClustersRequest; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListClustersRequest; + + /** + * Verifies a ListClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListClustersRequest; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @param message ListClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersResponse. */ + interface IListClustersResponse { + + /** ListClustersResponse clusters */ + clusters?: (google.bigtable.admin.v2.ICluster[]|null); + + /** ListClustersResponse failedLocations */ + failedLocations?: (string[]|null); + + /** ListClustersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListClustersResponse. */ + class ListClustersResponse implements IListClustersResponse { + + /** + * Constructs a new ListClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListClustersResponse); + + /** ListClustersResponse clusters. */ + public clusters: google.bigtable.admin.v2.ICluster[]; + + /** ListClustersResponse failedLocations. */ + public failedLocations: string[]; + + /** ListClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListClustersResponse): google.bigtable.admin.v2.ListClustersResponse; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListClustersResponse; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListClustersResponse; + + /** + * Verifies a ListClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListClustersResponse; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @param message ListClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteClusterRequest. */ + interface IDeleteClusterRequest { + + /** DeleteClusterRequest name */ + name?: (string|null); + } + + /** Represents a DeleteClusterRequest. */ + class DeleteClusterRequest implements IDeleteClusterRequest { + + /** + * Constructs a new DeleteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteClusterRequest); + + /** DeleteClusterRequest name. */ + public name: string; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteClusterRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteClusterRequest): google.bigtable.admin.v2.DeleteClusterRequest; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteClusterRequest; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteClusterRequest; + + /** + * Verifies a DeleteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteClusterRequest; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @param message DeleteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceMetadata. */ + interface ICreateInstanceMetadata { + + /** CreateInstanceMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateInstanceRequest|null); + + /** CreateInstanceMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateInstanceMetadata. */ + class CreateInstanceMetadata implements ICreateInstanceMetadata { + + /** + * Constructs a new CreateInstanceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateInstanceMetadata); + + /** CreateInstanceMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateInstanceRequest|null); + + /** CreateInstanceMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateInstanceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateInstanceMetadata): google.bigtable.admin.v2.CreateInstanceMetadata; + + /** + * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceMetadata.verify|verify} messages. + * @param message CreateInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceMetadata.verify|verify} messages. + * @param message CreateInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateInstanceMetadata; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateInstanceMetadata; + + /** + * Verifies a CreateInstanceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateInstanceMetadata; + + /** + * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. + * @param message CreateInstanceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceMetadata. */ + interface IUpdateInstanceMetadata { + + /** UpdateInstanceMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null); + + /** UpdateInstanceMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateInstanceMetadata. */ + class UpdateInstanceMetadata implements IUpdateInstanceMetadata { + + /** + * Constructs a new UpdateInstanceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateInstanceMetadata); + + /** UpdateInstanceMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null); + + /** UpdateInstanceMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateInstanceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateInstanceMetadata): google.bigtable.admin.v2.UpdateInstanceMetadata; + + /** + * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateInstanceMetadata.verify|verify} messages. + * @param message UpdateInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateInstanceMetadata.verify|verify} messages. + * @param message UpdateInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateInstanceMetadata; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateInstanceMetadata; + + /** + * Verifies an UpdateInstanceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateInstanceMetadata; + + /** + * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. + * @param message UpdateInstanceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClusterMetadata. */ + interface ICreateClusterMetadata { + + /** CreateClusterMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateClusterRequest|null); + + /** CreateClusterMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateClusterMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + + /** CreateClusterMetadata tables */ + tables?: ({ [k: string]: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress }|null); + } + + /** Represents a CreateClusterMetadata. */ + class CreateClusterMetadata implements ICreateClusterMetadata { + + /** + * Constructs a new CreateClusterMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateClusterMetadata); + + /** CreateClusterMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateClusterRequest|null); + + /** CreateClusterMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateClusterMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** CreateClusterMetadata tables. */ + public tables: { [k: string]: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress }; + + /** + * Creates a new CreateClusterMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateClusterMetadata): google.bigtable.admin.v2.CreateClusterMetadata; + + /** + * Encodes the specified CreateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.verify|verify} messages. + * @param message CreateClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.verify|verify} messages. + * @param message CreateClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClusterMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateClusterMetadata; + + /** + * Decodes a CreateClusterMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateClusterMetadata; + + /** + * Verifies a CreateClusterMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateClusterMetadata; + + /** + * Creates a plain object from a CreateClusterMetadata message. Also converts values to other types if specified. + * @param message CreateClusterMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateClusterMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClusterMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClusterMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CreateClusterMetadata { + + /** Properties of a TableProgress. */ + interface ITableProgress { + + /** TableProgress estimatedSizeBytes */ + estimatedSizeBytes?: (number|Long|string|null); + + /** TableProgress estimatedCopiedBytes */ + estimatedCopiedBytes?: (number|Long|string|null); + + /** TableProgress state */ + state?: (google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State|keyof typeof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State|null); + } + + /** Represents a TableProgress. */ + class TableProgress implements ITableProgress { + + /** + * Constructs a new TableProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress); + + /** TableProgress estimatedSizeBytes. */ + public estimatedSizeBytes: (number|Long|string); + + /** TableProgress estimatedCopiedBytes. */ + public estimatedCopiedBytes: (number|Long|string); + + /** TableProgress state. */ + public state: (google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State|keyof typeof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State); + + /** + * Creates a new TableProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns TableProgress instance + */ + public static create(properties?: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress): google.bigtable.admin.v2.CreateClusterMetadata.TableProgress; + + /** + * Encodes the specified TableProgress message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify|verify} messages. + * @param message TableProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableProgress message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify|verify} messages. + * @param message TableProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateClusterMetadata.TableProgress; + + /** + * Decodes a TableProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateClusterMetadata.TableProgress; + + /** + * Verifies a TableProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableProgress + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateClusterMetadata.TableProgress; + + /** + * Creates a plain object from a TableProgress message. Also converts values to other types if specified. + * @param message TableProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateClusterMetadata.TableProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TableProgress { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + COPYING = 2, + COMPLETED = 3, + CANCELLED = 4 + } + } + } + + /** Properties of an UpdateClusterMetadata. */ + interface IUpdateClusterMetadata { + + /** UpdateClusterMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICluster|null); + + /** UpdateClusterMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateClusterMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateClusterMetadata. */ + class UpdateClusterMetadata implements IUpdateClusterMetadata { + + /** + * Constructs a new UpdateClusterMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateClusterMetadata); + + /** UpdateClusterMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICluster|null); + + /** UpdateClusterMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateClusterMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateClusterMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateClusterMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateClusterMetadata): google.bigtable.admin.v2.UpdateClusterMetadata; + + /** + * Encodes the specified UpdateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateClusterMetadata.verify|verify} messages. + * @param message UpdateClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateClusterMetadata.verify|verify} messages. + * @param message UpdateClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateClusterMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateClusterMetadata; + + /** + * Decodes an UpdateClusterMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateClusterMetadata; + + /** + * Verifies an UpdateClusterMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateClusterMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateClusterMetadata; + + /** + * Creates a plain object from an UpdateClusterMetadata message. Also converts values to other types if specified. + * @param message UpdateClusterMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateClusterMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateClusterMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateClusterMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartialUpdateClusterMetadata. */ + interface IPartialUpdateClusterMetadata { + + /** PartialUpdateClusterMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** PartialUpdateClusterMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + + /** PartialUpdateClusterMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.IPartialUpdateClusterRequest|null); + } + + /** Represents a PartialUpdateClusterMetadata. */ + class PartialUpdateClusterMetadata implements IPartialUpdateClusterMetadata { + + /** + * Constructs a new PartialUpdateClusterMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IPartialUpdateClusterMetadata); + + /** PartialUpdateClusterMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** PartialUpdateClusterMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** PartialUpdateClusterMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.IPartialUpdateClusterRequest|null); + + /** + * Creates a new PartialUpdateClusterMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns PartialUpdateClusterMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IPartialUpdateClusterMetadata): google.bigtable.admin.v2.PartialUpdateClusterMetadata; + + /** + * Encodes the specified PartialUpdateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterMetadata.verify|verify} messages. + * @param message PartialUpdateClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IPartialUpdateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartialUpdateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterMetadata.verify|verify} messages. + * @param message PartialUpdateClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IPartialUpdateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartialUpdateClusterMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartialUpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.PartialUpdateClusterMetadata; + + /** + * Decodes a PartialUpdateClusterMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartialUpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.PartialUpdateClusterMetadata; + + /** + * Verifies a PartialUpdateClusterMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartialUpdateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartialUpdateClusterMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.PartialUpdateClusterMetadata; + + /** + * Creates a plain object from a PartialUpdateClusterMetadata message. Also converts values to other types if specified. + * @param message PartialUpdateClusterMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.PartialUpdateClusterMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartialUpdateClusterMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartialUpdateClusterMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartialUpdateClusterRequest. */ + interface IPartialUpdateClusterRequest { + + /** PartialUpdateClusterRequest cluster */ + cluster?: (google.bigtable.admin.v2.ICluster|null); + + /** PartialUpdateClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a PartialUpdateClusterRequest. */ + class PartialUpdateClusterRequest implements IPartialUpdateClusterRequest { + + /** + * Constructs a new PartialUpdateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IPartialUpdateClusterRequest); + + /** PartialUpdateClusterRequest cluster. */ + public cluster?: (google.bigtable.admin.v2.ICluster|null); + + /** PartialUpdateClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new PartialUpdateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PartialUpdateClusterRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IPartialUpdateClusterRequest): google.bigtable.admin.v2.PartialUpdateClusterRequest; + + /** + * Encodes the specified PartialUpdateClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterRequest.verify|verify} messages. + * @param message PartialUpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IPartialUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartialUpdateClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterRequest.verify|verify} messages. + * @param message PartialUpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IPartialUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartialUpdateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartialUpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.PartialUpdateClusterRequest; + + /** + * Decodes a PartialUpdateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartialUpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.PartialUpdateClusterRequest; + + /** + * Verifies a PartialUpdateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartialUpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartialUpdateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.PartialUpdateClusterRequest; + + /** + * Creates a plain object from a PartialUpdateClusterRequest message. Also converts values to other types if specified. + * @param message PartialUpdateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.PartialUpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartialUpdateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartialUpdateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAppProfileRequest. */ + interface ICreateAppProfileRequest { + + /** CreateAppProfileRequest parent */ + parent?: (string|null); + + /** CreateAppProfileRequest appProfileId */ + appProfileId?: (string|null); + + /** CreateAppProfileRequest appProfile */ + appProfile?: (google.bigtable.admin.v2.IAppProfile|null); + + /** CreateAppProfileRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents a CreateAppProfileRequest. */ + class CreateAppProfileRequest implements ICreateAppProfileRequest { + + /** + * Constructs a new CreateAppProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateAppProfileRequest); + + /** CreateAppProfileRequest parent. */ + public parent: string; + + /** CreateAppProfileRequest appProfileId. */ + public appProfileId: string; + + /** CreateAppProfileRequest appProfile. */ + public appProfile?: (google.bigtable.admin.v2.IAppProfile|null); + + /** CreateAppProfileRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new CreateAppProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAppProfileRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateAppProfileRequest): google.bigtable.admin.v2.CreateAppProfileRequest; + + /** + * Encodes the specified CreateAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateAppProfileRequest.verify|verify} messages. + * @param message CreateAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAppProfileRequest.verify|verify} messages. + * @param message CreateAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAppProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateAppProfileRequest; + + /** + * Decodes a CreateAppProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateAppProfileRequest; + + /** + * Verifies a CreateAppProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAppProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateAppProfileRequest; + + /** + * Creates a plain object from a CreateAppProfileRequest message. Also converts values to other types if specified. + * @param message CreateAppProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAppProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAppProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAppProfileRequest. */ + interface IGetAppProfileRequest { + + /** GetAppProfileRequest name */ + name?: (string|null); + } + + /** Represents a GetAppProfileRequest. */ + class GetAppProfileRequest implements IGetAppProfileRequest { + + /** + * Constructs a new GetAppProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetAppProfileRequest); + + /** GetAppProfileRequest name. */ + public name: string; + + /** + * Creates a new GetAppProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAppProfileRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetAppProfileRequest): google.bigtable.admin.v2.GetAppProfileRequest; + + /** + * Encodes the specified GetAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetAppProfileRequest.verify|verify} messages. + * @param message GetAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetAppProfileRequest.verify|verify} messages. + * @param message GetAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAppProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetAppProfileRequest; + + /** + * Decodes a GetAppProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetAppProfileRequest; + + /** + * Verifies a GetAppProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAppProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetAppProfileRequest; + + /** + * Creates a plain object from a GetAppProfileRequest message. Also converts values to other types if specified. + * @param message GetAppProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAppProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAppProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppProfilesRequest. */ + interface IListAppProfilesRequest { + + /** ListAppProfilesRequest parent */ + parent?: (string|null); + + /** ListAppProfilesRequest pageSize */ + pageSize?: (number|null); + + /** ListAppProfilesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAppProfilesRequest. */ + class ListAppProfilesRequest implements IListAppProfilesRequest { + + /** + * Constructs a new ListAppProfilesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListAppProfilesRequest); + + /** ListAppProfilesRequest parent. */ + public parent: string; + + /** ListAppProfilesRequest pageSize. */ + public pageSize: number; + + /** ListAppProfilesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAppProfilesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppProfilesRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListAppProfilesRequest): google.bigtable.admin.v2.ListAppProfilesRequest; + + /** + * Encodes the specified ListAppProfilesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesRequest.verify|verify} messages. + * @param message ListAppProfilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListAppProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppProfilesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesRequest.verify|verify} messages. + * @param message ListAppProfilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListAppProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppProfilesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListAppProfilesRequest; + + /** + * Decodes a ListAppProfilesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListAppProfilesRequest; + + /** + * Verifies a ListAppProfilesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppProfilesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppProfilesRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListAppProfilesRequest; + + /** + * Creates a plain object from a ListAppProfilesRequest message. Also converts values to other types if specified. + * @param message ListAppProfilesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListAppProfilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppProfilesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppProfilesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppProfilesResponse. */ + interface IListAppProfilesResponse { + + /** ListAppProfilesResponse appProfiles */ + appProfiles?: (google.bigtable.admin.v2.IAppProfile[]|null); + + /** ListAppProfilesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAppProfilesResponse failedLocations */ + failedLocations?: (string[]|null); + } + + /** Represents a ListAppProfilesResponse. */ + class ListAppProfilesResponse implements IListAppProfilesResponse { + + /** + * Constructs a new ListAppProfilesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListAppProfilesResponse); + + /** ListAppProfilesResponse appProfiles. */ + public appProfiles: google.bigtable.admin.v2.IAppProfile[]; + + /** ListAppProfilesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAppProfilesResponse failedLocations. */ + public failedLocations: string[]; + + /** + * Creates a new ListAppProfilesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppProfilesResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListAppProfilesResponse): google.bigtable.admin.v2.ListAppProfilesResponse; + + /** + * Encodes the specified ListAppProfilesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesResponse.verify|verify} messages. + * @param message ListAppProfilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListAppProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppProfilesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesResponse.verify|verify} messages. + * @param message ListAppProfilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListAppProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppProfilesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListAppProfilesResponse; + + /** + * Decodes a ListAppProfilesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListAppProfilesResponse; + + /** + * Verifies a ListAppProfilesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppProfilesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppProfilesResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListAppProfilesResponse; + + /** + * Creates a plain object from a ListAppProfilesResponse message. Also converts values to other types if specified. + * @param message ListAppProfilesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListAppProfilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppProfilesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppProfilesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAppProfileRequest. */ + interface IUpdateAppProfileRequest { + + /** UpdateAppProfileRequest appProfile */ + appProfile?: (google.bigtable.admin.v2.IAppProfile|null); + + /** UpdateAppProfileRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAppProfileRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents an UpdateAppProfileRequest. */ + class UpdateAppProfileRequest implements IUpdateAppProfileRequest { + + /** + * Constructs a new UpdateAppProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateAppProfileRequest); + + /** UpdateAppProfileRequest appProfile. */ + public appProfile?: (google.bigtable.admin.v2.IAppProfile|null); + + /** UpdateAppProfileRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAppProfileRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new UpdateAppProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAppProfileRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateAppProfileRequest): google.bigtable.admin.v2.UpdateAppProfileRequest; + + /** + * Encodes the specified UpdateAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileRequest.verify|verify} messages. + * @param message UpdateAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileRequest.verify|verify} messages. + * @param message UpdateAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAppProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateAppProfileRequest; + + /** + * Decodes an UpdateAppProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateAppProfileRequest; + + /** + * Verifies an UpdateAppProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAppProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateAppProfileRequest; + + /** + * Creates a plain object from an UpdateAppProfileRequest message. Also converts values to other types if specified. + * @param message UpdateAppProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAppProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAppProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAppProfileRequest. */ + interface IDeleteAppProfileRequest { + + /** DeleteAppProfileRequest name */ + name?: (string|null); + + /** DeleteAppProfileRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents a DeleteAppProfileRequest. */ + class DeleteAppProfileRequest implements IDeleteAppProfileRequest { + + /** + * Constructs a new DeleteAppProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteAppProfileRequest); + + /** DeleteAppProfileRequest name. */ + public name: string; + + /** DeleteAppProfileRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new DeleteAppProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAppProfileRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteAppProfileRequest): google.bigtable.admin.v2.DeleteAppProfileRequest; + + /** + * Encodes the specified DeleteAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteAppProfileRequest.verify|verify} messages. + * @param message DeleteAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteAppProfileRequest.verify|verify} messages. + * @param message DeleteAppProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAppProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteAppProfileRequest; + + /** + * Decodes a DeleteAppProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteAppProfileRequest; + + /** + * Verifies a DeleteAppProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAppProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteAppProfileRequest; + + /** + * Creates a plain object from a DeleteAppProfileRequest message. Also converts values to other types if specified. + * @param message DeleteAppProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAppProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAppProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAppProfileMetadata. */ + interface IUpdateAppProfileMetadata { + } + + /** Represents an UpdateAppProfileMetadata. */ + class UpdateAppProfileMetadata implements IUpdateAppProfileMetadata { + + /** + * Constructs a new UpdateAppProfileMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateAppProfileMetadata); + + /** + * Creates a new UpdateAppProfileMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAppProfileMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateAppProfileMetadata): google.bigtable.admin.v2.UpdateAppProfileMetadata; + + /** + * Encodes the specified UpdateAppProfileMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileMetadata.verify|verify} messages. + * @param message UpdateAppProfileMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateAppProfileMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAppProfileMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileMetadata.verify|verify} messages. + * @param message UpdateAppProfileMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateAppProfileMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAppProfileMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAppProfileMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateAppProfileMetadata; + + /** + * Decodes an UpdateAppProfileMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAppProfileMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateAppProfileMetadata; + + /** + * Verifies an UpdateAppProfileMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAppProfileMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAppProfileMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateAppProfileMetadata; + + /** + * Creates a plain object from an UpdateAppProfileMetadata message. Also converts values to other types if specified. + * @param message UpdateAppProfileMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateAppProfileMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAppProfileMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAppProfileMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListHotTabletsRequest. */ + interface IListHotTabletsRequest { + + /** ListHotTabletsRequest parent */ + parent?: (string|null); + + /** ListHotTabletsRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ListHotTabletsRequest endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ListHotTabletsRequest pageSize */ + pageSize?: (number|null); + + /** ListHotTabletsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListHotTabletsRequest. */ + class ListHotTabletsRequest implements IListHotTabletsRequest { + + /** + * Constructs a new ListHotTabletsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListHotTabletsRequest); + + /** ListHotTabletsRequest parent. */ + public parent: string; + + /** ListHotTabletsRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ListHotTabletsRequest endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ListHotTabletsRequest pageSize. */ + public pageSize: number; + + /** ListHotTabletsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListHotTabletsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHotTabletsRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListHotTabletsRequest): google.bigtable.admin.v2.ListHotTabletsRequest; + + /** + * Encodes the specified ListHotTabletsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsRequest.verify|verify} messages. + * @param message ListHotTabletsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListHotTabletsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHotTabletsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsRequest.verify|verify} messages. + * @param message ListHotTabletsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListHotTabletsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHotTabletsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHotTabletsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListHotTabletsRequest; + + /** + * Decodes a ListHotTabletsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHotTabletsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListHotTabletsRequest; + + /** + * Verifies a ListHotTabletsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHotTabletsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHotTabletsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListHotTabletsRequest; + + /** + * Creates a plain object from a ListHotTabletsRequest message. Also converts values to other types if specified. + * @param message ListHotTabletsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListHotTabletsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHotTabletsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListHotTabletsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListHotTabletsResponse. */ + interface IListHotTabletsResponse { + + /** ListHotTabletsResponse hotTablets */ + hotTablets?: (google.bigtable.admin.v2.IHotTablet[]|null); + + /** ListHotTabletsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListHotTabletsResponse. */ + class ListHotTabletsResponse implements IListHotTabletsResponse { + + /** + * Constructs a new ListHotTabletsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListHotTabletsResponse); + + /** ListHotTabletsResponse hotTablets. */ + public hotTablets: google.bigtable.admin.v2.IHotTablet[]; + + /** ListHotTabletsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListHotTabletsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHotTabletsResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListHotTabletsResponse): google.bigtable.admin.v2.ListHotTabletsResponse; + + /** + * Encodes the specified ListHotTabletsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsResponse.verify|verify} messages. + * @param message ListHotTabletsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListHotTabletsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHotTabletsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsResponse.verify|verify} messages. + * @param message ListHotTabletsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListHotTabletsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHotTabletsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHotTabletsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListHotTabletsResponse; + + /** + * Decodes a ListHotTabletsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHotTabletsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListHotTabletsResponse; + + /** + * Verifies a ListHotTabletsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHotTabletsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHotTabletsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListHotTabletsResponse; + + /** + * Creates a plain object from a ListHotTabletsResponse message. Also converts values to other types if specified. + * @param message ListHotTabletsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListHotTabletsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHotTabletsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListHotTabletsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateLogicalViewRequest. */ + interface ICreateLogicalViewRequest { + + /** CreateLogicalViewRequest parent */ + parent?: (string|null); + + /** CreateLogicalViewRequest logicalViewId */ + logicalViewId?: (string|null); + + /** CreateLogicalViewRequest logicalView */ + logicalView?: (google.bigtable.admin.v2.ILogicalView|null); + } + + /** Represents a CreateLogicalViewRequest. */ + class CreateLogicalViewRequest implements ICreateLogicalViewRequest { + + /** + * Constructs a new CreateLogicalViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateLogicalViewRequest); + + /** CreateLogicalViewRequest parent. */ + public parent: string; + + /** CreateLogicalViewRequest logicalViewId. */ + public logicalViewId: string; + + /** CreateLogicalViewRequest logicalView. */ + public logicalView?: (google.bigtable.admin.v2.ILogicalView|null); + + /** + * Creates a new CreateLogicalViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateLogicalViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateLogicalViewRequest): google.bigtable.admin.v2.CreateLogicalViewRequest; + + /** + * Encodes the specified CreateLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewRequest.verify|verify} messages. + * @param message CreateLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewRequest.verify|verify} messages. + * @param message CreateLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateLogicalViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateLogicalViewRequest; + + /** + * Decodes a CreateLogicalViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateLogicalViewRequest; + + /** + * Verifies a CreateLogicalViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateLogicalViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateLogicalViewRequest; + + /** + * Creates a plain object from a CreateLogicalViewRequest message. Also converts values to other types if specified. + * @param message CreateLogicalViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateLogicalViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateLogicalViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateLogicalViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateLogicalViewMetadata. */ + interface ICreateLogicalViewMetadata { + + /** CreateLogicalViewMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateLogicalViewRequest|null); + + /** CreateLogicalViewMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CreateLogicalViewMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateLogicalViewMetadata. */ + class CreateLogicalViewMetadata implements ICreateLogicalViewMetadata { + + /** + * Constructs a new CreateLogicalViewMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateLogicalViewMetadata); + + /** CreateLogicalViewMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateLogicalViewRequest|null); + + /** CreateLogicalViewMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CreateLogicalViewMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateLogicalViewMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateLogicalViewMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateLogicalViewMetadata): google.bigtable.admin.v2.CreateLogicalViewMetadata; + + /** + * Encodes the specified CreateLogicalViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewMetadata.verify|verify} messages. + * @param message CreateLogicalViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateLogicalViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateLogicalViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewMetadata.verify|verify} messages. + * @param message CreateLogicalViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateLogicalViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateLogicalViewMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateLogicalViewMetadata; + + /** + * Decodes a CreateLogicalViewMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateLogicalViewMetadata; + + /** + * Verifies a CreateLogicalViewMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateLogicalViewMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateLogicalViewMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateLogicalViewMetadata; + + /** + * Creates a plain object from a CreateLogicalViewMetadata message. Also converts values to other types if specified. + * @param message CreateLogicalViewMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateLogicalViewMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateLogicalViewMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateLogicalViewMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetLogicalViewRequest. */ + interface IGetLogicalViewRequest { + + /** GetLogicalViewRequest name */ + name?: (string|null); + } + + /** Represents a GetLogicalViewRequest. */ + class GetLogicalViewRequest implements IGetLogicalViewRequest { + + /** + * Constructs a new GetLogicalViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetLogicalViewRequest); + + /** GetLogicalViewRequest name. */ + public name: string; + + /** + * Creates a new GetLogicalViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetLogicalViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetLogicalViewRequest): google.bigtable.admin.v2.GetLogicalViewRequest; + + /** + * Encodes the specified GetLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetLogicalViewRequest.verify|verify} messages. + * @param message GetLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetLogicalViewRequest.verify|verify} messages. + * @param message GetLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetLogicalViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetLogicalViewRequest; + + /** + * Decodes a GetLogicalViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetLogicalViewRequest; + + /** + * Verifies a GetLogicalViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetLogicalViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetLogicalViewRequest; + + /** + * Creates a plain object from a GetLogicalViewRequest message. Also converts values to other types if specified. + * @param message GetLogicalViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetLogicalViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetLogicalViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetLogicalViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLogicalViewsRequest. */ + interface IListLogicalViewsRequest { + + /** ListLogicalViewsRequest parent */ + parent?: (string|null); + + /** ListLogicalViewsRequest pageSize */ + pageSize?: (number|null); + + /** ListLogicalViewsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListLogicalViewsRequest. */ + class ListLogicalViewsRequest implements IListLogicalViewsRequest { + + /** + * Constructs a new ListLogicalViewsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListLogicalViewsRequest); + + /** ListLogicalViewsRequest parent. */ + public parent: string; + + /** ListLogicalViewsRequest pageSize. */ + public pageSize: number; + + /** ListLogicalViewsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListLogicalViewsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLogicalViewsRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListLogicalViewsRequest): google.bigtable.admin.v2.ListLogicalViewsRequest; + + /** + * Encodes the specified ListLogicalViewsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsRequest.verify|verify} messages. + * @param message ListLogicalViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListLogicalViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLogicalViewsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsRequest.verify|verify} messages. + * @param message ListLogicalViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListLogicalViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLogicalViewsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLogicalViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListLogicalViewsRequest; + + /** + * Decodes a ListLogicalViewsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLogicalViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListLogicalViewsRequest; + + /** + * Verifies a ListLogicalViewsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListLogicalViewsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLogicalViewsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListLogicalViewsRequest; + + /** + * Creates a plain object from a ListLogicalViewsRequest message. Also converts values to other types if specified. + * @param message ListLogicalViewsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListLogicalViewsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLogicalViewsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLogicalViewsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLogicalViewsResponse. */ + interface IListLogicalViewsResponse { + + /** ListLogicalViewsResponse logicalViews */ + logicalViews?: (google.bigtable.admin.v2.ILogicalView[]|null); + + /** ListLogicalViewsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListLogicalViewsResponse. */ + class ListLogicalViewsResponse implements IListLogicalViewsResponse { + + /** + * Constructs a new ListLogicalViewsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListLogicalViewsResponse); + + /** ListLogicalViewsResponse logicalViews. */ + public logicalViews: google.bigtable.admin.v2.ILogicalView[]; + + /** ListLogicalViewsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListLogicalViewsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLogicalViewsResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListLogicalViewsResponse): google.bigtable.admin.v2.ListLogicalViewsResponse; + + /** + * Encodes the specified ListLogicalViewsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsResponse.verify|verify} messages. + * @param message ListLogicalViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListLogicalViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLogicalViewsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsResponse.verify|verify} messages. + * @param message ListLogicalViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListLogicalViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLogicalViewsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLogicalViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListLogicalViewsResponse; + + /** + * Decodes a ListLogicalViewsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLogicalViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListLogicalViewsResponse; + + /** + * Verifies a ListLogicalViewsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListLogicalViewsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLogicalViewsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListLogicalViewsResponse; + + /** + * Creates a plain object from a ListLogicalViewsResponse message. Also converts values to other types if specified. + * @param message ListLogicalViewsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListLogicalViewsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLogicalViewsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLogicalViewsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateLogicalViewRequest. */ + interface IUpdateLogicalViewRequest { + + /** UpdateLogicalViewRequest logicalView */ + logicalView?: (google.bigtable.admin.v2.ILogicalView|null); + + /** UpdateLogicalViewRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateLogicalViewRequest. */ + class UpdateLogicalViewRequest implements IUpdateLogicalViewRequest { + + /** + * Constructs a new UpdateLogicalViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateLogicalViewRequest); + + /** UpdateLogicalViewRequest logicalView. */ + public logicalView?: (google.bigtable.admin.v2.ILogicalView|null); + + /** UpdateLogicalViewRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateLogicalViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateLogicalViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateLogicalViewRequest): google.bigtable.admin.v2.UpdateLogicalViewRequest; + + /** + * Encodes the specified UpdateLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewRequest.verify|verify} messages. + * @param message UpdateLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewRequest.verify|verify} messages. + * @param message UpdateLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateLogicalViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateLogicalViewRequest; + + /** + * Decodes an UpdateLogicalViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateLogicalViewRequest; + + /** + * Verifies an UpdateLogicalViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateLogicalViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateLogicalViewRequest; + + /** + * Creates a plain object from an UpdateLogicalViewRequest message. Also converts values to other types if specified. + * @param message UpdateLogicalViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateLogicalViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateLogicalViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateLogicalViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateLogicalViewMetadata. */ + interface IUpdateLogicalViewMetadata { + + /** UpdateLogicalViewMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.IUpdateLogicalViewRequest|null); + + /** UpdateLogicalViewMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateLogicalViewMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateLogicalViewMetadata. */ + class UpdateLogicalViewMetadata implements IUpdateLogicalViewMetadata { + + /** + * Constructs a new UpdateLogicalViewMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateLogicalViewMetadata); + + /** UpdateLogicalViewMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.IUpdateLogicalViewRequest|null); + + /** UpdateLogicalViewMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateLogicalViewMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateLogicalViewMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateLogicalViewMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateLogicalViewMetadata): google.bigtable.admin.v2.UpdateLogicalViewMetadata; + + /** + * Encodes the specified UpdateLogicalViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewMetadata.verify|verify} messages. + * @param message UpdateLogicalViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateLogicalViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateLogicalViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewMetadata.verify|verify} messages. + * @param message UpdateLogicalViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateLogicalViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateLogicalViewMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateLogicalViewMetadata; + + /** + * Decodes an UpdateLogicalViewMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateLogicalViewMetadata; + + /** + * Verifies an UpdateLogicalViewMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateLogicalViewMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateLogicalViewMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateLogicalViewMetadata; + + /** + * Creates a plain object from an UpdateLogicalViewMetadata message. Also converts values to other types if specified. + * @param message UpdateLogicalViewMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateLogicalViewMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateLogicalViewMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateLogicalViewMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteLogicalViewRequest. */ + interface IDeleteLogicalViewRequest { + + /** DeleteLogicalViewRequest name */ + name?: (string|null); + + /** DeleteLogicalViewRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteLogicalViewRequest. */ + class DeleteLogicalViewRequest implements IDeleteLogicalViewRequest { + + /** + * Constructs a new DeleteLogicalViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteLogicalViewRequest); + + /** DeleteLogicalViewRequest name. */ + public name: string; + + /** DeleteLogicalViewRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteLogicalViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteLogicalViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteLogicalViewRequest): google.bigtable.admin.v2.DeleteLogicalViewRequest; + + /** + * Encodes the specified DeleteLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteLogicalViewRequest.verify|verify} messages. + * @param message DeleteLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteLogicalViewRequest.verify|verify} messages. + * @param message DeleteLogicalViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteLogicalViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteLogicalViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteLogicalViewRequest; + + /** + * Decodes a DeleteLogicalViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteLogicalViewRequest; + + /** + * Verifies a DeleteLogicalViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteLogicalViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteLogicalViewRequest; + + /** + * Creates a plain object from a DeleteLogicalViewRequest message. Also converts values to other types if specified. + * @param message DeleteLogicalViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteLogicalViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteLogicalViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteLogicalViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMaterializedViewRequest. */ + interface ICreateMaterializedViewRequest { + + /** CreateMaterializedViewRequest parent */ + parent?: (string|null); + + /** CreateMaterializedViewRequest materializedViewId */ + materializedViewId?: (string|null); + + /** CreateMaterializedViewRequest materializedView */ + materializedView?: (google.bigtable.admin.v2.IMaterializedView|null); + } + + /** Represents a CreateMaterializedViewRequest. */ + class CreateMaterializedViewRequest implements ICreateMaterializedViewRequest { + + /** + * Constructs a new CreateMaterializedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateMaterializedViewRequest); + + /** CreateMaterializedViewRequest parent. */ + public parent: string; + + /** CreateMaterializedViewRequest materializedViewId. */ + public materializedViewId: string; + + /** CreateMaterializedViewRequest materializedView. */ + public materializedView?: (google.bigtable.admin.v2.IMaterializedView|null); + + /** + * Creates a new CreateMaterializedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMaterializedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateMaterializedViewRequest): google.bigtable.admin.v2.CreateMaterializedViewRequest; + + /** + * Encodes the specified CreateMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewRequest.verify|verify} messages. + * @param message CreateMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewRequest.verify|verify} messages. + * @param message CreateMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMaterializedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateMaterializedViewRequest; + + /** + * Decodes a CreateMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateMaterializedViewRequest; + + /** + * Verifies a CreateMaterializedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMaterializedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateMaterializedViewRequest; + + /** + * Creates a plain object from a CreateMaterializedViewRequest message. Also converts values to other types if specified. + * @param message CreateMaterializedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateMaterializedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMaterializedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMaterializedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMaterializedViewMetadata. */ + interface ICreateMaterializedViewMetadata { + + /** CreateMaterializedViewMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateMaterializedViewRequest|null); + + /** CreateMaterializedViewMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CreateMaterializedViewMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateMaterializedViewMetadata. */ + class CreateMaterializedViewMetadata implements ICreateMaterializedViewMetadata { + + /** + * Constructs a new CreateMaterializedViewMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateMaterializedViewMetadata); + + /** CreateMaterializedViewMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateMaterializedViewRequest|null); + + /** CreateMaterializedViewMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CreateMaterializedViewMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateMaterializedViewMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMaterializedViewMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateMaterializedViewMetadata): google.bigtable.admin.v2.CreateMaterializedViewMetadata; + + /** + * Encodes the specified CreateMaterializedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewMetadata.verify|verify} messages. + * @param message CreateMaterializedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateMaterializedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMaterializedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewMetadata.verify|verify} messages. + * @param message CreateMaterializedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateMaterializedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMaterializedViewMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateMaterializedViewMetadata; + + /** + * Decodes a CreateMaterializedViewMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateMaterializedViewMetadata; + + /** + * Verifies a CreateMaterializedViewMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMaterializedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMaterializedViewMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateMaterializedViewMetadata; + + /** + * Creates a plain object from a CreateMaterializedViewMetadata message. Also converts values to other types if specified. + * @param message CreateMaterializedViewMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateMaterializedViewMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMaterializedViewMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMaterializedViewMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMaterializedViewRequest. */ + interface IGetMaterializedViewRequest { + + /** GetMaterializedViewRequest name */ + name?: (string|null); + } + + /** Represents a GetMaterializedViewRequest. */ + class GetMaterializedViewRequest implements IGetMaterializedViewRequest { + + /** + * Constructs a new GetMaterializedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetMaterializedViewRequest); + + /** GetMaterializedViewRequest name. */ + public name: string; + + /** + * Creates a new GetMaterializedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMaterializedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetMaterializedViewRequest): google.bigtable.admin.v2.GetMaterializedViewRequest; + + /** + * Encodes the specified GetMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetMaterializedViewRequest.verify|verify} messages. + * @param message GetMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetMaterializedViewRequest.verify|verify} messages. + * @param message GetMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMaterializedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetMaterializedViewRequest; + + /** + * Decodes a GetMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetMaterializedViewRequest; + + /** + * Verifies a GetMaterializedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMaterializedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetMaterializedViewRequest; + + /** + * Creates a plain object from a GetMaterializedViewRequest message. Also converts values to other types if specified. + * @param message GetMaterializedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetMaterializedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMaterializedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMaterializedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMaterializedViewsRequest. */ + interface IListMaterializedViewsRequest { + + /** ListMaterializedViewsRequest parent */ + parent?: (string|null); + + /** ListMaterializedViewsRequest pageSize */ + pageSize?: (number|null); + + /** ListMaterializedViewsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListMaterializedViewsRequest. */ + class ListMaterializedViewsRequest implements IListMaterializedViewsRequest { + + /** + * Constructs a new ListMaterializedViewsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListMaterializedViewsRequest); + + /** ListMaterializedViewsRequest parent. */ + public parent: string; + + /** ListMaterializedViewsRequest pageSize. */ + public pageSize: number; + + /** ListMaterializedViewsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListMaterializedViewsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMaterializedViewsRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListMaterializedViewsRequest): google.bigtable.admin.v2.ListMaterializedViewsRequest; + + /** + * Encodes the specified ListMaterializedViewsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsRequest.verify|verify} messages. + * @param message ListMaterializedViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListMaterializedViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMaterializedViewsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsRequest.verify|verify} messages. + * @param message ListMaterializedViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListMaterializedViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMaterializedViewsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMaterializedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListMaterializedViewsRequest; + + /** + * Decodes a ListMaterializedViewsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMaterializedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListMaterializedViewsRequest; + + /** + * Verifies a ListMaterializedViewsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMaterializedViewsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMaterializedViewsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListMaterializedViewsRequest; + + /** + * Creates a plain object from a ListMaterializedViewsRequest message. Also converts values to other types if specified. + * @param message ListMaterializedViewsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListMaterializedViewsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMaterializedViewsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMaterializedViewsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMaterializedViewsResponse. */ + interface IListMaterializedViewsResponse { + + /** ListMaterializedViewsResponse materializedViews */ + materializedViews?: (google.bigtable.admin.v2.IMaterializedView[]|null); + + /** ListMaterializedViewsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMaterializedViewsResponse. */ + class ListMaterializedViewsResponse implements IListMaterializedViewsResponse { + + /** + * Constructs a new ListMaterializedViewsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListMaterializedViewsResponse); + + /** ListMaterializedViewsResponse materializedViews. */ + public materializedViews: google.bigtable.admin.v2.IMaterializedView[]; + + /** ListMaterializedViewsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMaterializedViewsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMaterializedViewsResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListMaterializedViewsResponse): google.bigtable.admin.v2.ListMaterializedViewsResponse; + + /** + * Encodes the specified ListMaterializedViewsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsResponse.verify|verify} messages. + * @param message ListMaterializedViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListMaterializedViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMaterializedViewsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsResponse.verify|verify} messages. + * @param message ListMaterializedViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListMaterializedViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMaterializedViewsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMaterializedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListMaterializedViewsResponse; + + /** + * Decodes a ListMaterializedViewsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMaterializedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListMaterializedViewsResponse; + + /** + * Verifies a ListMaterializedViewsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMaterializedViewsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMaterializedViewsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListMaterializedViewsResponse; + + /** + * Creates a plain object from a ListMaterializedViewsResponse message. Also converts values to other types if specified. + * @param message ListMaterializedViewsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListMaterializedViewsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMaterializedViewsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMaterializedViewsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMaterializedViewRequest. */ + interface IUpdateMaterializedViewRequest { + + /** UpdateMaterializedViewRequest materializedView */ + materializedView?: (google.bigtable.admin.v2.IMaterializedView|null); + + /** UpdateMaterializedViewRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateMaterializedViewRequest. */ + class UpdateMaterializedViewRequest implements IUpdateMaterializedViewRequest { + + /** + * Constructs a new UpdateMaterializedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateMaterializedViewRequest); + + /** UpdateMaterializedViewRequest materializedView. */ + public materializedView?: (google.bigtable.admin.v2.IMaterializedView|null); + + /** UpdateMaterializedViewRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateMaterializedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMaterializedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateMaterializedViewRequest): google.bigtable.admin.v2.UpdateMaterializedViewRequest; + + /** + * Encodes the specified UpdateMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewRequest.verify|verify} messages. + * @param message UpdateMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewRequest.verify|verify} messages. + * @param message UpdateMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMaterializedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateMaterializedViewRequest; + + /** + * Decodes an UpdateMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateMaterializedViewRequest; + + /** + * Verifies an UpdateMaterializedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMaterializedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateMaterializedViewRequest; + + /** + * Creates a plain object from an UpdateMaterializedViewRequest message. Also converts values to other types if specified. + * @param message UpdateMaterializedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateMaterializedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMaterializedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMaterializedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMaterializedViewMetadata. */ + interface IUpdateMaterializedViewMetadata { + + /** UpdateMaterializedViewMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.IUpdateMaterializedViewRequest|null); + + /** UpdateMaterializedViewMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateMaterializedViewMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateMaterializedViewMetadata. */ + class UpdateMaterializedViewMetadata implements IUpdateMaterializedViewMetadata { + + /** + * Constructs a new UpdateMaterializedViewMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateMaterializedViewMetadata); + + /** UpdateMaterializedViewMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.IUpdateMaterializedViewRequest|null); + + /** UpdateMaterializedViewMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateMaterializedViewMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateMaterializedViewMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMaterializedViewMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateMaterializedViewMetadata): google.bigtable.admin.v2.UpdateMaterializedViewMetadata; + + /** + * Encodes the specified UpdateMaterializedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewMetadata.verify|verify} messages. + * @param message UpdateMaterializedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateMaterializedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMaterializedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewMetadata.verify|verify} messages. + * @param message UpdateMaterializedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateMaterializedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMaterializedViewMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateMaterializedViewMetadata; + + /** + * Decodes an UpdateMaterializedViewMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateMaterializedViewMetadata; + + /** + * Verifies an UpdateMaterializedViewMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateMaterializedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMaterializedViewMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateMaterializedViewMetadata; + + /** + * Creates a plain object from an UpdateMaterializedViewMetadata message. Also converts values to other types if specified. + * @param message UpdateMaterializedViewMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateMaterializedViewMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMaterializedViewMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMaterializedViewMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMaterializedViewRequest. */ + interface IDeleteMaterializedViewRequest { + + /** DeleteMaterializedViewRequest name */ + name?: (string|null); + + /** DeleteMaterializedViewRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteMaterializedViewRequest. */ + class DeleteMaterializedViewRequest implements IDeleteMaterializedViewRequest { + + /** + * Constructs a new DeleteMaterializedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteMaterializedViewRequest); + + /** DeleteMaterializedViewRequest name. */ + public name: string; + + /** DeleteMaterializedViewRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteMaterializedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMaterializedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteMaterializedViewRequest): google.bigtable.admin.v2.DeleteMaterializedViewRequest; + + /** + * Encodes the specified DeleteMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteMaterializedViewRequest.verify|verify} messages. + * @param message DeleteMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteMaterializedViewRequest.verify|verify} messages. + * @param message DeleteMaterializedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteMaterializedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMaterializedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteMaterializedViewRequest; + + /** + * Decodes a DeleteMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteMaterializedViewRequest; + + /** + * Verifies a DeleteMaterializedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMaterializedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteMaterializedViewRequest; + + /** + * Creates a plain object from a DeleteMaterializedViewRequest message. Also converts values to other types if specified. + * @param message DeleteMaterializedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteMaterializedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMaterializedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMaterializedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance state */ + state?: (google.bigtable.admin.v2.Instance.State|keyof typeof google.bigtable.admin.v2.Instance.State|null); + + /** Instance type */ + type?: (google.bigtable.admin.v2.Instance.Type|keyof typeof google.bigtable.admin.v2.Instance.Type|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Instance satisfiesPzi */ + satisfiesPzi?: (boolean|null); + + /** Instance tags */ + tags?: ({ [k: string]: string }|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance state. */ + public state: (google.bigtable.admin.v2.Instance.State|keyof typeof google.bigtable.admin.v2.Instance.State); + + /** Instance type. */ + public type: (google.bigtable.admin.v2.Instance.Type|keyof typeof google.bigtable.admin.v2.Instance.Type); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance satisfiesPzs. */ + public satisfiesPzs?: (boolean|null); + + /** Instance satisfiesPzi. */ + public satisfiesPzi?: (boolean|null); + + /** Instance tags. */ + public tags: { [k: string]: string }; + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.bigtable.admin.v2.IInstance): google.bigtable.admin.v2.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.bigtable.admin.v2.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** State enum. */ + enum State { + STATE_NOT_KNOWN = 0, + READY = 1, + CREATING = 2 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + PRODUCTION = 1, + DEVELOPMENT = 2 + } + } + + /** Properties of an AutoscalingTargets. */ + interface IAutoscalingTargets { + + /** AutoscalingTargets cpuUtilizationPercent */ + cpuUtilizationPercent?: (number|null); + + /** AutoscalingTargets storageUtilizationGibPerNode */ + storageUtilizationGibPerNode?: (number|null); + } + + /** Represents an AutoscalingTargets. */ + class AutoscalingTargets implements IAutoscalingTargets { + + /** + * Constructs a new AutoscalingTargets. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IAutoscalingTargets); + + /** AutoscalingTargets cpuUtilizationPercent. */ + public cpuUtilizationPercent: number; + + /** AutoscalingTargets storageUtilizationGibPerNode. */ + public storageUtilizationGibPerNode: number; + + /** + * Creates a new AutoscalingTargets instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingTargets instance + */ + public static create(properties?: google.bigtable.admin.v2.IAutoscalingTargets): google.bigtable.admin.v2.AutoscalingTargets; + + /** + * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingTargets.verify|verify} messages. + * @param message AutoscalingTargets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingTargets.verify|verify} messages. + * @param message AutoscalingTargets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AutoscalingTargets; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AutoscalingTargets; + + /** + * Verifies an AutoscalingTargets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingTargets + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AutoscalingTargets; + + /** + * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. + * @param message AutoscalingTargets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AutoscalingTargets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingTargets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingTargets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoscalingLimits. */ + interface IAutoscalingLimits { + + /** AutoscalingLimits minServeNodes */ + minServeNodes?: (number|null); + + /** AutoscalingLimits maxServeNodes */ + maxServeNodes?: (number|null); + } + + /** Represents an AutoscalingLimits. */ + class AutoscalingLimits implements IAutoscalingLimits { + + /** + * Constructs a new AutoscalingLimits. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IAutoscalingLimits); + + /** AutoscalingLimits minServeNodes. */ + public minServeNodes: number; + + /** AutoscalingLimits maxServeNodes. */ + public maxServeNodes: number; + + /** + * Creates a new AutoscalingLimits instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingLimits instance + */ + public static create(properties?: google.bigtable.admin.v2.IAutoscalingLimits): google.bigtable.admin.v2.AutoscalingLimits; + + /** + * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingLimits.verify|verify} messages. + * @param message AutoscalingLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingLimits.verify|verify} messages. + * @param message AutoscalingLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AutoscalingLimits; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AutoscalingLimits; + + /** + * Verifies an AutoscalingLimits message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingLimits + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AutoscalingLimits; + + /** + * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. + * @param message AutoscalingLimits + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AutoscalingLimits, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingLimits to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingLimits + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cluster. */ + interface ICluster { + + /** Cluster name */ + name?: (string|null); + + /** Cluster location */ + location?: (string|null); + + /** Cluster state */ + state?: (google.bigtable.admin.v2.Cluster.State|keyof typeof google.bigtable.admin.v2.Cluster.State|null); + + /** Cluster serveNodes */ + serveNodes?: (number|null); + + /** Cluster nodeScalingFactor */ + nodeScalingFactor?: (google.bigtable.admin.v2.Cluster.NodeScalingFactor|keyof typeof google.bigtable.admin.v2.Cluster.NodeScalingFactor|null); + + /** Cluster clusterConfig */ + clusterConfig?: (google.bigtable.admin.v2.Cluster.IClusterConfig|null); + + /** Cluster defaultStorageType */ + defaultStorageType?: (google.bigtable.admin.v2.StorageType|keyof typeof google.bigtable.admin.v2.StorageType|null); + + /** Cluster encryptionConfig */ + encryptionConfig?: (google.bigtable.admin.v2.Cluster.IEncryptionConfig|null); + } + + /** Represents a Cluster. */ + class Cluster implements ICluster { + + /** + * Constructs a new Cluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICluster); + + /** Cluster name. */ + public name: string; + + /** Cluster location. */ + public location: string; + + /** Cluster state. */ + public state: (google.bigtable.admin.v2.Cluster.State|keyof typeof google.bigtable.admin.v2.Cluster.State); + + /** Cluster serveNodes. */ + public serveNodes: number; + + /** Cluster nodeScalingFactor. */ + public nodeScalingFactor: (google.bigtable.admin.v2.Cluster.NodeScalingFactor|keyof typeof google.bigtable.admin.v2.Cluster.NodeScalingFactor); + + /** Cluster clusterConfig. */ + public clusterConfig?: (google.bigtable.admin.v2.Cluster.IClusterConfig|null); + + /** Cluster defaultStorageType. */ + public defaultStorageType: (google.bigtable.admin.v2.StorageType|keyof typeof google.bigtable.admin.v2.StorageType); + + /** Cluster encryptionConfig. */ + public encryptionConfig?: (google.bigtable.admin.v2.Cluster.IEncryptionConfig|null); + + /** Cluster config. */ + public config?: "clusterConfig"; + + /** + * Creates a new Cluster instance using the specified properties. + * @param [properties] Properties to set + * @returns Cluster instance + */ + public static create(properties?: google.bigtable.admin.v2.ICluster): google.bigtable.admin.v2.Cluster; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Cluster; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Cluster; + + /** + * Verifies a Cluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cluster + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Cluster; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @param message Cluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Cluster { + + /** State enum. */ + enum State { + STATE_NOT_KNOWN = 0, + READY = 1, + CREATING = 2, + RESIZING = 3, + DISABLED = 4 + } + + /** NodeScalingFactor enum. */ + enum NodeScalingFactor { + NODE_SCALING_FACTOR_UNSPECIFIED = 0, + NODE_SCALING_FACTOR_1X = 1, + NODE_SCALING_FACTOR_2X = 2 + } + + /** Properties of a ClusterAutoscalingConfig. */ + interface IClusterAutoscalingConfig { + + /** ClusterAutoscalingConfig autoscalingLimits */ + autoscalingLimits?: (google.bigtable.admin.v2.IAutoscalingLimits|null); + + /** ClusterAutoscalingConfig autoscalingTargets */ + autoscalingTargets?: (google.bigtable.admin.v2.IAutoscalingTargets|null); + } + + /** Represents a ClusterAutoscalingConfig. */ + class ClusterAutoscalingConfig implements IClusterAutoscalingConfig { + + /** + * Constructs a new ClusterAutoscalingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig); + + /** ClusterAutoscalingConfig autoscalingLimits. */ + public autoscalingLimits?: (google.bigtable.admin.v2.IAutoscalingLimits|null); + + /** ClusterAutoscalingConfig autoscalingTargets. */ + public autoscalingTargets?: (google.bigtable.admin.v2.IAutoscalingTargets|null); + + /** + * Creates a new ClusterAutoscalingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterAutoscalingConfig instance + */ + public static create(properties?: google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig): google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig; + + /** + * Encodes the specified ClusterAutoscalingConfig message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.verify|verify} messages. + * @param message ClusterAutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterAutoscalingConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.verify|verify} messages. + * @param message ClusterAutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterAutoscalingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig; + + /** + * Decodes a ClusterAutoscalingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig; + + /** + * Verifies a ClusterAutoscalingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterAutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterAutoscalingConfig + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig; + + /** + * Creates a plain object from a ClusterAutoscalingConfig message. Also converts values to other types if specified. + * @param message ClusterAutoscalingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterAutoscalingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterAutoscalingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClusterConfig. */ + interface IClusterConfig { + + /** ClusterConfig clusterAutoscalingConfig */ + clusterAutoscalingConfig?: (google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig|null); + } + + /** Represents a ClusterConfig. */ + class ClusterConfig implements IClusterConfig { + + /** + * Constructs a new ClusterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Cluster.IClusterConfig); + + /** ClusterConfig clusterAutoscalingConfig. */ + public clusterAutoscalingConfig?: (google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig|null); + + /** + * Creates a new ClusterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterConfig instance + */ + public static create(properties?: google.bigtable.admin.v2.Cluster.IClusterConfig): google.bigtable.admin.v2.Cluster.ClusterConfig; + + /** + * Encodes the specified ClusterConfig message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterConfig.verify|verify} messages. + * @param message ClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Cluster.IClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterConfig.verify|verify} messages. + * @param message ClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Cluster.IClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Cluster.ClusterConfig; + + /** + * Decodes a ClusterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Cluster.ClusterConfig; + + /** + * Verifies a ClusterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterConfig + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Cluster.ClusterConfig; + + /** + * Creates a plain object from a ClusterConfig message. Also converts values to other types if specified. + * @param message ClusterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Cluster.ClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { + + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + } + + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { + + /** + * Constructs a new EncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Cluster.IEncryptionConfig); + + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionConfig instance + */ + public static create(properties?: google.bigtable.admin.v2.Cluster.IEncryptionConfig): google.bigtable.admin.v2.Cluster.EncryptionConfig; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Cluster.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Cluster.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Cluster.EncryptionConfig; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Cluster.EncryptionConfig; + + /** + * Verifies an EncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Cluster.EncryptionConfig; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Cluster.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AppProfile. */ + interface IAppProfile { + + /** AppProfile name */ + name?: (string|null); + + /** AppProfile etag */ + etag?: (string|null); + + /** AppProfile description */ + description?: (string|null); + + /** AppProfile multiClusterRoutingUseAny */ + multiClusterRoutingUseAny?: (google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny|null); + + /** AppProfile singleClusterRouting */ + singleClusterRouting?: (google.bigtable.admin.v2.AppProfile.ISingleClusterRouting|null); + + /** AppProfile priority */ + priority?: (google.bigtable.admin.v2.AppProfile.Priority|keyof typeof google.bigtable.admin.v2.AppProfile.Priority|null); + + /** AppProfile standardIsolation */ + standardIsolation?: (google.bigtable.admin.v2.AppProfile.IStandardIsolation|null); + + /** AppProfile dataBoostIsolationReadOnly */ + dataBoostIsolationReadOnly?: (google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly|null); + } + + /** Represents an AppProfile. */ + class AppProfile implements IAppProfile { + + /** + * Constructs a new AppProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IAppProfile); + + /** AppProfile name. */ + public name: string; + + /** AppProfile etag. */ + public etag: string; + + /** AppProfile description. */ + public description: string; + + /** AppProfile multiClusterRoutingUseAny. */ + public multiClusterRoutingUseAny?: (google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny|null); + + /** AppProfile singleClusterRouting. */ + public singleClusterRouting?: (google.bigtable.admin.v2.AppProfile.ISingleClusterRouting|null); + + /** AppProfile priority. */ + public priority?: (google.bigtable.admin.v2.AppProfile.Priority|keyof typeof google.bigtable.admin.v2.AppProfile.Priority|null); + + /** AppProfile standardIsolation. */ + public standardIsolation?: (google.bigtable.admin.v2.AppProfile.IStandardIsolation|null); + + /** AppProfile dataBoostIsolationReadOnly. */ + public dataBoostIsolationReadOnly?: (google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly|null); + + /** AppProfile routingPolicy. */ + public routingPolicy?: ("multiClusterRoutingUseAny"|"singleClusterRouting"); + + /** AppProfile isolation. */ + public isolation?: ("priority"|"standardIsolation"|"dataBoostIsolationReadOnly"); + + /** + * Creates a new AppProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns AppProfile instance + */ + public static create(properties?: google.bigtable.admin.v2.IAppProfile): google.bigtable.admin.v2.AppProfile; + + /** + * Encodes the specified AppProfile message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.verify|verify} messages. + * @param message AppProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IAppProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppProfile message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.verify|verify} messages. + * @param message AppProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IAppProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile; + + /** + * Decodes an AppProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile; + + /** + * Verifies an AppProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppProfile + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile; + + /** + * Creates a plain object from an AppProfile message. Also converts values to other types if specified. + * @param message AppProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AppProfile { + + /** Properties of a MultiClusterRoutingUseAny. */ + interface IMultiClusterRoutingUseAny { + + /** MultiClusterRoutingUseAny clusterIds */ + clusterIds?: (string[]|null); + + /** MultiClusterRoutingUseAny rowAffinity */ + rowAffinity?: (google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity|null); + } + + /** Represents a MultiClusterRoutingUseAny. */ + class MultiClusterRoutingUseAny implements IMultiClusterRoutingUseAny { + + /** + * Constructs a new MultiClusterRoutingUseAny. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny); + + /** MultiClusterRoutingUseAny clusterIds. */ + public clusterIds: string[]; + + /** MultiClusterRoutingUseAny rowAffinity. */ + public rowAffinity?: (google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity|null); + + /** MultiClusterRoutingUseAny affinity. */ + public affinity?: "rowAffinity"; + + /** + * Creates a new MultiClusterRoutingUseAny instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiClusterRoutingUseAny instance + */ + public static create(properties?: google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny; + + /** + * Encodes the specified MultiClusterRoutingUseAny message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.verify|verify} messages. + * @param message MultiClusterRoutingUseAny message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiClusterRoutingUseAny message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.verify|verify} messages. + * @param message MultiClusterRoutingUseAny message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiClusterRoutingUseAny message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiClusterRoutingUseAny + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny; + + /** + * Decodes a MultiClusterRoutingUseAny message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiClusterRoutingUseAny + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny; + + /** + * Verifies a MultiClusterRoutingUseAny message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MultiClusterRoutingUseAny message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiClusterRoutingUseAny + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny; + + /** + * Creates a plain object from a MultiClusterRoutingUseAny message. Also converts values to other types if specified. + * @param message MultiClusterRoutingUseAny + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiClusterRoutingUseAny to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiClusterRoutingUseAny + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MultiClusterRoutingUseAny { + + /** Properties of a RowAffinity. */ + interface IRowAffinity { + } + + /** Represents a RowAffinity. */ + class RowAffinity implements IRowAffinity { + + /** + * Constructs a new RowAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity); + + /** + * Creates a new RowAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns RowAffinity instance + */ + public static create(properties?: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity; + + /** + * Encodes the specified RowAffinity message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify|verify} messages. + * @param message RowAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowAffinity message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify|verify} messages. + * @param message RowAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity; + + /** + * Decodes a RowAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity; + + /** + * Verifies a RowAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowAffinity + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity; + + /** + * Creates a plain object from a RowAffinity message. Also converts values to other types if specified. + * @param message RowAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowAffinity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SingleClusterRouting. */ + interface ISingleClusterRouting { + + /** SingleClusterRouting clusterId */ + clusterId?: (string|null); + + /** SingleClusterRouting allowTransactionalWrites */ + allowTransactionalWrites?: (boolean|null); + } + + /** Represents a SingleClusterRouting. */ + class SingleClusterRouting implements ISingleClusterRouting { + + /** + * Constructs a new SingleClusterRouting. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.ISingleClusterRouting); + + /** SingleClusterRouting clusterId. */ + public clusterId: string; + + /** SingleClusterRouting allowTransactionalWrites. */ + public allowTransactionalWrites: boolean; + + /** + * Creates a new SingleClusterRouting instance using the specified properties. + * @param [properties] Properties to set + * @returns SingleClusterRouting instance + */ + public static create(properties?: google.bigtable.admin.v2.AppProfile.ISingleClusterRouting): google.bigtable.admin.v2.AppProfile.SingleClusterRouting; + + /** + * Encodes the specified SingleClusterRouting message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.SingleClusterRouting.verify|verify} messages. + * @param message SingleClusterRouting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AppProfile.ISingleClusterRouting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SingleClusterRouting message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.SingleClusterRouting.verify|verify} messages. + * @param message SingleClusterRouting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AppProfile.ISingleClusterRouting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SingleClusterRouting message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SingleClusterRouting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile.SingleClusterRouting; + + /** + * Decodes a SingleClusterRouting message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SingleClusterRouting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile.SingleClusterRouting; + + /** + * Verifies a SingleClusterRouting message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SingleClusterRouting message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SingleClusterRouting + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile.SingleClusterRouting; + + /** + * Creates a plain object from a SingleClusterRouting message. Also converts values to other types if specified. + * @param message SingleClusterRouting + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile.SingleClusterRouting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SingleClusterRouting to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SingleClusterRouting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Priority enum. */ + enum Priority { + PRIORITY_UNSPECIFIED = 0, + PRIORITY_LOW = 1, + PRIORITY_MEDIUM = 2, + PRIORITY_HIGH = 3 + } + + /** Properties of a StandardIsolation. */ + interface IStandardIsolation { + + /** StandardIsolation priority */ + priority?: (google.bigtable.admin.v2.AppProfile.Priority|keyof typeof google.bigtable.admin.v2.AppProfile.Priority|null); + } + + /** Represents a StandardIsolation. */ + class StandardIsolation implements IStandardIsolation { + + /** + * Constructs a new StandardIsolation. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.IStandardIsolation); + + /** StandardIsolation priority. */ + public priority: (google.bigtable.admin.v2.AppProfile.Priority|keyof typeof google.bigtable.admin.v2.AppProfile.Priority); + + /** + * Creates a new StandardIsolation instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardIsolation instance + */ + public static create(properties?: google.bigtable.admin.v2.AppProfile.IStandardIsolation): google.bigtable.admin.v2.AppProfile.StandardIsolation; + + /** + * Encodes the specified StandardIsolation message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.StandardIsolation.verify|verify} messages. + * @param message StandardIsolation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AppProfile.IStandardIsolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardIsolation message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.StandardIsolation.verify|verify} messages. + * @param message StandardIsolation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AppProfile.IStandardIsolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardIsolation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardIsolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile.StandardIsolation; + + /** + * Decodes a StandardIsolation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardIsolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile.StandardIsolation; + + /** + * Verifies a StandardIsolation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardIsolation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardIsolation + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile.StandardIsolation; + + /** + * Creates a plain object from a StandardIsolation message. Also converts values to other types if specified. + * @param message StandardIsolation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile.StandardIsolation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardIsolation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardIsolation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataBoostIsolationReadOnly. */ + interface IDataBoostIsolationReadOnly { + + /** DataBoostIsolationReadOnly computeBillingOwner */ + computeBillingOwner?: (google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner|keyof typeof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner|null); + } + + /** Represents a DataBoostIsolationReadOnly. */ + class DataBoostIsolationReadOnly implements IDataBoostIsolationReadOnly { + + /** + * Constructs a new DataBoostIsolationReadOnly. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly); + + /** DataBoostIsolationReadOnly computeBillingOwner. */ + public computeBillingOwner?: (google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner|keyof typeof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner|null); + + /** + * Creates a new DataBoostIsolationReadOnly instance using the specified properties. + * @param [properties] Properties to set + * @returns DataBoostIsolationReadOnly instance + */ + public static create(properties?: google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly): google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly; + + /** + * Encodes the specified DataBoostIsolationReadOnly message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.verify|verify} messages. + * @param message DataBoostIsolationReadOnly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataBoostIsolationReadOnly message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.verify|verify} messages. + * @param message DataBoostIsolationReadOnly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataBoostIsolationReadOnly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataBoostIsolationReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly; + + /** + * Decodes a DataBoostIsolationReadOnly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataBoostIsolationReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly; + + /** + * Verifies a DataBoostIsolationReadOnly message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataBoostIsolationReadOnly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataBoostIsolationReadOnly + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly; + + /** + * Creates a plain object from a DataBoostIsolationReadOnly message. Also converts values to other types if specified. + * @param message DataBoostIsolationReadOnly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataBoostIsolationReadOnly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataBoostIsolationReadOnly + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataBoostIsolationReadOnly { + + /** ComputeBillingOwner enum. */ + enum ComputeBillingOwner { + COMPUTE_BILLING_OWNER_UNSPECIFIED = 0, + HOST_PAYS = 1 + } + } + } + + /** Properties of a HotTablet. */ + interface IHotTablet { + + /** HotTablet name */ + name?: (string|null); + + /** HotTablet tableName */ + tableName?: (string|null); + + /** HotTablet startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** HotTablet endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** HotTablet startKey */ + startKey?: (string|null); + + /** HotTablet endKey */ + endKey?: (string|null); + + /** HotTablet nodeCpuUsagePercent */ + nodeCpuUsagePercent?: (number|null); + } + + /** Represents a HotTablet. */ + class HotTablet implements IHotTablet { + + /** + * Constructs a new HotTablet. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IHotTablet); + + /** HotTablet name. */ + public name: string; + + /** HotTablet tableName. */ + public tableName: string; + + /** HotTablet startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** HotTablet endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** HotTablet startKey. */ + public startKey: string; + + /** HotTablet endKey. */ + public endKey: string; + + /** HotTablet nodeCpuUsagePercent. */ + public nodeCpuUsagePercent: number; + + /** + * Creates a new HotTablet instance using the specified properties. + * @param [properties] Properties to set + * @returns HotTablet instance + */ + public static create(properties?: google.bigtable.admin.v2.IHotTablet): google.bigtable.admin.v2.HotTablet; + + /** + * Encodes the specified HotTablet message. Does not implicitly {@link google.bigtable.admin.v2.HotTablet.verify|verify} messages. + * @param message HotTablet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IHotTablet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HotTablet message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.HotTablet.verify|verify} messages. + * @param message HotTablet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IHotTablet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HotTablet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HotTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.HotTablet; + + /** + * Decodes a HotTablet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HotTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.HotTablet; + + /** + * Verifies a HotTablet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HotTablet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HotTablet + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.HotTablet; + + /** + * Creates a plain object from a HotTablet message. Also converts values to other types if specified. + * @param message HotTablet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.HotTablet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HotTablet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HotTablet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogicalView. */ + interface ILogicalView { + + /** LogicalView name */ + name?: (string|null); + + /** LogicalView query */ + query?: (string|null); + + /** LogicalView etag */ + etag?: (string|null); + + /** LogicalView deletionProtection */ + deletionProtection?: (boolean|null); + } + + /** Represents a LogicalView. */ + class LogicalView implements ILogicalView { + + /** + * Constructs a new LogicalView. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ILogicalView); + + /** LogicalView name. */ + public name: string; + + /** LogicalView query. */ + public query: string; + + /** LogicalView etag. */ + public etag: string; + + /** LogicalView deletionProtection. */ + public deletionProtection: boolean; + + /** + * Creates a new LogicalView instance using the specified properties. + * @param [properties] Properties to set + * @returns LogicalView instance + */ + public static create(properties?: google.bigtable.admin.v2.ILogicalView): google.bigtable.admin.v2.LogicalView; + + /** + * Encodes the specified LogicalView message. Does not implicitly {@link google.bigtable.admin.v2.LogicalView.verify|verify} messages. + * @param message LogicalView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ILogicalView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogicalView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.LogicalView.verify|verify} messages. + * @param message LogicalView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ILogicalView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogicalView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogicalView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.LogicalView; + + /** + * Decodes a LogicalView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogicalView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.LogicalView; + + /** + * Verifies a LogicalView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogicalView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogicalView + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.LogicalView; + + /** + * Creates a plain object from a LogicalView message. Also converts values to other types if specified. + * @param message LogicalView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.LogicalView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogicalView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogicalView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaterializedView. */ + interface IMaterializedView { + + /** MaterializedView name */ + name?: (string|null); + + /** MaterializedView query */ + query?: (string|null); + + /** MaterializedView etag */ + etag?: (string|null); + + /** MaterializedView deletionProtection */ + deletionProtection?: (boolean|null); + } + + /** Represents a MaterializedView. */ + class MaterializedView implements IMaterializedView { + + /** + * Constructs a new MaterializedView. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IMaterializedView); + + /** MaterializedView name. */ + public name: string; + + /** MaterializedView query. */ + public query: string; + + /** MaterializedView etag. */ + public etag: string; + + /** MaterializedView deletionProtection. */ + public deletionProtection: boolean; + + /** + * Creates a new MaterializedView instance using the specified properties. + * @param [properties] Properties to set + * @returns MaterializedView instance + */ + public static create(properties?: google.bigtable.admin.v2.IMaterializedView): google.bigtable.admin.v2.MaterializedView; + + /** + * Encodes the specified MaterializedView message. Does not implicitly {@link google.bigtable.admin.v2.MaterializedView.verify|verify} messages. + * @param message MaterializedView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IMaterializedView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaterializedView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.MaterializedView.verify|verify} messages. + * @param message MaterializedView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IMaterializedView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaterializedView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaterializedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.MaterializedView; + + /** + * Decodes a MaterializedView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaterializedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.MaterializedView; + + /** + * Verifies a MaterializedView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaterializedView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaterializedView + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.MaterializedView; + + /** + * Creates a plain object from a MaterializedView message. Also converts values to other types if specified. + * @param message MaterializedView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.MaterializedView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaterializedView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaterializedView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** StorageType enum. */ + enum StorageType { + STORAGE_TYPE_UNSPECIFIED = 0, + SSD = 1, + HDD = 2 + } + + /** Properties of an OperationProgress. */ + interface IOperationProgress { + + /** OperationProgress progressPercent */ + progressPercent?: (number|null); + + /** OperationProgress startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** OperationProgress endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationProgress. */ + class OperationProgress implements IOperationProgress { + + /** + * Constructs a new OperationProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IOperationProgress); + + /** OperationProgress progressPercent. */ + public progressPercent: number; + + /** OperationProgress startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** OperationProgress endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OperationProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationProgress instance + */ + public static create(properties?: google.bigtable.admin.v2.IOperationProgress): google.bigtable.admin.v2.OperationProgress; + + /** + * Encodes the specified OperationProgress message. Does not implicitly {@link google.bigtable.admin.v2.OperationProgress.verify|verify} messages. + * @param message OperationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.OperationProgress.verify|verify} messages. + * @param message OperationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.OperationProgress; + + /** + * Decodes an OperationProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.OperationProgress; + + /** + * Verifies an OperationProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationProgress + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.OperationProgress; + + /** + * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. + * @param message OperationProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.OperationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a BigtableTableAdmin */ + class BigtableTableAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new BigtableTableAdmin 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 BigtableTableAdmin 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): BigtableTableAdmin; + + /** + * Calls CreateTable. + * @param request CreateTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table + */ + public createTable(request: google.bigtable.admin.v2.ICreateTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateTableCallback): void; + + /** + * Calls CreateTable. + * @param request CreateTableRequest message or plain object + * @returns Promise + */ + public createTable(request: google.bigtable.admin.v2.ICreateTableRequest): Promise; + + /** + * Calls CreateTableFromSnapshot. + * @param request CreateTableFromSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTableFromSnapshot(request: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshotCallback): void; + + /** + * Calls CreateTableFromSnapshot. + * @param request CreateTableFromSnapshotRequest message or plain object + * @returns Promise + */ + public createTableFromSnapshot(request: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest): Promise; + + /** + * Calls ListTables. + * @param request ListTablesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTablesResponse + */ + public listTables(request: google.bigtable.admin.v2.IListTablesRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ListTablesCallback): void; + + /** + * Calls ListTables. + * @param request ListTablesRequest message or plain object + * @returns Promise + */ + public listTables(request: google.bigtable.admin.v2.IListTablesRequest): Promise; + + /** + * Calls GetTable. + * @param request GetTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table + */ + public getTable(request: google.bigtable.admin.v2.IGetTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetTableCallback): void; + + /** + * Calls GetTable. + * @param request GetTableRequest message or plain object + * @returns Promise + */ + public getTable(request: google.bigtable.admin.v2.IGetTableRequest): Promise; + + /** + * Calls UpdateTable. + * @param request UpdateTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateTable(request: google.bigtable.admin.v2.IUpdateTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.UpdateTableCallback): void; + + /** + * Calls UpdateTable. + * @param request UpdateTableRequest message or plain object + * @returns Promise + */ + public updateTable(request: google.bigtable.admin.v2.IUpdateTableRequest): Promise; + + /** + * Calls DeleteTable. + * @param request DeleteTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTable(request: google.bigtable.admin.v2.IDeleteTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteTableCallback): void; + + /** + * Calls DeleteTable. + * @param request DeleteTableRequest message or plain object + * @returns Promise + */ + public deleteTable(request: google.bigtable.admin.v2.IDeleteTableRequest): Promise; + + /** + * Calls UndeleteTable. + * @param request UndeleteTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeleteTable(request: google.bigtable.admin.v2.IUndeleteTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTableCallback): void; + + /** + * Calls UndeleteTable. + * @param request UndeleteTableRequest message or plain object + * @returns Promise + */ + public undeleteTable(request: google.bigtable.admin.v2.IUndeleteTableRequest): Promise; + + /** + * Calls CreateAuthorizedView. + * @param request CreateAuthorizedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createAuthorizedView(request: google.bigtable.admin.v2.ICreateAuthorizedViewRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedViewCallback): void; + + /** + * Calls CreateAuthorizedView. + * @param request CreateAuthorizedViewRequest message or plain object + * @returns Promise + */ + public createAuthorizedView(request: google.bigtable.admin.v2.ICreateAuthorizedViewRequest): Promise; + + /** + * Calls ListAuthorizedViews. + * @param request ListAuthorizedViewsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAuthorizedViewsResponse + */ + public listAuthorizedViews(request: google.bigtable.admin.v2.IListAuthorizedViewsRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViewsCallback): void; + + /** + * Calls ListAuthorizedViews. + * @param request ListAuthorizedViewsRequest message or plain object + * @returns Promise + */ + public listAuthorizedViews(request: google.bigtable.admin.v2.IListAuthorizedViewsRequest): Promise; + + /** + * Calls GetAuthorizedView. + * @param request GetAuthorizedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AuthorizedView + */ + public getAuthorizedView(request: google.bigtable.admin.v2.IGetAuthorizedViewRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedViewCallback): void; + + /** + * Calls GetAuthorizedView. + * @param request GetAuthorizedViewRequest message or plain object + * @returns Promise + */ + public getAuthorizedView(request: google.bigtable.admin.v2.IGetAuthorizedViewRequest): Promise; + + /** + * Calls UpdateAuthorizedView. + * @param request UpdateAuthorizedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateAuthorizedView(request: google.bigtable.admin.v2.IUpdateAuthorizedViewRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedViewCallback): void; + + /** + * Calls UpdateAuthorizedView. + * @param request UpdateAuthorizedViewRequest message or plain object + * @returns Promise + */ + public updateAuthorizedView(request: google.bigtable.admin.v2.IUpdateAuthorizedViewRequest): Promise; + + /** + * Calls DeleteAuthorizedView. + * @param request DeleteAuthorizedViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAuthorizedView(request: google.bigtable.admin.v2.IDeleteAuthorizedViewRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedViewCallback): void; + + /** + * Calls DeleteAuthorizedView. + * @param request DeleteAuthorizedViewRequest message or plain object + * @returns Promise + */ + public deleteAuthorizedView(request: google.bigtable.admin.v2.IDeleteAuthorizedViewRequest): Promise; + + /** + * Calls ModifyColumnFamilies. + * @param request ModifyColumnFamiliesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table + */ + public modifyColumnFamilies(request: google.bigtable.admin.v2.IModifyColumnFamiliesRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamiliesCallback): void; + + /** + * Calls ModifyColumnFamilies. + * @param request ModifyColumnFamiliesRequest message or plain object + * @returns Promise + */ + public modifyColumnFamilies(request: google.bigtable.admin.v2.IModifyColumnFamiliesRequest): Promise; + + /** + * Calls DropRowRange. + * @param request DropRowRangeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public dropRowRange(request: google.bigtable.admin.v2.IDropRowRangeRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DropRowRangeCallback): void; + + /** + * Calls DropRowRange. + * @param request DropRowRangeRequest message or plain object + * @returns Promise + */ + public dropRowRange(request: google.bigtable.admin.v2.IDropRowRangeRequest): Promise; + + /** + * Calls GenerateConsistencyToken. + * @param request GenerateConsistencyTokenRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateConsistencyTokenResponse + */ + public generateConsistencyToken(request: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyTokenCallback): void; + + /** + * Calls GenerateConsistencyToken. + * @param request GenerateConsistencyTokenRequest message or plain object + * @returns Promise + */ + public generateConsistencyToken(request: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest): Promise; + + /** + * Calls CheckConsistency. + * @param request CheckConsistencyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckConsistencyResponse + */ + public checkConsistency(request: google.bigtable.admin.v2.ICheckConsistencyRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistencyCallback): void; + + /** + * Calls CheckConsistency. + * @param request CheckConsistencyRequest message or plain object + * @returns Promise + */ + public checkConsistency(request: google.bigtable.admin.v2.ICheckConsistencyRequest): Promise; + + /** + * Calls SnapshotTable. + * @param request SnapshotTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public snapshotTable(request: google.bigtable.admin.v2.ISnapshotTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTableCallback): void; + + /** + * Calls SnapshotTable. + * @param request SnapshotTableRequest message or plain object + * @returns Promise + */ + public snapshotTable(request: google.bigtable.admin.v2.ISnapshotTableRequest): Promise; + + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public getSnapshot(request: google.bigtable.admin.v2.IGetSnapshotRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshotCallback): void; + + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @returns Promise + */ + public getSnapshot(request: google.bigtable.admin.v2.IGetSnapshotRequest): Promise; + + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSnapshotsResponse + */ + public listSnapshots(request: google.bigtable.admin.v2.IListSnapshotsRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshotsCallback): void; + + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @returns Promise + */ + public listSnapshots(request: google.bigtable.admin.v2.IListSnapshotsRequest): Promise; + + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSnapshot(request: google.bigtable.admin.v2.IDeleteSnapshotRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshotCallback): void; + + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @returns Promise + */ + public deleteSnapshot(request: google.bigtable.admin.v2.IDeleteSnapshotRequest): Promise; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackup(request: google.bigtable.admin.v2.ICreateBackupRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateBackupCallback): void; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @returns Promise + */ + public createBackup(request: google.bigtable.admin.v2.ICreateBackupRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.bigtable.admin.v2.IGetBackupRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.bigtable.admin.v2.IGetBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public updateBackup(request: google.bigtable.admin.v2.IUpdateBackupRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.bigtable.admin.v2.IUpdateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBackup(request: google.bigtable.admin.v2.IDeleteBackupRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.bigtable.admin.v2.IDeleteBackupRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.bigtable.admin.v2.IListBackupsRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.bigtable.admin.v2.IListBackupsRequest): Promise; + + /** + * Calls RestoreTable. + * @param request RestoreTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreTable(request: google.bigtable.admin.v2.IRestoreTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.RestoreTableCallback): void; + + /** + * Calls RestoreTable. + * @param request RestoreTableRequest message or plain object + * @returns Promise + */ + public restoreTable(request: google.bigtable.admin.v2.IRestoreTableRequest): Promise; + + /** + * Calls CopyBackup. + * @param request CopyBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public copyBackup(request: google.bigtable.admin.v2.ICopyBackupRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CopyBackupCallback): void; + + /** + * Calls CopyBackup. + * @param request CopyBackupRequest message or plain object + * @returns Promise + */ + public copyBackup(request: google.bigtable.admin.v2.ICopyBackupRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls CreateSchemaBundle. + * @param request CreateSchemaBundleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSchemaBundle(request: google.bigtable.admin.v2.ICreateSchemaBundleRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundleCallback): void; + + /** + * Calls CreateSchemaBundle. + * @param request CreateSchemaBundleRequest message or plain object + * @returns Promise + */ + public createSchemaBundle(request: google.bigtable.admin.v2.ICreateSchemaBundleRequest): Promise; + + /** + * Calls UpdateSchemaBundle. + * @param request UpdateSchemaBundleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateSchemaBundle(request: google.bigtable.admin.v2.IUpdateSchemaBundleRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundleCallback): void; + + /** + * Calls UpdateSchemaBundle. + * @param request UpdateSchemaBundleRequest message or plain object + * @returns Promise + */ + public updateSchemaBundle(request: google.bigtable.admin.v2.IUpdateSchemaBundleRequest): Promise; + + /** + * Calls GetSchemaBundle. + * @param request GetSchemaBundleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SchemaBundle + */ + public getSchemaBundle(request: google.bigtable.admin.v2.IGetSchemaBundleRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundleCallback): void; + + /** + * Calls GetSchemaBundle. + * @param request GetSchemaBundleRequest message or plain object + * @returns Promise + */ + public getSchemaBundle(request: google.bigtable.admin.v2.IGetSchemaBundleRequest): Promise; + + /** + * Calls ListSchemaBundles. + * @param request ListSchemaBundlesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSchemaBundlesResponse + */ + public listSchemaBundles(request: google.bigtable.admin.v2.IListSchemaBundlesRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundlesCallback): void; + + /** + * Calls ListSchemaBundles. + * @param request ListSchemaBundlesRequest message or plain object + * @returns Promise + */ + public listSchemaBundles(request: google.bigtable.admin.v2.IListSchemaBundlesRequest): Promise; + + /** + * Calls DeleteSchemaBundle. + * @param request DeleteSchemaBundleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSchemaBundle(request: google.bigtable.admin.v2.IDeleteSchemaBundleRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundleCallback): void; + + /** + * Calls DeleteSchemaBundle. + * @param request DeleteSchemaBundleRequest message or plain object + * @returns Promise + */ + public deleteSchemaBundle(request: google.bigtable.admin.v2.IDeleteSchemaBundleRequest): Promise; + } + + namespace BigtableTableAdmin { + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createTable}. + * @param error Error, if any + * @param [response] Table + */ + type CreateTableCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Table) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createTableFromSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTableFromSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listTables}. + * @param error Error, if any + * @param [response] ListTablesResponse + */ + type ListTablesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListTablesResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getTable}. + * @param error Error, if any + * @param [response] Table + */ + type GetTableCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Table) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateTable}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateTableCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteTable}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTableCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|undeleteTable}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeleteTableCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createAuthorizedView}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateAuthorizedViewCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listAuthorizedViews}. + * @param error Error, if any + * @param [response] ListAuthorizedViewsResponse + */ + type ListAuthorizedViewsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListAuthorizedViewsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getAuthorizedView}. + * @param error Error, if any + * @param [response] AuthorizedView + */ + type GetAuthorizedViewCallback = (error: (Error|null), response?: google.bigtable.admin.v2.AuthorizedView) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateAuthorizedView}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateAuthorizedViewCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteAuthorizedView}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAuthorizedViewCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|modifyColumnFamilies}. + * @param error Error, if any + * @param [response] Table + */ + type ModifyColumnFamiliesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Table) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|dropRowRange}. + * @param error Error, if any + * @param [response] Empty + */ + type DropRowRangeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|generateConsistencyToken}. + * @param error Error, if any + * @param [response] GenerateConsistencyTokenResponse + */ + type GenerateConsistencyTokenCallback = (error: (Error|null), response?: google.bigtable.admin.v2.GenerateConsistencyTokenResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|checkConsistency}. + * @param error Error, if any + * @param [response] CheckConsistencyResponse + */ + type CheckConsistencyCallback = (error: (Error|null), response?: google.bigtable.admin.v2.CheckConsistencyResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|snapshotTable}. + * @param error Error, if any + * @param [response] Operation + */ + type SnapshotTableCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type GetSnapshotCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Snapshot) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listSnapshots}. + * @param error Error, if any + * @param [response] ListSnapshotsResponse + */ + type ListSnapshotsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListSnapshotsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteSnapshot}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSnapshotCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Backup) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Backup) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteBackup}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|restoreTable}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreTableCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|copyBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CopyBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createSchemaBundle}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSchemaBundleCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateSchemaBundle}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateSchemaBundleCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getSchemaBundle}. + * @param error Error, if any + * @param [response] SchemaBundle + */ + type GetSchemaBundleCallback = (error: (Error|null), response?: google.bigtable.admin.v2.SchemaBundle) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listSchemaBundles}. + * @param error Error, if any + * @param [response] ListSchemaBundlesResponse + */ + type ListSchemaBundlesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListSchemaBundlesResponse) => void; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteSchemaBundle}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSchemaBundleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a RestoreTableRequest. */ + interface IRestoreTableRequest { + + /** RestoreTableRequest parent */ + parent?: (string|null); + + /** RestoreTableRequest tableId */ + tableId?: (string|null); + + /** RestoreTableRequest backup */ + backup?: (string|null); + } + + /** Represents a RestoreTableRequest. */ + class RestoreTableRequest implements IRestoreTableRequest { + + /** + * Constructs a new RestoreTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IRestoreTableRequest); + + /** RestoreTableRequest parent. */ + public parent: string; + + /** RestoreTableRequest tableId. */ + public tableId: string; + + /** RestoreTableRequest backup. */ + public backup?: (string|null); + + /** RestoreTableRequest source. */ + public source?: "backup"; + + /** + * Creates a new RestoreTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IRestoreTableRequest): google.bigtable.admin.v2.RestoreTableRequest; + + /** + * Encodes the specified RestoreTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableRequest.verify|verify} messages. + * @param message RestoreTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IRestoreTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableRequest.verify|verify} messages. + * @param message RestoreTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IRestoreTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.RestoreTableRequest; + + /** + * Decodes a RestoreTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.RestoreTableRequest; + + /** + * Verifies a RestoreTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.RestoreTableRequest; + + /** + * Creates a plain object from a RestoreTableRequest message. Also converts values to other types if specified. + * @param message RestoreTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.RestoreTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreTableMetadata. */ + interface IRestoreTableMetadata { + + /** RestoreTableMetadata name */ + name?: (string|null); + + /** RestoreTableMetadata sourceType */ + sourceType?: (google.bigtable.admin.v2.RestoreSourceType|keyof typeof google.bigtable.admin.v2.RestoreSourceType|null); + + /** RestoreTableMetadata backupInfo */ + backupInfo?: (google.bigtable.admin.v2.IBackupInfo|null); + + /** RestoreTableMetadata optimizeTableOperationName */ + optimizeTableOperationName?: (string|null); + + /** RestoreTableMetadata progress */ + progress?: (google.bigtable.admin.v2.IOperationProgress|null); + } + + /** Represents a RestoreTableMetadata. */ + class RestoreTableMetadata implements IRestoreTableMetadata { + + /** + * Constructs a new RestoreTableMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IRestoreTableMetadata); + + /** RestoreTableMetadata name. */ + public name: string; + + /** RestoreTableMetadata sourceType. */ + public sourceType: (google.bigtable.admin.v2.RestoreSourceType|keyof typeof google.bigtable.admin.v2.RestoreSourceType); + + /** RestoreTableMetadata backupInfo. */ + public backupInfo?: (google.bigtable.admin.v2.IBackupInfo|null); + + /** RestoreTableMetadata optimizeTableOperationName. */ + public optimizeTableOperationName: string; + + /** RestoreTableMetadata progress. */ + public progress?: (google.bigtable.admin.v2.IOperationProgress|null); + + /** RestoreTableMetadata sourceInfo. */ + public sourceInfo?: "backupInfo"; + + /** + * Creates a new RestoreTableMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreTableMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IRestoreTableMetadata): google.bigtable.admin.v2.RestoreTableMetadata; + + /** + * Encodes the specified RestoreTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableMetadata.verify|verify} messages. + * @param message RestoreTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IRestoreTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableMetadata.verify|verify} messages. + * @param message RestoreTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IRestoreTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreTableMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.RestoreTableMetadata; + + /** + * Decodes a RestoreTableMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.RestoreTableMetadata; + + /** + * Verifies a RestoreTableMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreTableMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreTableMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.RestoreTableMetadata; + + /** + * Creates a plain object from a RestoreTableMetadata message. Also converts values to other types if specified. + * @param message RestoreTableMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.RestoreTableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreTableMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreTableMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OptimizeRestoredTableMetadata. */ + interface IOptimizeRestoredTableMetadata { + + /** OptimizeRestoredTableMetadata name */ + name?: (string|null); + + /** OptimizeRestoredTableMetadata progress */ + progress?: (google.bigtable.admin.v2.IOperationProgress|null); + } + + /** Represents an OptimizeRestoredTableMetadata. */ + class OptimizeRestoredTableMetadata implements IOptimizeRestoredTableMetadata { + + /** + * Constructs a new OptimizeRestoredTableMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IOptimizeRestoredTableMetadata); + + /** OptimizeRestoredTableMetadata name. */ + public name: string; + + /** OptimizeRestoredTableMetadata progress. */ + public progress?: (google.bigtable.admin.v2.IOperationProgress|null); + + /** + * Creates a new OptimizeRestoredTableMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OptimizeRestoredTableMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IOptimizeRestoredTableMetadata): google.bigtable.admin.v2.OptimizeRestoredTableMetadata; + + /** + * Encodes the specified OptimizeRestoredTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.OptimizeRestoredTableMetadata.verify|verify} messages. + * @param message OptimizeRestoredTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IOptimizeRestoredTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OptimizeRestoredTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.OptimizeRestoredTableMetadata.verify|verify} messages. + * @param message OptimizeRestoredTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IOptimizeRestoredTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OptimizeRestoredTableMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OptimizeRestoredTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.OptimizeRestoredTableMetadata; + + /** + * Decodes an OptimizeRestoredTableMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OptimizeRestoredTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.OptimizeRestoredTableMetadata; + + /** + * Verifies an OptimizeRestoredTableMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OptimizeRestoredTableMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OptimizeRestoredTableMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.OptimizeRestoredTableMetadata; + + /** + * Creates a plain object from an OptimizeRestoredTableMetadata message. Also converts values to other types if specified. + * @param message OptimizeRestoredTableMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.OptimizeRestoredTableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OptimizeRestoredTableMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OptimizeRestoredTableMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTableRequest. */ + interface ICreateTableRequest { + + /** CreateTableRequest parent */ + parent?: (string|null); + + /** CreateTableRequest tableId */ + tableId?: (string|null); + + /** CreateTableRequest table */ + table?: (google.bigtable.admin.v2.ITable|null); + + /** CreateTableRequest initialSplits */ + initialSplits?: (google.bigtable.admin.v2.CreateTableRequest.ISplit[]|null); + } + + /** Represents a CreateTableRequest. */ + class CreateTableRequest implements ICreateTableRequest { + + /** + * Constructs a new CreateTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateTableRequest); + + /** CreateTableRequest parent. */ + public parent: string; + + /** CreateTableRequest tableId. */ + public tableId: string; + + /** CreateTableRequest table. */ + public table?: (google.bigtable.admin.v2.ITable|null); + + /** CreateTableRequest initialSplits. */ + public initialSplits: google.bigtable.admin.v2.CreateTableRequest.ISplit[]; + + /** + * Creates a new CreateTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateTableRequest): google.bigtable.admin.v2.CreateTableRequest; + + /** + * Encodes the specified CreateTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.verify|verify} messages. + * @param message CreateTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.verify|verify} messages. + * @param message CreateTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateTableRequest; + + /** + * Decodes a CreateTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateTableRequest; + + /** + * Verifies a CreateTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableRequest; + + /** + * Creates a plain object from a CreateTableRequest message. Also converts values to other types if specified. + * @param message CreateTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CreateTableRequest { + + /** Properties of a Split. */ + interface ISplit { + + /** Split key */ + key?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Split. */ + class Split implements ISplit { + + /** + * Constructs a new Split. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.CreateTableRequest.ISplit); + + /** Split key. */ + public key: (Uint8Array|Buffer|string); + + /** + * Creates a new Split instance using the specified properties. + * @param [properties] Properties to set + * @returns Split instance + */ + public static create(properties?: google.bigtable.admin.v2.CreateTableRequest.ISplit): google.bigtable.admin.v2.CreateTableRequest.Split; + + /** + * Encodes the specified Split message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.Split.verify|verify} messages. + * @param message Split message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.CreateTableRequest.ISplit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Split message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.Split.verify|verify} messages. + * @param message Split message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.CreateTableRequest.ISplit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Split message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Split + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateTableRequest.Split; + + /** + * Decodes a Split message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Split + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateTableRequest.Split; + + /** + * Verifies a Split message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Split message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Split + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableRequest.Split; + + /** + * Creates a plain object from a Split message. Also converts values to other types if specified. + * @param message Split + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateTableRequest.Split, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Split to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Split + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateTableFromSnapshotRequest. */ + interface ICreateTableFromSnapshotRequest { + + /** CreateTableFromSnapshotRequest parent */ + parent?: (string|null); + + /** CreateTableFromSnapshotRequest tableId */ + tableId?: (string|null); + + /** CreateTableFromSnapshotRequest sourceSnapshot */ + sourceSnapshot?: (string|null); + } + + /** Represents a CreateTableFromSnapshotRequest. */ + class CreateTableFromSnapshotRequest implements ICreateTableFromSnapshotRequest { + + /** + * Constructs a new CreateTableFromSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest); + + /** CreateTableFromSnapshotRequest parent. */ + public parent: string; + + /** CreateTableFromSnapshotRequest tableId. */ + public tableId: string; + + /** CreateTableFromSnapshotRequest sourceSnapshot. */ + public sourceSnapshot: string; + + /** + * Creates a new CreateTableFromSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTableFromSnapshotRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; + + /** + * Encodes the specified CreateTableFromSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotRequest.verify|verify} messages. + * @param message CreateTableFromSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTableFromSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotRequest.verify|verify} messages. + * @param message CreateTableFromSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTableFromSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTableFromSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; + + /** + * Decodes a CreateTableFromSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTableFromSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; + + /** + * Verifies a CreateTableFromSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTableFromSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTableFromSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; + + /** + * Creates a plain object from a CreateTableFromSnapshotRequest message. Also converts values to other types if specified. + * @param message CreateTableFromSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateTableFromSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTableFromSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTableFromSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DropRowRangeRequest. */ + interface IDropRowRangeRequest { + + /** DropRowRangeRequest name */ + name?: (string|null); + + /** DropRowRangeRequest rowKeyPrefix */ + rowKeyPrefix?: (Uint8Array|Buffer|string|null); + + /** DropRowRangeRequest deleteAllDataFromTable */ + deleteAllDataFromTable?: (boolean|null); + } + + /** Represents a DropRowRangeRequest. */ + class DropRowRangeRequest implements IDropRowRangeRequest { + + /** + * Constructs a new DropRowRangeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDropRowRangeRequest); + + /** DropRowRangeRequest name. */ + public name: string; + + /** DropRowRangeRequest rowKeyPrefix. */ + public rowKeyPrefix?: (Uint8Array|Buffer|string|null); + + /** DropRowRangeRequest deleteAllDataFromTable. */ + public deleteAllDataFromTable?: (boolean|null); + + /** DropRowRangeRequest target. */ + public target?: ("rowKeyPrefix"|"deleteAllDataFromTable"); + + /** + * Creates a new DropRowRangeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DropRowRangeRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDropRowRangeRequest): google.bigtable.admin.v2.DropRowRangeRequest; + + /** + * Encodes the specified DropRowRangeRequest message. Does not implicitly {@link google.bigtable.admin.v2.DropRowRangeRequest.verify|verify} messages. + * @param message DropRowRangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDropRowRangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DropRowRangeRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DropRowRangeRequest.verify|verify} messages. + * @param message DropRowRangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDropRowRangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DropRowRangeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DropRowRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DropRowRangeRequest; + + /** + * Decodes a DropRowRangeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DropRowRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DropRowRangeRequest; + + /** + * Verifies a DropRowRangeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DropRowRangeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DropRowRangeRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DropRowRangeRequest; + + /** + * Creates a plain object from a DropRowRangeRequest message. Also converts values to other types if specified. + * @param message DropRowRangeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DropRowRangeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DropRowRangeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DropRowRangeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTablesRequest. */ + interface IListTablesRequest { + + /** ListTablesRequest parent */ + parent?: (string|null); + + /** ListTablesRequest view */ + view?: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View|null); + + /** ListTablesRequest pageSize */ + pageSize?: (number|null); + + /** ListTablesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTablesRequest. */ + class ListTablesRequest implements IListTablesRequest { + + /** + * Constructs a new ListTablesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListTablesRequest); + + /** ListTablesRequest parent. */ + public parent: string; + + /** ListTablesRequest view. */ + public view: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View); + + /** ListTablesRequest pageSize. */ + public pageSize: number; + + /** ListTablesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTablesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTablesRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListTablesRequest): google.bigtable.admin.v2.ListTablesRequest; + + /** + * Encodes the specified ListTablesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListTablesRequest.verify|verify} messages. + * @param message ListTablesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListTablesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTablesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListTablesRequest.verify|verify} messages. + * @param message ListTablesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListTablesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTablesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListTablesRequest; + + /** + * Decodes a ListTablesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListTablesRequest; + + /** + * Verifies a ListTablesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTablesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTablesRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListTablesRequest; + + /** + * Creates a plain object from a ListTablesRequest message. Also converts values to other types if specified. + * @param message ListTablesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListTablesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTablesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTablesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTablesResponse. */ + interface IListTablesResponse { + + /** ListTablesResponse tables */ + tables?: (google.bigtable.admin.v2.ITable[]|null); + + /** ListTablesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTablesResponse. */ + class ListTablesResponse implements IListTablesResponse { + + /** + * Constructs a new ListTablesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListTablesResponse); + + /** ListTablesResponse tables. */ + public tables: google.bigtable.admin.v2.ITable[]; + + /** ListTablesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTablesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTablesResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListTablesResponse): google.bigtable.admin.v2.ListTablesResponse; + + /** + * Encodes the specified ListTablesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListTablesResponse.verify|verify} messages. + * @param message ListTablesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListTablesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTablesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListTablesResponse.verify|verify} messages. + * @param message ListTablesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListTablesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTablesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTablesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListTablesResponse; + + /** + * Decodes a ListTablesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTablesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListTablesResponse; + + /** + * Verifies a ListTablesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTablesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTablesResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListTablesResponse; + + /** + * Creates a plain object from a ListTablesResponse message. Also converts values to other types if specified. + * @param message ListTablesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListTablesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTablesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTablesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTableRequest. */ + interface IGetTableRequest { + + /** GetTableRequest name */ + name?: (string|null); + + /** GetTableRequest view */ + view?: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View|null); + } + + /** Represents a GetTableRequest. */ + class GetTableRequest implements IGetTableRequest { + + /** + * Constructs a new GetTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetTableRequest); + + /** GetTableRequest name. */ + public name: string; + + /** GetTableRequest view. */ + public view: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View); + + /** + * Creates a new GetTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetTableRequest): google.bigtable.admin.v2.GetTableRequest; + + /** + * Encodes the specified GetTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetTableRequest.verify|verify} messages. + * @param message GetTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetTableRequest.verify|verify} messages. + * @param message GetTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetTableRequest; + + /** + * Decodes a GetTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetTableRequest; + + /** + * Verifies a GetTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetTableRequest; + + /** + * Creates a plain object from a GetTableRequest message. Also converts values to other types if specified. + * @param message GetTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTableRequest. */ + interface IUpdateTableRequest { + + /** UpdateTableRequest table */ + table?: (google.bigtable.admin.v2.ITable|null); + + /** UpdateTableRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTableRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents an UpdateTableRequest. */ + class UpdateTableRequest implements IUpdateTableRequest { + + /** + * Constructs a new UpdateTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateTableRequest); + + /** UpdateTableRequest table. */ + public table?: (google.bigtable.admin.v2.ITable|null); + + /** UpdateTableRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTableRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new UpdateTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateTableRequest): google.bigtable.admin.v2.UpdateTableRequest; + + /** + * Encodes the specified UpdateTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableRequest.verify|verify} messages. + * @param message UpdateTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableRequest.verify|verify} messages. + * @param message UpdateTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateTableRequest; + + /** + * Decodes an UpdateTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateTableRequest; + + /** + * Verifies an UpdateTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateTableRequest; + + /** + * Creates a plain object from an UpdateTableRequest message. Also converts values to other types if specified. + * @param message UpdateTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTableMetadata. */ + interface IUpdateTableMetadata { + + /** UpdateTableMetadata name */ + name?: (string|null); + + /** UpdateTableMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateTableMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateTableMetadata. */ + class UpdateTableMetadata implements IUpdateTableMetadata { + + /** + * Constructs a new UpdateTableMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateTableMetadata); + + /** UpdateTableMetadata name. */ + public name: string; + + /** UpdateTableMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateTableMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateTableMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTableMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateTableMetadata): google.bigtable.admin.v2.UpdateTableMetadata; + + /** + * Encodes the specified UpdateTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableMetadata.verify|verify} messages. + * @param message UpdateTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableMetadata.verify|verify} messages. + * @param message UpdateTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTableMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateTableMetadata; + + /** + * Decodes an UpdateTableMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateTableMetadata; + + /** + * Verifies an UpdateTableMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateTableMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTableMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateTableMetadata; + + /** + * Creates a plain object from an UpdateTableMetadata message. Also converts values to other types if specified. + * @param message UpdateTableMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateTableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTableMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTableMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTableRequest. */ + interface IDeleteTableRequest { + + /** DeleteTableRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTableRequest. */ + class DeleteTableRequest implements IDeleteTableRequest { + + /** + * Constructs a new DeleteTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteTableRequest); + + /** DeleteTableRequest name. */ + public name: string; + + /** + * Creates a new DeleteTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteTableRequest): google.bigtable.admin.v2.DeleteTableRequest; + + /** + * Encodes the specified DeleteTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteTableRequest.verify|verify} messages. + * @param message DeleteTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteTableRequest.verify|verify} messages. + * @param message DeleteTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteTableRequest; + + /** + * Decodes a DeleteTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteTableRequest; + + /** + * Verifies a DeleteTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteTableRequest; + + /** + * Creates a plain object from a DeleteTableRequest message. Also converts values to other types if specified. + * @param message DeleteTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteTableRequest. */ + interface IUndeleteTableRequest { + + /** UndeleteTableRequest name */ + name?: (string|null); + } + + /** Represents an UndeleteTableRequest. */ + class UndeleteTableRequest implements IUndeleteTableRequest { + + /** + * Constructs a new UndeleteTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUndeleteTableRequest); + + /** UndeleteTableRequest name. */ + public name: string; + + /** + * Creates a new UndeleteTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUndeleteTableRequest): google.bigtable.admin.v2.UndeleteTableRequest; + + /** + * Encodes the specified UndeleteTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableRequest.verify|verify} messages. + * @param message UndeleteTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUndeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableRequest.verify|verify} messages. + * @param message UndeleteTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUndeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UndeleteTableRequest; + + /** + * Decodes an UndeleteTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UndeleteTableRequest; + + /** + * Verifies an UndeleteTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UndeleteTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UndeleteTableRequest; + + /** + * Creates a plain object from an UndeleteTableRequest message. Also converts values to other types if specified. + * @param message UndeleteTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UndeleteTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteTableMetadata. */ + interface IUndeleteTableMetadata { + + /** UndeleteTableMetadata name */ + name?: (string|null); + + /** UndeleteTableMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UndeleteTableMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UndeleteTableMetadata. */ + class UndeleteTableMetadata implements IUndeleteTableMetadata { + + /** + * Constructs a new UndeleteTableMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUndeleteTableMetadata); + + /** UndeleteTableMetadata name. */ + public name: string; + + /** UndeleteTableMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UndeleteTableMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UndeleteTableMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteTableMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUndeleteTableMetadata): google.bigtable.admin.v2.UndeleteTableMetadata; + + /** + * Encodes the specified UndeleteTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableMetadata.verify|verify} messages. + * @param message UndeleteTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUndeleteTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableMetadata.verify|verify} messages. + * @param message UndeleteTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUndeleteTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteTableMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UndeleteTableMetadata; + + /** + * Decodes an UndeleteTableMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UndeleteTableMetadata; + + /** + * Verifies an UndeleteTableMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UndeleteTableMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteTableMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UndeleteTableMetadata; + + /** + * Creates a plain object from an UndeleteTableMetadata message. Also converts values to other types if specified. + * @param message UndeleteTableMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UndeleteTableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteTableMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteTableMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModifyColumnFamiliesRequest. */ + interface IModifyColumnFamiliesRequest { + + /** ModifyColumnFamiliesRequest name */ + name?: (string|null); + + /** ModifyColumnFamiliesRequest modifications */ + modifications?: (google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification[]|null); + + /** ModifyColumnFamiliesRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents a ModifyColumnFamiliesRequest. */ + class ModifyColumnFamiliesRequest implements IModifyColumnFamiliesRequest { + + /** + * Constructs a new ModifyColumnFamiliesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IModifyColumnFamiliesRequest); + + /** ModifyColumnFamiliesRequest name. */ + public name: string; + + /** ModifyColumnFamiliesRequest modifications. */ + public modifications: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification[]; + + /** ModifyColumnFamiliesRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new ModifyColumnFamiliesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ModifyColumnFamiliesRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IModifyColumnFamiliesRequest): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; + + /** + * Encodes the specified ModifyColumnFamiliesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.verify|verify} messages. + * @param message ModifyColumnFamiliesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IModifyColumnFamiliesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModifyColumnFamiliesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.verify|verify} messages. + * @param message ModifyColumnFamiliesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IModifyColumnFamiliesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModifyColumnFamiliesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; + + /** + * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModifyColumnFamiliesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; + + /** + * Verifies a ModifyColumnFamiliesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModifyColumnFamiliesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModifyColumnFamiliesRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; + + /** + * Creates a plain object from a ModifyColumnFamiliesRequest message. Also converts values to other types if specified. + * @param message ModifyColumnFamiliesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ModifyColumnFamiliesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModifyColumnFamiliesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModifyColumnFamiliesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ModifyColumnFamiliesRequest { + + /** Properties of a Modification. */ + interface IModification { + + /** Modification id */ + id?: (string|null); + + /** Modification create */ + create?: (google.bigtable.admin.v2.IColumnFamily|null); + + /** Modification update */ + update?: (google.bigtable.admin.v2.IColumnFamily|null); + + /** Modification drop */ + drop?: (boolean|null); + + /** Modification updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a Modification. */ + class Modification implements IModification { + + /** + * Constructs a new Modification. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification); + + /** Modification id. */ + public id: string; + + /** Modification create. */ + public create?: (google.bigtable.admin.v2.IColumnFamily|null); + + /** Modification update. */ + public update?: (google.bigtable.admin.v2.IColumnFamily|null); + + /** Modification drop. */ + public drop?: (boolean|null); + + /** Modification updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** Modification mod. */ + public mod?: ("create"|"update"|"drop"); + + /** + * Creates a new Modification instance using the specified properties. + * @param [properties] Properties to set + * @returns Modification instance + */ + public static create(properties?: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification): google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification; + + /** + * Encodes the specified Modification message. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.verify|verify} messages. + * @param message Modification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Modification message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.verify|verify} messages. + * @param message Modification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Modification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Modification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification; + + /** + * Decodes a Modification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Modification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification; + + /** + * Verifies a Modification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Modification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Modification + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification; + + /** + * Creates a plain object from a Modification message. Also converts values to other types if specified. + * @param message Modification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Modification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Modification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GenerateConsistencyTokenRequest. */ + interface IGenerateConsistencyTokenRequest { + + /** GenerateConsistencyTokenRequest name */ + name?: (string|null); + } + + /** Represents a GenerateConsistencyTokenRequest. */ + class GenerateConsistencyTokenRequest implements IGenerateConsistencyTokenRequest { + + /** + * Constructs a new GenerateConsistencyTokenRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest); + + /** GenerateConsistencyTokenRequest name. */ + public name: string; + + /** + * Creates a new GenerateConsistencyTokenRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateConsistencyTokenRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; + + /** + * Encodes the specified GenerateConsistencyTokenRequest message. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenRequest.verify|verify} messages. + * @param message GenerateConsistencyTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateConsistencyTokenRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenRequest.verify|verify} messages. + * @param message GenerateConsistencyTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateConsistencyTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; + + /** + * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateConsistencyTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; + + /** + * Verifies a GenerateConsistencyTokenRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateConsistencyTokenRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateConsistencyTokenRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; + + /** + * Creates a plain object from a GenerateConsistencyTokenRequest message. Also converts values to other types if specified. + * @param message GenerateConsistencyTokenRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GenerateConsistencyTokenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateConsistencyTokenRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateConsistencyTokenRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateConsistencyTokenResponse. */ + interface IGenerateConsistencyTokenResponse { + + /** GenerateConsistencyTokenResponse consistencyToken */ + consistencyToken?: (string|null); + } + + /** Represents a GenerateConsistencyTokenResponse. */ + class GenerateConsistencyTokenResponse implements IGenerateConsistencyTokenResponse { + + /** + * Constructs a new GenerateConsistencyTokenResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse); + + /** GenerateConsistencyTokenResponse consistencyToken. */ + public consistencyToken: string; + + /** + * Creates a new GenerateConsistencyTokenResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateConsistencyTokenResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; + + /** + * Encodes the specified GenerateConsistencyTokenResponse message. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse.verify|verify} messages. + * @param message GenerateConsistencyTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateConsistencyTokenResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse.verify|verify} messages. + * @param message GenerateConsistencyTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateConsistencyTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; + + /** + * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateConsistencyTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; + + /** + * Verifies a GenerateConsistencyTokenResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateConsistencyTokenResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateConsistencyTokenResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; + + /** + * Creates a plain object from a GenerateConsistencyTokenResponse message. Also converts values to other types if specified. + * @param message GenerateConsistencyTokenResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GenerateConsistencyTokenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateConsistencyTokenResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateConsistencyTokenResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckConsistencyRequest. */ + interface ICheckConsistencyRequest { + + /** CheckConsistencyRequest name */ + name?: (string|null); + + /** CheckConsistencyRequest consistencyToken */ + consistencyToken?: (string|null); + + /** CheckConsistencyRequest standardReadRemoteWrites */ + standardReadRemoteWrites?: (google.bigtable.admin.v2.IStandardReadRemoteWrites|null); + + /** CheckConsistencyRequest dataBoostReadLocalWrites */ + dataBoostReadLocalWrites?: (google.bigtable.admin.v2.IDataBoostReadLocalWrites|null); + } + + /** Represents a CheckConsistencyRequest. */ + class CheckConsistencyRequest implements ICheckConsistencyRequest { + + /** + * Constructs a new CheckConsistencyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICheckConsistencyRequest); + + /** CheckConsistencyRequest name. */ + public name: string; + + /** CheckConsistencyRequest consistencyToken. */ + public consistencyToken: string; + + /** CheckConsistencyRequest standardReadRemoteWrites. */ + public standardReadRemoteWrites?: (google.bigtable.admin.v2.IStandardReadRemoteWrites|null); + + /** CheckConsistencyRequest dataBoostReadLocalWrites. */ + public dataBoostReadLocalWrites?: (google.bigtable.admin.v2.IDataBoostReadLocalWrites|null); + + /** CheckConsistencyRequest mode. */ + public mode?: ("standardReadRemoteWrites"|"dataBoostReadLocalWrites"); + + /** + * Creates a new CheckConsistencyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckConsistencyRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICheckConsistencyRequest): google.bigtable.admin.v2.CheckConsistencyRequest; + + /** + * Encodes the specified CheckConsistencyRequest message. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyRequest.verify|verify} messages. + * @param message CheckConsistencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICheckConsistencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckConsistencyRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyRequest.verify|verify} messages. + * @param message CheckConsistencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICheckConsistencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckConsistencyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckConsistencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CheckConsistencyRequest; + + /** + * Decodes a CheckConsistencyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckConsistencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CheckConsistencyRequest; + + /** + * Verifies a CheckConsistencyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckConsistencyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckConsistencyRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CheckConsistencyRequest; + + /** + * Creates a plain object from a CheckConsistencyRequest message. Also converts values to other types if specified. + * @param message CheckConsistencyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CheckConsistencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckConsistencyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckConsistencyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StandardReadRemoteWrites. */ + interface IStandardReadRemoteWrites { + } + + /** Represents a StandardReadRemoteWrites. */ + class StandardReadRemoteWrites implements IStandardReadRemoteWrites { + + /** + * Constructs a new StandardReadRemoteWrites. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IStandardReadRemoteWrites); + + /** + * Creates a new StandardReadRemoteWrites instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardReadRemoteWrites instance + */ + public static create(properties?: google.bigtable.admin.v2.IStandardReadRemoteWrites): google.bigtable.admin.v2.StandardReadRemoteWrites; + + /** + * Encodes the specified StandardReadRemoteWrites message. Does not implicitly {@link google.bigtable.admin.v2.StandardReadRemoteWrites.verify|verify} messages. + * @param message StandardReadRemoteWrites message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IStandardReadRemoteWrites, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardReadRemoteWrites message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.StandardReadRemoteWrites.verify|verify} messages. + * @param message StandardReadRemoteWrites message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IStandardReadRemoteWrites, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardReadRemoteWrites message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardReadRemoteWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.StandardReadRemoteWrites; + + /** + * Decodes a StandardReadRemoteWrites message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardReadRemoteWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.StandardReadRemoteWrites; + + /** + * Verifies a StandardReadRemoteWrites message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardReadRemoteWrites message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardReadRemoteWrites + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.StandardReadRemoteWrites; + + /** + * Creates a plain object from a StandardReadRemoteWrites message. Also converts values to other types if specified. + * @param message StandardReadRemoteWrites + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.StandardReadRemoteWrites, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardReadRemoteWrites to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardReadRemoteWrites + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataBoostReadLocalWrites. */ + interface IDataBoostReadLocalWrites { + } + + /** Represents a DataBoostReadLocalWrites. */ + class DataBoostReadLocalWrites implements IDataBoostReadLocalWrites { + + /** + * Constructs a new DataBoostReadLocalWrites. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDataBoostReadLocalWrites); + + /** + * Creates a new DataBoostReadLocalWrites instance using the specified properties. + * @param [properties] Properties to set + * @returns DataBoostReadLocalWrites instance + */ + public static create(properties?: google.bigtable.admin.v2.IDataBoostReadLocalWrites): google.bigtable.admin.v2.DataBoostReadLocalWrites; + + /** + * Encodes the specified DataBoostReadLocalWrites message. Does not implicitly {@link google.bigtable.admin.v2.DataBoostReadLocalWrites.verify|verify} messages. + * @param message DataBoostReadLocalWrites message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDataBoostReadLocalWrites, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataBoostReadLocalWrites message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DataBoostReadLocalWrites.verify|verify} messages. + * @param message DataBoostReadLocalWrites message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDataBoostReadLocalWrites, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataBoostReadLocalWrites message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataBoostReadLocalWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DataBoostReadLocalWrites; + + /** + * Decodes a DataBoostReadLocalWrites message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataBoostReadLocalWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DataBoostReadLocalWrites; + + /** + * Verifies a DataBoostReadLocalWrites message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataBoostReadLocalWrites message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataBoostReadLocalWrites + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DataBoostReadLocalWrites; + + /** + * Creates a plain object from a DataBoostReadLocalWrites message. Also converts values to other types if specified. + * @param message DataBoostReadLocalWrites + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DataBoostReadLocalWrites, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataBoostReadLocalWrites to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataBoostReadLocalWrites + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckConsistencyResponse. */ + interface ICheckConsistencyResponse { + + /** CheckConsistencyResponse consistent */ + consistent?: (boolean|null); + } + + /** Represents a CheckConsistencyResponse. */ + class CheckConsistencyResponse implements ICheckConsistencyResponse { + + /** + * Constructs a new CheckConsistencyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICheckConsistencyResponse); + + /** CheckConsistencyResponse consistent. */ + public consistent: boolean; + + /** + * Creates a new CheckConsistencyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckConsistencyResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.ICheckConsistencyResponse): google.bigtable.admin.v2.CheckConsistencyResponse; + + /** + * Encodes the specified CheckConsistencyResponse message. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyResponse.verify|verify} messages. + * @param message CheckConsistencyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICheckConsistencyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckConsistencyResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyResponse.verify|verify} messages. + * @param message CheckConsistencyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICheckConsistencyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckConsistencyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckConsistencyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CheckConsistencyResponse; + + /** + * Decodes a CheckConsistencyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckConsistencyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CheckConsistencyResponse; + + /** + * Verifies a CheckConsistencyResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckConsistencyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckConsistencyResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CheckConsistencyResponse; + + /** + * Creates a plain object from a CheckConsistencyResponse message. Also converts values to other types if specified. + * @param message CheckConsistencyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CheckConsistencyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckConsistencyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckConsistencyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SnapshotTableRequest. */ + interface ISnapshotTableRequest { + + /** SnapshotTableRequest name */ + name?: (string|null); + + /** SnapshotTableRequest cluster */ + cluster?: (string|null); + + /** SnapshotTableRequest snapshotId */ + snapshotId?: (string|null); + + /** SnapshotTableRequest ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** SnapshotTableRequest description */ + description?: (string|null); + } + + /** Represents a SnapshotTableRequest. */ + class SnapshotTableRequest implements ISnapshotTableRequest { + + /** + * Constructs a new SnapshotTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ISnapshotTableRequest); + + /** SnapshotTableRequest name. */ + public name: string; + + /** SnapshotTableRequest cluster. */ + public cluster: string; + + /** SnapshotTableRequest snapshotId. */ + public snapshotId: string; + + /** SnapshotTableRequest ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** SnapshotTableRequest description. */ + public description: string; + + /** + * Creates a new SnapshotTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SnapshotTableRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ISnapshotTableRequest): google.bigtable.admin.v2.SnapshotTableRequest; + + /** + * Encodes the specified SnapshotTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableRequest.verify|verify} messages. + * @param message SnapshotTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ISnapshotTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SnapshotTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableRequest.verify|verify} messages. + * @param message SnapshotTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ISnapshotTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SnapshotTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SnapshotTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.SnapshotTableRequest; + + /** + * Decodes a SnapshotTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SnapshotTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.SnapshotTableRequest; + + /** + * Verifies a SnapshotTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SnapshotTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SnapshotTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.SnapshotTableRequest; + + /** + * Creates a plain object from a SnapshotTableRequest message. Also converts values to other types if specified. + * @param message SnapshotTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.SnapshotTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SnapshotTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SnapshotTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSnapshotRequest. */ + interface IGetSnapshotRequest { + + /** GetSnapshotRequest name */ + name?: (string|null); + } + + /** Represents a GetSnapshotRequest. */ + class GetSnapshotRequest implements IGetSnapshotRequest { + + /** + * Constructs a new GetSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetSnapshotRequest); + + /** GetSnapshotRequest name. */ + public name: string; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSnapshotRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetSnapshotRequest): google.bigtable.admin.v2.GetSnapshotRequest; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetSnapshotRequest; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetSnapshotRequest; + + /** + * Verifies a GetSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetSnapshotRequest; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @param message GetSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSnapshotsRequest. */ + interface IListSnapshotsRequest { + + /** ListSnapshotsRequest parent */ + parent?: (string|null); + + /** ListSnapshotsRequest pageSize */ + pageSize?: (number|null); + + /** ListSnapshotsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSnapshotsRequest. */ + class ListSnapshotsRequest implements IListSnapshotsRequest { + + /** + * Constructs a new ListSnapshotsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListSnapshotsRequest); + + /** ListSnapshotsRequest parent. */ + public parent: string; + + /** ListSnapshotsRequest pageSize. */ + public pageSize: number; + + /** ListSnapshotsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListSnapshotsRequest): google.bigtable.admin.v2.ListSnapshotsRequest; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListSnapshotsRequest; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListSnapshotsRequest; + + /** + * Verifies a ListSnapshotsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListSnapshotsRequest; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @param message ListSnapshotsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSnapshotsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSnapshotsResponse. */ + interface IListSnapshotsResponse { + + /** ListSnapshotsResponse snapshots */ + snapshots?: (google.bigtable.admin.v2.ISnapshot[]|null); + + /** ListSnapshotsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSnapshotsResponse. */ + class ListSnapshotsResponse implements IListSnapshotsResponse { + + /** + * Constructs a new ListSnapshotsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListSnapshotsResponse); + + /** ListSnapshotsResponse snapshots. */ + public snapshots: google.bigtable.admin.v2.ISnapshot[]; + + /** ListSnapshotsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSnapshotsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListSnapshotsResponse): google.bigtable.admin.v2.ListSnapshotsResponse; + + /** + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListSnapshotsResponse; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListSnapshotsResponse; + + /** + * Verifies a ListSnapshotsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListSnapshotsResponse; + + /** + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @param message ListSnapshotsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSnapshotsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSnapshotRequest. */ + interface IDeleteSnapshotRequest { + + /** DeleteSnapshotRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSnapshotRequest. */ + class DeleteSnapshotRequest implements IDeleteSnapshotRequest { + + /** + * Constructs a new DeleteSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteSnapshotRequest); + + /** DeleteSnapshotRequest name. */ + public name: string; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSnapshotRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteSnapshotRequest): google.bigtable.admin.v2.DeleteSnapshotRequest; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteSnapshotRequest; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteSnapshotRequest; + + /** + * Verifies a DeleteSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteSnapshotRequest; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @param message DeleteSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SnapshotTableMetadata. */ + interface ISnapshotTableMetadata { + + /** SnapshotTableMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ISnapshotTableRequest|null); + + /** SnapshotTableMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** SnapshotTableMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SnapshotTableMetadata. */ + class SnapshotTableMetadata implements ISnapshotTableMetadata { + + /** + * Constructs a new SnapshotTableMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ISnapshotTableMetadata); + + /** SnapshotTableMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ISnapshotTableRequest|null); + + /** SnapshotTableMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** SnapshotTableMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SnapshotTableMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns SnapshotTableMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ISnapshotTableMetadata): google.bigtable.admin.v2.SnapshotTableMetadata; + + /** + * Encodes the specified SnapshotTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableMetadata.verify|verify} messages. + * @param message SnapshotTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ISnapshotTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SnapshotTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableMetadata.verify|verify} messages. + * @param message SnapshotTableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ISnapshotTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SnapshotTableMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SnapshotTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.SnapshotTableMetadata; + + /** + * Decodes a SnapshotTableMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SnapshotTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.SnapshotTableMetadata; + + /** + * Verifies a SnapshotTableMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SnapshotTableMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SnapshotTableMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.SnapshotTableMetadata; + + /** + * Creates a plain object from a SnapshotTableMetadata message. Also converts values to other types if specified. + * @param message SnapshotTableMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.SnapshotTableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SnapshotTableMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SnapshotTableMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTableFromSnapshotMetadata. */ + interface ICreateTableFromSnapshotMetadata { + + /** CreateTableFromSnapshotMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateTableFromSnapshotRequest|null); + + /** CreateTableFromSnapshotMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateTableFromSnapshotMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateTableFromSnapshotMetadata. */ + class CreateTableFromSnapshotMetadata implements ICreateTableFromSnapshotMetadata { + + /** + * Constructs a new CreateTableFromSnapshotMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata); + + /** CreateTableFromSnapshotMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateTableFromSnapshotRequest|null); + + /** CreateTableFromSnapshotMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateTableFromSnapshotMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateTableFromSnapshotMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTableFromSnapshotMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; + + /** + * Encodes the specified CreateTableFromSnapshotMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.verify|verify} messages. + * @param message CreateTableFromSnapshotMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTableFromSnapshotMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.verify|verify} messages. + * @param message CreateTableFromSnapshotMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTableFromSnapshotMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; + + /** + * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTableFromSnapshotMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; + + /** + * Verifies a CreateTableFromSnapshotMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTableFromSnapshotMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTableFromSnapshotMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; + + /** + * Creates a plain object from a CreateTableFromSnapshotMetadata message. Also converts values to other types if specified. + * @param message CreateTableFromSnapshotMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateTableFromSnapshotMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTableFromSnapshotMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTableFromSnapshotMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupRequest. */ + interface ICreateBackupRequest { + + /** CreateBackupRequest parent */ + parent?: (string|null); + + /** CreateBackupRequest backupId */ + backupId?: (string|null); + + /** CreateBackupRequest backup */ + backup?: (google.bigtable.admin.v2.IBackup|null); + } + + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { + + /** + * Constructs a new CreateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateBackupRequest); + + /** CreateBackupRequest parent. */ + public parent: string; + + /** CreateBackupRequest backupId. */ + public backupId: string; + + /** CreateBackupRequest backup. */ + public backup?: (google.bigtable.admin.v2.IBackup|null); + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateBackupRequest): google.bigtable.admin.v2.CreateBackupRequest; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateBackupRequest; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateBackupRequest; + + /** + * Verifies a CreateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateBackupRequest; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupMetadata. */ + interface ICreateBackupMetadata { + + /** CreateBackupMetadata name */ + name?: (string|null); + + /** CreateBackupMetadata sourceTable */ + sourceTable?: (string|null); + + /** CreateBackupMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CreateBackupMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateBackupMetadata. */ + class CreateBackupMetadata implements ICreateBackupMetadata { + + /** + * Constructs a new CreateBackupMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateBackupMetadata); + + /** CreateBackupMetadata name. */ + public name: string; + + /** CreateBackupMetadata sourceTable. */ + public sourceTable: string; + + /** CreateBackupMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CreateBackupMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateBackupMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateBackupMetadata): google.bigtable.admin.v2.CreateBackupMetadata; + + /** + * Encodes the specified CreateBackupMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupMetadata.verify|verify} messages. + * @param message CreateBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupMetadata.verify|verify} messages. + * @param message CreateBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateBackupMetadata; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateBackupMetadata; + + /** + * Verifies a CreateBackupMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateBackupMetadata; + + /** + * Creates a plain object from a CreateBackupMetadata message. Also converts values to other types if specified. + * @param message CreateBackupMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateBackupMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest backup */ + backup?: (google.bigtable.admin.v2.IBackup|null); + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateBackupRequest); + + /** UpdateBackupRequest backup. */ + public backup?: (google.bigtable.admin.v2.IBackup|null); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateBackupRequest): google.bigtable.admin.v2.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetBackupRequest): google.bigtable.admin.v2.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteBackupRequest): google.bigtable.admin.v2.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListBackupsRequest): google.bigtable.admin.v2.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListBackupsRequest; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.bigtable.admin.v2.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.bigtable.admin.v2.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListBackupsResponse): google.bigtable.admin.v2.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListBackupsResponse; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListBackupsResponse; + + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListBackupsResponse; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyBackupRequest. */ + interface ICopyBackupRequest { + + /** CopyBackupRequest parent */ + parent?: (string|null); + + /** CopyBackupRequest backupId */ + backupId?: (string|null); + + /** CopyBackupRequest sourceBackup */ + sourceBackup?: (string|null); + + /** CopyBackupRequest expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CopyBackupRequest. */ + class CopyBackupRequest implements ICopyBackupRequest { + + /** + * Constructs a new CopyBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICopyBackupRequest); + + /** CopyBackupRequest parent. */ + public parent: string; + + /** CopyBackupRequest backupId. */ + public backupId: string; + + /** CopyBackupRequest sourceBackup. */ + public sourceBackup: string; + + /** CopyBackupRequest expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CopyBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyBackupRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICopyBackupRequest): google.bigtable.admin.v2.CopyBackupRequest; + + /** + * Encodes the specified CopyBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupRequest.verify|verify} messages. + * @param message CopyBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICopyBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CopyBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupRequest.verify|verify} messages. + * @param message CopyBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICopyBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CopyBackupRequest; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CopyBackupRequest; + + /** + * Verifies a CopyBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CopyBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CopyBackupRequest; + + /** + * Creates a plain object from a CopyBackupRequest message. Also converts values to other types if specified. + * @param message CopyBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CopyBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyBackupMetadata. */ + interface ICopyBackupMetadata { + + /** CopyBackupMetadata name */ + name?: (string|null); + + /** CopyBackupMetadata sourceBackupInfo */ + sourceBackupInfo?: (google.bigtable.admin.v2.IBackupInfo|null); + + /** CopyBackupMetadata progress */ + progress?: (google.bigtable.admin.v2.IOperationProgress|null); + } + + /** Represents a CopyBackupMetadata. */ + class CopyBackupMetadata implements ICopyBackupMetadata { + + /** + * Constructs a new CopyBackupMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICopyBackupMetadata); + + /** CopyBackupMetadata name. */ + public name: string; + + /** CopyBackupMetadata sourceBackupInfo. */ + public sourceBackupInfo?: (google.bigtable.admin.v2.IBackupInfo|null); + + /** CopyBackupMetadata progress. */ + public progress?: (google.bigtable.admin.v2.IOperationProgress|null); + + /** + * Creates a new CopyBackupMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyBackupMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICopyBackupMetadata): google.bigtable.admin.v2.CopyBackupMetadata; + + /** + * Encodes the specified CopyBackupMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupMetadata.verify|verify} messages. + * @param message CopyBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICopyBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CopyBackupMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupMetadata.verify|verify} messages. + * @param message CopyBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICopyBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CopyBackupMetadata; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CopyBackupMetadata; + + /** + * Verifies a CopyBackupMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CopyBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyBackupMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CopyBackupMetadata; + + /** + * Creates a plain object from a CopyBackupMetadata message. Also converts values to other types if specified. + * @param message CopyBackupMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CopyBackupMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyBackupMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyBackupMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAuthorizedViewRequest. */ + interface ICreateAuthorizedViewRequest { + + /** CreateAuthorizedViewRequest parent */ + parent?: (string|null); + + /** CreateAuthorizedViewRequest authorizedViewId */ + authorizedViewId?: (string|null); + + /** CreateAuthorizedViewRequest authorizedView */ + authorizedView?: (google.bigtable.admin.v2.IAuthorizedView|null); + } + + /** Represents a CreateAuthorizedViewRequest. */ + class CreateAuthorizedViewRequest implements ICreateAuthorizedViewRequest { + + /** + * Constructs a new CreateAuthorizedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateAuthorizedViewRequest); + + /** CreateAuthorizedViewRequest parent. */ + public parent: string; + + /** CreateAuthorizedViewRequest authorizedViewId. */ + public authorizedViewId: string; + + /** CreateAuthorizedViewRequest authorizedView. */ + public authorizedView?: (google.bigtable.admin.v2.IAuthorizedView|null); + + /** + * Creates a new CreateAuthorizedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAuthorizedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateAuthorizedViewRequest): google.bigtable.admin.v2.CreateAuthorizedViewRequest; + + /** + * Encodes the specified CreateAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewRequest.verify|verify} messages. + * @param message CreateAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewRequest.verify|verify} messages. + * @param message CreateAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAuthorizedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateAuthorizedViewRequest; + + /** + * Decodes a CreateAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateAuthorizedViewRequest; + + /** + * Verifies a CreateAuthorizedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAuthorizedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateAuthorizedViewRequest; + + /** + * Creates a plain object from a CreateAuthorizedViewRequest message. Also converts values to other types if specified. + * @param message CreateAuthorizedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateAuthorizedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAuthorizedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAuthorizedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAuthorizedViewMetadata. */ + interface ICreateAuthorizedViewMetadata { + + /** CreateAuthorizedViewMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateAuthorizedViewRequest|null); + + /** CreateAuthorizedViewMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateAuthorizedViewMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateAuthorizedViewMetadata. */ + class CreateAuthorizedViewMetadata implements ICreateAuthorizedViewMetadata { + + /** + * Constructs a new CreateAuthorizedViewMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateAuthorizedViewMetadata); + + /** CreateAuthorizedViewMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateAuthorizedViewRequest|null); + + /** CreateAuthorizedViewMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateAuthorizedViewMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateAuthorizedViewMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAuthorizedViewMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateAuthorizedViewMetadata): google.bigtable.admin.v2.CreateAuthorizedViewMetadata; + + /** + * Encodes the specified CreateAuthorizedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewMetadata.verify|verify} messages. + * @param message CreateAuthorizedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateAuthorizedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAuthorizedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewMetadata.verify|verify} messages. + * @param message CreateAuthorizedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateAuthorizedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAuthorizedViewMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateAuthorizedViewMetadata; + + /** + * Decodes a CreateAuthorizedViewMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateAuthorizedViewMetadata; + + /** + * Verifies a CreateAuthorizedViewMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAuthorizedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAuthorizedViewMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateAuthorizedViewMetadata; + + /** + * Creates a plain object from a CreateAuthorizedViewMetadata message. Also converts values to other types if specified. + * @param message CreateAuthorizedViewMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateAuthorizedViewMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAuthorizedViewMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAuthorizedViewMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAuthorizedViewsRequest. */ + interface IListAuthorizedViewsRequest { + + /** ListAuthorizedViewsRequest parent */ + parent?: (string|null); + + /** ListAuthorizedViewsRequest pageSize */ + pageSize?: (number|null); + + /** ListAuthorizedViewsRequest pageToken */ + pageToken?: (string|null); + + /** ListAuthorizedViewsRequest view */ + view?: (google.bigtable.admin.v2.AuthorizedView.ResponseView|keyof typeof google.bigtable.admin.v2.AuthorizedView.ResponseView|null); + } + + /** Represents a ListAuthorizedViewsRequest. */ + class ListAuthorizedViewsRequest implements IListAuthorizedViewsRequest { + + /** + * Constructs a new ListAuthorizedViewsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListAuthorizedViewsRequest); + + /** ListAuthorizedViewsRequest parent. */ + public parent: string; + + /** ListAuthorizedViewsRequest pageSize. */ + public pageSize: number; + + /** ListAuthorizedViewsRequest pageToken. */ + public pageToken: string; + + /** ListAuthorizedViewsRequest view. */ + public view: (google.bigtable.admin.v2.AuthorizedView.ResponseView|keyof typeof google.bigtable.admin.v2.AuthorizedView.ResponseView); + + /** + * Creates a new ListAuthorizedViewsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAuthorizedViewsRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListAuthorizedViewsRequest): google.bigtable.admin.v2.ListAuthorizedViewsRequest; + + /** + * Encodes the specified ListAuthorizedViewsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsRequest.verify|verify} messages. + * @param message ListAuthorizedViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListAuthorizedViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAuthorizedViewsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsRequest.verify|verify} messages. + * @param message ListAuthorizedViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListAuthorizedViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAuthorizedViewsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAuthorizedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListAuthorizedViewsRequest; + + /** + * Decodes a ListAuthorizedViewsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAuthorizedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListAuthorizedViewsRequest; + + /** + * Verifies a ListAuthorizedViewsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAuthorizedViewsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAuthorizedViewsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListAuthorizedViewsRequest; + + /** + * Creates a plain object from a ListAuthorizedViewsRequest message. Also converts values to other types if specified. + * @param message ListAuthorizedViewsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListAuthorizedViewsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAuthorizedViewsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAuthorizedViewsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAuthorizedViewsResponse. */ + interface IListAuthorizedViewsResponse { + + /** ListAuthorizedViewsResponse authorizedViews */ + authorizedViews?: (google.bigtable.admin.v2.IAuthorizedView[]|null); + + /** ListAuthorizedViewsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAuthorizedViewsResponse. */ + class ListAuthorizedViewsResponse implements IListAuthorizedViewsResponse { + + /** + * Constructs a new ListAuthorizedViewsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListAuthorizedViewsResponse); + + /** ListAuthorizedViewsResponse authorizedViews. */ + public authorizedViews: google.bigtable.admin.v2.IAuthorizedView[]; + + /** ListAuthorizedViewsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAuthorizedViewsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAuthorizedViewsResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListAuthorizedViewsResponse): google.bigtable.admin.v2.ListAuthorizedViewsResponse; + + /** + * Encodes the specified ListAuthorizedViewsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsResponse.verify|verify} messages. + * @param message ListAuthorizedViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListAuthorizedViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAuthorizedViewsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsResponse.verify|verify} messages. + * @param message ListAuthorizedViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListAuthorizedViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAuthorizedViewsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAuthorizedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListAuthorizedViewsResponse; + + /** + * Decodes a ListAuthorizedViewsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAuthorizedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListAuthorizedViewsResponse; + + /** + * Verifies a ListAuthorizedViewsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAuthorizedViewsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAuthorizedViewsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListAuthorizedViewsResponse; + + /** + * Creates a plain object from a ListAuthorizedViewsResponse message. Also converts values to other types if specified. + * @param message ListAuthorizedViewsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListAuthorizedViewsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAuthorizedViewsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAuthorizedViewsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAuthorizedViewRequest. */ + interface IGetAuthorizedViewRequest { + + /** GetAuthorizedViewRequest name */ + name?: (string|null); + + /** GetAuthorizedViewRequest view */ + view?: (google.bigtable.admin.v2.AuthorizedView.ResponseView|keyof typeof google.bigtable.admin.v2.AuthorizedView.ResponseView|null); + } + + /** Represents a GetAuthorizedViewRequest. */ + class GetAuthorizedViewRequest implements IGetAuthorizedViewRequest { + + /** + * Constructs a new GetAuthorizedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetAuthorizedViewRequest); + + /** GetAuthorizedViewRequest name. */ + public name: string; + + /** GetAuthorizedViewRequest view. */ + public view: (google.bigtable.admin.v2.AuthorizedView.ResponseView|keyof typeof google.bigtable.admin.v2.AuthorizedView.ResponseView); + + /** + * Creates a new GetAuthorizedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAuthorizedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetAuthorizedViewRequest): google.bigtable.admin.v2.GetAuthorizedViewRequest; + + /** + * Encodes the specified GetAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetAuthorizedViewRequest.verify|verify} messages. + * @param message GetAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetAuthorizedViewRequest.verify|verify} messages. + * @param message GetAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAuthorizedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetAuthorizedViewRequest; + + /** + * Decodes a GetAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetAuthorizedViewRequest; + + /** + * Verifies a GetAuthorizedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAuthorizedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetAuthorizedViewRequest; + + /** + * Creates a plain object from a GetAuthorizedViewRequest message. Also converts values to other types if specified. + * @param message GetAuthorizedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetAuthorizedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAuthorizedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAuthorizedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAuthorizedViewRequest. */ + interface IUpdateAuthorizedViewRequest { + + /** UpdateAuthorizedViewRequest authorizedView */ + authorizedView?: (google.bigtable.admin.v2.IAuthorizedView|null); + + /** UpdateAuthorizedViewRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAuthorizedViewRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents an UpdateAuthorizedViewRequest. */ + class UpdateAuthorizedViewRequest implements IUpdateAuthorizedViewRequest { + + /** + * Constructs a new UpdateAuthorizedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateAuthorizedViewRequest); + + /** UpdateAuthorizedViewRequest authorizedView. */ + public authorizedView?: (google.bigtable.admin.v2.IAuthorizedView|null); + + /** UpdateAuthorizedViewRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAuthorizedViewRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new UpdateAuthorizedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAuthorizedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateAuthorizedViewRequest): google.bigtable.admin.v2.UpdateAuthorizedViewRequest; + + /** + * Encodes the specified UpdateAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewRequest.verify|verify} messages. + * @param message UpdateAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewRequest.verify|verify} messages. + * @param message UpdateAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAuthorizedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateAuthorizedViewRequest; + + /** + * Decodes an UpdateAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateAuthorizedViewRequest; + + /** + * Verifies an UpdateAuthorizedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAuthorizedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateAuthorizedViewRequest; + + /** + * Creates a plain object from an UpdateAuthorizedViewRequest message. Also converts values to other types if specified. + * @param message UpdateAuthorizedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateAuthorizedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAuthorizedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAuthorizedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAuthorizedViewMetadata. */ + interface IUpdateAuthorizedViewMetadata { + + /** UpdateAuthorizedViewMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.IUpdateAuthorizedViewRequest|null); + + /** UpdateAuthorizedViewMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateAuthorizedViewMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateAuthorizedViewMetadata. */ + class UpdateAuthorizedViewMetadata implements IUpdateAuthorizedViewMetadata { + + /** + * Constructs a new UpdateAuthorizedViewMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata); + + /** UpdateAuthorizedViewMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.IUpdateAuthorizedViewRequest|null); + + /** UpdateAuthorizedViewMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateAuthorizedViewMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateAuthorizedViewMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAuthorizedViewMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata): google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; + + /** + * Encodes the specified UpdateAuthorizedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.verify|verify} messages. + * @param message UpdateAuthorizedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAuthorizedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.verify|verify} messages. + * @param message UpdateAuthorizedViewMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAuthorizedViewMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; + + /** + * Decodes an UpdateAuthorizedViewMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; + + /** + * Verifies an UpdateAuthorizedViewMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAuthorizedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAuthorizedViewMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; + + /** + * Creates a plain object from an UpdateAuthorizedViewMetadata message. Also converts values to other types if specified. + * @param message UpdateAuthorizedViewMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateAuthorizedViewMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAuthorizedViewMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAuthorizedViewMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAuthorizedViewRequest. */ + interface IDeleteAuthorizedViewRequest { + + /** DeleteAuthorizedViewRequest name */ + name?: (string|null); + + /** DeleteAuthorizedViewRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteAuthorizedViewRequest. */ + class DeleteAuthorizedViewRequest implements IDeleteAuthorizedViewRequest { + + /** + * Constructs a new DeleteAuthorizedViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteAuthorizedViewRequest); + + /** DeleteAuthorizedViewRequest name. */ + public name: string; + + /** DeleteAuthorizedViewRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteAuthorizedViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAuthorizedViewRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteAuthorizedViewRequest): google.bigtable.admin.v2.DeleteAuthorizedViewRequest; + + /** + * Encodes the specified DeleteAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteAuthorizedViewRequest.verify|verify} messages. + * @param message DeleteAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteAuthorizedViewRequest.verify|verify} messages. + * @param message DeleteAuthorizedViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteAuthorizedViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAuthorizedViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteAuthorizedViewRequest; + + /** + * Decodes a DeleteAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteAuthorizedViewRequest; + + /** + * Verifies a DeleteAuthorizedViewRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAuthorizedViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteAuthorizedViewRequest; + + /** + * Creates a plain object from a DeleteAuthorizedViewRequest message. Also converts values to other types if specified. + * @param message DeleteAuthorizedViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteAuthorizedViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAuthorizedViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAuthorizedViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSchemaBundleRequest. */ + interface ICreateSchemaBundleRequest { + + /** CreateSchemaBundleRequest parent */ + parent?: (string|null); + + /** CreateSchemaBundleRequest schemaBundleId */ + schemaBundleId?: (string|null); + + /** CreateSchemaBundleRequest schemaBundle */ + schemaBundle?: (google.bigtable.admin.v2.ISchemaBundle|null); + } + + /** Represents a CreateSchemaBundleRequest. */ + class CreateSchemaBundleRequest implements ICreateSchemaBundleRequest { + + /** + * Constructs a new CreateSchemaBundleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateSchemaBundleRequest); + + /** CreateSchemaBundleRequest parent. */ + public parent: string; + + /** CreateSchemaBundleRequest schemaBundleId. */ + public schemaBundleId: string; + + /** CreateSchemaBundleRequest schemaBundle. */ + public schemaBundle?: (google.bigtable.admin.v2.ISchemaBundle|null); + + /** + * Creates a new CreateSchemaBundleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSchemaBundleRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateSchemaBundleRequest): google.bigtable.admin.v2.CreateSchemaBundleRequest; + + /** + * Encodes the specified CreateSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleRequest.verify|verify} messages. + * @param message CreateSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleRequest.verify|verify} messages. + * @param message CreateSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSchemaBundleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateSchemaBundleRequest; + + /** + * Decodes a CreateSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateSchemaBundleRequest; + + /** + * Verifies a CreateSchemaBundleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSchemaBundleRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateSchemaBundleRequest; + + /** + * Creates a plain object from a CreateSchemaBundleRequest message. Also converts values to other types if specified. + * @param message CreateSchemaBundleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateSchemaBundleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSchemaBundleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSchemaBundleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSchemaBundleMetadata. */ + interface ICreateSchemaBundleMetadata { + + /** CreateSchemaBundleMetadata name */ + name?: (string|null); + + /** CreateSchemaBundleMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CreateSchemaBundleMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateSchemaBundleMetadata. */ + class CreateSchemaBundleMetadata implements ICreateSchemaBundleMetadata { + + /** + * Constructs a new CreateSchemaBundleMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateSchemaBundleMetadata); + + /** CreateSchemaBundleMetadata name. */ + public name: string; + + /** CreateSchemaBundleMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CreateSchemaBundleMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateSchemaBundleMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSchemaBundleMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.ICreateSchemaBundleMetadata): google.bigtable.admin.v2.CreateSchemaBundleMetadata; + + /** + * Encodes the specified CreateSchemaBundleMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleMetadata.verify|verify} messages. + * @param message CreateSchemaBundleMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ICreateSchemaBundleMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSchemaBundleMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleMetadata.verify|verify} messages. + * @param message CreateSchemaBundleMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateSchemaBundleMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSchemaBundleMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateSchemaBundleMetadata; + + /** + * Decodes a CreateSchemaBundleMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateSchemaBundleMetadata; + + /** + * Verifies a CreateSchemaBundleMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSchemaBundleMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSchemaBundleMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateSchemaBundleMetadata; + + /** + * Creates a plain object from a CreateSchemaBundleMetadata message. Also converts values to other types if specified. + * @param message CreateSchemaBundleMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateSchemaBundleMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSchemaBundleMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSchemaBundleMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSchemaBundleRequest. */ + interface IUpdateSchemaBundleRequest { + + /** UpdateSchemaBundleRequest schemaBundle */ + schemaBundle?: (google.bigtable.admin.v2.ISchemaBundle|null); + + /** UpdateSchemaBundleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSchemaBundleRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); + } + + /** Represents an UpdateSchemaBundleRequest. */ + class UpdateSchemaBundleRequest implements IUpdateSchemaBundleRequest { + + /** + * Constructs a new UpdateSchemaBundleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateSchemaBundleRequest); + + /** UpdateSchemaBundleRequest schemaBundle. */ + public schemaBundle?: (google.bigtable.admin.v2.ISchemaBundle|null); + + /** UpdateSchemaBundleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSchemaBundleRequest ignoreWarnings. */ + public ignoreWarnings: boolean; + + /** + * Creates a new UpdateSchemaBundleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSchemaBundleRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateSchemaBundleRequest): google.bigtable.admin.v2.UpdateSchemaBundleRequest; + + /** + * Encodes the specified UpdateSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleRequest.verify|verify} messages. + * @param message UpdateSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleRequest.verify|verify} messages. + * @param message UpdateSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSchemaBundleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateSchemaBundleRequest; + + /** + * Decodes an UpdateSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateSchemaBundleRequest; + + /** + * Verifies an UpdateSchemaBundleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSchemaBundleRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateSchemaBundleRequest; + + /** + * Creates a plain object from an UpdateSchemaBundleRequest message. Also converts values to other types if specified. + * @param message UpdateSchemaBundleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateSchemaBundleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSchemaBundleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSchemaBundleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSchemaBundleMetadata. */ + interface IUpdateSchemaBundleMetadata { + + /** UpdateSchemaBundleMetadata name */ + name?: (string|null); + + /** UpdateSchemaBundleMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateSchemaBundleMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateSchemaBundleMetadata. */ + class UpdateSchemaBundleMetadata implements IUpdateSchemaBundleMetadata { + + /** + * Constructs a new UpdateSchemaBundleMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IUpdateSchemaBundleMetadata); + + /** UpdateSchemaBundleMetadata name. */ + public name: string; + + /** UpdateSchemaBundleMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateSchemaBundleMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateSchemaBundleMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSchemaBundleMetadata instance + */ + public static create(properties?: google.bigtable.admin.v2.IUpdateSchemaBundleMetadata): google.bigtable.admin.v2.UpdateSchemaBundleMetadata; + + /** + * Encodes the specified UpdateSchemaBundleMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleMetadata.verify|verify} messages. + * @param message UpdateSchemaBundleMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IUpdateSchemaBundleMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSchemaBundleMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleMetadata.verify|verify} messages. + * @param message UpdateSchemaBundleMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateSchemaBundleMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSchemaBundleMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateSchemaBundleMetadata; + + /** + * Decodes an UpdateSchemaBundleMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateSchemaBundleMetadata; + + /** + * Verifies an UpdateSchemaBundleMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSchemaBundleMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSchemaBundleMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateSchemaBundleMetadata; + + /** + * Creates a plain object from an UpdateSchemaBundleMetadata message. Also converts values to other types if specified. + * @param message UpdateSchemaBundleMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.UpdateSchemaBundleMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSchemaBundleMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSchemaBundleMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSchemaBundleRequest. */ + interface IGetSchemaBundleRequest { + + /** GetSchemaBundleRequest name */ + name?: (string|null); + } + + /** Represents a GetSchemaBundleRequest. */ + class GetSchemaBundleRequest implements IGetSchemaBundleRequest { + + /** + * Constructs a new GetSchemaBundleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGetSchemaBundleRequest); + + /** GetSchemaBundleRequest name. */ + public name: string; + + /** + * Creates a new GetSchemaBundleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSchemaBundleRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IGetSchemaBundleRequest): google.bigtable.admin.v2.GetSchemaBundleRequest; + + /** + * Encodes the specified GetSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetSchemaBundleRequest.verify|verify} messages. + * @param message GetSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGetSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetSchemaBundleRequest.verify|verify} messages. + * @param message GetSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGetSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSchemaBundleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetSchemaBundleRequest; + + /** + * Decodes a GetSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetSchemaBundleRequest; + + /** + * Verifies a GetSchemaBundleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSchemaBundleRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetSchemaBundleRequest; + + /** + * Creates a plain object from a GetSchemaBundleRequest message. Also converts values to other types if specified. + * @param message GetSchemaBundleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GetSchemaBundleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSchemaBundleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSchemaBundleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemaBundlesRequest. */ + interface IListSchemaBundlesRequest { + + /** ListSchemaBundlesRequest parent */ + parent?: (string|null); + + /** ListSchemaBundlesRequest pageSize */ + pageSize?: (number|null); + + /** ListSchemaBundlesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSchemaBundlesRequest. */ + class ListSchemaBundlesRequest implements IListSchemaBundlesRequest { + + /** + * Constructs a new ListSchemaBundlesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListSchemaBundlesRequest); + + /** ListSchemaBundlesRequest parent. */ + public parent: string; + + /** ListSchemaBundlesRequest pageSize. */ + public pageSize: number; + + /** ListSchemaBundlesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSchemaBundlesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemaBundlesRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IListSchemaBundlesRequest): google.bigtable.admin.v2.ListSchemaBundlesRequest; + + /** + * Encodes the specified ListSchemaBundlesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesRequest.verify|verify} messages. + * @param message ListSchemaBundlesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListSchemaBundlesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemaBundlesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesRequest.verify|verify} messages. + * @param message ListSchemaBundlesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListSchemaBundlesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemaBundlesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemaBundlesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListSchemaBundlesRequest; + + /** + * Decodes a ListSchemaBundlesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemaBundlesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListSchemaBundlesRequest; + + /** + * Verifies a ListSchemaBundlesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSchemaBundlesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemaBundlesRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListSchemaBundlesRequest; + + /** + * Creates a plain object from a ListSchemaBundlesRequest message. Also converts values to other types if specified. + * @param message ListSchemaBundlesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListSchemaBundlesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemaBundlesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemaBundlesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemaBundlesResponse. */ + interface IListSchemaBundlesResponse { + + /** ListSchemaBundlesResponse schemaBundles */ + schemaBundles?: (google.bigtable.admin.v2.ISchemaBundle[]|null); + + /** ListSchemaBundlesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSchemaBundlesResponse. */ + class ListSchemaBundlesResponse implements IListSchemaBundlesResponse { + + /** + * Constructs a new ListSchemaBundlesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IListSchemaBundlesResponse); + + /** ListSchemaBundlesResponse schemaBundles. */ + public schemaBundles: google.bigtable.admin.v2.ISchemaBundle[]; + + /** ListSchemaBundlesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSchemaBundlesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemaBundlesResponse instance + */ + public static create(properties?: google.bigtable.admin.v2.IListSchemaBundlesResponse): google.bigtable.admin.v2.ListSchemaBundlesResponse; + + /** + * Encodes the specified ListSchemaBundlesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesResponse.verify|verify} messages. + * @param message ListSchemaBundlesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IListSchemaBundlesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemaBundlesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesResponse.verify|verify} messages. + * @param message ListSchemaBundlesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IListSchemaBundlesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemaBundlesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemaBundlesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListSchemaBundlesResponse; + + /** + * Decodes a ListSchemaBundlesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemaBundlesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListSchemaBundlesResponse; + + /** + * Verifies a ListSchemaBundlesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSchemaBundlesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemaBundlesResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListSchemaBundlesResponse; + + /** + * Creates a plain object from a ListSchemaBundlesResponse message. Also converts values to other types if specified. + * @param message ListSchemaBundlesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ListSchemaBundlesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemaBundlesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemaBundlesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSchemaBundleRequest. */ + interface IDeleteSchemaBundleRequest { + + /** DeleteSchemaBundleRequest name */ + name?: (string|null); + + /** DeleteSchemaBundleRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteSchemaBundleRequest. */ + class DeleteSchemaBundleRequest implements IDeleteSchemaBundleRequest { + + /** + * Constructs a new DeleteSchemaBundleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IDeleteSchemaBundleRequest); + + /** DeleteSchemaBundleRequest name. */ + public name: string; + + /** DeleteSchemaBundleRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteSchemaBundleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSchemaBundleRequest instance + */ + public static create(properties?: google.bigtable.admin.v2.IDeleteSchemaBundleRequest): google.bigtable.admin.v2.DeleteSchemaBundleRequest; + + /** + * Encodes the specified DeleteSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteSchemaBundleRequest.verify|verify} messages. + * @param message DeleteSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IDeleteSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteSchemaBundleRequest.verify|verify} messages. + * @param message DeleteSchemaBundleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteSchemaBundleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSchemaBundleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteSchemaBundleRequest; + + /** + * Decodes a DeleteSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteSchemaBundleRequest; + + /** + * Verifies a DeleteSchemaBundleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSchemaBundleRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteSchemaBundleRequest; + + /** + * Creates a plain object from a DeleteSchemaBundleRequest message. Also converts values to other types if specified. + * @param message DeleteSchemaBundleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.DeleteSchemaBundleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSchemaBundleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSchemaBundleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreInfo. */ + interface IRestoreInfo { + + /** RestoreInfo sourceType */ + sourceType?: (google.bigtable.admin.v2.RestoreSourceType|keyof typeof google.bigtable.admin.v2.RestoreSourceType|null); + + /** RestoreInfo backupInfo */ + backupInfo?: (google.bigtable.admin.v2.IBackupInfo|null); + } + + /** Represents a RestoreInfo. */ + class RestoreInfo implements IRestoreInfo { + + /** + * Constructs a new RestoreInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IRestoreInfo); + + /** RestoreInfo sourceType. */ + public sourceType: (google.bigtable.admin.v2.RestoreSourceType|keyof typeof google.bigtable.admin.v2.RestoreSourceType); + + /** RestoreInfo backupInfo. */ + public backupInfo?: (google.bigtable.admin.v2.IBackupInfo|null); + + /** RestoreInfo sourceInfo. */ + public sourceInfo?: "backupInfo"; + + /** + * Creates a new RestoreInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreInfo instance + */ + public static create(properties?: google.bigtable.admin.v2.IRestoreInfo): google.bigtable.admin.v2.RestoreInfo; + + /** + * Encodes the specified RestoreInfo message. Does not implicitly {@link google.bigtable.admin.v2.RestoreInfo.verify|verify} messages. + * @param message RestoreInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IRestoreInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreInfo message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.RestoreInfo.verify|verify} messages. + * @param message RestoreInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IRestoreInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.RestoreInfo; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.RestoreInfo; + + /** + * Verifies a RestoreInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreInfo + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.RestoreInfo; + + /** + * Creates a plain object from a RestoreInfo message. Also converts values to other types if specified. + * @param message RestoreInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.RestoreInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChangeStreamConfig. */ + interface IChangeStreamConfig { + + /** ChangeStreamConfig retentionPeriod */ + retentionPeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a ChangeStreamConfig. */ + class ChangeStreamConfig implements IChangeStreamConfig { + + /** + * Constructs a new ChangeStreamConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IChangeStreamConfig); + + /** ChangeStreamConfig retentionPeriod. */ + public retentionPeriod?: (google.protobuf.IDuration|null); + + /** + * Creates a new ChangeStreamConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ChangeStreamConfig instance + */ + public static create(properties?: google.bigtable.admin.v2.IChangeStreamConfig): google.bigtable.admin.v2.ChangeStreamConfig; + + /** + * Encodes the specified ChangeStreamConfig message. Does not implicitly {@link google.bigtable.admin.v2.ChangeStreamConfig.verify|verify} messages. + * @param message ChangeStreamConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IChangeStreamConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChangeStreamConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ChangeStreamConfig.verify|verify} messages. + * @param message ChangeStreamConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IChangeStreamConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChangeStreamConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChangeStreamConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ChangeStreamConfig; + + /** + * Decodes a ChangeStreamConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChangeStreamConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ChangeStreamConfig; + + /** + * Verifies a ChangeStreamConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChangeStreamConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChangeStreamConfig + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ChangeStreamConfig; + + /** + * Creates a plain object from a ChangeStreamConfig message. Also converts values to other types if specified. + * @param message ChangeStreamConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ChangeStreamConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChangeStreamConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChangeStreamConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Table. */ + interface ITable { + + /** Table name */ + name?: (string|null); + + /** Table clusterStates */ + clusterStates?: ({ [k: string]: google.bigtable.admin.v2.Table.IClusterState }|null); + + /** Table columnFamilies */ + columnFamilies?: ({ [k: string]: google.bigtable.admin.v2.IColumnFamily }|null); + + /** Table granularity */ + granularity?: (google.bigtable.admin.v2.Table.TimestampGranularity|keyof typeof google.bigtable.admin.v2.Table.TimestampGranularity|null); + + /** Table restoreInfo */ + restoreInfo?: (google.bigtable.admin.v2.IRestoreInfo|null); + + /** Table changeStreamConfig */ + changeStreamConfig?: (google.bigtable.admin.v2.IChangeStreamConfig|null); + + /** Table deletionProtection */ + deletionProtection?: (boolean|null); + + /** Table automatedBackupPolicy */ + automatedBackupPolicy?: (google.bigtable.admin.v2.Table.IAutomatedBackupPolicy|null); + + /** Table rowKeySchema */ + rowKeySchema?: (google.bigtable.admin.v2.Type.IStruct|null); + } + + /** Represents a Table. */ + class Table implements ITable { + + /** + * Constructs a new Table. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ITable); + + /** Table name. */ + public name: string; + + /** Table clusterStates. */ + public clusterStates: { [k: string]: google.bigtable.admin.v2.Table.IClusterState }; + + /** Table columnFamilies. */ + public columnFamilies: { [k: string]: google.bigtable.admin.v2.IColumnFamily }; + + /** Table granularity. */ + public granularity: (google.bigtable.admin.v2.Table.TimestampGranularity|keyof typeof google.bigtable.admin.v2.Table.TimestampGranularity); + + /** Table restoreInfo. */ + public restoreInfo?: (google.bigtable.admin.v2.IRestoreInfo|null); + + /** Table changeStreamConfig. */ + public changeStreamConfig?: (google.bigtable.admin.v2.IChangeStreamConfig|null); + + /** Table deletionProtection. */ + public deletionProtection: boolean; + + /** Table automatedBackupPolicy. */ + public automatedBackupPolicy?: (google.bigtable.admin.v2.Table.IAutomatedBackupPolicy|null); + + /** Table rowKeySchema. */ + public rowKeySchema?: (google.bigtable.admin.v2.Type.IStruct|null); + + /** Table automatedBackupConfig. */ + public automatedBackupConfig?: "automatedBackupPolicy"; + + /** + * Creates a new Table instance using the specified properties. + * @param [properties] Properties to set + * @returns Table instance + */ + public static create(properties?: google.bigtable.admin.v2.ITable): google.bigtable.admin.v2.Table; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.bigtable.admin.v2.Table.verify|verify} messages. + * @param message Table message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Table.verify|verify} messages. + * @param message Table message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Table message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Table; + + /** + * Decodes a Table message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Table; + + /** + * Verifies a Table message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Table message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Table + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Table; + + /** + * Creates a plain object from a Table message. Also converts values to other types if specified. + * @param message Table + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Table, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Table to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Table + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Table { + + /** Properties of a ClusterState. */ + interface IClusterState { + + /** ClusterState replicationState */ + replicationState?: (google.bigtable.admin.v2.Table.ClusterState.ReplicationState|keyof typeof google.bigtable.admin.v2.Table.ClusterState.ReplicationState|null); + + /** ClusterState encryptionInfo */ + encryptionInfo?: (google.bigtable.admin.v2.IEncryptionInfo[]|null); + } + + /** Represents a ClusterState. */ + class ClusterState implements IClusterState { + + /** + * Constructs a new ClusterState. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Table.IClusterState); + + /** ClusterState replicationState. */ + public replicationState: (google.bigtable.admin.v2.Table.ClusterState.ReplicationState|keyof typeof google.bigtable.admin.v2.Table.ClusterState.ReplicationState); + + /** ClusterState encryptionInfo. */ + public encryptionInfo: google.bigtable.admin.v2.IEncryptionInfo[]; + + /** + * Creates a new ClusterState instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterState instance + */ + public static create(properties?: google.bigtable.admin.v2.Table.IClusterState): google.bigtable.admin.v2.Table.ClusterState; + + /** + * Encodes the specified ClusterState message. Does not implicitly {@link google.bigtable.admin.v2.Table.ClusterState.verify|verify} messages. + * @param message ClusterState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Table.IClusterState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterState message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Table.ClusterState.verify|verify} messages. + * @param message ClusterState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Table.IClusterState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Table.ClusterState; + + /** + * Decodes a ClusterState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Table.ClusterState; + + /** + * Verifies a ClusterState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterState + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Table.ClusterState; + + /** + * Creates a plain object from a ClusterState message. Also converts values to other types if specified. + * @param message ClusterState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Table.ClusterState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClusterState { + + /** ReplicationState enum. */ + enum ReplicationState { + STATE_NOT_KNOWN = 0, + INITIALIZING = 1, + PLANNED_MAINTENANCE = 2, + UNPLANNED_MAINTENANCE = 3, + READY = 4, + READY_OPTIMIZING = 5 + } + } + + /** TimestampGranularity enum. */ + enum TimestampGranularity { + TIMESTAMP_GRANULARITY_UNSPECIFIED = 0, + MILLIS = 1 + } + + /** View enum. */ + enum View { + VIEW_UNSPECIFIED = 0, + NAME_ONLY = 1, + SCHEMA_VIEW = 2, + REPLICATION_VIEW = 3, + ENCRYPTION_VIEW = 5, + FULL = 4 + } + + /** Properties of an AutomatedBackupPolicy. */ + interface IAutomatedBackupPolicy { + + /** AutomatedBackupPolicy retentionPeriod */ + retentionPeriod?: (google.protobuf.IDuration|null); + + /** AutomatedBackupPolicy frequency */ + frequency?: (google.protobuf.IDuration|null); + } + + /** Represents an AutomatedBackupPolicy. */ + class AutomatedBackupPolicy implements IAutomatedBackupPolicy { + + /** + * Constructs a new AutomatedBackupPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Table.IAutomatedBackupPolicy); + + /** AutomatedBackupPolicy retentionPeriod. */ + public retentionPeriod?: (google.protobuf.IDuration|null); + + /** AutomatedBackupPolicy frequency. */ + public frequency?: (google.protobuf.IDuration|null); + + /** + * Creates a new AutomatedBackupPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AutomatedBackupPolicy instance + */ + public static create(properties?: google.bigtable.admin.v2.Table.IAutomatedBackupPolicy): google.bigtable.admin.v2.Table.AutomatedBackupPolicy; + + /** + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.bigtable.admin.v2.Table.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Table.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Table.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Table.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Table.AutomatedBackupPolicy; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Table.AutomatedBackupPolicy; + + /** + * Verifies an AutomatedBackupPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutomatedBackupPolicy + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Table.AutomatedBackupPolicy; + + /** + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @param message AutomatedBackupPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Table.AutomatedBackupPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutomatedBackupPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutomatedBackupPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AuthorizedView. */ + interface IAuthorizedView { + + /** AuthorizedView name */ + name?: (string|null); + + /** AuthorizedView subsetView */ + subsetView?: (google.bigtable.admin.v2.AuthorizedView.ISubsetView|null); + + /** AuthorizedView etag */ + etag?: (string|null); + + /** AuthorizedView deletionProtection */ + deletionProtection?: (boolean|null); + } + + /** Represents an AuthorizedView. */ + class AuthorizedView implements IAuthorizedView { + + /** + * Constructs a new AuthorizedView. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IAuthorizedView); + + /** AuthorizedView name. */ + public name: string; + + /** AuthorizedView subsetView. */ + public subsetView?: (google.bigtable.admin.v2.AuthorizedView.ISubsetView|null); + + /** AuthorizedView etag. */ + public etag: string; + + /** AuthorizedView deletionProtection. */ + public deletionProtection: boolean; + + /** AuthorizedView authorizedView. */ + public authorizedView?: "subsetView"; + + /** + * Creates a new AuthorizedView instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizedView instance + */ + public static create(properties?: google.bigtable.admin.v2.IAuthorizedView): google.bigtable.admin.v2.AuthorizedView; + + /** + * Encodes the specified AuthorizedView message. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.verify|verify} messages. + * @param message AuthorizedView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IAuthorizedView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizedView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.verify|verify} messages. + * @param message AuthorizedView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IAuthorizedView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizedView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AuthorizedView; + + /** + * Decodes an AuthorizedView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AuthorizedView; + + /** + * Verifies an AuthorizedView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuthorizedView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizedView + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AuthorizedView; + + /** + * Creates a plain object from an AuthorizedView message. Also converts values to other types if specified. + * @param message AuthorizedView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AuthorizedView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizedView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizedView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuthorizedView { + + /** Properties of a FamilySubsets. */ + interface IFamilySubsets { + + /** FamilySubsets qualifiers */ + qualifiers?: (Uint8Array[]|null); + + /** FamilySubsets qualifierPrefixes */ + qualifierPrefixes?: (Uint8Array[]|null); + } + + /** Represents a FamilySubsets. */ + class FamilySubsets implements IFamilySubsets { + + /** + * Constructs a new FamilySubsets. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AuthorizedView.IFamilySubsets); + + /** FamilySubsets qualifiers. */ + public qualifiers: Uint8Array[]; + + /** FamilySubsets qualifierPrefixes. */ + public qualifierPrefixes: Uint8Array[]; + + /** + * Creates a new FamilySubsets instance using the specified properties. + * @param [properties] Properties to set + * @returns FamilySubsets instance + */ + public static create(properties?: google.bigtable.admin.v2.AuthorizedView.IFamilySubsets): google.bigtable.admin.v2.AuthorizedView.FamilySubsets; + + /** + * Encodes the specified FamilySubsets message. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.FamilySubsets.verify|verify} messages. + * @param message FamilySubsets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AuthorizedView.IFamilySubsets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FamilySubsets message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.FamilySubsets.verify|verify} messages. + * @param message FamilySubsets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AuthorizedView.IFamilySubsets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FamilySubsets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FamilySubsets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AuthorizedView.FamilySubsets; + + /** + * Decodes a FamilySubsets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FamilySubsets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AuthorizedView.FamilySubsets; + + /** + * Verifies a FamilySubsets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FamilySubsets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FamilySubsets + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AuthorizedView.FamilySubsets; + + /** + * Creates a plain object from a FamilySubsets message. Also converts values to other types if specified. + * @param message FamilySubsets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AuthorizedView.FamilySubsets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FamilySubsets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FamilySubsets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubsetView. */ + interface ISubsetView { + + /** SubsetView rowPrefixes */ + rowPrefixes?: (Uint8Array[]|null); + + /** SubsetView familySubsets */ + familySubsets?: ({ [k: string]: google.bigtable.admin.v2.AuthorizedView.IFamilySubsets }|null); + } + + /** Represents a SubsetView. */ + class SubsetView implements ISubsetView { + + /** + * Constructs a new SubsetView. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AuthorizedView.ISubsetView); + + /** SubsetView rowPrefixes. */ + public rowPrefixes: Uint8Array[]; + + /** SubsetView familySubsets. */ + public familySubsets: { [k: string]: google.bigtable.admin.v2.AuthorizedView.IFamilySubsets }; + + /** + * Creates a new SubsetView instance using the specified properties. + * @param [properties] Properties to set + * @returns SubsetView instance + */ + public static create(properties?: google.bigtable.admin.v2.AuthorizedView.ISubsetView): google.bigtable.admin.v2.AuthorizedView.SubsetView; + + /** + * Encodes the specified SubsetView message. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.SubsetView.verify|verify} messages. + * @param message SubsetView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AuthorizedView.ISubsetView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubsetView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.SubsetView.verify|verify} messages. + * @param message SubsetView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AuthorizedView.ISubsetView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubsetView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubsetView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AuthorizedView.SubsetView; + + /** + * Decodes a SubsetView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubsetView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AuthorizedView.SubsetView; + + /** + * Verifies a SubsetView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubsetView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubsetView + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AuthorizedView.SubsetView; + + /** + * Creates a plain object from a SubsetView message. Also converts values to other types if specified. + * @param message SubsetView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AuthorizedView.SubsetView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubsetView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubsetView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ResponseView enum. */ + enum ResponseView { + RESPONSE_VIEW_UNSPECIFIED = 0, + NAME_ONLY = 1, + BASIC = 2, + FULL = 3 + } + } + + /** Properties of a ColumnFamily. */ + interface IColumnFamily { + + /** ColumnFamily gcRule */ + gcRule?: (google.bigtable.admin.v2.IGcRule|null); + + /** ColumnFamily valueType */ + valueType?: (google.bigtable.admin.v2.IType|null); + } + + /** Represents a ColumnFamily. */ + class ColumnFamily implements IColumnFamily { + + /** + * Constructs a new ColumnFamily. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IColumnFamily); + + /** ColumnFamily gcRule. */ + public gcRule?: (google.bigtable.admin.v2.IGcRule|null); + + /** ColumnFamily valueType. */ + public valueType?: (google.bigtable.admin.v2.IType|null); + + /** + * Creates a new ColumnFamily instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnFamily instance + */ + public static create(properties?: google.bigtable.admin.v2.IColumnFamily): google.bigtable.admin.v2.ColumnFamily; + + /** + * Encodes the specified ColumnFamily message. Does not implicitly {@link google.bigtable.admin.v2.ColumnFamily.verify|verify} messages. + * @param message ColumnFamily message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IColumnFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnFamily message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ColumnFamily.verify|verify} messages. + * @param message ColumnFamily message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IColumnFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnFamily message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ColumnFamily; + + /** + * Decodes a ColumnFamily message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ColumnFamily; + + /** + * Verifies a ColumnFamily message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnFamily message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnFamily + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ColumnFamily; + + /** + * Creates a plain object from a ColumnFamily message. Also converts values to other types if specified. + * @param message ColumnFamily + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ColumnFamily, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnFamily to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnFamily + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcRule. */ + interface IGcRule { + + /** GcRule maxNumVersions */ + maxNumVersions?: (number|null); + + /** GcRule maxAge */ + maxAge?: (google.protobuf.IDuration|null); + + /** GcRule intersection */ + intersection?: (google.bigtable.admin.v2.GcRule.IIntersection|null); + + /** GcRule union */ + union?: (google.bigtable.admin.v2.GcRule.IUnion|null); + } + + /** Represents a GcRule. */ + class GcRule implements IGcRule { + + /** + * Constructs a new GcRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IGcRule); + + /** GcRule maxNumVersions. */ + public maxNumVersions?: (number|null); + + /** GcRule maxAge. */ + public maxAge?: (google.protobuf.IDuration|null); + + /** GcRule intersection. */ + public intersection?: (google.bigtable.admin.v2.GcRule.IIntersection|null); + + /** GcRule union. */ + public union?: (google.bigtable.admin.v2.GcRule.IUnion|null); + + /** GcRule rule. */ + public rule?: ("maxNumVersions"|"maxAge"|"intersection"|"union"); + + /** + * Creates a new GcRule instance using the specified properties. + * @param [properties] Properties to set + * @returns GcRule instance + */ + public static create(properties?: google.bigtable.admin.v2.IGcRule): google.bigtable.admin.v2.GcRule; + + /** + * Encodes the specified GcRule message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.verify|verify} messages. + * @param message GcRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IGcRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcRule message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.verify|verify} messages. + * @param message GcRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IGcRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GcRule; + + /** + * Decodes a GcRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GcRule; + + /** + * Verifies a GcRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcRule + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GcRule; + + /** + * Creates a plain object from a GcRule message. Also converts values to other types if specified. + * @param message GcRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GcRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GcRule { + + /** Properties of an Intersection. */ + interface IIntersection { + + /** Intersection rules */ + rules?: (google.bigtable.admin.v2.IGcRule[]|null); + } + + /** Represents an Intersection. */ + class Intersection implements IIntersection { + + /** + * Constructs a new Intersection. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.GcRule.IIntersection); + + /** Intersection rules. */ + public rules: google.bigtable.admin.v2.IGcRule[]; + + /** + * Creates a new Intersection instance using the specified properties. + * @param [properties] Properties to set + * @returns Intersection instance + */ + public static create(properties?: google.bigtable.admin.v2.GcRule.IIntersection): google.bigtable.admin.v2.GcRule.Intersection; + + /** + * Encodes the specified Intersection message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Intersection.verify|verify} messages. + * @param message Intersection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.GcRule.IIntersection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Intersection message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Intersection.verify|verify} messages. + * @param message Intersection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.GcRule.IIntersection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Intersection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Intersection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GcRule.Intersection; + + /** + * Decodes an Intersection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Intersection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GcRule.Intersection; + + /** + * Verifies an Intersection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Intersection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Intersection + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GcRule.Intersection; + + /** + * Creates a plain object from an Intersection message. Also converts values to other types if specified. + * @param message Intersection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GcRule.Intersection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Intersection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Intersection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Union. */ + interface IUnion { + + /** Union rules */ + rules?: (google.bigtable.admin.v2.IGcRule[]|null); + } + + /** Represents an Union. */ + class Union implements IUnion { + + /** + * Constructs a new Union. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.GcRule.IUnion); + + /** Union rules. */ + public rules: google.bigtable.admin.v2.IGcRule[]; + + /** + * Creates a new Union instance using the specified properties. + * @param [properties] Properties to set + * @returns Union instance + */ + public static create(properties?: google.bigtable.admin.v2.GcRule.IUnion): google.bigtable.admin.v2.GcRule.Union; + + /** + * Encodes the specified Union message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Union.verify|verify} messages. + * @param message Union message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.GcRule.IUnion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Union message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Union.verify|verify} messages. + * @param message Union message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.GcRule.IUnion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Union message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Union + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GcRule.Union; + + /** + * Decodes an Union message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Union + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GcRule.Union; + + /** + * Verifies an Union message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Union message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Union + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GcRule.Union; + + /** + * Creates a plain object from an Union message. Also converts values to other types if specified. + * @param message Union + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.GcRule.Union, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Union to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Union + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EncryptionInfo. */ + interface IEncryptionInfo { + + /** EncryptionInfo encryptionType */ + encryptionType?: (google.bigtable.admin.v2.EncryptionInfo.EncryptionType|keyof typeof google.bigtable.admin.v2.EncryptionInfo.EncryptionType|null); + + /** EncryptionInfo encryptionStatus */ + encryptionStatus?: (google.rpc.IStatus|null); + + /** EncryptionInfo kmsKeyVersion */ + kmsKeyVersion?: (string|null); + } + + /** Represents an EncryptionInfo. */ + class EncryptionInfo implements IEncryptionInfo { + + /** + * Constructs a new EncryptionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IEncryptionInfo); + + /** EncryptionInfo encryptionType. */ + public encryptionType: (google.bigtable.admin.v2.EncryptionInfo.EncryptionType|keyof typeof google.bigtable.admin.v2.EncryptionInfo.EncryptionType); + + /** EncryptionInfo encryptionStatus. */ + public encryptionStatus?: (google.rpc.IStatus|null); + + /** EncryptionInfo kmsKeyVersion. */ + public kmsKeyVersion: string; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionInfo instance + */ + public static create(properties?: google.bigtable.admin.v2.IEncryptionInfo): google.bigtable.admin.v2.EncryptionInfo; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.bigtable.admin.v2.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.EncryptionInfo; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.EncryptionInfo; + + /** + * Verifies an EncryptionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionInfo + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.EncryptionInfo; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @param message EncryptionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EncryptionInfo { + + /** EncryptionType enum. */ + enum EncryptionType { + ENCRYPTION_TYPE_UNSPECIFIED = 0, + GOOGLE_DEFAULT_ENCRYPTION = 1, + CUSTOMER_MANAGED_ENCRYPTION = 2 + } + } + + /** Properties of a Snapshot. */ + interface ISnapshot { + + /** Snapshot name */ + name?: (string|null); + + /** Snapshot sourceTable */ + sourceTable?: (google.bigtable.admin.v2.ITable|null); + + /** Snapshot dataSizeBytes */ + dataSizeBytes?: (number|Long|string|null); + + /** Snapshot createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot state */ + state?: (google.bigtable.admin.v2.Snapshot.State|keyof typeof google.bigtable.admin.v2.Snapshot.State|null); + + /** Snapshot description */ + description?: (string|null); + } + + /** Represents a Snapshot. */ + class Snapshot implements ISnapshot { + + /** + * Constructs a new Snapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ISnapshot); + + /** Snapshot name. */ + public name: string; + + /** Snapshot sourceTable. */ + public sourceTable?: (google.bigtable.admin.v2.ITable|null); + + /** Snapshot dataSizeBytes. */ + public dataSizeBytes: (number|Long|string); + + /** Snapshot createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot state. */ + public state: (google.bigtable.admin.v2.Snapshot.State|keyof typeof google.bigtable.admin.v2.Snapshot.State); + + /** Snapshot description. */ + public description: string; + + /** + * Creates a new Snapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns Snapshot instance + */ + public static create(properties?: google.bigtable.admin.v2.ISnapshot): google.bigtable.admin.v2.Snapshot; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.bigtable.admin.v2.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Snapshot; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Snapshot; + + /** + * Verifies a Snapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Snapshot + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Snapshot; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @param message Snapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Snapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Snapshot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Snapshot { + + /** State enum. */ + enum State { + STATE_NOT_KNOWN = 0, + READY = 1, + CREATING = 2 + } + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup sourceTable */ + sourceTable?: (string|null); + + /** Backup sourceBackup */ + sourceBackup?: (string|null); + + /** Backup expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Backup endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Backup sizeBytes */ + sizeBytes?: (number|Long|string|null); + + /** Backup state */ + state?: (google.bigtable.admin.v2.Backup.State|keyof typeof google.bigtable.admin.v2.Backup.State|null); + + /** Backup encryptionInfo */ + encryptionInfo?: (google.bigtable.admin.v2.IEncryptionInfo|null); + + /** Backup backupType */ + backupType?: (google.bigtable.admin.v2.Backup.BackupType|keyof typeof google.bigtable.admin.v2.Backup.BackupType|null); + + /** Backup hotToStandardTime */ + hotToStandardTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup sourceTable. */ + public sourceTable: string; + + /** Backup sourceBackup. */ + public sourceBackup: string; + + /** Backup expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Backup endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Backup sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** Backup state. */ + public state: (google.bigtable.admin.v2.Backup.State|keyof typeof google.bigtable.admin.v2.Backup.State); + + /** Backup encryptionInfo. */ + public encryptionInfo?: (google.bigtable.admin.v2.IEncryptionInfo|null); + + /** Backup backupType. */ + public backupType: (google.bigtable.admin.v2.Backup.BackupType|keyof typeof google.bigtable.admin.v2.Backup.BackupType); + + /** Backup hotToStandardTime. */ + public hotToStandardTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.bigtable.admin.v2.IBackup): google.bigtable.admin.v2.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.bigtable.admin.v2.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Backup { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2 + } + + /** BackupType enum. */ + enum BackupType { + BACKUP_TYPE_UNSPECIFIED = 0, + STANDARD = 1, + HOT = 2 + } + } + + /** Properties of a BackupInfo. */ + interface IBackupInfo { + + /** BackupInfo backup */ + backup?: (string|null); + + /** BackupInfo startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo sourceTable */ + sourceTable?: (string|null); + + /** BackupInfo sourceBackup */ + sourceBackup?: (string|null); + } + + /** Represents a BackupInfo. */ + class BackupInfo implements IBackupInfo { + + /** + * Constructs a new BackupInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IBackupInfo); + + /** BackupInfo backup. */ + public backup: string; + + /** BackupInfo startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo sourceTable. */ + public sourceTable: string; + + /** BackupInfo sourceBackup. */ + public sourceBackup: string; + + /** + * Creates a new BackupInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupInfo instance + */ + public static create(properties?: google.bigtable.admin.v2.IBackupInfo): google.bigtable.admin.v2.BackupInfo; + + /** + * Encodes the specified BackupInfo message. Does not implicitly {@link google.bigtable.admin.v2.BackupInfo.verify|verify} messages. + * @param message BackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupInfo message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.BackupInfo.verify|verify} messages. + * @param message BackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.BackupInfo; + + /** + * Decodes a BackupInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.BackupInfo; + + /** + * Verifies a BackupInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupInfo + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.BackupInfo; + + /** + * Creates a plain object from a BackupInfo message. Also converts values to other types if specified. + * @param message BackupInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.BackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RestoreSourceType enum. */ + enum RestoreSourceType { + RESTORE_SOURCE_TYPE_UNSPECIFIED = 0, + BACKUP = 1 + } + + /** Properties of a ProtoSchema. */ + interface IProtoSchema { + + /** ProtoSchema protoDescriptors */ + protoDescriptors?: (Uint8Array|Buffer|string|null); + } + + /** Represents a ProtoSchema. */ + class ProtoSchema implements IProtoSchema { + + /** + * Constructs a new ProtoSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IProtoSchema); + + /** ProtoSchema protoDescriptors. */ + public protoDescriptors: (Uint8Array|Buffer|string); + + /** + * Creates a new ProtoSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoSchema instance + */ + public static create(properties?: google.bigtable.admin.v2.IProtoSchema): google.bigtable.admin.v2.ProtoSchema; + + /** + * Encodes the specified ProtoSchema message. Does not implicitly {@link google.bigtable.admin.v2.ProtoSchema.verify|verify} messages. + * @param message ProtoSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IProtoSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoSchema message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ProtoSchema.verify|verify} messages. + * @param message ProtoSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IProtoSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ProtoSchema; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ProtoSchema; + + /** + * Verifies a ProtoSchema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoSchema + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ProtoSchema; + + /** + * Creates a plain object from a ProtoSchema message. Also converts values to other types if specified. + * @param message ProtoSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.ProtoSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SchemaBundle. */ + interface ISchemaBundle { + + /** SchemaBundle name */ + name?: (string|null); + + /** SchemaBundle protoSchema */ + protoSchema?: (google.bigtable.admin.v2.IProtoSchema|null); + + /** SchemaBundle etag */ + etag?: (string|null); + } + + /** Represents a SchemaBundle. */ + class SchemaBundle implements ISchemaBundle { + + /** + * Constructs a new SchemaBundle. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ISchemaBundle); + + /** SchemaBundle name. */ + public name: string; + + /** SchemaBundle protoSchema. */ + public protoSchema?: (google.bigtable.admin.v2.IProtoSchema|null); + + /** SchemaBundle etag. */ + public etag: string; + + /** SchemaBundle type. */ + public type?: "protoSchema"; + + /** + * Creates a new SchemaBundle instance using the specified properties. + * @param [properties] Properties to set + * @returns SchemaBundle instance + */ + public static create(properties?: google.bigtable.admin.v2.ISchemaBundle): google.bigtable.admin.v2.SchemaBundle; + + /** + * Encodes the specified SchemaBundle message. Does not implicitly {@link google.bigtable.admin.v2.SchemaBundle.verify|verify} messages. + * @param message SchemaBundle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.ISchemaBundle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchemaBundle message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SchemaBundle.verify|verify} messages. + * @param message SchemaBundle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.ISchemaBundle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchemaBundle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchemaBundle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.SchemaBundle; + + /** + * Decodes a SchemaBundle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchemaBundle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.SchemaBundle; + + /** + * Verifies a SchemaBundle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SchemaBundle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchemaBundle + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.SchemaBundle; + + /** + * Creates a plain object from a SchemaBundle message. Also converts values to other types if specified. + * @param message SchemaBundle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.SchemaBundle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchemaBundle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchemaBundle + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Type. */ + interface IType { + + /** Type bytesType */ + bytesType?: (google.bigtable.admin.v2.Type.IBytes|null); + + /** Type stringType */ + stringType?: (google.bigtable.admin.v2.Type.IString|null); + + /** Type int64Type */ + int64Type?: (google.bigtable.admin.v2.Type.IInt64|null); + + /** Type float32Type */ + float32Type?: (google.bigtable.admin.v2.Type.IFloat32|null); + + /** Type float64Type */ + float64Type?: (google.bigtable.admin.v2.Type.IFloat64|null); + + /** Type boolType */ + boolType?: (google.bigtable.admin.v2.Type.IBool|null); + + /** Type timestampType */ + timestampType?: (google.bigtable.admin.v2.Type.ITimestamp|null); + + /** Type dateType */ + dateType?: (google.bigtable.admin.v2.Type.IDate|null); + + /** Type aggregateType */ + aggregateType?: (google.bigtable.admin.v2.Type.IAggregate|null); + + /** Type structType */ + structType?: (google.bigtable.admin.v2.Type.IStruct|null); + + /** Type arrayType */ + arrayType?: (google.bigtable.admin.v2.Type.IArray|null); + + /** Type mapType */ + mapType?: (google.bigtable.admin.v2.Type.IMap|null); + + /** Type protoType */ + protoType?: (google.bigtable.admin.v2.Type.IProto|null); + + /** Type enumType */ + enumType?: (google.bigtable.admin.v2.Type.IEnum|null); + } + + /** Represents a Type. */ + class Type implements IType { + + /** + * Constructs a new Type. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.IType); + + /** Type bytesType. */ + public bytesType?: (google.bigtable.admin.v2.Type.IBytes|null); + + /** Type stringType. */ + public stringType?: (google.bigtable.admin.v2.Type.IString|null); + + /** Type int64Type. */ + public int64Type?: (google.bigtable.admin.v2.Type.IInt64|null); + + /** Type float32Type. */ + public float32Type?: (google.bigtable.admin.v2.Type.IFloat32|null); + + /** Type float64Type. */ + public float64Type?: (google.bigtable.admin.v2.Type.IFloat64|null); + + /** Type boolType. */ + public boolType?: (google.bigtable.admin.v2.Type.IBool|null); + + /** Type timestampType. */ + public timestampType?: (google.bigtable.admin.v2.Type.ITimestamp|null); + + /** Type dateType. */ + public dateType?: (google.bigtable.admin.v2.Type.IDate|null); + + /** Type aggregateType. */ + public aggregateType?: (google.bigtable.admin.v2.Type.IAggregate|null); + + /** Type structType. */ + public structType?: (google.bigtable.admin.v2.Type.IStruct|null); + + /** Type arrayType. */ + public arrayType?: (google.bigtable.admin.v2.Type.IArray|null); + + /** Type mapType. */ + public mapType?: (google.bigtable.admin.v2.Type.IMap|null); + + /** Type protoType. */ + public protoType?: (google.bigtable.admin.v2.Type.IProto|null); + + /** Type enumType. */ + public enumType?: (google.bigtable.admin.v2.Type.IEnum|null); + + /** Type kind. */ + public kind?: ("bytesType"|"stringType"|"int64Type"|"float32Type"|"float64Type"|"boolType"|"timestampType"|"dateType"|"aggregateType"|"structType"|"arrayType"|"mapType"|"protoType"|"enumType"); + + /** + * Creates a new Type instance using the specified properties. + * @param [properties] Properties to set + * @returns Type instance + */ + public static create(properties?: google.bigtable.admin.v2.IType): google.bigtable.admin.v2.Type; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.bigtable.admin.v2.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Type message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type; + + /** + * Verifies a Type message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Type + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @param message Type + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Type to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Type + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Type { + + /** Properties of a Bytes. */ + interface IBytes { + + /** Bytes encoding */ + encoding?: (google.bigtable.admin.v2.Type.Bytes.IEncoding|null); + } + + /** Represents a Bytes. */ + class Bytes implements IBytes { + + /** + * Constructs a new Bytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IBytes); + + /** Bytes encoding. */ + public encoding?: (google.bigtable.admin.v2.Type.Bytes.IEncoding|null); + + /** + * Creates a new Bytes instance using the specified properties. + * @param [properties] Properties to set + * @returns Bytes instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IBytes): google.bigtable.admin.v2.Type.Bytes; + + /** + * Encodes the specified Bytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.verify|verify} messages. + * @param message Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Bytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.verify|verify} messages. + * @param message Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Bytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Bytes; + + /** + * Decodes a Bytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Bytes; + + /** + * Verifies a Bytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Bytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Bytes; + + /** + * Creates a plain object from a Bytes message. Also converts values to other types if specified. + * @param message Bytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Bytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Bytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Bytes { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding raw */ + raw?: (google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Bytes.IEncoding); + + /** Encoding raw. */ + public raw?: (google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw|null); + + /** Encoding encoding. */ + public encoding?: "raw"; + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Bytes.IEncoding): google.bigtable.admin.v2.Type.Bytes.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Bytes.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Bytes.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Bytes.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Bytes.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Bytes.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Bytes.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of a Raw. */ + interface IRaw { + } + + /** Represents a Raw. */ + class Raw implements IRaw { + + /** + * Constructs a new Raw. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw); + + /** + * Creates a new Raw instance using the specified properties. + * @param [properties] Properties to set + * @returns Raw instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw): google.bigtable.admin.v2.Type.Bytes.Encoding.Raw; + + /** + * Encodes the specified Raw message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @param message Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Raw message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @param message Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Raw message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Bytes.Encoding.Raw; + + /** + * Decodes a Raw message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Bytes.Encoding.Raw; + + /** + * Verifies a Raw message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Raw message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Raw + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Bytes.Encoding.Raw; + + /** + * Creates a plain object from a Raw message. Also converts values to other types if specified. + * @param message Raw + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Bytes.Encoding.Raw, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Raw to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Raw + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a String. */ + interface IString { + + /** String encoding */ + encoding?: (google.bigtable.admin.v2.Type.String.IEncoding|null); + } + + /** Represents a String. */ + class String implements IString { + + /** + * Constructs a new String. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IString); + + /** String encoding. */ + public encoding?: (google.bigtable.admin.v2.Type.String.IEncoding|null); + + /** + * Creates a new String instance using the specified properties. + * @param [properties] Properties to set + * @returns String instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IString): google.bigtable.admin.v2.Type.String; + + /** + * Encodes the specified String message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.verify|verify} messages. + * @param message String message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IString, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified String message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.verify|verify} messages. + * @param message String message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IString, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a String message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.String; + + /** + * Decodes a String message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.String; + + /** + * Verifies a String message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a String message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns String + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.String; + + /** + * Creates a plain object from a String message. Also converts values to other types if specified. + * @param message String + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.String, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this String to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for String + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace String { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding utf8Raw */ + utf8Raw?: (google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw|null); + + /** Encoding utf8Bytes */ + utf8Bytes?: (google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.String.IEncoding); + + /** Encoding utf8Raw. */ + public utf8Raw?: (google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw|null); + + /** Encoding utf8Bytes. */ + public utf8Bytes?: (google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes|null); + + /** Encoding encoding. */ + public encoding?: ("utf8Raw"|"utf8Bytes"); + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.String.IEncoding): google.bigtable.admin.v2.Type.String.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.String.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.String.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.String.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.String.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.String.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.String.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of an Utf8Raw. */ + interface IUtf8Raw { + } + + /** Represents an Utf8Raw. */ + class Utf8Raw implements IUtf8Raw { + + /** + * Constructs a new Utf8Raw. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw); + + /** + * Creates a new Utf8Raw instance using the specified properties. + * @param [properties] Properties to set + * @returns Utf8Raw instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw): google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw; + + /** + * Encodes the specified Utf8Raw message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @param message Utf8Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Utf8Raw message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @param message Utf8Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw; + + /** + * Verifies an Utf8Raw message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Utf8Raw message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Utf8Raw + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw; + + /** + * Creates a plain object from an Utf8Raw message. Also converts values to other types if specified. + * @param message Utf8Raw + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Utf8Raw to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Utf8Raw + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Utf8Bytes. */ + interface IUtf8Bytes { + } + + /** Represents an Utf8Bytes. */ + class Utf8Bytes implements IUtf8Bytes { + + /** + * Constructs a new Utf8Bytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes); + + /** + * Creates a new Utf8Bytes instance using the specified properties. + * @param [properties] Properties to set + * @returns Utf8Bytes instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes): google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Encodes the specified Utf8Bytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @param message Utf8Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Utf8Bytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @param message Utf8Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Verifies an Utf8Bytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Utf8Bytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Utf8Bytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Creates a plain object from an Utf8Bytes message. Also converts values to other types if specified. + * @param message Utf8Bytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Utf8Bytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Utf8Bytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an Int64. */ + interface IInt64 { + + /** Int64 encoding */ + encoding?: (google.bigtable.admin.v2.Type.Int64.IEncoding|null); + } + + /** Represents an Int64. */ + class Int64 implements IInt64 { + + /** + * Constructs a new Int64. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IInt64); + + /** Int64 encoding. */ + public encoding?: (google.bigtable.admin.v2.Type.Int64.IEncoding|null); + + /** + * Creates a new Int64 instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64 instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IInt64): google.bigtable.admin.v2.Type.Int64; + + /** + * Encodes the specified Int64 message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.verify|verify} messages. + * @param message Int64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IInt64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64 message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.verify|verify} messages. + * @param message Int64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IInt64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Int64; + + /** + * Decodes an Int64 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Int64; + + /** + * Verifies an Int64 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64 + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Int64; + + /** + * Creates a plain object from an Int64 message. Also converts values to other types if specified. + * @param message Int64 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Int64, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Int64 { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding bigEndianBytes */ + bigEndianBytes?: (google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes|null); + + /** Encoding orderedCodeBytes */ + orderedCodeBytes?: (google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Int64.IEncoding); + + /** Encoding bigEndianBytes. */ + public bigEndianBytes?: (google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes|null); + + /** Encoding orderedCodeBytes. */ + public orderedCodeBytes?: (google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes|null); + + /** Encoding encoding. */ + public encoding?: ("bigEndianBytes"|"orderedCodeBytes"); + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Int64.IEncoding): google.bigtable.admin.v2.Type.Int64.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Int64.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Int64.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Int64.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Int64.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Int64.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Int64.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of a BigEndianBytes. */ + interface IBigEndianBytes { + + /** BigEndianBytes bytesType */ + bytesType?: (google.bigtable.admin.v2.Type.IBytes|null); + } + + /** Represents a BigEndianBytes. */ + class BigEndianBytes implements IBigEndianBytes { + + /** + * Constructs a new BigEndianBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes); + + /** BigEndianBytes bytesType. */ + public bytesType?: (google.bigtable.admin.v2.Type.IBytes|null); + + /** + * Creates a new BigEndianBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns BigEndianBytes instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes): google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Encodes the specified BigEndianBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @param message BigEndianBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigEndianBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @param message BigEndianBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Verifies a BigEndianBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigEndianBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigEndianBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Creates a plain object from a BigEndianBytes message. Also converts values to other types if specified. + * @param message BigEndianBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigEndianBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigEndianBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrderedCodeBytes. */ + interface IOrderedCodeBytes { + } + + /** Represents an OrderedCodeBytes. */ + class OrderedCodeBytes implements IOrderedCodeBytes { + + /** + * Constructs a new OrderedCodeBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes); + + /** + * Creates a new OrderedCodeBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns OrderedCodeBytes instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes): google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Verifies an OrderedCodeBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrderedCodeBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @param message OrderedCodeBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrderedCodeBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Bool. */ + interface IBool { + } + + /** Represents a Bool. */ + class Bool implements IBool { + + /** + * Constructs a new Bool. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IBool); + + /** + * Creates a new Bool instance using the specified properties. + * @param [properties] Properties to set + * @returns Bool instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IBool): google.bigtable.admin.v2.Type.Bool; + + /** + * Encodes the specified Bool message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bool.verify|verify} messages. + * @param message Bool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IBool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Bool message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bool.verify|verify} messages. + * @param message Bool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IBool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Bool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Bool; + + /** + * Decodes a Bool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Bool; + + /** + * Verifies a Bool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Bool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bool + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Bool; + + /** + * Creates a plain object from a Bool message. Also converts values to other types if specified. + * @param message Bool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Bool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Bool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Float32. */ + interface IFloat32 { + } + + /** Represents a Float32. */ + class Float32 implements IFloat32 { + + /** + * Constructs a new Float32. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IFloat32); + + /** + * Creates a new Float32 instance using the specified properties. + * @param [properties] Properties to set + * @returns Float32 instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IFloat32): google.bigtable.admin.v2.Type.Float32; + + /** + * Encodes the specified Float32 message. Does not implicitly {@link google.bigtable.admin.v2.Type.Float32.verify|verify} messages. + * @param message Float32 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IFloat32, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Float32 message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Float32.verify|verify} messages. + * @param message Float32 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IFloat32, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Float32 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Float32; + + /** + * Decodes a Float32 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Float32; + + /** + * Verifies a Float32 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Float32 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Float32 + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Float32; + + /** + * Creates a plain object from a Float32 message. Also converts values to other types if specified. + * @param message Float32 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Float32, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Float32 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Float32 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Float64. */ + interface IFloat64 { + } + + /** Represents a Float64. */ + class Float64 implements IFloat64 { + + /** + * Constructs a new Float64. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IFloat64); + + /** + * Creates a new Float64 instance using the specified properties. + * @param [properties] Properties to set + * @returns Float64 instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IFloat64): google.bigtable.admin.v2.Type.Float64; + + /** + * Encodes the specified Float64 message. Does not implicitly {@link google.bigtable.admin.v2.Type.Float64.verify|verify} messages. + * @param message Float64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IFloat64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Float64 message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Float64.verify|verify} messages. + * @param message Float64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IFloat64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Float64 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Float64; + + /** + * Decodes a Float64 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Float64; + + /** + * Verifies a Float64 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Float64 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Float64 + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Float64; + + /** + * Creates a plain object from a Float64 message. Also converts values to other types if specified. + * @param message Float64 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Float64, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Float64 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Float64 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp encoding */ + encoding?: (google.bigtable.admin.v2.Type.Timestamp.IEncoding|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.ITimestamp); + + /** Timestamp encoding. */ + public encoding?: (google.bigtable.admin.v2.Type.Timestamp.IEncoding|null); + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.ITimestamp): google.bigtable.admin.v2.Type.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Timestamp { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding unixMicrosInt64 */ + unixMicrosInt64?: (google.bigtable.admin.v2.Type.Int64.IEncoding|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Timestamp.IEncoding); + + /** Encoding unixMicrosInt64. */ + public unixMicrosInt64?: (google.bigtable.admin.v2.Type.Int64.IEncoding|null); + + /** Encoding encoding. */ + public encoding?: "unixMicrosInt64"; + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Timestamp.IEncoding): google.bigtable.admin.v2.Type.Timestamp.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Timestamp.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Timestamp.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Timestamp.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Timestamp.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Timestamp.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Timestamp.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Date. */ + interface IDate { + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IDate); + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IDate): google.bigtable.admin.v2.Type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.bigtable.admin.v2.Type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: (google.bigtable.admin.v2.Type.Struct.IField[]|null); + + /** Struct encoding */ + encoding?: (google.bigtable.admin.v2.Type.Struct.IEncoding|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IStruct); + + /** Struct fields. */ + public fields: google.bigtable.admin.v2.Type.Struct.IField[]; + + /** Struct encoding. */ + public encoding?: (google.bigtable.admin.v2.Type.Struct.IEncoding|null); + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IStruct): google.bigtable.admin.v2.Type.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Struct { + + /** Properties of a Field. */ + interface IField { + + /** Field fieldName */ + fieldName?: (string|null); + + /** Field type */ + type?: (google.bigtable.admin.v2.IType|null); + } + + /** Represents a Field. */ + class Field implements IField { + + /** + * Constructs a new Field. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Struct.IField); + + /** Field fieldName. */ + public fieldName: string; + + /** Field type. */ + public type?: (google.bigtable.admin.v2.IType|null); + + /** + * Creates a new Field instance using the specified properties. + * @param [properties] Properties to set + * @returns Field instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Struct.IField): google.bigtable.admin.v2.Type.Struct.Field; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Struct.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Struct.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Field message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Struct.Field; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Struct.Field; + + /** + * Verifies a Field message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Field + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Struct.Field; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @param message Field + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Struct.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Field to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Field + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding singleton */ + singleton?: (google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton|null); + + /** Encoding delimitedBytes */ + delimitedBytes?: (google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes|null); + + /** Encoding orderedCodeBytes */ + orderedCodeBytes?: (google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Struct.IEncoding); + + /** Encoding singleton. */ + public singleton?: (google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton|null); + + /** Encoding delimitedBytes. */ + public delimitedBytes?: (google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes|null); + + /** Encoding orderedCodeBytes. */ + public orderedCodeBytes?: (google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes|null); + + /** Encoding encoding. */ + public encoding?: ("singleton"|"delimitedBytes"|"orderedCodeBytes"); + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Struct.IEncoding): google.bigtable.admin.v2.Type.Struct.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Struct.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Struct.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Struct.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Struct.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Struct.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Struct.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of a Singleton. */ + interface ISingleton { + } + + /** Represents a Singleton. */ + class Singleton implements ISingleton { + + /** + * Constructs a new Singleton. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton); + + /** + * Creates a new Singleton instance using the specified properties. + * @param [properties] Properties to set + * @returns Singleton instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton): google.bigtable.admin.v2.Type.Struct.Encoding.Singleton; + + /** + * Encodes the specified Singleton message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @param message Singleton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Singleton message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @param message Singleton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Singleton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Struct.Encoding.Singleton; + + /** + * Decodes a Singleton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Struct.Encoding.Singleton; + + /** + * Verifies a Singleton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Singleton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Singleton + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Struct.Encoding.Singleton; + + /** + * Creates a plain object from a Singleton message. Also converts values to other types if specified. + * @param message Singleton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Struct.Encoding.Singleton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Singleton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Singleton + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DelimitedBytes. */ + interface IDelimitedBytes { + + /** DelimitedBytes delimiter */ + delimiter?: (Uint8Array|Buffer|string|null); + } + + /** Represents a DelimitedBytes. */ + class DelimitedBytes implements IDelimitedBytes { + + /** + * Constructs a new DelimitedBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes); + + /** DelimitedBytes delimiter. */ + public delimiter: (Uint8Array|Buffer|string); + + /** + * Creates a new DelimitedBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns DelimitedBytes instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes): google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Encodes the specified DelimitedBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @param message DelimitedBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DelimitedBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @param message DelimitedBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Verifies a DelimitedBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DelimitedBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DelimitedBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Creates a plain object from a DelimitedBytes message. Also converts values to other types if specified. + * @param message DelimitedBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DelimitedBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DelimitedBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrderedCodeBytes. */ + interface IOrderedCodeBytes { + } + + /** Represents an OrderedCodeBytes. */ + class OrderedCodeBytes implements IOrderedCodeBytes { + + /** + * Constructs a new OrderedCodeBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes); + + /** + * Creates a new OrderedCodeBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns OrderedCodeBytes instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes): google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Verifies an OrderedCodeBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrderedCodeBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @param message OrderedCodeBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrderedCodeBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Proto. */ + interface IProto { + + /** Proto schemaBundleId */ + schemaBundleId?: (string|null); + + /** Proto messageName */ + messageName?: (string|null); + } + + /** Represents a Proto. */ + class Proto implements IProto { + + /** + * Constructs a new Proto. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IProto); + + /** Proto schemaBundleId. */ + public schemaBundleId: string; + + /** Proto messageName. */ + public messageName: string; + + /** + * Creates a new Proto instance using the specified properties. + * @param [properties] Properties to set + * @returns Proto instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IProto): google.bigtable.admin.v2.Type.Proto; + + /** + * Encodes the specified Proto message. Does not implicitly {@link google.bigtable.admin.v2.Type.Proto.verify|verify} messages. + * @param message Proto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Proto message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Proto.verify|verify} messages. + * @param message Proto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Proto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Proto; + + /** + * Decodes a Proto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Proto; + + /** + * Verifies a Proto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Proto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Proto + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Proto; + + /** + * Creates a plain object from a Proto message. Also converts values to other types if specified. + * @param message Proto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Proto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Proto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Proto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Enum. */ + interface IEnum { + + /** Enum schemaBundleId */ + schemaBundleId?: (string|null); + + /** Enum enumName */ + enumName?: (string|null); + } + + /** Represents an Enum. */ + class Enum implements IEnum { + + /** + * Constructs a new Enum. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IEnum); + + /** Enum schemaBundleId. */ + public schemaBundleId: string; + + /** Enum enumName. */ + public enumName: string; + + /** + * Creates a new Enum instance using the specified properties. + * @param [properties] Properties to set + * @returns Enum instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IEnum): google.bigtable.admin.v2.Type.Enum; + + /** + * Encodes the specified Enum message. Does not implicitly {@link google.bigtable.admin.v2.Type.Enum.verify|verify} messages. + * @param message Enum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Enum.verify|verify} messages. + * @param message Enum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Enum message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Enum; + + /** + * Decodes an Enum message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Enum; + + /** + * Verifies an Enum message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Enum message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Enum + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Enum; + + /** + * Creates a plain object from an Enum message. Also converts values to other types if specified. + * @param message Enum + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Enum, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Enum to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Enum + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Array. */ + interface IArray { + + /** Array elementType */ + elementType?: (google.bigtable.admin.v2.IType|null); + } + + /** Represents an Array. */ + class Array implements IArray { + + /** + * Constructs a new Array. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IArray); + + /** Array elementType. */ + public elementType?: (google.bigtable.admin.v2.IType|null); + + /** + * Creates a new Array instance using the specified properties. + * @param [properties] Properties to set + * @returns Array instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IArray): google.bigtable.admin.v2.Type.Array; + + /** + * Encodes the specified Array message. Does not implicitly {@link google.bigtable.admin.v2.Type.Array.verify|verify} messages. + * @param message Array message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Array message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Array.verify|verify} messages. + * @param message Array message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Array message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Array; + + /** + * Decodes an Array message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Array; + + /** + * Verifies an Array message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Array message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Array + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Array; + + /** + * Creates a plain object from an Array message. Also converts values to other types if specified. + * @param message Array + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Array, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Array to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Array + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Map. */ + interface IMap { + + /** Map keyType */ + keyType?: (google.bigtable.admin.v2.IType|null); + + /** Map valueType */ + valueType?: (google.bigtable.admin.v2.IType|null); + } + + /** Represents a Map. */ + class Map implements IMap { + + /** + * Constructs a new Map. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IMap); + + /** Map keyType. */ + public keyType?: (google.bigtable.admin.v2.IType|null); + + /** Map valueType. */ + public valueType?: (google.bigtable.admin.v2.IType|null); + + /** + * Creates a new Map instance using the specified properties. + * @param [properties] Properties to set + * @returns Map instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IMap): google.bigtable.admin.v2.Type.Map; + + /** + * Encodes the specified Map message. Does not implicitly {@link google.bigtable.admin.v2.Type.Map.verify|verify} messages. + * @param message Map message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Map message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Map.verify|verify} messages. + * @param message Map message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Map message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Map; + + /** + * Decodes a Map message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Map; + + /** + * Verifies a Map message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Map message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Map + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Map; + + /** + * Creates a plain object from a Map message. Also converts values to other types if specified. + * @param message Map + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Map, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Map to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Map + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Aggregate. */ + interface IAggregate { + + /** Aggregate inputType */ + inputType?: (google.bigtable.admin.v2.IType|null); + + /** Aggregate stateType */ + stateType?: (google.bigtable.admin.v2.IType|null); + + /** Aggregate sum */ + sum?: (google.bigtable.admin.v2.Type.Aggregate.ISum|null); + + /** Aggregate hllppUniqueCount */ + hllppUniqueCount?: (google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null); + + /** Aggregate max */ + max?: (google.bigtable.admin.v2.Type.Aggregate.IMax|null); + + /** Aggregate min */ + min?: (google.bigtable.admin.v2.Type.Aggregate.IMin|null); + } + + /** Represents an Aggregate. */ + class Aggregate implements IAggregate { + + /** + * Constructs a new Aggregate. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.IAggregate); + + /** Aggregate inputType. */ + public inputType?: (google.bigtable.admin.v2.IType|null); + + /** Aggregate stateType. */ + public stateType?: (google.bigtable.admin.v2.IType|null); + + /** Aggregate sum. */ + public sum?: (google.bigtable.admin.v2.Type.Aggregate.ISum|null); + + /** Aggregate hllppUniqueCount. */ + public hllppUniqueCount?: (google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null); + + /** Aggregate max. */ + public max?: (google.bigtable.admin.v2.Type.Aggregate.IMax|null); + + /** Aggregate min. */ + public min?: (google.bigtable.admin.v2.Type.Aggregate.IMin|null); + + /** Aggregate aggregator. */ + public aggregator?: ("sum"|"hllppUniqueCount"|"max"|"min"); + + /** + * Creates a new Aggregate instance using the specified properties. + * @param [properties] Properties to set + * @returns Aggregate instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.IAggregate): google.bigtable.admin.v2.Type.Aggregate; + + /** + * Encodes the specified Aggregate message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.verify|verify} messages. + * @param message Aggregate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.IAggregate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Aggregate message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.verify|verify} messages. + * @param message Aggregate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.IAggregate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Aggregate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Aggregate; + + /** + * Decodes an Aggregate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Aggregate; + + /** + * Verifies an Aggregate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Aggregate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Aggregate + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Aggregate; + + /** + * Creates a plain object from an Aggregate message. Also converts values to other types if specified. + * @param message Aggregate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Aggregate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Aggregate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Aggregate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Aggregate { + + /** Properties of a Sum. */ + interface ISum { + } + + /** Represents a Sum. */ + class Sum implements ISum { + + /** + * Constructs a new Sum. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Aggregate.ISum); + + /** + * Creates a new Sum instance using the specified properties. + * @param [properties] Properties to set + * @returns Sum instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Aggregate.ISum): google.bigtable.admin.v2.Type.Aggregate.Sum; + + /** + * Encodes the specified Sum message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Sum.verify|verify} messages. + * @param message Sum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Aggregate.ISum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Sum.verify|verify} messages. + * @param message Sum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Aggregate.ISum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sum message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Aggregate.Sum; + + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Aggregate.Sum; + + /** + * Verifies a Sum message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sum + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Aggregate.Sum; + + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @param message Sum + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Aggregate.Sum, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Sum to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Sum + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Max. */ + interface IMax { + } + + /** Represents a Max. */ + class Max implements IMax { + + /** + * Constructs a new Max. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Aggregate.IMax); + + /** + * Creates a new Max instance using the specified properties. + * @param [properties] Properties to set + * @returns Max instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Aggregate.IMax): google.bigtable.admin.v2.Type.Aggregate.Max; + + /** + * Encodes the specified Max message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Max.verify|verify} messages. + * @param message Max message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Aggregate.IMax, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Max message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Max.verify|verify} messages. + * @param message Max message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Aggregate.IMax, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Max message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Aggregate.Max; + + /** + * Decodes a Max message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Aggregate.Max; + + /** + * Verifies a Max message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Max message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Max + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Aggregate.Max; + + /** + * Creates a plain object from a Max message. Also converts values to other types if specified. + * @param message Max + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Aggregate.Max, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Max to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Max + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Min. */ + interface IMin { + } + + /** Represents a Min. */ + class Min implements IMin { + + /** + * Constructs a new Min. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Aggregate.IMin); + + /** + * Creates a new Min instance using the specified properties. + * @param [properties] Properties to set + * @returns Min instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Aggregate.IMin): google.bigtable.admin.v2.Type.Aggregate.Min; + + /** + * Encodes the specified Min message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Min.verify|verify} messages. + * @param message Min message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Aggregate.IMin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Min message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Min.verify|verify} messages. + * @param message Min message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Aggregate.IMin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Min message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Aggregate.Min; + + /** + * Decodes a Min message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Aggregate.Min; + + /** + * Verifies a Min message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Min message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Min + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Aggregate.Min; + + /** + * Creates a plain object from a Min message. Also converts values to other types if specified. + * @param message Min + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Aggregate.Min, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Min to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Min + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HyperLogLogPlusPlusUniqueCount. */ + interface IHyperLogLogPlusPlusUniqueCount { + } + + /** Represents a HyperLogLogPlusPlusUniqueCount. */ + class HyperLogLogPlusPlusUniqueCount implements IHyperLogLogPlusPlusUniqueCount { + + /** + * Constructs a new HyperLogLogPlusPlusUniqueCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount); + + /** + * Creates a new HyperLogLogPlusPlusUniqueCount instance using the specified properties. + * @param [properties] Properties to set + * @returns HyperLogLogPlusPlusUniqueCount instance + */ + public static create(properties?: google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount): google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @param message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @param message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Verifies a HyperLogLogPlusPlusUniqueCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HyperLogLogPlusPlusUniqueCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HyperLogLogPlusPlusUniqueCount + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Creates a plain object from a HyperLogLogPlusPlusUniqueCount message. Also converts values to other types if specified. + * @param message HyperLogLogPlusPlusUniqueCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HyperLogLogPlusPlusUniqueCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HyperLogLogPlusPlusUniqueCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } + + /** Namespace v2. */ + namespace v2 { + + /** Represents a Bigtable */ + class Bigtable extends $protobuf.rpc.Service { + + /** + * Constructs a new Bigtable 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 Bigtable 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): Bigtable; + + /** + * 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.bigtable.v2.IReadRowsRequest, callback: google.bigtable.v2.Bigtable.ReadRowsCallback): void; + + /** + * Calls ReadRows. + * @param request ReadRowsRequest message or plain object + * @returns Promise + */ + public readRows(request: google.bigtable.v2.IReadRowsRequest): Promise; + + /** + * Calls SampleRowKeys. + * @param request SampleRowKeysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SampleRowKeysResponse + */ + public sampleRowKeys(request: google.bigtable.v2.ISampleRowKeysRequest, callback: google.bigtable.v2.Bigtable.SampleRowKeysCallback): void; + + /** + * Calls SampleRowKeys. + * @param request SampleRowKeysRequest message or plain object + * @returns Promise + */ + public sampleRowKeys(request: google.bigtable.v2.ISampleRowKeysRequest): Promise; + + /** + * Calls MutateRow. + * @param request MutateRowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MutateRowResponse + */ + public mutateRow(request: google.bigtable.v2.IMutateRowRequest, callback: google.bigtable.v2.Bigtable.MutateRowCallback): void; + + /** + * Calls MutateRow. + * @param request MutateRowRequest message or plain object + * @returns Promise + */ + public mutateRow(request: google.bigtable.v2.IMutateRowRequest): Promise; + + /** + * Calls MutateRows. + * @param request MutateRowsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MutateRowsResponse + */ + public mutateRows(request: google.bigtable.v2.IMutateRowsRequest, callback: google.bigtable.v2.Bigtable.MutateRowsCallback): void; + + /** + * Calls MutateRows. + * @param request MutateRowsRequest message or plain object + * @returns Promise + */ + public mutateRows(request: google.bigtable.v2.IMutateRowsRequest): Promise; + + /** + * Calls CheckAndMutateRow. + * @param request CheckAndMutateRowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckAndMutateRowResponse + */ + public checkAndMutateRow(request: google.bigtable.v2.ICheckAndMutateRowRequest, callback: google.bigtable.v2.Bigtable.CheckAndMutateRowCallback): void; + + /** + * Calls CheckAndMutateRow. + * @param request CheckAndMutateRowRequest message or plain object + * @returns Promise + */ + public checkAndMutateRow(request: google.bigtable.v2.ICheckAndMutateRowRequest): Promise; + + /** + * Calls PingAndWarm. + * @param request PingAndWarmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PingAndWarmResponse + */ + public pingAndWarm(request: google.bigtable.v2.IPingAndWarmRequest, callback: google.bigtable.v2.Bigtable.PingAndWarmCallback): void; + + /** + * Calls PingAndWarm. + * @param request PingAndWarmRequest message or plain object + * @returns Promise + */ + public pingAndWarm(request: google.bigtable.v2.IPingAndWarmRequest): Promise; + + /** + * Calls ReadModifyWriteRow. + * @param request ReadModifyWriteRowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadModifyWriteRowResponse + */ + public readModifyWriteRow(request: google.bigtable.v2.IReadModifyWriteRowRequest, callback: google.bigtable.v2.Bigtable.ReadModifyWriteRowCallback): void; + + /** + * Calls ReadModifyWriteRow. + * @param request ReadModifyWriteRowRequest message or plain object + * @returns Promise + */ + public readModifyWriteRow(request: google.bigtable.v2.IReadModifyWriteRowRequest): Promise; + + /** + * Calls GenerateInitialChangeStreamPartitions. + * @param request GenerateInitialChangeStreamPartitionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateInitialChangeStreamPartitionsResponse + */ + public generateInitialChangeStreamPartitions(request: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest, callback: google.bigtable.v2.Bigtable.GenerateInitialChangeStreamPartitionsCallback): void; + + /** + * Calls GenerateInitialChangeStreamPartitions. + * @param request GenerateInitialChangeStreamPartitionsRequest message or plain object + * @returns Promise + */ + public generateInitialChangeStreamPartitions(request: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest): Promise; + + /** + * Calls ReadChangeStream. + * @param request ReadChangeStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadChangeStreamResponse + */ + public readChangeStream(request: google.bigtable.v2.IReadChangeStreamRequest, callback: google.bigtable.v2.Bigtable.ReadChangeStreamCallback): void; + + /** + * Calls ReadChangeStream. + * @param request ReadChangeStreamRequest message or plain object + * @returns Promise + */ + public readChangeStream(request: google.bigtable.v2.IReadChangeStreamRequest): Promise; + + /** + * Calls PrepareQuery. + * @param request PrepareQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PrepareQueryResponse + */ + public prepareQuery(request: google.bigtable.v2.IPrepareQueryRequest, callback: google.bigtable.v2.Bigtable.PrepareQueryCallback): void; + + /** + * Calls PrepareQuery. + * @param request PrepareQueryRequest message or plain object + * @returns Promise + */ + public prepareQuery(request: google.bigtable.v2.IPrepareQueryRequest): Promise; + + /** + * Calls ExecuteQuery. + * @param request ExecuteQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteQueryResponse + */ + public executeQuery(request: google.bigtable.v2.IExecuteQueryRequest, callback: google.bigtable.v2.Bigtable.ExecuteQueryCallback): void; + + /** + * Calls ExecuteQuery. + * @param request ExecuteQueryRequest message or plain object + * @returns Promise + */ + public executeQuery(request: google.bigtable.v2.IExecuteQueryRequest): Promise; + } + + namespace Bigtable { + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|readRows}. + * @param error Error, if any + * @param [response] ReadRowsResponse + */ + type ReadRowsCallback = (error: (Error|null), response?: google.bigtable.v2.ReadRowsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|sampleRowKeys}. + * @param error Error, if any + * @param [response] SampleRowKeysResponse + */ + type SampleRowKeysCallback = (error: (Error|null), response?: google.bigtable.v2.SampleRowKeysResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|mutateRow}. + * @param error Error, if any + * @param [response] MutateRowResponse + */ + type MutateRowCallback = (error: (Error|null), response?: google.bigtable.v2.MutateRowResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|mutateRows}. + * @param error Error, if any + * @param [response] MutateRowsResponse + */ + type MutateRowsCallback = (error: (Error|null), response?: google.bigtable.v2.MutateRowsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|checkAndMutateRow}. + * @param error Error, if any + * @param [response] CheckAndMutateRowResponse + */ + type CheckAndMutateRowCallback = (error: (Error|null), response?: google.bigtable.v2.CheckAndMutateRowResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|pingAndWarm}. + * @param error Error, if any + * @param [response] PingAndWarmResponse + */ + type PingAndWarmCallback = (error: (Error|null), response?: google.bigtable.v2.PingAndWarmResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|readModifyWriteRow}. + * @param error Error, if any + * @param [response] ReadModifyWriteRowResponse + */ + type ReadModifyWriteRowCallback = (error: (Error|null), response?: google.bigtable.v2.ReadModifyWriteRowResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|generateInitialChangeStreamPartitions}. + * @param error Error, if any + * @param [response] GenerateInitialChangeStreamPartitionsResponse + */ + type GenerateInitialChangeStreamPartitionsCallback = (error: (Error|null), response?: google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|readChangeStream}. + * @param error Error, if any + * @param [response] ReadChangeStreamResponse + */ + type ReadChangeStreamCallback = (error: (Error|null), response?: google.bigtable.v2.ReadChangeStreamResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|prepareQuery}. + * @param error Error, if any + * @param [response] PrepareQueryResponse + */ + type PrepareQueryCallback = (error: (Error|null), response?: google.bigtable.v2.PrepareQueryResponse) => void; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|executeQuery}. + * @param error Error, if any + * @param [response] ExecuteQueryResponse + */ + type ExecuteQueryCallback = (error: (Error|null), response?: google.bigtable.v2.ExecuteQueryResponse) => void; + } + + /** Properties of a ReadRowsRequest. */ + interface IReadRowsRequest { + + /** ReadRowsRequest tableName */ + tableName?: (string|null); + + /** ReadRowsRequest authorizedViewName */ + authorizedViewName?: (string|null); + + /** ReadRowsRequest materializedViewName */ + materializedViewName?: (string|null); + + /** ReadRowsRequest appProfileId */ + appProfileId?: (string|null); + + /** ReadRowsRequest rows */ + rows?: (google.bigtable.v2.IRowSet|null); + + /** ReadRowsRequest filter */ + filter?: (google.bigtable.v2.IRowFilter|null); + + /** ReadRowsRequest rowsLimit */ + rowsLimit?: (number|Long|string|null); + + /** ReadRowsRequest requestStatsView */ + requestStatsView?: (google.bigtable.v2.ReadRowsRequest.RequestStatsView|keyof typeof google.bigtable.v2.ReadRowsRequest.RequestStatsView|null); + + /** ReadRowsRequest reversed */ + reversed?: (boolean|null); + } + + /** Represents a ReadRowsRequest. */ + class ReadRowsRequest implements IReadRowsRequest { + + /** + * Constructs a new ReadRowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadRowsRequest); + + /** ReadRowsRequest tableName. */ + public tableName: string; + + /** ReadRowsRequest authorizedViewName. */ + public authorizedViewName: string; + + /** ReadRowsRequest materializedViewName. */ + public materializedViewName: string; + + /** ReadRowsRequest appProfileId. */ + public appProfileId: string; + + /** ReadRowsRequest rows. */ + public rows?: (google.bigtable.v2.IRowSet|null); + + /** ReadRowsRequest filter. */ + public filter?: (google.bigtable.v2.IRowFilter|null); + + /** ReadRowsRequest rowsLimit. */ + public rowsLimit: (number|Long|string); + + /** ReadRowsRequest requestStatsView. */ + public requestStatsView: (google.bigtable.v2.ReadRowsRequest.RequestStatsView|keyof typeof google.bigtable.v2.ReadRowsRequest.RequestStatsView); + + /** ReadRowsRequest reversed. */ + public reversed: boolean; + + /** + * Creates a new ReadRowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRowsRequest instance + */ + public static create(properties?: google.bigtable.v2.IReadRowsRequest): google.bigtable.v2.ReadRowsRequest; + + /** + * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.bigtable.v2.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.bigtable.v2.IReadRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.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.bigtable.v2.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.bigtable.v2.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.bigtable.v2.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.bigtable.v2.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.bigtable.v2.ReadRowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadRowsRequest { + + /** RequestStatsView enum. */ + enum RequestStatsView { + REQUEST_STATS_VIEW_UNSPECIFIED = 0, + REQUEST_STATS_NONE = 1, + REQUEST_STATS_FULL = 2 + } + } + + /** Properties of a ReadRowsResponse. */ + interface IReadRowsResponse { + + /** ReadRowsResponse chunks */ + chunks?: (google.bigtable.v2.ReadRowsResponse.ICellChunk[]|null); + + /** ReadRowsResponse lastScannedRowKey */ + lastScannedRowKey?: (Uint8Array|Buffer|string|null); + + /** ReadRowsResponse requestStats */ + requestStats?: (google.bigtable.v2.IRequestStats|null); + } + + /** Represents a ReadRowsResponse. */ + class ReadRowsResponse implements IReadRowsResponse { + + /** + * Constructs a new ReadRowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadRowsResponse); + + /** ReadRowsResponse chunks. */ + public chunks: google.bigtable.v2.ReadRowsResponse.ICellChunk[]; + + /** ReadRowsResponse lastScannedRowKey. */ + public lastScannedRowKey: (Uint8Array|Buffer|string); + + /** ReadRowsResponse requestStats. */ + public requestStats?: (google.bigtable.v2.IRequestStats|null); + + /** + * Creates a new ReadRowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRowsResponse instance + */ + public static create(properties?: google.bigtable.v2.IReadRowsResponse): google.bigtable.v2.ReadRowsResponse; + + /** + * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.bigtable.v2.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.bigtable.v2.IReadRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRowsResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.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.bigtable.v2.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.bigtable.v2.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.bigtable.v2.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.bigtable.v2.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.bigtable.v2.ReadRowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadRowsResponse { + + /** Properties of a CellChunk. */ + interface ICellChunk { + + /** CellChunk rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** CellChunk familyName */ + familyName?: (google.protobuf.IStringValue|null); + + /** CellChunk qualifier */ + qualifier?: (google.protobuf.IBytesValue|null); + + /** CellChunk timestampMicros */ + timestampMicros?: (number|Long|string|null); + + /** CellChunk labels */ + labels?: (string[]|null); + + /** CellChunk value */ + value?: (Uint8Array|Buffer|string|null); + + /** CellChunk valueSize */ + valueSize?: (number|null); + + /** CellChunk resetRow */ + resetRow?: (boolean|null); + + /** CellChunk commitRow */ + commitRow?: (boolean|null); + } + + /** Represents a CellChunk. */ + class CellChunk implements ICellChunk { + + /** + * Constructs a new CellChunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ReadRowsResponse.ICellChunk); + + /** CellChunk rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** CellChunk familyName. */ + public familyName?: (google.protobuf.IStringValue|null); + + /** CellChunk qualifier. */ + public qualifier?: (google.protobuf.IBytesValue|null); + + /** CellChunk timestampMicros. */ + public timestampMicros: (number|Long|string); + + /** CellChunk labels. */ + public labels: string[]; + + /** CellChunk value. */ + public value: (Uint8Array|Buffer|string); + + /** CellChunk valueSize. */ + public valueSize: number; + + /** CellChunk resetRow. */ + public resetRow?: (boolean|null); + + /** CellChunk commitRow. */ + public commitRow?: (boolean|null); + + /** CellChunk rowStatus. */ + public rowStatus?: ("resetRow"|"commitRow"); + + /** + * Creates a new CellChunk instance using the specified properties. + * @param [properties] Properties to set + * @returns CellChunk instance + */ + public static create(properties?: google.bigtable.v2.ReadRowsResponse.ICellChunk): google.bigtable.v2.ReadRowsResponse.CellChunk; + + /** + * Encodes the specified CellChunk message. Does not implicitly {@link google.bigtable.v2.ReadRowsResponse.CellChunk.verify|verify} messages. + * @param message CellChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ReadRowsResponse.ICellChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CellChunk message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadRowsResponse.CellChunk.verify|verify} messages. + * @param message CellChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ReadRowsResponse.ICellChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CellChunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CellChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadRowsResponse.CellChunk; + + /** + * Decodes a CellChunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CellChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadRowsResponse.CellChunk; + + /** + * Verifies a CellChunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CellChunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CellChunk + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadRowsResponse.CellChunk; + + /** + * Creates a plain object from a CellChunk message. Also converts values to other types if specified. + * @param message CellChunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadRowsResponse.CellChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CellChunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CellChunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SampleRowKeysRequest. */ + interface ISampleRowKeysRequest { + + /** SampleRowKeysRequest tableName */ + tableName?: (string|null); + + /** SampleRowKeysRequest authorizedViewName */ + authorizedViewName?: (string|null); + + /** SampleRowKeysRequest materializedViewName */ + materializedViewName?: (string|null); + + /** SampleRowKeysRequest appProfileId */ + appProfileId?: (string|null); + } + + /** Represents a SampleRowKeysRequest. */ + class SampleRowKeysRequest implements ISampleRowKeysRequest { + + /** + * Constructs a new SampleRowKeysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ISampleRowKeysRequest); + + /** SampleRowKeysRequest tableName. */ + public tableName: string; + + /** SampleRowKeysRequest authorizedViewName. */ + public authorizedViewName: string; + + /** SampleRowKeysRequest materializedViewName. */ + public materializedViewName: string; + + /** SampleRowKeysRequest appProfileId. */ + public appProfileId: string; + + /** + * Creates a new SampleRowKeysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SampleRowKeysRequest instance + */ + public static create(properties?: google.bigtable.v2.ISampleRowKeysRequest): google.bigtable.v2.SampleRowKeysRequest; + + /** + * Encodes the specified SampleRowKeysRequest message. Does not implicitly {@link google.bigtable.v2.SampleRowKeysRequest.verify|verify} messages. + * @param message SampleRowKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ISampleRowKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SampleRowKeysRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.SampleRowKeysRequest.verify|verify} messages. + * @param message SampleRowKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ISampleRowKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SampleRowKeysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SampleRowKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.SampleRowKeysRequest; + + /** + * Decodes a SampleRowKeysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SampleRowKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.SampleRowKeysRequest; + + /** + * Verifies a SampleRowKeysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SampleRowKeysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SampleRowKeysRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.SampleRowKeysRequest; + + /** + * Creates a plain object from a SampleRowKeysRequest message. Also converts values to other types if specified. + * @param message SampleRowKeysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.SampleRowKeysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SampleRowKeysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SampleRowKeysRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SampleRowKeysResponse. */ + interface ISampleRowKeysResponse { + + /** SampleRowKeysResponse rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** SampleRowKeysResponse offsetBytes */ + offsetBytes?: (number|Long|string|null); + } + + /** Represents a SampleRowKeysResponse. */ + class SampleRowKeysResponse implements ISampleRowKeysResponse { + + /** + * Constructs a new SampleRowKeysResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ISampleRowKeysResponse); + + /** SampleRowKeysResponse rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** SampleRowKeysResponse offsetBytes. */ + public offsetBytes: (number|Long|string); + + /** + * Creates a new SampleRowKeysResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SampleRowKeysResponse instance + */ + public static create(properties?: google.bigtable.v2.ISampleRowKeysResponse): google.bigtable.v2.SampleRowKeysResponse; + + /** + * Encodes the specified SampleRowKeysResponse message. Does not implicitly {@link google.bigtable.v2.SampleRowKeysResponse.verify|verify} messages. + * @param message SampleRowKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ISampleRowKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SampleRowKeysResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.SampleRowKeysResponse.verify|verify} messages. + * @param message SampleRowKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ISampleRowKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SampleRowKeysResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SampleRowKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.SampleRowKeysResponse; + + /** + * Decodes a SampleRowKeysResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SampleRowKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.SampleRowKeysResponse; + + /** + * Verifies a SampleRowKeysResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SampleRowKeysResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SampleRowKeysResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.SampleRowKeysResponse; + + /** + * Creates a plain object from a SampleRowKeysResponse message. Also converts values to other types if specified. + * @param message SampleRowKeysResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.SampleRowKeysResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SampleRowKeysResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SampleRowKeysResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateRowRequest. */ + interface IMutateRowRequest { + + /** MutateRowRequest tableName */ + tableName?: (string|null); + + /** MutateRowRequest authorizedViewName */ + authorizedViewName?: (string|null); + + /** MutateRowRequest appProfileId */ + appProfileId?: (string|null); + + /** MutateRowRequest rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** MutateRowRequest mutations */ + mutations?: (google.bigtable.v2.IMutation[]|null); + + /** MutateRowRequest idempotency */ + idempotency?: (google.bigtable.v2.IIdempotency|null); + } + + /** Represents a MutateRowRequest. */ + class MutateRowRequest implements IMutateRowRequest { + + /** + * Constructs a new MutateRowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IMutateRowRequest); + + /** MutateRowRequest tableName. */ + public tableName: string; + + /** MutateRowRequest authorizedViewName. */ + public authorizedViewName: string; + + /** MutateRowRequest appProfileId. */ + public appProfileId: string; + + /** MutateRowRequest rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** MutateRowRequest mutations. */ + public mutations: google.bigtable.v2.IMutation[]; + + /** MutateRowRequest idempotency. */ + public idempotency?: (google.bigtable.v2.IIdempotency|null); + + /** + * Creates a new MutateRowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateRowRequest instance + */ + public static create(properties?: google.bigtable.v2.IMutateRowRequest): google.bigtable.v2.MutateRowRequest; + + /** + * Encodes the specified MutateRowRequest message. Does not implicitly {@link google.bigtable.v2.MutateRowRequest.verify|verify} messages. + * @param message MutateRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IMutateRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateRowRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowRequest.verify|verify} messages. + * @param message MutateRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IMutateRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateRowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.MutateRowRequest; + + /** + * Decodes a MutateRowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.MutateRowRequest; + + /** + * Verifies a MutateRowRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateRowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateRowRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.MutateRowRequest; + + /** + * Creates a plain object from a MutateRowRequest message. Also converts values to other types if specified. + * @param message MutateRowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.MutateRowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateRowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateRowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateRowResponse. */ + interface IMutateRowResponse { + } + + /** Represents a MutateRowResponse. */ + class MutateRowResponse implements IMutateRowResponse { + + /** + * Constructs a new MutateRowResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IMutateRowResponse); + + /** + * Creates a new MutateRowResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateRowResponse instance + */ + public static create(properties?: google.bigtable.v2.IMutateRowResponse): google.bigtable.v2.MutateRowResponse; + + /** + * Encodes the specified MutateRowResponse message. Does not implicitly {@link google.bigtable.v2.MutateRowResponse.verify|verify} messages. + * @param message MutateRowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IMutateRowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateRowResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowResponse.verify|verify} messages. + * @param message MutateRowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IMutateRowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateRowResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.MutateRowResponse; + + /** + * Decodes a MutateRowResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.MutateRowResponse; + + /** + * Verifies a MutateRowResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateRowResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateRowResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.MutateRowResponse; + + /** + * Creates a plain object from a MutateRowResponse message. Also converts values to other types if specified. + * @param message MutateRowResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.MutateRowResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateRowResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateRowResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateRowsRequest. */ + interface IMutateRowsRequest { + + /** MutateRowsRequest tableName */ + tableName?: (string|null); + + /** MutateRowsRequest authorizedViewName */ + authorizedViewName?: (string|null); + + /** MutateRowsRequest appProfileId */ + appProfileId?: (string|null); + + /** MutateRowsRequest entries */ + entries?: (google.bigtable.v2.MutateRowsRequest.IEntry[]|null); + } + + /** Represents a MutateRowsRequest. */ + class MutateRowsRequest implements IMutateRowsRequest { + + /** + * Constructs a new MutateRowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IMutateRowsRequest); + + /** MutateRowsRequest tableName. */ + public tableName: string; + + /** MutateRowsRequest authorizedViewName. */ + public authorizedViewName: string; + + /** MutateRowsRequest appProfileId. */ + public appProfileId: string; + + /** MutateRowsRequest entries. */ + public entries: google.bigtable.v2.MutateRowsRequest.IEntry[]; + + /** + * Creates a new MutateRowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateRowsRequest instance + */ + public static create(properties?: google.bigtable.v2.IMutateRowsRequest): google.bigtable.v2.MutateRowsRequest; + + /** + * Encodes the specified MutateRowsRequest message. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.verify|verify} messages. + * @param message MutateRowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IMutateRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateRowsRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.verify|verify} messages. + * @param message MutateRowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IMutateRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateRowsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.MutateRowsRequest; + + /** + * Decodes a MutateRowsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.MutateRowsRequest; + + /** + * Verifies a MutateRowsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateRowsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateRowsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.MutateRowsRequest; + + /** + * Creates a plain object from a MutateRowsRequest message. Also converts values to other types if specified. + * @param message MutateRowsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.MutateRowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateRowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateRowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MutateRowsRequest { + + /** Properties of an Entry. */ + interface IEntry { + + /** Entry rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** Entry mutations */ + mutations?: (google.bigtable.v2.IMutation[]|null); + + /** Entry idempotency */ + idempotency?: (google.bigtable.v2.IIdempotency|null); + } + + /** Represents an Entry. */ + class Entry implements IEntry { + + /** + * Constructs a new Entry. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.MutateRowsRequest.IEntry); + + /** Entry rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** Entry mutations. */ + public mutations: google.bigtable.v2.IMutation[]; + + /** Entry idempotency. */ + public idempotency?: (google.bigtable.v2.IIdempotency|null); + + /** + * Creates a new Entry instance using the specified properties. + * @param [properties] Properties to set + * @returns Entry instance + */ + public static create(properties?: google.bigtable.v2.MutateRowsRequest.IEntry): google.bigtable.v2.MutateRowsRequest.Entry; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.MutateRowsRequest.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.MutateRowsRequest.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.MutateRowsRequest.Entry; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.MutateRowsRequest.Entry; + + /** + * Verifies an Entry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entry + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.MutateRowsRequest.Entry; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @param message Entry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.MutateRowsRequest.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a MutateRowsResponse. */ + interface IMutateRowsResponse { + + /** MutateRowsResponse entries */ + entries?: (google.bigtable.v2.MutateRowsResponse.IEntry[]|null); + + /** MutateRowsResponse rateLimitInfo */ + rateLimitInfo?: (google.bigtable.v2.IRateLimitInfo|null); + } + + /** Represents a MutateRowsResponse. */ + class MutateRowsResponse implements IMutateRowsResponse { + + /** + * Constructs a new MutateRowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IMutateRowsResponse); + + /** MutateRowsResponse entries. */ + public entries: google.bigtable.v2.MutateRowsResponse.IEntry[]; + + /** MutateRowsResponse rateLimitInfo. */ + public rateLimitInfo?: (google.bigtable.v2.IRateLimitInfo|null); + + /** + * Creates a new MutateRowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateRowsResponse instance + */ + public static create(properties?: google.bigtable.v2.IMutateRowsResponse): google.bigtable.v2.MutateRowsResponse; + + /** + * Encodes the specified MutateRowsResponse message. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.verify|verify} messages. + * @param message MutateRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IMutateRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateRowsResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.verify|verify} messages. + * @param message MutateRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IMutateRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateRowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.MutateRowsResponse; + + /** + * Decodes a MutateRowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.MutateRowsResponse; + + /** + * Verifies a MutateRowsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateRowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateRowsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.MutateRowsResponse; + + /** + * Creates a plain object from a MutateRowsResponse message. Also converts values to other types if specified. + * @param message MutateRowsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.MutateRowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateRowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateRowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MutateRowsResponse { + + /** Properties of an Entry. */ + interface IEntry { + + /** Entry index */ + index?: (number|Long|string|null); + + /** Entry status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents an Entry. */ + class Entry implements IEntry { + + /** + * Constructs a new Entry. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.MutateRowsResponse.IEntry); + + /** Entry index. */ + public index: (number|Long|string); + + /** Entry status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new Entry instance using the specified properties. + * @param [properties] Properties to set + * @returns Entry instance + */ + public static create(properties?: google.bigtable.v2.MutateRowsResponse.IEntry): google.bigtable.v2.MutateRowsResponse.Entry; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.MutateRowsResponse.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.MutateRowsResponse.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.MutateRowsResponse.Entry; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.MutateRowsResponse.Entry; + + /** + * Verifies an Entry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entry + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.MutateRowsResponse.Entry; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @param message Entry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.MutateRowsResponse.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RateLimitInfo. */ + interface IRateLimitInfo { + + /** RateLimitInfo period */ + period?: (google.protobuf.IDuration|null); + + /** RateLimitInfo factor */ + factor?: (number|null); + } + + /** Represents a RateLimitInfo. */ + class RateLimitInfo implements IRateLimitInfo { + + /** + * Constructs a new RateLimitInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRateLimitInfo); + + /** RateLimitInfo period. */ + public period?: (google.protobuf.IDuration|null); + + /** RateLimitInfo factor. */ + public factor: number; + + /** + * Creates a new RateLimitInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RateLimitInfo instance + */ + public static create(properties?: google.bigtable.v2.IRateLimitInfo): google.bigtable.v2.RateLimitInfo; + + /** + * Encodes the specified RateLimitInfo message. Does not implicitly {@link google.bigtable.v2.RateLimitInfo.verify|verify} messages. + * @param message RateLimitInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRateLimitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RateLimitInfo message, length delimited. Does not implicitly {@link google.bigtable.v2.RateLimitInfo.verify|verify} messages. + * @param message RateLimitInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRateLimitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RateLimitInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RateLimitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RateLimitInfo; + + /** + * Decodes a RateLimitInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RateLimitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RateLimitInfo; + + /** + * Verifies a RateLimitInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RateLimitInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RateLimitInfo + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RateLimitInfo; + + /** + * Creates a plain object from a RateLimitInfo message. Also converts values to other types if specified. + * @param message RateLimitInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RateLimitInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RateLimitInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RateLimitInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckAndMutateRowRequest. */ + interface ICheckAndMutateRowRequest { + + /** CheckAndMutateRowRequest tableName */ + tableName?: (string|null); + + /** CheckAndMutateRowRequest authorizedViewName */ + authorizedViewName?: (string|null); + + /** CheckAndMutateRowRequest appProfileId */ + appProfileId?: (string|null); + + /** CheckAndMutateRowRequest rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** CheckAndMutateRowRequest predicateFilter */ + predicateFilter?: (google.bigtable.v2.IRowFilter|null); + + /** CheckAndMutateRowRequest trueMutations */ + trueMutations?: (google.bigtable.v2.IMutation[]|null); + + /** CheckAndMutateRowRequest falseMutations */ + falseMutations?: (google.bigtable.v2.IMutation[]|null); + } + + /** Represents a CheckAndMutateRowRequest. */ + class CheckAndMutateRowRequest implements ICheckAndMutateRowRequest { + + /** + * Constructs a new CheckAndMutateRowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ICheckAndMutateRowRequest); + + /** CheckAndMutateRowRequest tableName. */ + public tableName: string; + + /** CheckAndMutateRowRequest authorizedViewName. */ + public authorizedViewName: string; + + /** CheckAndMutateRowRequest appProfileId. */ + public appProfileId: string; + + /** CheckAndMutateRowRequest rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** CheckAndMutateRowRequest predicateFilter. */ + public predicateFilter?: (google.bigtable.v2.IRowFilter|null); + + /** CheckAndMutateRowRequest trueMutations. */ + public trueMutations: google.bigtable.v2.IMutation[]; + + /** CheckAndMutateRowRequest falseMutations. */ + public falseMutations: google.bigtable.v2.IMutation[]; + + /** + * Creates a new CheckAndMutateRowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckAndMutateRowRequest instance + */ + public static create(properties?: google.bigtable.v2.ICheckAndMutateRowRequest): google.bigtable.v2.CheckAndMutateRowRequest; + + /** + * Encodes the specified CheckAndMutateRowRequest message. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowRequest.verify|verify} messages. + * @param message CheckAndMutateRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ICheckAndMutateRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckAndMutateRowRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowRequest.verify|verify} messages. + * @param message CheckAndMutateRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ICheckAndMutateRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckAndMutateRowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckAndMutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.CheckAndMutateRowRequest; + + /** + * Decodes a CheckAndMutateRowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckAndMutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.CheckAndMutateRowRequest; + + /** + * Verifies a CheckAndMutateRowRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckAndMutateRowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckAndMutateRowRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.CheckAndMutateRowRequest; + + /** + * Creates a plain object from a CheckAndMutateRowRequest message. Also converts values to other types if specified. + * @param message CheckAndMutateRowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.CheckAndMutateRowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckAndMutateRowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckAndMutateRowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckAndMutateRowResponse. */ + interface ICheckAndMutateRowResponse { + + /** CheckAndMutateRowResponse predicateMatched */ + predicateMatched?: (boolean|null); + } + + /** Represents a CheckAndMutateRowResponse. */ + class CheckAndMutateRowResponse implements ICheckAndMutateRowResponse { + + /** + * Constructs a new CheckAndMutateRowResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ICheckAndMutateRowResponse); + + /** CheckAndMutateRowResponse predicateMatched. */ + public predicateMatched: boolean; + + /** + * Creates a new CheckAndMutateRowResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckAndMutateRowResponse instance + */ + public static create(properties?: google.bigtable.v2.ICheckAndMutateRowResponse): google.bigtable.v2.CheckAndMutateRowResponse; + + /** + * Encodes the specified CheckAndMutateRowResponse message. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowResponse.verify|verify} messages. + * @param message CheckAndMutateRowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ICheckAndMutateRowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckAndMutateRowResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowResponse.verify|verify} messages. + * @param message CheckAndMutateRowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ICheckAndMutateRowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckAndMutateRowResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckAndMutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.CheckAndMutateRowResponse; + + /** + * Decodes a CheckAndMutateRowResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckAndMutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.CheckAndMutateRowResponse; + + /** + * Verifies a CheckAndMutateRowResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckAndMutateRowResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckAndMutateRowResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.CheckAndMutateRowResponse; + + /** + * Creates a plain object from a CheckAndMutateRowResponse message. Also converts values to other types if specified. + * @param message CheckAndMutateRowResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.CheckAndMutateRowResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckAndMutateRowResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckAndMutateRowResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PingAndWarmRequest. */ + interface IPingAndWarmRequest { + + /** PingAndWarmRequest name */ + name?: (string|null); + + /** PingAndWarmRequest appProfileId */ + appProfileId?: (string|null); + } + + /** Represents a PingAndWarmRequest. */ + class PingAndWarmRequest implements IPingAndWarmRequest { + + /** + * Constructs a new PingAndWarmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IPingAndWarmRequest); + + /** PingAndWarmRequest name. */ + public name: string; + + /** PingAndWarmRequest appProfileId. */ + public appProfileId: string; + + /** + * Creates a new PingAndWarmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PingAndWarmRequest instance + */ + public static create(properties?: google.bigtable.v2.IPingAndWarmRequest): google.bigtable.v2.PingAndWarmRequest; + + /** + * Encodes the specified PingAndWarmRequest message. Does not implicitly {@link google.bigtable.v2.PingAndWarmRequest.verify|verify} messages. + * @param message PingAndWarmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IPingAndWarmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PingAndWarmRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.PingAndWarmRequest.verify|verify} messages. + * @param message PingAndWarmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IPingAndWarmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PingAndWarmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PingAndWarmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.PingAndWarmRequest; + + /** + * Decodes a PingAndWarmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PingAndWarmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.PingAndWarmRequest; + + /** + * Verifies a PingAndWarmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PingAndWarmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PingAndWarmRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.PingAndWarmRequest; + + /** + * Creates a plain object from a PingAndWarmRequest message. Also converts values to other types if specified. + * @param message PingAndWarmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.PingAndWarmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PingAndWarmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PingAndWarmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PingAndWarmResponse. */ + interface IPingAndWarmResponse { + } + + /** Represents a PingAndWarmResponse. */ + class PingAndWarmResponse implements IPingAndWarmResponse { + + /** + * Constructs a new PingAndWarmResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IPingAndWarmResponse); + + /** + * Creates a new PingAndWarmResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PingAndWarmResponse instance + */ + public static create(properties?: google.bigtable.v2.IPingAndWarmResponse): google.bigtable.v2.PingAndWarmResponse; + + /** + * Encodes the specified PingAndWarmResponse message. Does not implicitly {@link google.bigtable.v2.PingAndWarmResponse.verify|verify} messages. + * @param message PingAndWarmResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IPingAndWarmResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PingAndWarmResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.PingAndWarmResponse.verify|verify} messages. + * @param message PingAndWarmResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IPingAndWarmResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PingAndWarmResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PingAndWarmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.PingAndWarmResponse; + + /** + * Decodes a PingAndWarmResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PingAndWarmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.PingAndWarmResponse; + + /** + * Verifies a PingAndWarmResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PingAndWarmResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PingAndWarmResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.PingAndWarmResponse; + + /** + * Creates a plain object from a PingAndWarmResponse message. Also converts values to other types if specified. + * @param message PingAndWarmResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.PingAndWarmResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PingAndWarmResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PingAndWarmResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadModifyWriteRowRequest. */ + interface IReadModifyWriteRowRequest { + + /** ReadModifyWriteRowRequest tableName */ + tableName?: (string|null); + + /** ReadModifyWriteRowRequest authorizedViewName */ + authorizedViewName?: (string|null); + + /** ReadModifyWriteRowRequest appProfileId */ + appProfileId?: (string|null); + + /** ReadModifyWriteRowRequest rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** ReadModifyWriteRowRequest rules */ + rules?: (google.bigtable.v2.IReadModifyWriteRule[]|null); + } + + /** Represents a ReadModifyWriteRowRequest. */ + class ReadModifyWriteRowRequest implements IReadModifyWriteRowRequest { + + /** + * Constructs a new ReadModifyWriteRowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadModifyWriteRowRequest); + + /** ReadModifyWriteRowRequest tableName. */ + public tableName: string; + + /** ReadModifyWriteRowRequest authorizedViewName. */ + public authorizedViewName: string; + + /** ReadModifyWriteRowRequest appProfileId. */ + public appProfileId: string; + + /** ReadModifyWriteRowRequest rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** ReadModifyWriteRowRequest rules. */ + public rules: google.bigtable.v2.IReadModifyWriteRule[]; + + /** + * Creates a new ReadModifyWriteRowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadModifyWriteRowRequest instance + */ + public static create(properties?: google.bigtable.v2.IReadModifyWriteRowRequest): google.bigtable.v2.ReadModifyWriteRowRequest; + + /** + * Encodes the specified ReadModifyWriteRowRequest message. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowRequest.verify|verify} messages. + * @param message ReadModifyWriteRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadModifyWriteRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadModifyWriteRowRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowRequest.verify|verify} messages. + * @param message ReadModifyWriteRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadModifyWriteRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadModifyWriteRowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadModifyWriteRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadModifyWriteRowRequest; + + /** + * Decodes a ReadModifyWriteRowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadModifyWriteRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadModifyWriteRowRequest; + + /** + * Verifies a ReadModifyWriteRowRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadModifyWriteRowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadModifyWriteRowRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadModifyWriteRowRequest; + + /** + * Creates a plain object from a ReadModifyWriteRowRequest message. Also converts values to other types if specified. + * @param message ReadModifyWriteRowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadModifyWriteRowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadModifyWriteRowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadModifyWriteRowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadModifyWriteRowResponse. */ + interface IReadModifyWriteRowResponse { + + /** ReadModifyWriteRowResponse row */ + row?: (google.bigtable.v2.IRow|null); + } + + /** Represents a ReadModifyWriteRowResponse. */ + class ReadModifyWriteRowResponse implements IReadModifyWriteRowResponse { + + /** + * Constructs a new ReadModifyWriteRowResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadModifyWriteRowResponse); + + /** ReadModifyWriteRowResponse row. */ + public row?: (google.bigtable.v2.IRow|null); + + /** + * Creates a new ReadModifyWriteRowResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadModifyWriteRowResponse instance + */ + public static create(properties?: google.bigtable.v2.IReadModifyWriteRowResponse): google.bigtable.v2.ReadModifyWriteRowResponse; + + /** + * Encodes the specified ReadModifyWriteRowResponse message. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowResponse.verify|verify} messages. + * @param message ReadModifyWriteRowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadModifyWriteRowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadModifyWriteRowResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowResponse.verify|verify} messages. + * @param message ReadModifyWriteRowResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadModifyWriteRowResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadModifyWriteRowResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadModifyWriteRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadModifyWriteRowResponse; + + /** + * Decodes a ReadModifyWriteRowResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadModifyWriteRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadModifyWriteRowResponse; + + /** + * Verifies a ReadModifyWriteRowResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadModifyWriteRowResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadModifyWriteRowResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadModifyWriteRowResponse; + + /** + * Creates a plain object from a ReadModifyWriteRowResponse message. Also converts values to other types if specified. + * @param message ReadModifyWriteRowResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadModifyWriteRowResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadModifyWriteRowResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadModifyWriteRowResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateInitialChangeStreamPartitionsRequest. */ + interface IGenerateInitialChangeStreamPartitionsRequest { + + /** GenerateInitialChangeStreamPartitionsRequest tableName */ + tableName?: (string|null); + + /** GenerateInitialChangeStreamPartitionsRequest appProfileId */ + appProfileId?: (string|null); + } + + /** Represents a GenerateInitialChangeStreamPartitionsRequest. */ + class GenerateInitialChangeStreamPartitionsRequest implements IGenerateInitialChangeStreamPartitionsRequest { + + /** + * Constructs a new GenerateInitialChangeStreamPartitionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest); + + /** GenerateInitialChangeStreamPartitionsRequest tableName. */ + public tableName: string; + + /** GenerateInitialChangeStreamPartitionsRequest appProfileId. */ + public appProfileId: string; + + /** + * Creates a new GenerateInitialChangeStreamPartitionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateInitialChangeStreamPartitionsRequest instance + */ + public static create(properties?: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest): google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsRequest message. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.verify|verify} messages. + * @param message GenerateInitialChangeStreamPartitionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.verify|verify} messages. + * @param message GenerateInitialChangeStreamPartitionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateInitialChangeStreamPartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateInitialChangeStreamPartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; + + /** + * Verifies a GenerateInitialChangeStreamPartitionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateInitialChangeStreamPartitionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateInitialChangeStreamPartitionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; + + /** + * Creates a plain object from a GenerateInitialChangeStreamPartitionsRequest message. Also converts values to other types if specified. + * @param message GenerateInitialChangeStreamPartitionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateInitialChangeStreamPartitionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateInitialChangeStreamPartitionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateInitialChangeStreamPartitionsResponse. */ + interface IGenerateInitialChangeStreamPartitionsResponse { + + /** GenerateInitialChangeStreamPartitionsResponse partition */ + partition?: (google.bigtable.v2.IStreamPartition|null); + } + + /** Represents a GenerateInitialChangeStreamPartitionsResponse. */ + class GenerateInitialChangeStreamPartitionsResponse implements IGenerateInitialChangeStreamPartitionsResponse { + + /** + * Constructs a new GenerateInitialChangeStreamPartitionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse); + + /** GenerateInitialChangeStreamPartitionsResponse partition. */ + public partition?: (google.bigtable.v2.IStreamPartition|null); + + /** + * Creates a new GenerateInitialChangeStreamPartitionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateInitialChangeStreamPartitionsResponse instance + */ + public static create(properties?: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse): google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsResponse message. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.verify|verify} messages. + * @param message GenerateInitialChangeStreamPartitionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.verify|verify} messages. + * @param message GenerateInitialChangeStreamPartitionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateInitialChangeStreamPartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateInitialChangeStreamPartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; + + /** + * Verifies a GenerateInitialChangeStreamPartitionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateInitialChangeStreamPartitionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateInitialChangeStreamPartitionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; + + /** + * Creates a plain object from a GenerateInitialChangeStreamPartitionsResponse message. Also converts values to other types if specified. + * @param message GenerateInitialChangeStreamPartitionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateInitialChangeStreamPartitionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateInitialChangeStreamPartitionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadChangeStreamRequest. */ + interface IReadChangeStreamRequest { + + /** ReadChangeStreamRequest tableName */ + tableName?: (string|null); + + /** ReadChangeStreamRequest appProfileId */ + appProfileId?: (string|null); + + /** ReadChangeStreamRequest partition */ + partition?: (google.bigtable.v2.IStreamPartition|null); + + /** ReadChangeStreamRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ReadChangeStreamRequest continuationTokens */ + continuationTokens?: (google.bigtable.v2.IStreamContinuationTokens|null); + + /** ReadChangeStreamRequest endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ReadChangeStreamRequest heartbeatDuration */ + heartbeatDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a ReadChangeStreamRequest. */ + class ReadChangeStreamRequest implements IReadChangeStreamRequest { + + /** + * Constructs a new ReadChangeStreamRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadChangeStreamRequest); + + /** ReadChangeStreamRequest tableName. */ + public tableName: string; + + /** ReadChangeStreamRequest appProfileId. */ + public appProfileId: string; + + /** ReadChangeStreamRequest partition. */ + public partition?: (google.bigtable.v2.IStreamPartition|null); + + /** ReadChangeStreamRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ReadChangeStreamRequest continuationTokens. */ + public continuationTokens?: (google.bigtable.v2.IStreamContinuationTokens|null); + + /** ReadChangeStreamRequest endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ReadChangeStreamRequest heartbeatDuration. */ + public heartbeatDuration?: (google.protobuf.IDuration|null); + + /** ReadChangeStreamRequest startFrom. */ + public startFrom?: ("startTime"|"continuationTokens"); + + /** + * Creates a new ReadChangeStreamRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadChangeStreamRequest instance + */ + public static create(properties?: google.bigtable.v2.IReadChangeStreamRequest): google.bigtable.v2.ReadChangeStreamRequest; + + /** + * Encodes the specified ReadChangeStreamRequest message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamRequest.verify|verify} messages. + * @param message ReadChangeStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadChangeStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadChangeStreamRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamRequest.verify|verify} messages. + * @param message ReadChangeStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadChangeStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadChangeStreamRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadChangeStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamRequest; + + /** + * Decodes a ReadChangeStreamRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadChangeStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamRequest; + + /** + * Verifies a ReadChangeStreamRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadChangeStreamRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadChangeStreamRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamRequest; + + /** + * Creates a plain object from a ReadChangeStreamRequest message. Also converts values to other types if specified. + * @param message ReadChangeStreamRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadChangeStreamRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadChangeStreamRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadChangeStreamResponse. */ + interface IReadChangeStreamResponse { + + /** ReadChangeStreamResponse dataChange */ + dataChange?: (google.bigtable.v2.ReadChangeStreamResponse.IDataChange|null); + + /** ReadChangeStreamResponse heartbeat */ + heartbeat?: (google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat|null); + + /** ReadChangeStreamResponse closeStream */ + closeStream?: (google.bigtable.v2.ReadChangeStreamResponse.ICloseStream|null); + } + + /** Represents a ReadChangeStreamResponse. */ + class ReadChangeStreamResponse implements IReadChangeStreamResponse { + + /** + * Constructs a new ReadChangeStreamResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadChangeStreamResponse); + + /** ReadChangeStreamResponse dataChange. */ + public dataChange?: (google.bigtable.v2.ReadChangeStreamResponse.IDataChange|null); + + /** ReadChangeStreamResponse heartbeat. */ + public heartbeat?: (google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat|null); + + /** ReadChangeStreamResponse closeStream. */ + public closeStream?: (google.bigtable.v2.ReadChangeStreamResponse.ICloseStream|null); + + /** ReadChangeStreamResponse streamRecord. */ + public streamRecord?: ("dataChange"|"heartbeat"|"closeStream"); + + /** + * Creates a new ReadChangeStreamResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadChangeStreamResponse instance + */ + public static create(properties?: google.bigtable.v2.IReadChangeStreamResponse): google.bigtable.v2.ReadChangeStreamResponse; + + /** + * Encodes the specified ReadChangeStreamResponse message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.verify|verify} messages. + * @param message ReadChangeStreamResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadChangeStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadChangeStreamResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.verify|verify} messages. + * @param message ReadChangeStreamResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadChangeStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadChangeStreamResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadChangeStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamResponse; + + /** + * Decodes a ReadChangeStreamResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadChangeStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamResponse; + + /** + * Verifies a ReadChangeStreamResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadChangeStreamResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadChangeStreamResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamResponse; + + /** + * Creates a plain object from a ReadChangeStreamResponse message. Also converts values to other types if specified. + * @param message ReadChangeStreamResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadChangeStreamResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadChangeStreamResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadChangeStreamResponse { + + /** Properties of a MutationChunk. */ + interface IMutationChunk { + + /** MutationChunk chunkInfo */ + chunkInfo?: (google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo|null); + + /** MutationChunk mutation */ + mutation?: (google.bigtable.v2.IMutation|null); + } + + /** Represents a MutationChunk. */ + class MutationChunk implements IMutationChunk { + + /** + * Constructs a new MutationChunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk); + + /** MutationChunk chunkInfo. */ + public chunkInfo?: (google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo|null); + + /** MutationChunk mutation. */ + public mutation?: (google.bigtable.v2.IMutation|null); + + /** + * Creates a new MutationChunk instance using the specified properties. + * @param [properties] Properties to set + * @returns MutationChunk instance + */ + public static create(properties?: google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk; + + /** + * Encodes the specified MutationChunk message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.verify|verify} messages. + * @param message MutationChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutationChunk message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.verify|verify} messages. + * @param message MutationChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutationChunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutationChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk; + + /** + * Decodes a MutationChunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutationChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk; + + /** + * Verifies a MutationChunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutationChunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutationChunk + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk; + + /** + * Creates a plain object from a MutationChunk message. Also converts values to other types if specified. + * @param message MutationChunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamResponse.MutationChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutationChunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutationChunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MutationChunk { + + /** Properties of a ChunkInfo. */ + interface IChunkInfo { + + /** ChunkInfo chunkedValueSize */ + chunkedValueSize?: (number|null); + + /** ChunkInfo chunkedValueOffset */ + chunkedValueOffset?: (number|null); + + /** ChunkInfo lastChunk */ + lastChunk?: (boolean|null); + } + + /** Represents a ChunkInfo. */ + class ChunkInfo implements IChunkInfo { + + /** + * Constructs a new ChunkInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo); + + /** ChunkInfo chunkedValueSize. */ + public chunkedValueSize: number; + + /** ChunkInfo chunkedValueOffset. */ + public chunkedValueOffset: number; + + /** ChunkInfo lastChunk. */ + public lastChunk: boolean; + + /** + * Creates a new ChunkInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkInfo instance + */ + public static create(properties?: google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo; + + /** + * Encodes the specified ChunkInfo message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.verify|verify} messages. + * @param message ChunkInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkInfo message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.verify|verify} messages. + * @param message ChunkInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo; + + /** + * Decodes a ChunkInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo; + + /** + * Verifies a ChunkInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChunkInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkInfo + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo; + + /** + * Creates a plain object from a ChunkInfo message. Also converts values to other types if specified. + * @param message ChunkInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DataChange. */ + interface IDataChange { + + /** DataChange type */ + type?: (google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type|keyof typeof google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type|null); + + /** DataChange sourceClusterId */ + sourceClusterId?: (string|null); + + /** DataChange rowKey */ + rowKey?: (Uint8Array|Buffer|string|null); + + /** DataChange commitTimestamp */ + commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** DataChange tiebreaker */ + tiebreaker?: (number|null); + + /** DataChange chunks */ + chunks?: (google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk[]|null); + + /** DataChange done */ + done?: (boolean|null); + + /** DataChange token */ + token?: (string|null); + + /** DataChange estimatedLowWatermark */ + estimatedLowWatermark?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DataChange. */ + class DataChange implements IDataChange { + + /** + * Constructs a new DataChange. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ReadChangeStreamResponse.IDataChange); + + /** DataChange type. */ + public type: (google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type|keyof typeof google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type); + + /** DataChange sourceClusterId. */ + public sourceClusterId: string; + + /** DataChange rowKey. */ + public rowKey: (Uint8Array|Buffer|string); + + /** DataChange commitTimestamp. */ + public commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** DataChange tiebreaker. */ + public tiebreaker: number; + + /** DataChange chunks. */ + public chunks: google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk[]; + + /** DataChange done. */ + public done: boolean; + + /** DataChange token. */ + public token: string; + + /** DataChange estimatedLowWatermark. */ + public estimatedLowWatermark?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DataChange instance using the specified properties. + * @param [properties] Properties to set + * @returns DataChange instance + */ + public static create(properties?: google.bigtable.v2.ReadChangeStreamResponse.IDataChange): google.bigtable.v2.ReadChangeStreamResponse.DataChange; + + /** + * Encodes the specified DataChange message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.DataChange.verify|verify} messages. + * @param message DataChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ReadChangeStreamResponse.IDataChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataChange message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.DataChange.verify|verify} messages. + * @param message DataChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ReadChangeStreamResponse.IDataChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataChange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamResponse.DataChange; + + /** + * Decodes a DataChange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamResponse.DataChange; + + /** + * Verifies a DataChange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataChange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataChange + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamResponse.DataChange; + + /** + * Creates a plain object from a DataChange message. Also converts values to other types if specified. + * @param message DataChange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamResponse.DataChange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataChange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataChange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataChange { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + USER = 1, + GARBAGE_COLLECTION = 2, + CONTINUATION = 3 + } + } + + /** Properties of a Heartbeat. */ + interface IHeartbeat { + + /** Heartbeat continuationToken */ + continuationToken?: (google.bigtable.v2.IStreamContinuationToken|null); + + /** Heartbeat estimatedLowWatermark */ + estimatedLowWatermark?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Heartbeat. */ + class Heartbeat implements IHeartbeat { + + /** + * Constructs a new Heartbeat. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat); + + /** Heartbeat continuationToken. */ + public continuationToken?: (google.bigtable.v2.IStreamContinuationToken|null); + + /** Heartbeat estimatedLowWatermark. */ + public estimatedLowWatermark?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Heartbeat instance using the specified properties. + * @param [properties] Properties to set + * @returns Heartbeat instance + */ + public static create(properties?: google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat): google.bigtable.v2.ReadChangeStreamResponse.Heartbeat; + + /** + * Encodes the specified Heartbeat message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.verify|verify} messages. + * @param message Heartbeat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Heartbeat message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.verify|verify} messages. + * @param message Heartbeat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Heartbeat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Heartbeat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamResponse.Heartbeat; + + /** + * Decodes a Heartbeat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Heartbeat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamResponse.Heartbeat; + + /** + * Verifies a Heartbeat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Heartbeat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Heartbeat + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamResponse.Heartbeat; + + /** + * Creates a plain object from a Heartbeat message. Also converts values to other types if specified. + * @param message Heartbeat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamResponse.Heartbeat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Heartbeat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Heartbeat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloseStream. */ + interface ICloseStream { + + /** CloseStream status */ + status?: (google.rpc.IStatus|null); + + /** CloseStream continuationTokens */ + continuationTokens?: (google.bigtable.v2.IStreamContinuationToken[]|null); + + /** CloseStream newPartitions */ + newPartitions?: (google.bigtable.v2.IStreamPartition[]|null); + } + + /** Represents a CloseStream. */ + class CloseStream implements ICloseStream { + + /** + * Constructs a new CloseStream. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ReadChangeStreamResponse.ICloseStream); + + /** CloseStream status. */ + public status?: (google.rpc.IStatus|null); + + /** CloseStream continuationTokens. */ + public continuationTokens: google.bigtable.v2.IStreamContinuationToken[]; + + /** CloseStream newPartitions. */ + public newPartitions: google.bigtable.v2.IStreamPartition[]; + + /** + * Creates a new CloseStream instance using the specified properties. + * @param [properties] Properties to set + * @returns CloseStream instance + */ + public static create(properties?: google.bigtable.v2.ReadChangeStreamResponse.ICloseStream): google.bigtable.v2.ReadChangeStreamResponse.CloseStream; + + /** + * Encodes the specified CloseStream message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.CloseStream.verify|verify} messages. + * @param message CloseStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ReadChangeStreamResponse.ICloseStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloseStream message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.CloseStream.verify|verify} messages. + * @param message CloseStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ReadChangeStreamResponse.ICloseStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloseStream message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloseStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadChangeStreamResponse.CloseStream; + + /** + * Decodes a CloseStream message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloseStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadChangeStreamResponse.CloseStream; + + /** + * Verifies a CloseStream message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloseStream message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloseStream + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadChangeStreamResponse.CloseStream; + + /** + * Creates a plain object from a CloseStream message. Also converts values to other types if specified. + * @param message CloseStream + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadChangeStreamResponse.CloseStream, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloseStream to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloseStream + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExecuteQueryRequest. */ + interface IExecuteQueryRequest { + + /** ExecuteQueryRequest instanceName */ + instanceName?: (string|null); + + /** ExecuteQueryRequest appProfileId */ + appProfileId?: (string|null); + + /** ExecuteQueryRequest query */ + query?: (string|null); + + /** ExecuteQueryRequest preparedQuery */ + preparedQuery?: (Uint8Array|Buffer|string|null); + + /** ExecuteQueryRequest protoFormat */ + protoFormat?: (google.bigtable.v2.IProtoFormat|null); + + /** ExecuteQueryRequest resumeToken */ + resumeToken?: (Uint8Array|Buffer|string|null); + + /** ExecuteQueryRequest params */ + params?: ({ [k: string]: google.bigtable.v2.IValue }|null); + } + + /** Represents an ExecuteQueryRequest. */ + class ExecuteQueryRequest implements IExecuteQueryRequest { + + /** + * Constructs a new ExecuteQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IExecuteQueryRequest); + + /** ExecuteQueryRequest instanceName. */ + public instanceName: string; + + /** ExecuteQueryRequest appProfileId. */ + public appProfileId: string; + + /** ExecuteQueryRequest query. */ + public query: string; + + /** ExecuteQueryRequest preparedQuery. */ + public preparedQuery: (Uint8Array|Buffer|string); + + /** ExecuteQueryRequest protoFormat. */ + public protoFormat?: (google.bigtable.v2.IProtoFormat|null); + + /** ExecuteQueryRequest resumeToken. */ + public resumeToken: (Uint8Array|Buffer|string); + + /** ExecuteQueryRequest params. */ + public params: { [k: string]: google.bigtable.v2.IValue }; + + /** ExecuteQueryRequest dataFormat. */ + public dataFormat?: "protoFormat"; + + /** + * Creates a new ExecuteQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteQueryRequest instance + */ + public static create(properties?: google.bigtable.v2.IExecuteQueryRequest): google.bigtable.v2.ExecuteQueryRequest; + + /** + * Encodes the specified ExecuteQueryRequest message. Does not implicitly {@link google.bigtable.v2.ExecuteQueryRequest.verify|verify} messages. + * @param message ExecuteQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IExecuteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteQueryRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ExecuteQueryRequest.verify|verify} messages. + * @param message ExecuteQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IExecuteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ExecuteQueryRequest; + + /** + * Decodes an ExecuteQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ExecuteQueryRequest; + + /** + * Verifies an ExecuteQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ExecuteQueryRequest; + + /** + * Creates a plain object from an ExecuteQueryRequest message. Also converts values to other types if specified. + * @param message ExecuteQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ExecuteQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteQueryResponse. */ + interface IExecuteQueryResponse { + + /** ExecuteQueryResponse metadata */ + metadata?: (google.bigtable.v2.IResultSetMetadata|null); + + /** ExecuteQueryResponse results */ + results?: (google.bigtable.v2.IPartialResultSet|null); + } + + /** Represents an ExecuteQueryResponse. */ + class ExecuteQueryResponse implements IExecuteQueryResponse { + + /** + * Constructs a new ExecuteQueryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IExecuteQueryResponse); + + /** ExecuteQueryResponse metadata. */ + public metadata?: (google.bigtable.v2.IResultSetMetadata|null); + + /** ExecuteQueryResponse results. */ + public results?: (google.bigtable.v2.IPartialResultSet|null); + + /** ExecuteQueryResponse response. */ + public response?: ("metadata"|"results"); + + /** + * Creates a new ExecuteQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteQueryResponse instance + */ + public static create(properties?: google.bigtable.v2.IExecuteQueryResponse): google.bigtable.v2.ExecuteQueryResponse; + + /** + * Encodes the specified ExecuteQueryResponse message. Does not implicitly {@link google.bigtable.v2.ExecuteQueryResponse.verify|verify} messages. + * @param message ExecuteQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IExecuteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteQueryResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ExecuteQueryResponse.verify|verify} messages. + * @param message ExecuteQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IExecuteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ExecuteQueryResponse; + + /** + * Decodes an ExecuteQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ExecuteQueryResponse; + + /** + * Verifies an ExecuteQueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteQueryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteQueryResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ExecuteQueryResponse; + + /** + * Creates a plain object from an ExecuteQueryResponse message. Also converts values to other types if specified. + * @param message ExecuteQueryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ExecuteQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteQueryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteQueryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrepareQueryRequest. */ + interface IPrepareQueryRequest { + + /** PrepareQueryRequest instanceName */ + instanceName?: (string|null); + + /** PrepareQueryRequest appProfileId */ + appProfileId?: (string|null); + + /** PrepareQueryRequest query */ + query?: (string|null); + + /** PrepareQueryRequest protoFormat */ + protoFormat?: (google.bigtable.v2.IProtoFormat|null); + + /** PrepareQueryRequest paramTypes */ + paramTypes?: ({ [k: string]: google.bigtable.v2.IType }|null); + } + + /** Represents a PrepareQueryRequest. */ + class PrepareQueryRequest implements IPrepareQueryRequest { + + /** + * Constructs a new PrepareQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IPrepareQueryRequest); + + /** PrepareQueryRequest instanceName. */ + public instanceName: string; + + /** PrepareQueryRequest appProfileId. */ + public appProfileId: string; + + /** PrepareQueryRequest query. */ + public query: string; + + /** PrepareQueryRequest protoFormat. */ + public protoFormat?: (google.bigtable.v2.IProtoFormat|null); + + /** PrepareQueryRequest paramTypes. */ + public paramTypes: { [k: string]: google.bigtable.v2.IType }; + + /** PrepareQueryRequest dataFormat. */ + public dataFormat?: "protoFormat"; + + /** + * Creates a new PrepareQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PrepareQueryRequest instance + */ + public static create(properties?: google.bigtable.v2.IPrepareQueryRequest): google.bigtable.v2.PrepareQueryRequest; + + /** + * Encodes the specified PrepareQueryRequest message. Does not implicitly {@link google.bigtable.v2.PrepareQueryRequest.verify|verify} messages. + * @param message PrepareQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IPrepareQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrepareQueryRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.PrepareQueryRequest.verify|verify} messages. + * @param message PrepareQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IPrepareQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrepareQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrepareQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.PrepareQueryRequest; + + /** + * Decodes a PrepareQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrepareQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.PrepareQueryRequest; + + /** + * Verifies a PrepareQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrepareQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrepareQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.PrepareQueryRequest; + + /** + * Creates a plain object from a PrepareQueryRequest message. Also converts values to other types if specified. + * @param message PrepareQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.PrepareQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrepareQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrepareQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrepareQueryResponse. */ + interface IPrepareQueryResponse { + + /** PrepareQueryResponse metadata */ + metadata?: (google.bigtable.v2.IResultSetMetadata|null); + + /** PrepareQueryResponse preparedQuery */ + preparedQuery?: (Uint8Array|Buffer|string|null); + + /** PrepareQueryResponse validUntil */ + validUntil?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PrepareQueryResponse. */ + class PrepareQueryResponse implements IPrepareQueryResponse { + + /** + * Constructs a new PrepareQueryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IPrepareQueryResponse); + + /** PrepareQueryResponse metadata. */ + public metadata?: (google.bigtable.v2.IResultSetMetadata|null); + + /** PrepareQueryResponse preparedQuery. */ + public preparedQuery: (Uint8Array|Buffer|string); + + /** PrepareQueryResponse validUntil. */ + public validUntil?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PrepareQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PrepareQueryResponse instance + */ + public static create(properties?: google.bigtable.v2.IPrepareQueryResponse): google.bigtable.v2.PrepareQueryResponse; + + /** + * Encodes the specified PrepareQueryResponse message. Does not implicitly {@link google.bigtable.v2.PrepareQueryResponse.verify|verify} messages. + * @param message PrepareQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IPrepareQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrepareQueryResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.PrepareQueryResponse.verify|verify} messages. + * @param message PrepareQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IPrepareQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrepareQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrepareQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.PrepareQueryResponse; + + /** + * Decodes a PrepareQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrepareQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.PrepareQueryResponse; + + /** + * Verifies a PrepareQueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrepareQueryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrepareQueryResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.PrepareQueryResponse; + + /** + * Creates a plain object from a PrepareQueryResponse message. Also converts values to other types if specified. + * @param message PrepareQueryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.PrepareQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrepareQueryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrepareQueryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Row. */ + interface IRow { + + /** Row key */ + key?: (Uint8Array|Buffer|string|null); + + /** Row families */ + families?: (google.bigtable.v2.IFamily[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRow); + + /** Row key. */ + public key: (Uint8Array|Buffer|string); + + /** Row families. */ + public families: google.bigtable.v2.IFamily[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.bigtable.v2.IRow): google.bigtable.v2.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.bigtable.v2.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.bigtable.v2.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Row; + + /** + * Verifies a Row message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Family. */ + interface IFamily { + + /** Family name */ + name?: (string|null); + + /** Family columns */ + columns?: (google.bigtable.v2.IColumn[]|null); + } + + /** Represents a Family. */ + class Family implements IFamily { + + /** + * Constructs a new Family. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IFamily); + + /** Family name. */ + public name: string; + + /** Family columns. */ + public columns: google.bigtable.v2.IColumn[]; + + /** + * Creates a new Family instance using the specified properties. + * @param [properties] Properties to set + * @returns Family instance + */ + public static create(properties?: google.bigtable.v2.IFamily): google.bigtable.v2.Family; + + /** + * Encodes the specified Family message. Does not implicitly {@link google.bigtable.v2.Family.verify|verify} messages. + * @param message Family message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Family message, length delimited. Does not implicitly {@link google.bigtable.v2.Family.verify|verify} messages. + * @param message Family message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Family message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Family + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Family; + + /** + * Decodes a Family message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Family + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Family; + + /** + * Verifies a Family message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Family message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Family + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Family; + + /** + * Creates a plain object from a Family message. Also converts values to other types if specified. + * @param message Family + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Family, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Family to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Family + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Column. */ + interface IColumn { + + /** Column qualifier */ + qualifier?: (Uint8Array|Buffer|string|null); + + /** Column cells */ + cells?: (google.bigtable.v2.ICell[]|null); + } + + /** Represents a Column. */ + class Column implements IColumn { + + /** + * Constructs a new Column. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IColumn); + + /** Column qualifier. */ + public qualifier: (Uint8Array|Buffer|string); + + /** Column cells. */ + public cells: google.bigtable.v2.ICell[]; + + /** + * Creates a new Column instance using the specified properties. + * @param [properties] Properties to set + * @returns Column instance + */ + public static create(properties?: google.bigtable.v2.IColumn): google.bigtable.v2.Column; + + /** + * Encodes the specified Column message. Does not implicitly {@link google.bigtable.v2.Column.verify|verify} messages. + * @param message Column message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Column message, length delimited. Does not implicitly {@link google.bigtable.v2.Column.verify|verify} messages. + * @param message Column message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Column message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Column; + + /** + * Decodes a Column message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Column; + + /** + * Verifies a Column message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Column message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Column + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Column; + + /** + * Creates a plain object from a Column message. Also converts values to other types if specified. + * @param message Column + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Column, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Column to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Column + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cell. */ + interface ICell { + + /** Cell timestampMicros */ + timestampMicros?: (number|Long|string|null); + + /** Cell value */ + value?: (Uint8Array|Buffer|string|null); + + /** Cell labels */ + labels?: (string[]|null); + } + + /** Represents a Cell. */ + class Cell implements ICell { + + /** + * Constructs a new Cell. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ICell); + + /** Cell timestampMicros. */ + public timestampMicros: (number|Long|string); + + /** Cell value. */ + public value: (Uint8Array|Buffer|string); + + /** Cell labels. */ + public labels: string[]; + + /** + * Creates a new Cell instance using the specified properties. + * @param [properties] Properties to set + * @returns Cell instance + */ + public static create(properties?: google.bigtable.v2.ICell): google.bigtable.v2.Cell; + + /** + * Encodes the specified Cell message. Does not implicitly {@link google.bigtable.v2.Cell.verify|verify} messages. + * @param message Cell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ICell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cell message, length delimited. Does not implicitly {@link google.bigtable.v2.Cell.verify|verify} messages. + * @param message Cell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ICell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cell message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Cell; + + /** + * Decodes a Cell message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Cell; + + /** + * Verifies a Cell message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cell message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cell + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Cell; + + /** + * Creates a plain object from a Cell message. Also converts values to other types if specified. + * @param message Cell + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Cell, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cell + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value type */ + type?: (google.bigtable.v2.IType|null); + + /** Value rawValue */ + rawValue?: (Uint8Array|Buffer|string|null); + + /** Value rawTimestampMicros */ + rawTimestampMicros?: (number|Long|string|null); + + /** Value bytesValue */ + bytesValue?: (Uint8Array|Buffer|string|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value intValue */ + intValue?: (number|Long|string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value floatValue */ + floatValue?: (number|null); + + /** Value timestampValue */ + timestampValue?: (google.protobuf.ITimestamp|null); + + /** Value dateValue */ + dateValue?: (google.type.IDate|null); + + /** Value arrayValue */ + arrayValue?: (google.bigtable.v2.IArrayValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IValue); + + /** Value type. */ + public type?: (google.bigtable.v2.IType|null); + + /** Value rawValue. */ + public rawValue?: (Uint8Array|Buffer|string|null); + + /** Value rawTimestampMicros. */ + public rawTimestampMicros?: (number|Long|string|null); + + /** Value bytesValue. */ + public bytesValue?: (Uint8Array|Buffer|string|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value intValue. */ + public intValue?: (number|Long|string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value floatValue. */ + public floatValue?: (number|null); + + /** Value timestampValue. */ + public timestampValue?: (google.protobuf.ITimestamp|null); + + /** Value dateValue. */ + public dateValue?: (google.type.IDate|null); + + /** Value arrayValue. */ + public arrayValue?: (google.bigtable.v2.IArrayValue|null); + + /** Value kind. */ + public kind?: ("rawValue"|"rawTimestampMicros"|"bytesValue"|"stringValue"|"intValue"|"boolValue"|"floatValue"|"timestampValue"|"dateValue"|"arrayValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.bigtable.v2.IValue): google.bigtable.v2.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.bigtable.v2.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.bigtable.v2.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ArrayValue. */ + interface IArrayValue { + + /** ArrayValue values */ + values?: (google.bigtable.v2.IValue[]|null); + } + + /** Represents an ArrayValue. */ + class ArrayValue implements IArrayValue { + + /** + * Constructs a new ArrayValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IArrayValue); + + /** ArrayValue values. */ + public values: google.bigtable.v2.IValue[]; + + /** + * Creates a new ArrayValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ArrayValue instance + */ + public static create(properties?: google.bigtable.v2.IArrayValue): google.bigtable.v2.ArrayValue; + + /** + * Encodes the specified ArrayValue message. Does not implicitly {@link google.bigtable.v2.ArrayValue.verify|verify} messages. + * @param message ArrayValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IArrayValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.bigtable.v2.ArrayValue.verify|verify} messages. + * @param message ArrayValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IArrayValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArrayValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ArrayValue; + + /** + * Decodes an ArrayValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ArrayValue; + + /** + * Verifies an ArrayValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArrayValue + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ArrayValue; + + /** + * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. + * @param message ArrayValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ArrayValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArrayValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArrayValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RowRange. */ + interface IRowRange { + + /** RowRange startKeyClosed */ + startKeyClosed?: (Uint8Array|Buffer|string|null); + + /** RowRange startKeyOpen */ + startKeyOpen?: (Uint8Array|Buffer|string|null); + + /** RowRange endKeyOpen */ + endKeyOpen?: (Uint8Array|Buffer|string|null); + + /** RowRange endKeyClosed */ + endKeyClosed?: (Uint8Array|Buffer|string|null); + } + + /** Represents a RowRange. */ + class RowRange implements IRowRange { + + /** + * Constructs a new RowRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRowRange); + + /** RowRange startKeyClosed. */ + public startKeyClosed?: (Uint8Array|Buffer|string|null); + + /** RowRange startKeyOpen. */ + public startKeyOpen?: (Uint8Array|Buffer|string|null); + + /** RowRange endKeyOpen. */ + public endKeyOpen?: (Uint8Array|Buffer|string|null); + + /** RowRange endKeyClosed. */ + public endKeyClosed?: (Uint8Array|Buffer|string|null); + + /** RowRange startKey. */ + public startKey?: ("startKeyClosed"|"startKeyOpen"); + + /** RowRange endKey. */ + public endKey?: ("endKeyOpen"|"endKeyClosed"); + + /** + * Creates a new RowRange instance using the specified properties. + * @param [properties] Properties to set + * @returns RowRange instance + */ + public static create(properties?: google.bigtable.v2.IRowRange): google.bigtable.v2.RowRange; + + /** + * Encodes the specified RowRange message. Does not implicitly {@link google.bigtable.v2.RowRange.verify|verify} messages. + * @param message RowRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRowRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowRange message, length delimited. Does not implicitly {@link google.bigtable.v2.RowRange.verify|verify} messages. + * @param message RowRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRowRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RowRange; + + /** + * Decodes a RowRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RowRange; + + /** + * Verifies a RowRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowRange + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RowRange; + + /** + * Creates a plain object from a RowRange message. Also converts values to other types if specified. + * @param message RowRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RowRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RowSet. */ + interface IRowSet { + + /** RowSet rowKeys */ + rowKeys?: (Uint8Array[]|null); + + /** RowSet rowRanges */ + rowRanges?: (google.bigtable.v2.IRowRange[]|null); + } + + /** Represents a RowSet. */ + class RowSet implements IRowSet { + + /** + * Constructs a new RowSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRowSet); + + /** RowSet rowKeys. */ + public rowKeys: Uint8Array[]; + + /** RowSet rowRanges. */ + public rowRanges: google.bigtable.v2.IRowRange[]; + + /** + * Creates a new RowSet instance using the specified properties. + * @param [properties] Properties to set + * @returns RowSet instance + */ + public static create(properties?: google.bigtable.v2.IRowSet): google.bigtable.v2.RowSet; + + /** + * Encodes the specified RowSet message. Does not implicitly {@link google.bigtable.v2.RowSet.verify|verify} messages. + * @param message RowSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRowSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowSet message, length delimited. Does not implicitly {@link google.bigtable.v2.RowSet.verify|verify} messages. + * @param message RowSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRowSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RowSet; + + /** + * Decodes a RowSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RowSet; + + /** + * Verifies a RowSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowSet + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RowSet; + + /** + * Creates a plain object from a RowSet message. Also converts values to other types if specified. + * @param message RowSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RowSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ColumnRange. */ + interface IColumnRange { + + /** ColumnRange familyName */ + familyName?: (string|null); + + /** ColumnRange startQualifierClosed */ + startQualifierClosed?: (Uint8Array|Buffer|string|null); + + /** ColumnRange startQualifierOpen */ + startQualifierOpen?: (Uint8Array|Buffer|string|null); + + /** ColumnRange endQualifierClosed */ + endQualifierClosed?: (Uint8Array|Buffer|string|null); + + /** ColumnRange endQualifierOpen */ + endQualifierOpen?: (Uint8Array|Buffer|string|null); + } + + /** Represents a ColumnRange. */ + class ColumnRange implements IColumnRange { + + /** + * Constructs a new ColumnRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IColumnRange); + + /** ColumnRange familyName. */ + public familyName: string; + + /** ColumnRange startQualifierClosed. */ + public startQualifierClosed?: (Uint8Array|Buffer|string|null); + + /** ColumnRange startQualifierOpen. */ + public startQualifierOpen?: (Uint8Array|Buffer|string|null); + + /** ColumnRange endQualifierClosed. */ + public endQualifierClosed?: (Uint8Array|Buffer|string|null); + + /** ColumnRange endQualifierOpen. */ + public endQualifierOpen?: (Uint8Array|Buffer|string|null); + + /** ColumnRange startQualifier. */ + public startQualifier?: ("startQualifierClosed"|"startQualifierOpen"); + + /** ColumnRange endQualifier. */ + public endQualifier?: ("endQualifierClosed"|"endQualifierOpen"); + + /** + * Creates a new ColumnRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnRange instance + */ + public static create(properties?: google.bigtable.v2.IColumnRange): google.bigtable.v2.ColumnRange; + + /** + * Encodes the specified ColumnRange message. Does not implicitly {@link google.bigtable.v2.ColumnRange.verify|verify} messages. + * @param message ColumnRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IColumnRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnRange message, length delimited. Does not implicitly {@link google.bigtable.v2.ColumnRange.verify|verify} messages. + * @param message ColumnRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IColumnRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ColumnRange; + + /** + * Decodes a ColumnRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ColumnRange; + + /** + * Verifies a ColumnRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnRange + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ColumnRange; + + /** + * Creates a plain object from a ColumnRange message. Also converts values to other types if specified. + * @param message ColumnRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ColumnRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampRange. */ + interface ITimestampRange { + + /** TimestampRange startTimestampMicros */ + startTimestampMicros?: (number|Long|string|null); + + /** TimestampRange endTimestampMicros */ + endTimestampMicros?: (number|Long|string|null); + } + + /** Represents a TimestampRange. */ + class TimestampRange implements ITimestampRange { + + /** + * Constructs a new TimestampRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.ITimestampRange); + + /** TimestampRange startTimestampMicros. */ + public startTimestampMicros: (number|Long|string); + + /** TimestampRange endTimestampMicros. */ + public endTimestampMicros: (number|Long|string); + + /** + * Creates a new TimestampRange instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampRange instance + */ + public static create(properties?: google.bigtable.v2.ITimestampRange): google.bigtable.v2.TimestampRange; + + /** + * Encodes the specified TimestampRange message. Does not implicitly {@link google.bigtable.v2.TimestampRange.verify|verify} messages. + * @param message TimestampRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.ITimestampRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimestampRange message, length delimited. Does not implicitly {@link google.bigtable.v2.TimestampRange.verify|verify} messages. + * @param message TimestampRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.ITimestampRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.TimestampRange; + + /** + * Decodes a TimestampRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.TimestampRange; + + /** + * Verifies a TimestampRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimestampRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimestampRange + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.TimestampRange; + + /** + * Creates a plain object from a TimestampRange message. Also converts values to other types if specified. + * @param message TimestampRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.TimestampRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimestampRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimestampRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValueRange. */ + interface IValueRange { + + /** ValueRange startValueClosed */ + startValueClosed?: (Uint8Array|Buffer|string|null); + + /** ValueRange startValueOpen */ + startValueOpen?: (Uint8Array|Buffer|string|null); + + /** ValueRange endValueClosed */ + endValueClosed?: (Uint8Array|Buffer|string|null); + + /** ValueRange endValueOpen */ + endValueOpen?: (Uint8Array|Buffer|string|null); + } + + /** Represents a ValueRange. */ + class ValueRange implements IValueRange { + + /** + * Constructs a new ValueRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IValueRange); + + /** ValueRange startValueClosed. */ + public startValueClosed?: (Uint8Array|Buffer|string|null); + + /** ValueRange startValueOpen. */ + public startValueOpen?: (Uint8Array|Buffer|string|null); + + /** ValueRange endValueClosed. */ + public endValueClosed?: (Uint8Array|Buffer|string|null); + + /** ValueRange endValueOpen. */ + public endValueOpen?: (Uint8Array|Buffer|string|null); + + /** ValueRange startValue. */ + public startValue?: ("startValueClosed"|"startValueOpen"); + + /** ValueRange endValue. */ + public endValue?: ("endValueClosed"|"endValueOpen"); + + /** + * Creates a new ValueRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ValueRange instance + */ + public static create(properties?: google.bigtable.v2.IValueRange): google.bigtable.v2.ValueRange; + + /** + * Encodes the specified ValueRange message. Does not implicitly {@link google.bigtable.v2.ValueRange.verify|verify} messages. + * @param message ValueRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IValueRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValueRange message, length delimited. Does not implicitly {@link google.bigtable.v2.ValueRange.verify|verify} messages. + * @param message ValueRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IValueRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValueRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValueRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ValueRange; + + /** + * Decodes a ValueRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValueRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ValueRange; + + /** + * Verifies a ValueRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValueRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValueRange + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ValueRange; + + /** + * Creates a plain object from a ValueRange message. Also converts values to other types if specified. + * @param message ValueRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ValueRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValueRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValueRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RowFilter. */ + interface IRowFilter { + + /** RowFilter chain */ + chain?: (google.bigtable.v2.RowFilter.IChain|null); + + /** RowFilter interleave */ + interleave?: (google.bigtable.v2.RowFilter.IInterleave|null); + + /** RowFilter condition */ + condition?: (google.bigtable.v2.RowFilter.ICondition|null); + + /** RowFilter sink */ + sink?: (boolean|null); + + /** RowFilter passAllFilter */ + passAllFilter?: (boolean|null); + + /** RowFilter blockAllFilter */ + blockAllFilter?: (boolean|null); + + /** RowFilter rowKeyRegexFilter */ + rowKeyRegexFilter?: (Uint8Array|Buffer|string|null); + + /** RowFilter rowSampleFilter */ + rowSampleFilter?: (number|null); + + /** RowFilter familyNameRegexFilter */ + familyNameRegexFilter?: (string|null); + + /** RowFilter columnQualifierRegexFilter */ + columnQualifierRegexFilter?: (Uint8Array|Buffer|string|null); + + /** RowFilter columnRangeFilter */ + columnRangeFilter?: (google.bigtable.v2.IColumnRange|null); + + /** RowFilter timestampRangeFilter */ + timestampRangeFilter?: (google.bigtable.v2.ITimestampRange|null); + + /** RowFilter valueRegexFilter */ + valueRegexFilter?: (Uint8Array|Buffer|string|null); + + /** RowFilter valueRangeFilter */ + valueRangeFilter?: (google.bigtable.v2.IValueRange|null); + + /** RowFilter cellsPerRowOffsetFilter */ + cellsPerRowOffsetFilter?: (number|null); + + /** RowFilter cellsPerRowLimitFilter */ + cellsPerRowLimitFilter?: (number|null); + + /** RowFilter cellsPerColumnLimitFilter */ + cellsPerColumnLimitFilter?: (number|null); + + /** RowFilter stripValueTransformer */ + stripValueTransformer?: (boolean|null); + + /** RowFilter applyLabelTransformer */ + applyLabelTransformer?: (string|null); + } + + /** Represents a RowFilter. */ + class RowFilter implements IRowFilter { + + /** + * Constructs a new RowFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRowFilter); + + /** RowFilter chain. */ + public chain?: (google.bigtable.v2.RowFilter.IChain|null); + + /** RowFilter interleave. */ + public interleave?: (google.bigtable.v2.RowFilter.IInterleave|null); + + /** RowFilter condition. */ + public condition?: (google.bigtable.v2.RowFilter.ICondition|null); + + /** RowFilter sink. */ + public sink?: (boolean|null); + + /** RowFilter passAllFilter. */ + public passAllFilter?: (boolean|null); + + /** RowFilter blockAllFilter. */ + public blockAllFilter?: (boolean|null); + + /** RowFilter rowKeyRegexFilter. */ + public rowKeyRegexFilter?: (Uint8Array|Buffer|string|null); + + /** RowFilter rowSampleFilter. */ + public rowSampleFilter?: (number|null); + + /** RowFilter familyNameRegexFilter. */ + public familyNameRegexFilter?: (string|null); + + /** RowFilter columnQualifierRegexFilter. */ + public columnQualifierRegexFilter?: (Uint8Array|Buffer|string|null); + + /** RowFilter columnRangeFilter. */ + public columnRangeFilter?: (google.bigtable.v2.IColumnRange|null); + + /** RowFilter timestampRangeFilter. */ + public timestampRangeFilter?: (google.bigtable.v2.ITimestampRange|null); + + /** RowFilter valueRegexFilter. */ + public valueRegexFilter?: (Uint8Array|Buffer|string|null); + + /** RowFilter valueRangeFilter. */ + public valueRangeFilter?: (google.bigtable.v2.IValueRange|null); + + /** RowFilter cellsPerRowOffsetFilter. */ + public cellsPerRowOffsetFilter?: (number|null); + + /** RowFilter cellsPerRowLimitFilter. */ + public cellsPerRowLimitFilter?: (number|null); + + /** RowFilter cellsPerColumnLimitFilter. */ + public cellsPerColumnLimitFilter?: (number|null); + + /** RowFilter stripValueTransformer. */ + public stripValueTransformer?: (boolean|null); + + /** RowFilter applyLabelTransformer. */ + public applyLabelTransformer?: (string|null); + + /** RowFilter filter. */ + public filter?: ("chain"|"interleave"|"condition"|"sink"|"passAllFilter"|"blockAllFilter"|"rowKeyRegexFilter"|"rowSampleFilter"|"familyNameRegexFilter"|"columnQualifierRegexFilter"|"columnRangeFilter"|"timestampRangeFilter"|"valueRegexFilter"|"valueRangeFilter"|"cellsPerRowOffsetFilter"|"cellsPerRowLimitFilter"|"cellsPerColumnLimitFilter"|"stripValueTransformer"|"applyLabelTransformer"); + + /** + * Creates a new RowFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns RowFilter instance + */ + public static create(properties?: google.bigtable.v2.IRowFilter): google.bigtable.v2.RowFilter; + + /** + * Encodes the specified RowFilter message. Does not implicitly {@link google.bigtable.v2.RowFilter.verify|verify} messages. + * @param message RowFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRowFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowFilter message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.verify|verify} messages. + * @param message RowFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRowFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RowFilter; + + /** + * Decodes a RowFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RowFilter; + + /** + * Verifies a RowFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowFilter + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RowFilter; + + /** + * Creates a plain object from a RowFilter message. Also converts values to other types if specified. + * @param message RowFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RowFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RowFilter { + + /** Properties of a Chain. */ + interface IChain { + + /** Chain filters */ + filters?: (google.bigtable.v2.IRowFilter[]|null); + } + + /** Represents a Chain. */ + class Chain implements IChain { + + /** + * Constructs a new Chain. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.RowFilter.IChain); + + /** Chain filters. */ + public filters: google.bigtable.v2.IRowFilter[]; + + /** + * Creates a new Chain instance using the specified properties. + * @param [properties] Properties to set + * @returns Chain instance + */ + public static create(properties?: google.bigtable.v2.RowFilter.IChain): google.bigtable.v2.RowFilter.Chain; + + /** + * Encodes the specified Chain message. Does not implicitly {@link google.bigtable.v2.RowFilter.Chain.verify|verify} messages. + * @param message Chain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.RowFilter.IChain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chain message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.Chain.verify|verify} messages. + * @param message Chain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.RowFilter.IChain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Chain message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RowFilter.Chain; + + /** + * Decodes a Chain message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RowFilter.Chain; + + /** + * Verifies a Chain message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Chain message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chain + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RowFilter.Chain; + + /** + * Creates a plain object from a Chain message. Also converts values to other types if specified. + * @param message Chain + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RowFilter.Chain, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Chain to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Chain + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Interleave. */ + interface IInterleave { + + /** Interleave filters */ + filters?: (google.bigtable.v2.IRowFilter[]|null); + } + + /** Represents an Interleave. */ + class Interleave implements IInterleave { + + /** + * Constructs a new Interleave. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.RowFilter.IInterleave); + + /** Interleave filters. */ + public filters: google.bigtable.v2.IRowFilter[]; + + /** + * Creates a new Interleave instance using the specified properties. + * @param [properties] Properties to set + * @returns Interleave instance + */ + public static create(properties?: google.bigtable.v2.RowFilter.IInterleave): google.bigtable.v2.RowFilter.Interleave; + + /** + * Encodes the specified Interleave message. Does not implicitly {@link google.bigtable.v2.RowFilter.Interleave.verify|verify} messages. + * @param message Interleave message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.RowFilter.IInterleave, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interleave message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.Interleave.verify|verify} messages. + * @param message Interleave message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.RowFilter.IInterleave, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interleave message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interleave + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RowFilter.Interleave; + + /** + * Decodes an Interleave message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interleave + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RowFilter.Interleave; + + /** + * Verifies an Interleave message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Interleave message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interleave + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RowFilter.Interleave; + + /** + * Creates a plain object from an Interleave message. Also converts values to other types if specified. + * @param message Interleave + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RowFilter.Interleave, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interleave to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Interleave + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition predicateFilter */ + predicateFilter?: (google.bigtable.v2.IRowFilter|null); + + /** Condition trueFilter */ + trueFilter?: (google.bigtable.v2.IRowFilter|null); + + /** Condition falseFilter */ + falseFilter?: (google.bigtable.v2.IRowFilter|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.RowFilter.ICondition); + + /** Condition predicateFilter. */ + public predicateFilter?: (google.bigtable.v2.IRowFilter|null); + + /** Condition trueFilter. */ + public trueFilter?: (google.bigtable.v2.IRowFilter|null); + + /** Condition falseFilter. */ + public falseFilter?: (google.bigtable.v2.IRowFilter|null); + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.bigtable.v2.RowFilter.ICondition): google.bigtable.v2.RowFilter.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.bigtable.v2.RowFilter.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.RowFilter.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.RowFilter.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RowFilter.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RowFilter.Condition; + + /** + * Verifies a Condition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RowFilter.Condition; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RowFilter.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Condition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Mutation. */ + interface IMutation { + + /** Mutation setCell */ + setCell?: (google.bigtable.v2.Mutation.ISetCell|null); + + /** Mutation addToCell */ + addToCell?: (google.bigtable.v2.Mutation.IAddToCell|null); + + /** Mutation mergeToCell */ + mergeToCell?: (google.bigtable.v2.Mutation.IMergeToCell|null); + + /** Mutation deleteFromColumn */ + deleteFromColumn?: (google.bigtable.v2.Mutation.IDeleteFromColumn|null); + + /** Mutation deleteFromFamily */ + deleteFromFamily?: (google.bigtable.v2.Mutation.IDeleteFromFamily|null); + + /** Mutation deleteFromRow */ + deleteFromRow?: (google.bigtable.v2.Mutation.IDeleteFromRow|null); + } + + /** Represents a Mutation. */ + class Mutation implements IMutation { + + /** + * Constructs a new Mutation. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IMutation); + + /** Mutation setCell. */ + public setCell?: (google.bigtable.v2.Mutation.ISetCell|null); + + /** Mutation addToCell. */ + public addToCell?: (google.bigtable.v2.Mutation.IAddToCell|null); + + /** Mutation mergeToCell. */ + public mergeToCell?: (google.bigtable.v2.Mutation.IMergeToCell|null); + + /** Mutation deleteFromColumn. */ + public deleteFromColumn?: (google.bigtable.v2.Mutation.IDeleteFromColumn|null); + + /** Mutation deleteFromFamily. */ + public deleteFromFamily?: (google.bigtable.v2.Mutation.IDeleteFromFamily|null); + + /** Mutation deleteFromRow. */ + public deleteFromRow?: (google.bigtable.v2.Mutation.IDeleteFromRow|null); + + /** Mutation mutation. */ + public mutation?: ("setCell"|"addToCell"|"mergeToCell"|"deleteFromColumn"|"deleteFromFamily"|"deleteFromRow"); + + /** + * Creates a new Mutation instance using the specified properties. + * @param [properties] Properties to set + * @returns Mutation instance + */ + public static create(properties?: google.bigtable.v2.IMutation): google.bigtable.v2.Mutation; + + /** + * Encodes the specified Mutation message. Does not implicitly {@link google.bigtable.v2.Mutation.verify|verify} messages. + * @param message Mutation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.verify|verify} messages. + * @param message Mutation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Mutation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation; + + /** + * Decodes a Mutation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation; + + /** + * Verifies a Mutation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Mutation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Mutation + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation; + + /** + * Creates a plain object from a Mutation message. Also converts values to other types if specified. + * @param message Mutation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Mutation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Mutation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Mutation { + + /** Properties of a SetCell. */ + interface ISetCell { + + /** SetCell familyName */ + familyName?: (string|null); + + /** SetCell columnQualifier */ + columnQualifier?: (Uint8Array|Buffer|string|null); + + /** SetCell timestampMicros */ + timestampMicros?: (number|Long|string|null); + + /** SetCell value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a SetCell. */ + class SetCell implements ISetCell { + + /** + * Constructs a new SetCell. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Mutation.ISetCell); + + /** SetCell familyName. */ + public familyName: string; + + /** SetCell columnQualifier. */ + public columnQualifier: (Uint8Array|Buffer|string); + + /** SetCell timestampMicros. */ + public timestampMicros: (number|Long|string); + + /** SetCell value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new SetCell instance using the specified properties. + * @param [properties] Properties to set + * @returns SetCell instance + */ + public static create(properties?: google.bigtable.v2.Mutation.ISetCell): google.bigtable.v2.Mutation.SetCell; + + /** + * Encodes the specified SetCell message. Does not implicitly {@link google.bigtable.v2.Mutation.SetCell.verify|verify} messages. + * @param message SetCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Mutation.ISetCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetCell message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.SetCell.verify|verify} messages. + * @param message SetCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Mutation.ISetCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetCell message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation.SetCell; + + /** + * Decodes a SetCell message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation.SetCell; + + /** + * Verifies a SetCell message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetCell message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetCell + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation.SetCell; + + /** + * Creates a plain object from a SetCell message. Also converts values to other types if specified. + * @param message SetCell + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation.SetCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetCell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetCell + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddToCell. */ + interface IAddToCell { + + /** AddToCell familyName */ + familyName?: (string|null); + + /** AddToCell columnQualifier */ + columnQualifier?: (google.bigtable.v2.IValue|null); + + /** AddToCell timestamp */ + timestamp?: (google.bigtable.v2.IValue|null); + + /** AddToCell input */ + input?: (google.bigtable.v2.IValue|null); + } + + /** Represents an AddToCell. */ + class AddToCell implements IAddToCell { + + /** + * Constructs a new AddToCell. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Mutation.IAddToCell); + + /** AddToCell familyName. */ + public familyName: string; + + /** AddToCell columnQualifier. */ + public columnQualifier?: (google.bigtable.v2.IValue|null); + + /** AddToCell timestamp. */ + public timestamp?: (google.bigtable.v2.IValue|null); + + /** AddToCell input. */ + public input?: (google.bigtable.v2.IValue|null); + + /** + * Creates a new AddToCell instance using the specified properties. + * @param [properties] Properties to set + * @returns AddToCell instance + */ + public static create(properties?: google.bigtable.v2.Mutation.IAddToCell): google.bigtable.v2.Mutation.AddToCell; + + /** + * Encodes the specified AddToCell message. Does not implicitly {@link google.bigtable.v2.Mutation.AddToCell.verify|verify} messages. + * @param message AddToCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Mutation.IAddToCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddToCell message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.AddToCell.verify|verify} messages. + * @param message AddToCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Mutation.IAddToCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddToCell message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation.AddToCell; + + /** + * Decodes an AddToCell message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation.AddToCell; + + /** + * Verifies an AddToCell message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddToCell message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddToCell + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation.AddToCell; + + /** + * Creates a plain object from an AddToCell message. Also converts values to other types if specified. + * @param message AddToCell + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation.AddToCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddToCell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddToCell + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MergeToCell. */ + interface IMergeToCell { + + /** MergeToCell familyName */ + familyName?: (string|null); + + /** MergeToCell columnQualifier */ + columnQualifier?: (google.bigtable.v2.IValue|null); + + /** MergeToCell timestamp */ + timestamp?: (google.bigtable.v2.IValue|null); + + /** MergeToCell input */ + input?: (google.bigtable.v2.IValue|null); + } + + /** Represents a MergeToCell. */ + class MergeToCell implements IMergeToCell { + + /** + * Constructs a new MergeToCell. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Mutation.IMergeToCell); + + /** MergeToCell familyName. */ + public familyName: string; + + /** MergeToCell columnQualifier. */ + public columnQualifier?: (google.bigtable.v2.IValue|null); + + /** MergeToCell timestamp. */ + public timestamp?: (google.bigtable.v2.IValue|null); + + /** MergeToCell input. */ + public input?: (google.bigtable.v2.IValue|null); + + /** + * Creates a new MergeToCell instance using the specified properties. + * @param [properties] Properties to set + * @returns MergeToCell instance + */ + public static create(properties?: google.bigtable.v2.Mutation.IMergeToCell): google.bigtable.v2.Mutation.MergeToCell; + + /** + * Encodes the specified MergeToCell message. Does not implicitly {@link google.bigtable.v2.Mutation.MergeToCell.verify|verify} messages. + * @param message MergeToCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Mutation.IMergeToCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MergeToCell message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.MergeToCell.verify|verify} messages. + * @param message MergeToCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Mutation.IMergeToCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MergeToCell message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MergeToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation.MergeToCell; + + /** + * Decodes a MergeToCell message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MergeToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation.MergeToCell; + + /** + * Verifies a MergeToCell message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MergeToCell message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MergeToCell + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation.MergeToCell; + + /** + * Creates a plain object from a MergeToCell message. Also converts values to other types if specified. + * @param message MergeToCell + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation.MergeToCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MergeToCell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MergeToCell + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFromColumn. */ + interface IDeleteFromColumn { + + /** DeleteFromColumn familyName */ + familyName?: (string|null); + + /** DeleteFromColumn columnQualifier */ + columnQualifier?: (Uint8Array|Buffer|string|null); + + /** DeleteFromColumn timeRange */ + timeRange?: (google.bigtable.v2.ITimestampRange|null); + } + + /** Represents a DeleteFromColumn. */ + class DeleteFromColumn implements IDeleteFromColumn { + + /** + * Constructs a new DeleteFromColumn. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Mutation.IDeleteFromColumn); + + /** DeleteFromColumn familyName. */ + public familyName: string; + + /** DeleteFromColumn columnQualifier. */ + public columnQualifier: (Uint8Array|Buffer|string); + + /** DeleteFromColumn timeRange. */ + public timeRange?: (google.bigtable.v2.ITimestampRange|null); + + /** + * Creates a new DeleteFromColumn instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFromColumn instance + */ + public static create(properties?: google.bigtable.v2.Mutation.IDeleteFromColumn): google.bigtable.v2.Mutation.DeleteFromColumn; + + /** + * Encodes the specified DeleteFromColumn message. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromColumn.verify|verify} messages. + * @param message DeleteFromColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Mutation.IDeleteFromColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFromColumn message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromColumn.verify|verify} messages. + * @param message DeleteFromColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Mutation.IDeleteFromColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFromColumn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFromColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation.DeleteFromColumn; + + /** + * Decodes a DeleteFromColumn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFromColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation.DeleteFromColumn; + + /** + * Verifies a DeleteFromColumn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFromColumn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFromColumn + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation.DeleteFromColumn; + + /** + * Creates a plain object from a DeleteFromColumn message. Also converts values to other types if specified. + * @param message DeleteFromColumn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation.DeleteFromColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFromColumn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFromColumn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFromFamily. */ + interface IDeleteFromFamily { + + /** DeleteFromFamily familyName */ + familyName?: (string|null); + } + + /** Represents a DeleteFromFamily. */ + class DeleteFromFamily implements IDeleteFromFamily { + + /** + * Constructs a new DeleteFromFamily. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Mutation.IDeleteFromFamily); + + /** DeleteFromFamily familyName. */ + public familyName: string; + + /** + * Creates a new DeleteFromFamily instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFromFamily instance + */ + public static create(properties?: google.bigtable.v2.Mutation.IDeleteFromFamily): google.bigtable.v2.Mutation.DeleteFromFamily; + + /** + * Encodes the specified DeleteFromFamily message. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromFamily.verify|verify} messages. + * @param message DeleteFromFamily message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Mutation.IDeleteFromFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFromFamily message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromFamily.verify|verify} messages. + * @param message DeleteFromFamily message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Mutation.IDeleteFromFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFromFamily message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFromFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation.DeleteFromFamily; + + /** + * Decodes a DeleteFromFamily message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFromFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation.DeleteFromFamily; + + /** + * Verifies a DeleteFromFamily message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFromFamily message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFromFamily + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation.DeleteFromFamily; + + /** + * Creates a plain object from a DeleteFromFamily message. Also converts values to other types if specified. + * @param message DeleteFromFamily + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation.DeleteFromFamily, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFromFamily to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFromFamily + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFromRow. */ + interface IDeleteFromRow { + } + + /** Represents a DeleteFromRow. */ + class DeleteFromRow implements IDeleteFromRow { + + /** + * Constructs a new DeleteFromRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Mutation.IDeleteFromRow); + + /** + * Creates a new DeleteFromRow instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFromRow instance + */ + public static create(properties?: google.bigtable.v2.Mutation.IDeleteFromRow): google.bigtable.v2.Mutation.DeleteFromRow; + + /** + * Encodes the specified DeleteFromRow message. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromRow.verify|verify} messages. + * @param message DeleteFromRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Mutation.IDeleteFromRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFromRow message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromRow.verify|verify} messages. + * @param message DeleteFromRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Mutation.IDeleteFromRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFromRow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFromRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Mutation.DeleteFromRow; + + /** + * Decodes a DeleteFromRow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFromRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Mutation.DeleteFromRow; + + /** + * Verifies a DeleteFromRow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFromRow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFromRow + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Mutation.DeleteFromRow; + + /** + * Creates a plain object from a DeleteFromRow message. Also converts values to other types if specified. + * @param message DeleteFromRow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Mutation.DeleteFromRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFromRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFromRow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ReadModifyWriteRule. */ + interface IReadModifyWriteRule { + + /** ReadModifyWriteRule familyName */ + familyName?: (string|null); + + /** ReadModifyWriteRule columnQualifier */ + columnQualifier?: (Uint8Array|Buffer|string|null); + + /** ReadModifyWriteRule appendValue */ + appendValue?: (Uint8Array|Buffer|string|null); + + /** ReadModifyWriteRule incrementAmount */ + incrementAmount?: (number|Long|string|null); + } + + /** Represents a ReadModifyWriteRule. */ + class ReadModifyWriteRule implements IReadModifyWriteRule { + + /** + * Constructs a new ReadModifyWriteRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadModifyWriteRule); + + /** ReadModifyWriteRule familyName. */ + public familyName: string; + + /** ReadModifyWriteRule columnQualifier. */ + public columnQualifier: (Uint8Array|Buffer|string); + + /** ReadModifyWriteRule appendValue. */ + public appendValue?: (Uint8Array|Buffer|string|null); + + /** ReadModifyWriteRule incrementAmount. */ + public incrementAmount?: (number|Long|string|null); + + /** ReadModifyWriteRule rule. */ + public rule?: ("appendValue"|"incrementAmount"); + + /** + * Creates a new ReadModifyWriteRule instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadModifyWriteRule instance + */ + public static create(properties?: google.bigtable.v2.IReadModifyWriteRule): google.bigtable.v2.ReadModifyWriteRule; + + /** + * Encodes the specified ReadModifyWriteRule message. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRule.verify|verify} messages. + * @param message ReadModifyWriteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadModifyWriteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadModifyWriteRule message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRule.verify|verify} messages. + * @param message ReadModifyWriteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadModifyWriteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadModifyWriteRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadModifyWriteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadModifyWriteRule; + + /** + * Decodes a ReadModifyWriteRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadModifyWriteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadModifyWriteRule; + + /** + * Verifies a ReadModifyWriteRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadModifyWriteRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadModifyWriteRule + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadModifyWriteRule; + + /** + * Creates a plain object from a ReadModifyWriteRule message. Also converts values to other types if specified. + * @param message ReadModifyWriteRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadModifyWriteRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadModifyWriteRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadModifyWriteRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamPartition. */ + interface IStreamPartition { + + /** StreamPartition rowRange */ + rowRange?: (google.bigtable.v2.IRowRange|null); + } + + /** Represents a StreamPartition. */ + class StreamPartition implements IStreamPartition { + + /** + * Constructs a new StreamPartition. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IStreamPartition); + + /** StreamPartition rowRange. */ + public rowRange?: (google.bigtable.v2.IRowRange|null); + + /** + * Creates a new StreamPartition instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamPartition instance + */ + public static create(properties?: google.bigtable.v2.IStreamPartition): google.bigtable.v2.StreamPartition; + + /** + * Encodes the specified StreamPartition message. Does not implicitly {@link google.bigtable.v2.StreamPartition.verify|verify} messages. + * @param message StreamPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IStreamPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamPartition message, length delimited. Does not implicitly {@link google.bigtable.v2.StreamPartition.verify|verify} messages. + * @param message StreamPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IStreamPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamPartition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.StreamPartition; + + /** + * Decodes a StreamPartition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.StreamPartition; + + /** + * Verifies a StreamPartition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamPartition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamPartition + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.StreamPartition; + + /** + * Creates a plain object from a StreamPartition message. Also converts values to other types if specified. + * @param message StreamPartition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.StreamPartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamPartition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamPartition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamContinuationTokens. */ + interface IStreamContinuationTokens { + + /** StreamContinuationTokens tokens */ + tokens?: (google.bigtable.v2.IStreamContinuationToken[]|null); + } + + /** Represents a StreamContinuationTokens. */ + class StreamContinuationTokens implements IStreamContinuationTokens { + + /** + * Constructs a new StreamContinuationTokens. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IStreamContinuationTokens); + + /** StreamContinuationTokens tokens. */ + public tokens: google.bigtable.v2.IStreamContinuationToken[]; + + /** + * Creates a new StreamContinuationTokens instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamContinuationTokens instance + */ + public static create(properties?: google.bigtable.v2.IStreamContinuationTokens): google.bigtable.v2.StreamContinuationTokens; + + /** + * Encodes the specified StreamContinuationTokens message. Does not implicitly {@link google.bigtable.v2.StreamContinuationTokens.verify|verify} messages. + * @param message StreamContinuationTokens message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IStreamContinuationTokens, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamContinuationTokens message, length delimited. Does not implicitly {@link google.bigtable.v2.StreamContinuationTokens.verify|verify} messages. + * @param message StreamContinuationTokens message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IStreamContinuationTokens, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamContinuationTokens message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamContinuationTokens + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.StreamContinuationTokens; + + /** + * Decodes a StreamContinuationTokens message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamContinuationTokens + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.StreamContinuationTokens; + + /** + * Verifies a StreamContinuationTokens message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamContinuationTokens message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamContinuationTokens + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.StreamContinuationTokens; + + /** + * Creates a plain object from a StreamContinuationTokens message. Also converts values to other types if specified. + * @param message StreamContinuationTokens + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.StreamContinuationTokens, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamContinuationTokens to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamContinuationTokens + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamContinuationToken. */ + interface IStreamContinuationToken { + + /** StreamContinuationToken partition */ + partition?: (google.bigtable.v2.IStreamPartition|null); + + /** StreamContinuationToken token */ + token?: (string|null); + } + + /** Represents a StreamContinuationToken. */ + class StreamContinuationToken implements IStreamContinuationToken { + + /** + * Constructs a new StreamContinuationToken. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IStreamContinuationToken); + + /** StreamContinuationToken partition. */ + public partition?: (google.bigtable.v2.IStreamPartition|null); + + /** StreamContinuationToken token. */ + public token: string; + + /** + * Creates a new StreamContinuationToken instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamContinuationToken instance + */ + public static create(properties?: google.bigtable.v2.IStreamContinuationToken): google.bigtable.v2.StreamContinuationToken; + + /** + * Encodes the specified StreamContinuationToken message. Does not implicitly {@link google.bigtable.v2.StreamContinuationToken.verify|verify} messages. + * @param message StreamContinuationToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IStreamContinuationToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamContinuationToken message, length delimited. Does not implicitly {@link google.bigtable.v2.StreamContinuationToken.verify|verify} messages. + * @param message StreamContinuationToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IStreamContinuationToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamContinuationToken message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamContinuationToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.StreamContinuationToken; + + /** + * Decodes a StreamContinuationToken message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamContinuationToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.StreamContinuationToken; + + /** + * Verifies a StreamContinuationToken message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamContinuationToken message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamContinuationToken + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.StreamContinuationToken; + + /** + * Creates a plain object from a StreamContinuationToken message. Also converts values to other types if specified. + * @param message StreamContinuationToken + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.StreamContinuationToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamContinuationToken to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamContinuationToken + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProtoFormat. */ + interface IProtoFormat { + } + + /** Represents a ProtoFormat. */ + class ProtoFormat implements IProtoFormat { + + /** + * Constructs a new ProtoFormat. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IProtoFormat); + + /** + * Creates a new ProtoFormat instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoFormat instance + */ + public static create(properties?: google.bigtable.v2.IProtoFormat): google.bigtable.v2.ProtoFormat; + + /** + * Encodes the specified ProtoFormat message. Does not implicitly {@link google.bigtable.v2.ProtoFormat.verify|verify} messages. + * @param message ProtoFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IProtoFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoFormat message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoFormat.verify|verify} messages. + * @param message ProtoFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IProtoFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoFormat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ProtoFormat; + + /** + * Decodes a ProtoFormat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ProtoFormat; + + /** + * Verifies a ProtoFormat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoFormat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoFormat + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ProtoFormat; + + /** + * Creates a plain object from a ProtoFormat message. Also converts values to other types if specified. + * @param message ProtoFormat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ProtoFormat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoFormat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoFormat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ColumnMetadata. */ + interface IColumnMetadata { + + /** ColumnMetadata name */ + name?: (string|null); + + /** ColumnMetadata type */ + type?: (google.bigtable.v2.IType|null); + } + + /** Represents a ColumnMetadata. */ + class ColumnMetadata implements IColumnMetadata { + + /** + * Constructs a new ColumnMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IColumnMetadata); + + /** ColumnMetadata name. */ + public name: string; + + /** ColumnMetadata type. */ + public type?: (google.bigtable.v2.IType|null); + + /** + * Creates a new ColumnMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnMetadata instance + */ + public static create(properties?: google.bigtable.v2.IColumnMetadata): google.bigtable.v2.ColumnMetadata; + + /** + * Encodes the specified ColumnMetadata message. Does not implicitly {@link google.bigtable.v2.ColumnMetadata.verify|verify} messages. + * @param message ColumnMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IColumnMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnMetadata message, length delimited. Does not implicitly {@link google.bigtable.v2.ColumnMetadata.verify|verify} messages. + * @param message ColumnMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IColumnMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ColumnMetadata; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ColumnMetadata; + + /** + * Verifies a ColumnMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ColumnMetadata; + + /** + * Creates a plain object from a ColumnMetadata message. Also converts values to other types if specified. + * @param message ColumnMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ColumnMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProtoSchema. */ + interface IProtoSchema { + + /** ProtoSchema columns */ + columns?: (google.bigtable.v2.IColumnMetadata[]|null); + } + + /** Represents a ProtoSchema. */ + class ProtoSchema implements IProtoSchema { + + /** + * Constructs a new ProtoSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IProtoSchema); + + /** ProtoSchema columns. */ + public columns: google.bigtable.v2.IColumnMetadata[]; + + /** + * Creates a new ProtoSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoSchema instance + */ + public static create(properties?: google.bigtable.v2.IProtoSchema): google.bigtable.v2.ProtoSchema; + + /** + * Encodes the specified ProtoSchema message. Does not implicitly {@link google.bigtable.v2.ProtoSchema.verify|verify} messages. + * @param message ProtoSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IProtoSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoSchema message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoSchema.verify|verify} messages. + * @param message ProtoSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IProtoSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ProtoSchema; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ProtoSchema; + + /** + * Verifies a ProtoSchema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoSchema + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ProtoSchema; + + /** + * Creates a plain object from a ProtoSchema message. Also converts values to other types if specified. + * @param message ProtoSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ProtoSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResultSetMetadata. */ + interface IResultSetMetadata { + + /** ResultSetMetadata protoSchema */ + protoSchema?: (google.bigtable.v2.IProtoSchema|null); + } + + /** Represents a ResultSetMetadata. */ + class ResultSetMetadata implements IResultSetMetadata { + + /** + * Constructs a new ResultSetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IResultSetMetadata); + + /** ResultSetMetadata protoSchema. */ + public protoSchema?: (google.bigtable.v2.IProtoSchema|null); + + /** ResultSetMetadata schema. */ + public schema?: "protoSchema"; + + /** + * Creates a new ResultSetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ResultSetMetadata instance + */ + public static create(properties?: google.bigtable.v2.IResultSetMetadata): google.bigtable.v2.ResultSetMetadata; + + /** + * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.bigtable.v2.ResultSetMetadata.verify|verify} messages. + * @param message ResultSetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.bigtable.v2.ResultSetMetadata.verify|verify} messages. + * @param message ResultSetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ResultSetMetadata; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ResultSetMetadata; + + /** + * Verifies a ResultSetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultSetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ResultSetMetadata; + + /** + * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. + * @param message ResultSetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ResultSetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultSetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultSetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProtoRows. */ + interface IProtoRows { + + /** ProtoRows values */ + values?: (google.bigtable.v2.IValue[]|null); + } + + /** Represents a ProtoRows. */ + class ProtoRows implements IProtoRows { + + /** + * Constructs a new ProtoRows. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IProtoRows); + + /** ProtoRows values. */ + public values: google.bigtable.v2.IValue[]; + + /** + * Creates a new ProtoRows instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoRows instance + */ + public static create(properties?: google.bigtable.v2.IProtoRows): google.bigtable.v2.ProtoRows; + + /** + * Encodes the specified ProtoRows message. Does not implicitly {@link google.bigtable.v2.ProtoRows.verify|verify} messages. + * @param message ProtoRows message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IProtoRows, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoRows message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoRows.verify|verify} messages. + * @param message ProtoRows message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IProtoRows, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoRows message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ProtoRows; + + /** + * Decodes a ProtoRows message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ProtoRows; + + /** + * Verifies a ProtoRows message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoRows message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoRows + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ProtoRows; + + /** + * Creates a plain object from a ProtoRows message. Also converts values to other types if specified. + * @param message ProtoRows + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ProtoRows, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoRows to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoRows + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProtoRowsBatch. */ + interface IProtoRowsBatch { + + /** ProtoRowsBatch batchData */ + batchData?: (Uint8Array|Buffer|string|null); + } + + /** Represents a ProtoRowsBatch. */ + class ProtoRowsBatch implements IProtoRowsBatch { + + /** + * Constructs a new ProtoRowsBatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IProtoRowsBatch); + + /** ProtoRowsBatch batchData. */ + public batchData: (Uint8Array|Buffer|string); + + /** + * Creates a new ProtoRowsBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoRowsBatch instance + */ + public static create(properties?: google.bigtable.v2.IProtoRowsBatch): google.bigtable.v2.ProtoRowsBatch; + + /** + * Encodes the specified ProtoRowsBatch message. Does not implicitly {@link google.bigtable.v2.ProtoRowsBatch.verify|verify} messages. + * @param message ProtoRowsBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IProtoRowsBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoRowsBatch message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoRowsBatch.verify|verify} messages. + * @param message ProtoRowsBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IProtoRowsBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoRowsBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoRowsBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ProtoRowsBatch; + + /** + * Decodes a ProtoRowsBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoRowsBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ProtoRowsBatch; + + /** + * Verifies a ProtoRowsBatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoRowsBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoRowsBatch + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ProtoRowsBatch; + + /** + * Creates a plain object from a ProtoRowsBatch message. Also converts values to other types if specified. + * @param message ProtoRowsBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ProtoRowsBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoRowsBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoRowsBatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartialResultSet. */ + interface IPartialResultSet { + + /** PartialResultSet protoRowsBatch */ + protoRowsBatch?: (google.bigtable.v2.IProtoRowsBatch|null); + + /** PartialResultSet batchChecksum */ + batchChecksum?: (number|null); + + /** PartialResultSet resumeToken */ + resumeToken?: (Uint8Array|Buffer|string|null); + + /** PartialResultSet reset */ + reset?: (boolean|null); + + /** PartialResultSet estimatedBatchSize */ + estimatedBatchSize?: (number|null); + } + + /** Represents a PartialResultSet. */ + class PartialResultSet implements IPartialResultSet { + + /** + * Constructs a new PartialResultSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IPartialResultSet); + + /** PartialResultSet protoRowsBatch. */ + public protoRowsBatch?: (google.bigtable.v2.IProtoRowsBatch|null); + + /** PartialResultSet batchChecksum. */ + public batchChecksum?: (number|null); + + /** PartialResultSet resumeToken. */ + public resumeToken: (Uint8Array|Buffer|string); + + /** PartialResultSet reset. */ + public reset: boolean; + + /** PartialResultSet estimatedBatchSize. */ + public estimatedBatchSize: number; + + /** PartialResultSet partialRows. */ + public partialRows?: "protoRowsBatch"; + + /** + * Creates a new PartialResultSet instance using the specified properties. + * @param [properties] Properties to set + * @returns PartialResultSet instance + */ + public static create(properties?: google.bigtable.v2.IPartialResultSet): google.bigtable.v2.PartialResultSet; + + /** + * Encodes the specified PartialResultSet message. Does not implicitly {@link google.bigtable.v2.PartialResultSet.verify|verify} messages. + * @param message PartialResultSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IPartialResultSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartialResultSet message, length delimited. Does not implicitly {@link google.bigtable.v2.PartialResultSet.verify|verify} messages. + * @param message PartialResultSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IPartialResultSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.PartialResultSet; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.PartialResultSet; + + /** + * Verifies a PartialResultSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartialResultSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartialResultSet + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.PartialResultSet; + + /** + * Creates a plain object from a PartialResultSet message. Also converts values to other types if specified. + * @param message PartialResultSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.PartialResultSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartialResultSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartialResultSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Idempotency. */ + interface IIdempotency { + + /** Idempotency token */ + token?: (Uint8Array|Buffer|string|null); + + /** Idempotency startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Idempotency. */ + class Idempotency implements IIdempotency { + + /** + * Constructs a new Idempotency. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IIdempotency); + + /** Idempotency token. */ + public token: (Uint8Array|Buffer|string); + + /** Idempotency startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Idempotency instance using the specified properties. + * @param [properties] Properties to set + * @returns Idempotency instance + */ + public static create(properties?: google.bigtable.v2.IIdempotency): google.bigtable.v2.Idempotency; + + /** + * Encodes the specified Idempotency message. Does not implicitly {@link google.bigtable.v2.Idempotency.verify|verify} messages. + * @param message Idempotency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IIdempotency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Idempotency message, length delimited. Does not implicitly {@link google.bigtable.v2.Idempotency.verify|verify} messages. + * @param message Idempotency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IIdempotency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Idempotency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Idempotency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Idempotency; + + /** + * Decodes an Idempotency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Idempotency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Idempotency; + + /** + * Verifies an Idempotency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Idempotency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Idempotency + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Idempotency; + + /** + * Creates a plain object from an Idempotency message. Also converts values to other types if specified. + * @param message Idempotency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Idempotency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Idempotency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Idempotency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Type. */ + interface IType { + + /** Type bytesType */ + bytesType?: (google.bigtable.v2.Type.IBytes|null); + + /** Type stringType */ + stringType?: (google.bigtable.v2.Type.IString|null); + + /** Type int64Type */ + int64Type?: (google.bigtable.v2.Type.IInt64|null); + + /** Type float32Type */ + float32Type?: (google.bigtable.v2.Type.IFloat32|null); + + /** Type float64Type */ + float64Type?: (google.bigtable.v2.Type.IFloat64|null); + + /** Type boolType */ + boolType?: (google.bigtable.v2.Type.IBool|null); + + /** Type timestampType */ + timestampType?: (google.bigtable.v2.Type.ITimestamp|null); + + /** Type dateType */ + dateType?: (google.bigtable.v2.Type.IDate|null); + + /** Type aggregateType */ + aggregateType?: (google.bigtable.v2.Type.IAggregate|null); + + /** Type structType */ + structType?: (google.bigtable.v2.Type.IStruct|null); + + /** Type arrayType */ + arrayType?: (google.bigtable.v2.Type.IArray|null); + + /** Type mapType */ + mapType?: (google.bigtable.v2.Type.IMap|null); + + /** Type protoType */ + protoType?: (google.bigtable.v2.Type.IProto|null); + + /** Type enumType */ + enumType?: (google.bigtable.v2.Type.IEnum|null); + } + + /** Represents a Type. */ + class Type implements IType { + + /** + * Constructs a new Type. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IType); + + /** Type bytesType. */ + public bytesType?: (google.bigtable.v2.Type.IBytes|null); + + /** Type stringType. */ + public stringType?: (google.bigtable.v2.Type.IString|null); + + /** Type int64Type. */ + public int64Type?: (google.bigtable.v2.Type.IInt64|null); + + /** Type float32Type. */ + public float32Type?: (google.bigtable.v2.Type.IFloat32|null); + + /** Type float64Type. */ + public float64Type?: (google.bigtable.v2.Type.IFloat64|null); + + /** Type boolType. */ + public boolType?: (google.bigtable.v2.Type.IBool|null); + + /** Type timestampType. */ + public timestampType?: (google.bigtable.v2.Type.ITimestamp|null); + + /** Type dateType. */ + public dateType?: (google.bigtable.v2.Type.IDate|null); + + /** Type aggregateType. */ + public aggregateType?: (google.bigtable.v2.Type.IAggregate|null); + + /** Type structType. */ + public structType?: (google.bigtable.v2.Type.IStruct|null); + + /** Type arrayType. */ + public arrayType?: (google.bigtable.v2.Type.IArray|null); + + /** Type mapType. */ + public mapType?: (google.bigtable.v2.Type.IMap|null); + + /** Type protoType. */ + public protoType?: (google.bigtable.v2.Type.IProto|null); + + /** Type enumType. */ + public enumType?: (google.bigtable.v2.Type.IEnum|null); + + /** Type kind. */ + public kind?: ("bytesType"|"stringType"|"int64Type"|"float32Type"|"float64Type"|"boolType"|"timestampType"|"dateType"|"aggregateType"|"structType"|"arrayType"|"mapType"|"protoType"|"enumType"); + + /** + * Creates a new Type instance using the specified properties. + * @param [properties] Properties to set + * @returns Type instance + */ + public static create(properties?: google.bigtable.v2.IType): google.bigtable.v2.Type; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.bigtable.v2.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Type message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type; + + /** + * Verifies a Type message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Type + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @param message Type + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Type to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Type + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Type { + + /** Properties of a Bytes. */ + interface IBytes { + + /** Bytes encoding */ + encoding?: (google.bigtable.v2.Type.Bytes.IEncoding|null); + } + + /** Represents a Bytes. */ + class Bytes implements IBytes { + + /** + * Constructs a new Bytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IBytes); + + /** Bytes encoding. */ + public encoding?: (google.bigtable.v2.Type.Bytes.IEncoding|null); + + /** + * Creates a new Bytes instance using the specified properties. + * @param [properties] Properties to set + * @returns Bytes instance + */ + public static create(properties?: google.bigtable.v2.Type.IBytes): google.bigtable.v2.Type.Bytes; + + /** + * Encodes the specified Bytes message. Does not implicitly {@link google.bigtable.v2.Type.Bytes.verify|verify} messages. + * @param message Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Bytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bytes.verify|verify} messages. + * @param message Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Bytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Bytes; + + /** + * Decodes a Bytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Bytes; + + /** + * Verifies a Bytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Bytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Bytes; + + /** + * Creates a plain object from a Bytes message. Also converts values to other types if specified. + * @param message Bytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Bytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Bytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Bytes { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding raw */ + raw?: (google.bigtable.v2.Type.Bytes.Encoding.IRaw|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Bytes.IEncoding); + + /** Encoding raw. */ + public raw?: (google.bigtable.v2.Type.Bytes.Encoding.IRaw|null); + + /** Encoding encoding. */ + public encoding?: "raw"; + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.v2.Type.Bytes.IEncoding): google.bigtable.v2.Type.Bytes.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Bytes.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Bytes.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Bytes.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Bytes.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Bytes.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Bytes.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of a Raw. */ + interface IRaw { + + /** Raw escapeNulls */ + escapeNulls?: (boolean|null); + } + + /** Represents a Raw. */ + class Raw implements IRaw { + + /** + * Constructs a new Raw. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Bytes.Encoding.IRaw); + + /** Raw escapeNulls. */ + public escapeNulls: boolean; + + /** + * Creates a new Raw instance using the specified properties. + * @param [properties] Properties to set + * @returns Raw instance + */ + public static create(properties?: google.bigtable.v2.Type.Bytes.Encoding.IRaw): google.bigtable.v2.Type.Bytes.Encoding.Raw; + + /** + * Encodes the specified Raw message. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @param message Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Bytes.Encoding.IRaw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Raw message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @param message Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Bytes.Encoding.IRaw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Raw message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Bytes.Encoding.Raw; + + /** + * Decodes a Raw message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Bytes.Encoding.Raw; + + /** + * Verifies a Raw message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Raw message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Raw + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Bytes.Encoding.Raw; + + /** + * Creates a plain object from a Raw message. Also converts values to other types if specified. + * @param message Raw + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Bytes.Encoding.Raw, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Raw to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Raw + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a String. */ + interface IString { + + /** String encoding */ + encoding?: (google.bigtable.v2.Type.String.IEncoding|null); + } + + /** Represents a String. */ + class String implements IString { + + /** + * Constructs a new String. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IString); + + /** String encoding. */ + public encoding?: (google.bigtable.v2.Type.String.IEncoding|null); + + /** + * Creates a new String instance using the specified properties. + * @param [properties] Properties to set + * @returns String instance + */ + public static create(properties?: google.bigtable.v2.Type.IString): google.bigtable.v2.Type.String; + + /** + * Encodes the specified String message. Does not implicitly {@link google.bigtable.v2.Type.String.verify|verify} messages. + * @param message String message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IString, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified String message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.verify|verify} messages. + * @param message String message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IString, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a String message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.String; + + /** + * Decodes a String message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.String; + + /** + * Verifies a String message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a String message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns String + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.String; + + /** + * Creates a plain object from a String message. Also converts values to other types if specified. + * @param message String + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.String, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this String to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for String + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace String { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding utf8Raw */ + utf8Raw?: (google.bigtable.v2.Type.String.Encoding.IUtf8Raw|null); + + /** Encoding utf8Bytes */ + utf8Bytes?: (google.bigtable.v2.Type.String.Encoding.IUtf8Bytes|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.String.IEncoding); + + /** Encoding utf8Raw. */ + public utf8Raw?: (google.bigtable.v2.Type.String.Encoding.IUtf8Raw|null); + + /** Encoding utf8Bytes. */ + public utf8Bytes?: (google.bigtable.v2.Type.String.Encoding.IUtf8Bytes|null); + + /** Encoding encoding. */ + public encoding?: ("utf8Raw"|"utf8Bytes"); + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.v2.Type.String.IEncoding): google.bigtable.v2.Type.String.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.String.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.String.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.String.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.String.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.String.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.String.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of an Utf8Raw. */ + interface IUtf8Raw { + } + + /** Represents an Utf8Raw. */ + class Utf8Raw implements IUtf8Raw { + + /** + * Constructs a new Utf8Raw. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.String.Encoding.IUtf8Raw); + + /** + * Creates a new Utf8Raw instance using the specified properties. + * @param [properties] Properties to set + * @returns Utf8Raw instance + */ + public static create(properties?: google.bigtable.v2.Type.String.Encoding.IUtf8Raw): google.bigtable.v2.Type.String.Encoding.Utf8Raw; + + /** + * Encodes the specified Utf8Raw message. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @param message Utf8Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.String.Encoding.IUtf8Raw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Utf8Raw message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @param message Utf8Raw message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.String.Encoding.IUtf8Raw, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.String.Encoding.Utf8Raw; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.String.Encoding.Utf8Raw; + + /** + * Verifies an Utf8Raw message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Utf8Raw message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Utf8Raw + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.String.Encoding.Utf8Raw; + + /** + * Creates a plain object from an Utf8Raw message. Also converts values to other types if specified. + * @param message Utf8Raw + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.String.Encoding.Utf8Raw, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Utf8Raw to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Utf8Raw + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Utf8Bytes. */ + interface IUtf8Bytes { + + /** Utf8Bytes nullEscapeChar */ + nullEscapeChar?: (string|null); + } + + /** Represents an Utf8Bytes. */ + class Utf8Bytes implements IUtf8Bytes { + + /** + * Constructs a new Utf8Bytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.String.Encoding.IUtf8Bytes); + + /** Utf8Bytes nullEscapeChar. */ + public nullEscapeChar: string; + + /** + * Creates a new Utf8Bytes instance using the specified properties. + * @param [properties] Properties to set + * @returns Utf8Bytes instance + */ + public static create(properties?: google.bigtable.v2.Type.String.Encoding.IUtf8Bytes): google.bigtable.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Encodes the specified Utf8Bytes message. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @param message Utf8Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.String.Encoding.IUtf8Bytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Utf8Bytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @param message Utf8Bytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.String.Encoding.IUtf8Bytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Verifies an Utf8Bytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Utf8Bytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Utf8Bytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.String.Encoding.Utf8Bytes; + + /** + * Creates a plain object from an Utf8Bytes message. Also converts values to other types if specified. + * @param message Utf8Bytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.String.Encoding.Utf8Bytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Utf8Bytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Utf8Bytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an Int64. */ + interface IInt64 { + + /** Int64 encoding */ + encoding?: (google.bigtable.v2.Type.Int64.IEncoding|null); + } + + /** Represents an Int64. */ + class Int64 implements IInt64 { + + /** + * Constructs a new Int64. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IInt64); + + /** Int64 encoding. */ + public encoding?: (google.bigtable.v2.Type.Int64.IEncoding|null); + + /** + * Creates a new Int64 instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64 instance + */ + public static create(properties?: google.bigtable.v2.Type.IInt64): google.bigtable.v2.Type.Int64; + + /** + * Encodes the specified Int64 message. Does not implicitly {@link google.bigtable.v2.Type.Int64.verify|verify} messages. + * @param message Int64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IInt64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64 message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.verify|verify} messages. + * @param message Int64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IInt64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Int64; + + /** + * Decodes an Int64 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Int64; + + /** + * Verifies an Int64 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64 + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Int64; + + /** + * Creates a plain object from an Int64 message. Also converts values to other types if specified. + * @param message Int64 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Int64, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Int64 { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding bigEndianBytes */ + bigEndianBytes?: (google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes|null); + + /** Encoding orderedCodeBytes */ + orderedCodeBytes?: (google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Int64.IEncoding); + + /** Encoding bigEndianBytes. */ + public bigEndianBytes?: (google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes|null); + + /** Encoding orderedCodeBytes. */ + public orderedCodeBytes?: (google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes|null); + + /** Encoding encoding. */ + public encoding?: ("bigEndianBytes"|"orderedCodeBytes"); + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.v2.Type.Int64.IEncoding): google.bigtable.v2.Type.Int64.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Int64.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Int64.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Int64.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Int64.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Int64.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Int64.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of a BigEndianBytes. */ + interface IBigEndianBytes { + + /** BigEndianBytes bytesType */ + bytesType?: (google.bigtable.v2.Type.IBytes|null); + } + + /** Represents a BigEndianBytes. */ + class BigEndianBytes implements IBigEndianBytes { + + /** + * Constructs a new BigEndianBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes); + + /** BigEndianBytes bytesType. */ + public bytesType?: (google.bigtable.v2.Type.IBytes|null); + + /** + * Creates a new BigEndianBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns BigEndianBytes instance + */ + public static create(properties?: google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes): google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Encodes the specified BigEndianBytes message. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @param message BigEndianBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigEndianBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @param message BigEndianBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Verifies a BigEndianBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigEndianBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigEndianBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes; + + /** + * Creates a plain object from a BigEndianBytes message. Also converts values to other types if specified. + * @param message BigEndianBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigEndianBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigEndianBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrderedCodeBytes. */ + interface IOrderedCodeBytes { + } + + /** Represents an OrderedCodeBytes. */ + class OrderedCodeBytes implements IOrderedCodeBytes { + + /** + * Constructs a new OrderedCodeBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes); + + /** + * Creates a new OrderedCodeBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns OrderedCodeBytes instance + */ + public static create(properties?: google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes): google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Verifies an OrderedCodeBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrderedCodeBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @param message OrderedCodeBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrderedCodeBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Bool. */ + interface IBool { + } + + /** Represents a Bool. */ + class Bool implements IBool { + + /** + * Constructs a new Bool. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IBool); + + /** + * Creates a new Bool instance using the specified properties. + * @param [properties] Properties to set + * @returns Bool instance + */ + public static create(properties?: google.bigtable.v2.Type.IBool): google.bigtable.v2.Type.Bool; + + /** + * Encodes the specified Bool message. Does not implicitly {@link google.bigtable.v2.Type.Bool.verify|verify} messages. + * @param message Bool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IBool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Bool message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bool.verify|verify} messages. + * @param message Bool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IBool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Bool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Bool; + + /** + * Decodes a Bool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Bool; + + /** + * Verifies a Bool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Bool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bool + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Bool; + + /** + * Creates a plain object from a Bool message. Also converts values to other types if specified. + * @param message Bool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Bool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Bool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Float32. */ + interface IFloat32 { + } + + /** Represents a Float32. */ + class Float32 implements IFloat32 { + + /** + * Constructs a new Float32. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IFloat32); + + /** + * Creates a new Float32 instance using the specified properties. + * @param [properties] Properties to set + * @returns Float32 instance + */ + public static create(properties?: google.bigtable.v2.Type.IFloat32): google.bigtable.v2.Type.Float32; + + /** + * Encodes the specified Float32 message. Does not implicitly {@link google.bigtable.v2.Type.Float32.verify|verify} messages. + * @param message Float32 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IFloat32, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Float32 message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Float32.verify|verify} messages. + * @param message Float32 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IFloat32, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Float32 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Float32; + + /** + * Decodes a Float32 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Float32; + + /** + * Verifies a Float32 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Float32 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Float32 + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Float32; + + /** + * Creates a plain object from a Float32 message. Also converts values to other types if specified. + * @param message Float32 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Float32, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Float32 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Float32 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Float64. */ + interface IFloat64 { + } + + /** Represents a Float64. */ + class Float64 implements IFloat64 { + + /** + * Constructs a new Float64. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IFloat64); + + /** + * Creates a new Float64 instance using the specified properties. + * @param [properties] Properties to set + * @returns Float64 instance + */ + public static create(properties?: google.bigtable.v2.Type.IFloat64): google.bigtable.v2.Type.Float64; + + /** + * Encodes the specified Float64 message. Does not implicitly {@link google.bigtable.v2.Type.Float64.verify|verify} messages. + * @param message Float64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IFloat64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Float64 message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Float64.verify|verify} messages. + * @param message Float64 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IFloat64, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Float64 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Float64; + + /** + * Decodes a Float64 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Float64; + + /** + * Verifies a Float64 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Float64 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Float64 + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Float64; + + /** + * Creates a plain object from a Float64 message. Also converts values to other types if specified. + * @param message Float64 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Float64, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Float64 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Float64 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp encoding */ + encoding?: (google.bigtable.v2.Type.Timestamp.IEncoding|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.ITimestamp); + + /** Timestamp encoding. */ + public encoding?: (google.bigtable.v2.Type.Timestamp.IEncoding|null); + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.bigtable.v2.Type.ITimestamp): google.bigtable.v2.Type.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.bigtable.v2.Type.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.bigtable.v2.Type.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.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.bigtable.v2.Type.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.bigtable.v2.Type.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.bigtable.v2.Type.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.bigtable.v2.Type.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.bigtable.v2.Type.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Timestamp { + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding unixMicrosInt64 */ + unixMicrosInt64?: (google.bigtable.v2.Type.Int64.IEncoding|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Timestamp.IEncoding); + + /** Encoding unixMicrosInt64. */ + public unixMicrosInt64?: (google.bigtable.v2.Type.Int64.IEncoding|null); + + /** Encoding encoding. */ + public encoding?: "unixMicrosInt64"; + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.v2.Type.Timestamp.IEncoding): google.bigtable.v2.Type.Timestamp.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Timestamp.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Timestamp.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Timestamp.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Timestamp.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Timestamp.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Timestamp.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Date. */ + interface IDate { + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IDate); + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.bigtable.v2.Type.IDate): google.bigtable.v2.Type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.bigtable.v2.Type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: (google.bigtable.v2.Type.Struct.IField[]|null); + + /** Struct encoding */ + encoding?: (google.bigtable.v2.Type.Struct.IEncoding|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IStruct); + + /** Struct fields. */ + public fields: google.bigtable.v2.Type.Struct.IField[]; + + /** Struct encoding. */ + public encoding?: (google.bigtable.v2.Type.Struct.IEncoding|null); + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.bigtable.v2.Type.IStruct): google.bigtable.v2.Type.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.bigtable.v2.Type.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Struct { + + /** Properties of a Field. */ + interface IField { + + /** Field fieldName */ + fieldName?: (string|null); + + /** Field type */ + type?: (google.bigtable.v2.IType|null); + } + + /** Represents a Field. */ + class Field implements IField { + + /** + * Constructs a new Field. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Struct.IField); + + /** Field fieldName. */ + public fieldName: string; + + /** Field type. */ + public type?: (google.bigtable.v2.IType|null); + + /** + * Creates a new Field instance using the specified properties. + * @param [properties] Properties to set + * @returns Field instance + */ + public static create(properties?: google.bigtable.v2.Type.Struct.IField): google.bigtable.v2.Type.Struct.Field; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Struct.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Struct.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Field message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Struct.Field; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Struct.Field; + + /** + * Verifies a Field message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Field + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Struct.Field; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @param message Field + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Struct.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Field to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Field + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Encoding. */ + interface IEncoding { + + /** Encoding singleton */ + singleton?: (google.bigtable.v2.Type.Struct.Encoding.ISingleton|null); + + /** Encoding delimitedBytes */ + delimitedBytes?: (google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes|null); + + /** Encoding orderedCodeBytes */ + orderedCodeBytes?: (google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes|null); + } + + /** Represents an Encoding. */ + class Encoding implements IEncoding { + + /** + * Constructs a new Encoding. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Struct.IEncoding); + + /** Encoding singleton. */ + public singleton?: (google.bigtable.v2.Type.Struct.Encoding.ISingleton|null); + + /** Encoding delimitedBytes. */ + public delimitedBytes?: (google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes|null); + + /** Encoding orderedCodeBytes. */ + public orderedCodeBytes?: (google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes|null); + + /** Encoding encoding. */ + public encoding?: ("singleton"|"delimitedBytes"|"orderedCodeBytes"); + + /** + * Creates a new Encoding instance using the specified properties. + * @param [properties] Properties to set + * @returns Encoding instance + */ + public static create(properties?: google.bigtable.v2.Type.Struct.IEncoding): google.bigtable.v2.Type.Struct.Encoding; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Struct.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.verify|verify} messages. + * @param message Encoding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Struct.IEncoding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Struct.Encoding; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Struct.Encoding; + + /** + * Verifies an Encoding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encoding + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Struct.Encoding; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @param message Encoding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Struct.Encoding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encoding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encoding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encoding { + + /** Properties of a Singleton. */ + interface ISingleton { + } + + /** Represents a Singleton. */ + class Singleton implements ISingleton { + + /** + * Constructs a new Singleton. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Struct.Encoding.ISingleton); + + /** + * Creates a new Singleton instance using the specified properties. + * @param [properties] Properties to set + * @returns Singleton instance + */ + public static create(properties?: google.bigtable.v2.Type.Struct.Encoding.ISingleton): google.bigtable.v2.Type.Struct.Encoding.Singleton; + + /** + * Encodes the specified Singleton message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @param message Singleton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Struct.Encoding.ISingleton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Singleton message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @param message Singleton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Struct.Encoding.ISingleton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Singleton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Struct.Encoding.Singleton; + + /** + * Decodes a Singleton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Struct.Encoding.Singleton; + + /** + * Verifies a Singleton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Singleton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Singleton + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Struct.Encoding.Singleton; + + /** + * Creates a plain object from a Singleton message. Also converts values to other types if specified. + * @param message Singleton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Struct.Encoding.Singleton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Singleton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Singleton + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DelimitedBytes. */ + interface IDelimitedBytes { + + /** DelimitedBytes delimiter */ + delimiter?: (Uint8Array|Buffer|string|null); + } + + /** Represents a DelimitedBytes. */ + class DelimitedBytes implements IDelimitedBytes { + + /** + * Constructs a new DelimitedBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes); + + /** DelimitedBytes delimiter. */ + public delimiter: (Uint8Array|Buffer|string); + + /** + * Creates a new DelimitedBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns DelimitedBytes instance + */ + public static create(properties?: google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes): google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Encodes the specified DelimitedBytes message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @param message DelimitedBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DelimitedBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @param message DelimitedBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Verifies a DelimitedBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DelimitedBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DelimitedBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes; + + /** + * Creates a plain object from a DelimitedBytes message. Also converts values to other types if specified. + * @param message DelimitedBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DelimitedBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DelimitedBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrderedCodeBytes. */ + interface IOrderedCodeBytes { + } + + /** Represents an OrderedCodeBytes. */ + class OrderedCodeBytes implements IOrderedCodeBytes { + + /** + * Constructs a new OrderedCodeBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes); + + /** + * Creates a new OrderedCodeBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns OrderedCodeBytes instance + */ + public static create(properties?: google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes): google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @param message OrderedCodeBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Verifies an OrderedCodeBytes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrderedCodeBytes + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @param message OrderedCodeBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrderedCodeBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Proto. */ + interface IProto { + + /** Proto schemaBundleId */ + schemaBundleId?: (string|null); + + /** Proto messageName */ + messageName?: (string|null); + } + + /** Represents a Proto. */ + class Proto implements IProto { + + /** + * Constructs a new Proto. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IProto); + + /** Proto schemaBundleId. */ + public schemaBundleId: string; + + /** Proto messageName. */ + public messageName: string; + + /** + * Creates a new Proto instance using the specified properties. + * @param [properties] Properties to set + * @returns Proto instance + */ + public static create(properties?: google.bigtable.v2.Type.IProto): google.bigtable.v2.Type.Proto; + + /** + * Encodes the specified Proto message. Does not implicitly {@link google.bigtable.v2.Type.Proto.verify|verify} messages. + * @param message Proto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Proto message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Proto.verify|verify} messages. + * @param message Proto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Proto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Proto; + + /** + * Decodes a Proto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Proto; + + /** + * Verifies a Proto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Proto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Proto + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Proto; + + /** + * Creates a plain object from a Proto message. Also converts values to other types if specified. + * @param message Proto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Proto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Proto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Proto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Enum. */ + interface IEnum { + + /** Enum schemaBundleId */ + schemaBundleId?: (string|null); + + /** Enum enumName */ + enumName?: (string|null); + } + + /** Represents an Enum. */ + class Enum implements IEnum { + + /** + * Constructs a new Enum. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IEnum); + + /** Enum schemaBundleId. */ + public schemaBundleId: string; + + /** Enum enumName. */ + public enumName: string; + + /** + * Creates a new Enum instance using the specified properties. + * @param [properties] Properties to set + * @returns Enum instance + */ + public static create(properties?: google.bigtable.v2.Type.IEnum): google.bigtable.v2.Type.Enum; + + /** + * Encodes the specified Enum message. Does not implicitly {@link google.bigtable.v2.Type.Enum.verify|verify} messages. + * @param message Enum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Enum.verify|verify} messages. + * @param message Enum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Enum message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Enum; + + /** + * Decodes an Enum message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Enum; + + /** + * Verifies an Enum message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Enum message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Enum + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Enum; + + /** + * Creates a plain object from an Enum message. Also converts values to other types if specified. + * @param message Enum + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Enum, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Enum to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Enum + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Array. */ + interface IArray { + + /** Array elementType */ + elementType?: (google.bigtable.v2.IType|null); + } + + /** Represents an Array. */ + class Array implements IArray { + + /** + * Constructs a new Array. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IArray); + + /** Array elementType. */ + public elementType?: (google.bigtable.v2.IType|null); + + /** + * Creates a new Array instance using the specified properties. + * @param [properties] Properties to set + * @returns Array instance + */ + public static create(properties?: google.bigtable.v2.Type.IArray): google.bigtable.v2.Type.Array; + + /** + * Encodes the specified Array message. Does not implicitly {@link google.bigtable.v2.Type.Array.verify|verify} messages. + * @param message Array message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Array message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Array.verify|verify} messages. + * @param message Array message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Array message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Array; + + /** + * Decodes an Array message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Array; + + /** + * Verifies an Array message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Array message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Array + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Array; + + /** + * Creates a plain object from an Array message. Also converts values to other types if specified. + * @param message Array + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Array, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Array to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Array + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Map. */ + interface IMap { + + /** Map keyType */ + keyType?: (google.bigtable.v2.IType|null); + + /** Map valueType */ + valueType?: (google.bigtable.v2.IType|null); + } + + /** Represents a Map. */ + class Map implements IMap { + + /** + * Constructs a new Map. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IMap); + + /** Map keyType. */ + public keyType?: (google.bigtable.v2.IType|null); + + /** Map valueType. */ + public valueType?: (google.bigtable.v2.IType|null); + + /** + * Creates a new Map instance using the specified properties. + * @param [properties] Properties to set + * @returns Map instance + */ + public static create(properties?: google.bigtable.v2.Type.IMap): google.bigtable.v2.Type.Map; + + /** + * Encodes the specified Map message. Does not implicitly {@link google.bigtable.v2.Type.Map.verify|verify} messages. + * @param message Map message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Map message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Map.verify|verify} messages. + * @param message Map message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Map message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Map; + + /** + * Decodes a Map message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Map; + + /** + * Verifies a Map message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Map message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Map + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Map; + + /** + * Creates a plain object from a Map message. Also converts values to other types if specified. + * @param message Map + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Map, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Map to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Map + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Aggregate. */ + interface IAggregate { + + /** Aggregate inputType */ + inputType?: (google.bigtable.v2.IType|null); + + /** Aggregate stateType */ + stateType?: (google.bigtable.v2.IType|null); + + /** Aggregate sum */ + sum?: (google.bigtable.v2.Type.Aggregate.ISum|null); + + /** Aggregate hllppUniqueCount */ + hllppUniqueCount?: (google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null); + + /** Aggregate max */ + max?: (google.bigtable.v2.Type.Aggregate.IMax|null); + + /** Aggregate min */ + min?: (google.bigtable.v2.Type.Aggregate.IMin|null); + } + + /** Represents an Aggregate. */ + class Aggregate implements IAggregate { + + /** + * Constructs a new Aggregate. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.IAggregate); + + /** Aggregate inputType. */ + public inputType?: (google.bigtable.v2.IType|null); + + /** Aggregate stateType. */ + public stateType?: (google.bigtable.v2.IType|null); + + /** Aggregate sum. */ + public sum?: (google.bigtable.v2.Type.Aggregate.ISum|null); + + /** Aggregate hllppUniqueCount. */ + public hllppUniqueCount?: (google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null); + + /** Aggregate max. */ + public max?: (google.bigtable.v2.Type.Aggregate.IMax|null); + + /** Aggregate min. */ + public min?: (google.bigtable.v2.Type.Aggregate.IMin|null); + + /** Aggregate aggregator. */ + public aggregator?: ("sum"|"hllppUniqueCount"|"max"|"min"); + + /** + * Creates a new Aggregate instance using the specified properties. + * @param [properties] Properties to set + * @returns Aggregate instance + */ + public static create(properties?: google.bigtable.v2.Type.IAggregate): google.bigtable.v2.Type.Aggregate; + + /** + * Encodes the specified Aggregate message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.verify|verify} messages. + * @param message Aggregate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.IAggregate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Aggregate message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.verify|verify} messages. + * @param message Aggregate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.IAggregate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Aggregate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Aggregate; + + /** + * Decodes an Aggregate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Aggregate; + + /** + * Verifies an Aggregate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Aggregate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Aggregate + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Aggregate; + + /** + * Creates a plain object from an Aggregate message. Also converts values to other types if specified. + * @param message Aggregate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Aggregate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Aggregate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Aggregate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Aggregate { + + /** Properties of a Sum. */ + interface ISum { + } + + /** Represents a Sum. */ + class Sum implements ISum { + + /** + * Constructs a new Sum. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Aggregate.ISum); + + /** + * Creates a new Sum instance using the specified properties. + * @param [properties] Properties to set + * @returns Sum instance + */ + public static create(properties?: google.bigtable.v2.Type.Aggregate.ISum): google.bigtable.v2.Type.Aggregate.Sum; + + /** + * Encodes the specified Sum message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Sum.verify|verify} messages. + * @param message Sum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Aggregate.ISum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Sum.verify|verify} messages. + * @param message Sum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Aggregate.ISum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sum message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Aggregate.Sum; + + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Aggregate.Sum; + + /** + * Verifies a Sum message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sum + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Aggregate.Sum; + + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @param message Sum + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Aggregate.Sum, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Sum to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Sum + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Max. */ + interface IMax { + } + + /** Represents a Max. */ + class Max implements IMax { + + /** + * Constructs a new Max. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Aggregate.IMax); + + /** + * Creates a new Max instance using the specified properties. + * @param [properties] Properties to set + * @returns Max instance + */ + public static create(properties?: google.bigtable.v2.Type.Aggregate.IMax): google.bigtable.v2.Type.Aggregate.Max; + + /** + * Encodes the specified Max message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Max.verify|verify} messages. + * @param message Max message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Aggregate.IMax, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Max message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Max.verify|verify} messages. + * @param message Max message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Aggregate.IMax, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Max message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Aggregate.Max; + + /** + * Decodes a Max message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Aggregate.Max; + + /** + * Verifies a Max message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Max message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Max + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Aggregate.Max; + + /** + * Creates a plain object from a Max message. Also converts values to other types if specified. + * @param message Max + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Aggregate.Max, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Max to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Max + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Min. */ + interface IMin { + } + + /** Represents a Min. */ + class Min implements IMin { + + /** + * Constructs a new Min. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Aggregate.IMin); + + /** + * Creates a new Min instance using the specified properties. + * @param [properties] Properties to set + * @returns Min instance + */ + public static create(properties?: google.bigtable.v2.Type.Aggregate.IMin): google.bigtable.v2.Type.Aggregate.Min; + + /** + * Encodes the specified Min message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Min.verify|verify} messages. + * @param message Min message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Aggregate.IMin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Min message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Min.verify|verify} messages. + * @param message Min message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Aggregate.IMin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Min message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Aggregate.Min; + + /** + * Decodes a Min message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Aggregate.Min; + + /** + * Verifies a Min message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Min message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Min + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Aggregate.Min; + + /** + * Creates a plain object from a Min message. Also converts values to other types if specified. + * @param message Min + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Aggregate.Min, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Min to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Min + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HyperLogLogPlusPlusUniqueCount. */ + interface IHyperLogLogPlusPlusUniqueCount { + } + + /** Represents a HyperLogLogPlusPlusUniqueCount. */ + class HyperLogLogPlusPlusUniqueCount implements IHyperLogLogPlusPlusUniqueCount { + + /** + * Constructs a new HyperLogLogPlusPlusUniqueCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount); + + /** + * Creates a new HyperLogLogPlusPlusUniqueCount instance using the specified properties. + * @param [properties] Properties to set + * @returns HyperLogLogPlusPlusUniqueCount instance + */ + public static create(properties?: google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount): google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @param message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @param message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Verifies a HyperLogLogPlusPlusUniqueCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HyperLogLogPlusPlusUniqueCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HyperLogLogPlusPlusUniqueCount + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount; + + /** + * Creates a plain object from a HyperLogLogPlusPlusUniqueCount message. Also converts values to other types if specified. + * @param message HyperLogLogPlusPlusUniqueCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HyperLogLogPlusPlusUniqueCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HyperLogLogPlusPlusUniqueCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a ReadIterationStats. */ + interface IReadIterationStats { + + /** ReadIterationStats rowsSeenCount */ + rowsSeenCount?: (number|Long|string|null); + + /** ReadIterationStats rowsReturnedCount */ + rowsReturnedCount?: (number|Long|string|null); + + /** ReadIterationStats cellsSeenCount */ + cellsSeenCount?: (number|Long|string|null); + + /** ReadIterationStats cellsReturnedCount */ + cellsReturnedCount?: (number|Long|string|null); + } + + /** Represents a ReadIterationStats. */ + class ReadIterationStats implements IReadIterationStats { + + /** + * Constructs a new ReadIterationStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadIterationStats); + + /** ReadIterationStats rowsSeenCount. */ + public rowsSeenCount: (number|Long|string); + + /** ReadIterationStats rowsReturnedCount. */ + public rowsReturnedCount: (number|Long|string); + + /** ReadIterationStats cellsSeenCount. */ + public cellsSeenCount: (number|Long|string); + + /** ReadIterationStats cellsReturnedCount. */ + public cellsReturnedCount: (number|Long|string); + + /** + * Creates a new ReadIterationStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadIterationStats instance + */ + public static create(properties?: google.bigtable.v2.IReadIterationStats): google.bigtable.v2.ReadIterationStats; + + /** + * Encodes the specified ReadIterationStats message. Does not implicitly {@link google.bigtable.v2.ReadIterationStats.verify|verify} messages. + * @param message ReadIterationStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadIterationStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadIterationStats message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadIterationStats.verify|verify} messages. + * @param message ReadIterationStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadIterationStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadIterationStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadIterationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadIterationStats; + + /** + * Decodes a ReadIterationStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadIterationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadIterationStats; + + /** + * Verifies a ReadIterationStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadIterationStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadIterationStats + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadIterationStats; + + /** + * Creates a plain object from a ReadIterationStats message. Also converts values to other types if specified. + * @param message ReadIterationStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadIterationStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadIterationStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadIterationStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestLatencyStats. */ + interface IRequestLatencyStats { + + /** RequestLatencyStats frontendServerLatency */ + frontendServerLatency?: (google.protobuf.IDuration|null); + } + + /** Represents a RequestLatencyStats. */ + class RequestLatencyStats implements IRequestLatencyStats { + + /** + * Constructs a new RequestLatencyStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRequestLatencyStats); + + /** RequestLatencyStats frontendServerLatency. */ + public frontendServerLatency?: (google.protobuf.IDuration|null); + + /** + * Creates a new RequestLatencyStats instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestLatencyStats instance + */ + public static create(properties?: google.bigtable.v2.IRequestLatencyStats): google.bigtable.v2.RequestLatencyStats; + + /** + * Encodes the specified RequestLatencyStats message. Does not implicitly {@link google.bigtable.v2.RequestLatencyStats.verify|verify} messages. + * @param message RequestLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRequestLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestLatencyStats message, length delimited. Does not implicitly {@link google.bigtable.v2.RequestLatencyStats.verify|verify} messages. + * @param message RequestLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRequestLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestLatencyStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RequestLatencyStats; + + /** + * Decodes a RequestLatencyStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RequestLatencyStats; + + /** + * Verifies a RequestLatencyStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestLatencyStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestLatencyStats + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RequestLatencyStats; + + /** + * Creates a plain object from a RequestLatencyStats message. Also converts values to other types if specified. + * @param message RequestLatencyStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RequestLatencyStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestLatencyStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestLatencyStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FullReadStatsView. */ + interface IFullReadStatsView { + + /** FullReadStatsView readIterationStats */ + readIterationStats?: (google.bigtable.v2.IReadIterationStats|null); + + /** FullReadStatsView requestLatencyStats */ + requestLatencyStats?: (google.bigtable.v2.IRequestLatencyStats|null); + } + + /** Represents a FullReadStatsView. */ + class FullReadStatsView implements IFullReadStatsView { + + /** + * Constructs a new FullReadStatsView. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IFullReadStatsView); + + /** FullReadStatsView readIterationStats. */ + public readIterationStats?: (google.bigtable.v2.IReadIterationStats|null); + + /** FullReadStatsView requestLatencyStats. */ + public requestLatencyStats?: (google.bigtable.v2.IRequestLatencyStats|null); + + /** + * Creates a new FullReadStatsView instance using the specified properties. + * @param [properties] Properties to set + * @returns FullReadStatsView instance + */ + public static create(properties?: google.bigtable.v2.IFullReadStatsView): google.bigtable.v2.FullReadStatsView; + + /** + * Encodes the specified FullReadStatsView message. Does not implicitly {@link google.bigtable.v2.FullReadStatsView.verify|verify} messages. + * @param message FullReadStatsView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IFullReadStatsView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FullReadStatsView message, length delimited. Does not implicitly {@link google.bigtable.v2.FullReadStatsView.verify|verify} messages. + * @param message FullReadStatsView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IFullReadStatsView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FullReadStatsView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FullReadStatsView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.FullReadStatsView; + + /** + * Decodes a FullReadStatsView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FullReadStatsView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.FullReadStatsView; + + /** + * Verifies a FullReadStatsView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FullReadStatsView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FullReadStatsView + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.FullReadStatsView; + + /** + * Creates a plain object from a FullReadStatsView message. Also converts values to other types if specified. + * @param message FullReadStatsView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.FullReadStatsView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FullReadStatsView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FullReadStatsView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestStats. */ + interface IRequestStats { + + /** RequestStats fullReadStatsView */ + fullReadStatsView?: (google.bigtable.v2.IFullReadStatsView|null); + } + + /** Represents a RequestStats. */ + class RequestStats implements IRequestStats { + + /** + * Constructs a new RequestStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRequestStats); + + /** RequestStats fullReadStatsView. */ + public fullReadStatsView?: (google.bigtable.v2.IFullReadStatsView|null); + + /** RequestStats statsView. */ + public statsView?: "fullReadStatsView"; + + /** + * Creates a new RequestStats instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestStats instance + */ + public static create(properties?: google.bigtable.v2.IRequestStats): google.bigtable.v2.RequestStats; + + /** + * Encodes the specified RequestStats message. Does not implicitly {@link google.bigtable.v2.RequestStats.verify|verify} messages. + * @param message RequestStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRequestStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestStats message, length delimited. Does not implicitly {@link google.bigtable.v2.RequestStats.verify|verify} messages. + * @param message RequestStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRequestStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RequestStats; + + /** + * Decodes a RequestStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RequestStats; + + /** + * Verifies a RequestStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestStats + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RequestStats; + + /** + * Creates a plain object from a RequestStats message. Also converts values to other types if specified. + * @param message RequestStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RequestStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeatureFlags. */ + interface IFeatureFlags { + + /** FeatureFlags reverseScans */ + reverseScans?: (boolean|null); + + /** FeatureFlags mutateRowsRateLimit */ + mutateRowsRateLimit?: (boolean|null); + + /** FeatureFlags mutateRowsRateLimit2 */ + mutateRowsRateLimit2?: (boolean|null); + + /** FeatureFlags lastScannedRowResponses */ + lastScannedRowResponses?: (boolean|null); + + /** FeatureFlags routingCookie */ + routingCookie?: (boolean|null); + + /** FeatureFlags retryInfo */ + retryInfo?: (boolean|null); + + /** FeatureFlags clientSideMetricsEnabled */ + clientSideMetricsEnabled?: (boolean|null); + + /** FeatureFlags trafficDirectorEnabled */ + trafficDirectorEnabled?: (boolean|null); + + /** FeatureFlags directAccessRequested */ + directAccessRequested?: (boolean|null); + + /** FeatureFlags peerInfo */ + peerInfo?: (boolean|null); + } + + /** Represents a FeatureFlags. */ + class FeatureFlags implements IFeatureFlags { + + /** + * Constructs a new FeatureFlags. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IFeatureFlags); + + /** FeatureFlags reverseScans. */ + public reverseScans: boolean; + + /** FeatureFlags mutateRowsRateLimit. */ + public mutateRowsRateLimit: boolean; + + /** FeatureFlags mutateRowsRateLimit2. */ + public mutateRowsRateLimit2: boolean; + + /** FeatureFlags lastScannedRowResponses. */ + public lastScannedRowResponses: boolean; + + /** FeatureFlags routingCookie. */ + public routingCookie: boolean; + + /** FeatureFlags retryInfo. */ + public retryInfo: boolean; + + /** FeatureFlags clientSideMetricsEnabled. */ + public clientSideMetricsEnabled: boolean; + + /** FeatureFlags trafficDirectorEnabled. */ + public trafficDirectorEnabled: boolean; + + /** FeatureFlags directAccessRequested. */ + public directAccessRequested: boolean; + + /** FeatureFlags peerInfo. */ + public peerInfo: boolean; + + /** + * Creates a new FeatureFlags instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureFlags instance + */ + public static create(properties?: google.bigtable.v2.IFeatureFlags): google.bigtable.v2.FeatureFlags; + + /** + * Encodes the specified FeatureFlags message. Does not implicitly {@link google.bigtable.v2.FeatureFlags.verify|verify} messages. + * @param message FeatureFlags message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IFeatureFlags, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureFlags message, length delimited. Does not implicitly {@link google.bigtable.v2.FeatureFlags.verify|verify} messages. + * @param message FeatureFlags message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IFeatureFlags, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureFlags message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.FeatureFlags; + + /** + * Decodes a FeatureFlags message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.FeatureFlags; + + /** + * Verifies a FeatureFlags message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureFlags message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureFlags + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.FeatureFlags; + + /** + * Creates a plain object from a FeatureFlags message. Also converts values to other types if specified. + * @param message FeatureFlags + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.FeatureFlags, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureFlags to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureFlags + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PeerInfo. */ + interface IPeerInfo { + + /** PeerInfo googleFrontendId */ + googleFrontendId?: (number|Long|string|null); + + /** PeerInfo applicationFrontendId */ + applicationFrontendId?: (number|Long|string|null); + + /** PeerInfo applicationFrontendZone */ + applicationFrontendZone?: (string|null); + + /** PeerInfo applicationFrontendSubzone */ + applicationFrontendSubzone?: (string|null); + + /** PeerInfo transportType */ + transportType?: (google.bigtable.v2.PeerInfo.TransportType|keyof typeof google.bigtable.v2.PeerInfo.TransportType|null); + } + + /** Represents a PeerInfo. */ + class PeerInfo implements IPeerInfo { + + /** + * Constructs a new PeerInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IPeerInfo); + + /** PeerInfo googleFrontendId. */ + public googleFrontendId: (number|Long|string); + + /** PeerInfo applicationFrontendId. */ + public applicationFrontendId: (number|Long|string); + + /** PeerInfo applicationFrontendZone. */ + public applicationFrontendZone: string; + + /** PeerInfo applicationFrontendSubzone. */ + public applicationFrontendSubzone: string; + + /** PeerInfo transportType. */ + public transportType: (google.bigtable.v2.PeerInfo.TransportType|keyof typeof google.bigtable.v2.PeerInfo.TransportType); + + /** + * Creates a new PeerInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PeerInfo instance + */ + public static create(properties?: google.bigtable.v2.IPeerInfo): google.bigtable.v2.PeerInfo; + + /** + * Encodes the specified PeerInfo message. Does not implicitly {@link google.bigtable.v2.PeerInfo.verify|verify} messages. + * @param message PeerInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IPeerInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PeerInfo message, length delimited. Does not implicitly {@link google.bigtable.v2.PeerInfo.verify|verify} messages. + * @param message PeerInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IPeerInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PeerInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PeerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.PeerInfo; + + /** + * Decodes a PeerInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PeerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.PeerInfo; + + /** + * Verifies a PeerInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PeerInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PeerInfo + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.PeerInfo; + + /** + * Creates a plain object from a PeerInfo message. Also converts values to other types if specified. + * @param message PeerInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.PeerInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PeerInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PeerInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PeerInfo { + + /** TransportType enum. */ + enum TransportType { + TRANSPORT_TYPE_UNKNOWN = 0, + TRANSPORT_TYPE_EXTERNAL = 1, + TRANSPORT_TYPE_CLOUD_PATH = 2, + TRANSPORT_TYPE_DIRECT_ACCESS = 3, + TRANSPORT_TYPE_SESSION_UNKNOWN = 4, + TRANSPORT_TYPE_SESSION_EXTERNAL = 5, + TRANSPORT_TYPE_SESSION_CLOUD_PATH = 6, + TRANSPORT_TYPE_SESSION_DIRECT_ACCESS = 7 + } + } + + /** Properties of a ResponseParams. */ + interface IResponseParams { + + /** ResponseParams zoneId */ + zoneId?: (string|null); + + /** ResponseParams clusterId */ + clusterId?: (string|null); + + /** ResponseParams afeId */ + afeId?: (number|Long|string|null); + } + + /** Represents a ResponseParams. */ + class ResponseParams implements IResponseParams { + + /** + * Constructs a new ResponseParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IResponseParams); + + /** ResponseParams zoneId. */ + public zoneId?: (string|null); + + /** ResponseParams clusterId. */ + public clusterId?: (string|null); + + /** ResponseParams afeId. */ + public afeId?: (number|Long|string|null); + + /** + * Creates a new ResponseParams instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponseParams instance + */ + public static create(properties?: google.bigtable.v2.IResponseParams): google.bigtable.v2.ResponseParams; + + /** + * Encodes the specified ResponseParams message. Does not implicitly {@link google.bigtable.v2.ResponseParams.verify|verify} messages. + * @param message ResponseParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IResponseParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResponseParams message, length delimited. Does not implicitly {@link google.bigtable.v2.ResponseParams.verify|verify} messages. + * @param message ResponseParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IResponseParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResponseParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponseParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ResponseParams; + + /** + * Decodes a ResponseParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponseParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ResponseParams; + + /** + * Verifies a ResponseParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResponseParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResponseParams + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ResponseParams; + + /** + * Creates a plain object from a ResponseParams message. Also converts values to other types if specified. + * @param message ResponseParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ResponseParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResponseParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResponseParams + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace testproxy. */ + namespace testproxy { + + /** OptionalFeatureConfig enum. */ + enum OptionalFeatureConfig { + OPTIONAL_FEATURE_CONFIG_DEFAULT = 0, + OPTIONAL_FEATURE_CONFIG_ENABLE_ALL = 1 + } + + /** Properties of a CreateClientRequest. */ + interface ICreateClientRequest { + + /** CreateClientRequest clientId */ + clientId?: (string|null); + + /** CreateClientRequest dataTarget */ + dataTarget?: (string|null); + + /** CreateClientRequest projectId */ + projectId?: (string|null); + + /** CreateClientRequest instanceId */ + instanceId?: (string|null); + + /** CreateClientRequest appProfileId */ + appProfileId?: (string|null); + + /** CreateClientRequest perOperationTimeout */ + perOperationTimeout?: (google.protobuf.IDuration|null); + + /** CreateClientRequest optionalFeatureConfig */ + optionalFeatureConfig?: (google.bigtable.testproxy.OptionalFeatureConfig|keyof typeof google.bigtable.testproxy.OptionalFeatureConfig|null); + + /** CreateClientRequest securityOptions */ + securityOptions?: (google.bigtable.testproxy.CreateClientRequest.ISecurityOptions|null); + } + + /** Represents a CreateClientRequest. */ + class CreateClientRequest implements ICreateClientRequest { + + /** + * Constructs a new CreateClientRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.ICreateClientRequest); + + /** CreateClientRequest clientId. */ + public clientId: string; + + /** CreateClientRequest dataTarget. */ + public dataTarget: string; + + /** CreateClientRequest projectId. */ + public projectId: string; + + /** CreateClientRequest instanceId. */ + public instanceId: string; + + /** CreateClientRequest appProfileId. */ + public appProfileId: string; + + /** CreateClientRequest perOperationTimeout. */ + public perOperationTimeout?: (google.protobuf.IDuration|null); + + /** CreateClientRequest optionalFeatureConfig. */ + public optionalFeatureConfig: (google.bigtable.testproxy.OptionalFeatureConfig|keyof typeof google.bigtable.testproxy.OptionalFeatureConfig); + + /** CreateClientRequest securityOptions. */ + public securityOptions?: (google.bigtable.testproxy.CreateClientRequest.ISecurityOptions|null); + + /** + * Creates a new CreateClientRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClientRequest instance + */ + public static create(properties?: google.bigtable.testproxy.ICreateClientRequest): google.bigtable.testproxy.CreateClientRequest; + + /** + * Encodes the specified CreateClientRequest message. Does not implicitly {@link google.bigtable.testproxy.CreateClientRequest.verify|verify} messages. + * @param message CreateClientRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.ICreateClientRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClientRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CreateClientRequest.verify|verify} messages. + * @param message CreateClientRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.ICreateClientRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClientRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClientRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.CreateClientRequest; + + /** + * Decodes a CreateClientRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClientRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.CreateClientRequest; + + /** + * Verifies a CreateClientRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClientRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClientRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.CreateClientRequest; + + /** + * Creates a plain object from a CreateClientRequest message. Also converts values to other types if specified. + * @param message CreateClientRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.CreateClientRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClientRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClientRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CreateClientRequest { + + /** Properties of a SecurityOptions. */ + interface ISecurityOptions { + + /** SecurityOptions accessToken */ + accessToken?: (string|null); + + /** SecurityOptions useSsl */ + useSsl?: (boolean|null); + + /** SecurityOptions sslEndpointOverride */ + sslEndpointOverride?: (string|null); + + /** SecurityOptions sslRootCertsPem */ + sslRootCertsPem?: (string|null); + } + + /** Represents a SecurityOptions. */ + class SecurityOptions implements ISecurityOptions { + + /** + * Constructs a new SecurityOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.CreateClientRequest.ISecurityOptions); + + /** SecurityOptions accessToken. */ + public accessToken: string; + + /** SecurityOptions useSsl. */ + public useSsl: boolean; + + /** SecurityOptions sslEndpointOverride. */ + public sslEndpointOverride: string; + + /** SecurityOptions sslRootCertsPem. */ + public sslRootCertsPem: string; + + /** + * Creates a new SecurityOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityOptions instance + */ + public static create(properties?: google.bigtable.testproxy.CreateClientRequest.ISecurityOptions): google.bigtable.testproxy.CreateClientRequest.SecurityOptions; + + /** + * Encodes the specified SecurityOptions message. Does not implicitly {@link google.bigtable.testproxy.CreateClientRequest.SecurityOptions.verify|verify} messages. + * @param message SecurityOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.CreateClientRequest.ISecurityOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityOptions message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CreateClientRequest.SecurityOptions.verify|verify} messages. + * @param message SecurityOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.CreateClientRequest.ISecurityOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.CreateClientRequest.SecurityOptions; + + /** + * Decodes a SecurityOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.CreateClientRequest.SecurityOptions; + + /** + * Verifies a SecurityOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityOptions + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.CreateClientRequest.SecurityOptions; + + /** + * Creates a plain object from a SecurityOptions message. Also converts values to other types if specified. + * @param message SecurityOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.CreateClientRequest.SecurityOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateClientResponse. */ + interface ICreateClientResponse { + } + + /** Represents a CreateClientResponse. */ + class CreateClientResponse implements ICreateClientResponse { + + /** + * Constructs a new CreateClientResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.ICreateClientResponse); + + /** + * Creates a new CreateClientResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClientResponse instance + */ + public static create(properties?: google.bigtable.testproxy.ICreateClientResponse): google.bigtable.testproxy.CreateClientResponse; + + /** + * Encodes the specified CreateClientResponse message. Does not implicitly {@link google.bigtable.testproxy.CreateClientResponse.verify|verify} messages. + * @param message CreateClientResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.ICreateClientResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClientResponse message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CreateClientResponse.verify|verify} messages. + * @param message CreateClientResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.ICreateClientResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClientResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.CreateClientResponse; + + /** + * Decodes a CreateClientResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.CreateClientResponse; + + /** + * Verifies a CreateClientResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClientResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClientResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.CreateClientResponse; + + /** + * Creates a plain object from a CreateClientResponse message. Also converts values to other types if specified. + * @param message CreateClientResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.CreateClientResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClientResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClientResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloseClientRequest. */ + interface ICloseClientRequest { + + /** CloseClientRequest clientId */ + clientId?: (string|null); + } + + /** Represents a CloseClientRequest. */ + class CloseClientRequest implements ICloseClientRequest { + + /** + * Constructs a new CloseClientRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.ICloseClientRequest); + + /** CloseClientRequest clientId. */ + public clientId: string; + + /** + * Creates a new CloseClientRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CloseClientRequest instance + */ + public static create(properties?: google.bigtable.testproxy.ICloseClientRequest): google.bigtable.testproxy.CloseClientRequest; + + /** + * Encodes the specified CloseClientRequest message. Does not implicitly {@link google.bigtable.testproxy.CloseClientRequest.verify|verify} messages. + * @param message CloseClientRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.ICloseClientRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloseClientRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CloseClientRequest.verify|verify} messages. + * @param message CloseClientRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.ICloseClientRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloseClientRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloseClientRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.CloseClientRequest; + + /** + * Decodes a CloseClientRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloseClientRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.CloseClientRequest; + + /** + * Verifies a CloseClientRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloseClientRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloseClientRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.CloseClientRequest; + + /** + * Creates a plain object from a CloseClientRequest message. Also converts values to other types if specified. + * @param message CloseClientRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.CloseClientRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloseClientRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloseClientRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloseClientResponse. */ + interface ICloseClientResponse { + } + + /** Represents a CloseClientResponse. */ + class CloseClientResponse implements ICloseClientResponse { + + /** + * Constructs a new CloseClientResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.ICloseClientResponse); + + /** + * Creates a new CloseClientResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CloseClientResponse instance + */ + public static create(properties?: google.bigtable.testproxy.ICloseClientResponse): google.bigtable.testproxy.CloseClientResponse; + + /** + * Encodes the specified CloseClientResponse message. Does not implicitly {@link google.bigtable.testproxy.CloseClientResponse.verify|verify} messages. + * @param message CloseClientResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.ICloseClientResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloseClientResponse message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CloseClientResponse.verify|verify} messages. + * @param message CloseClientResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.ICloseClientResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloseClientResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloseClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.CloseClientResponse; + + /** + * Decodes a CloseClientResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloseClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.CloseClientResponse; + + /** + * Verifies a CloseClientResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloseClientResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloseClientResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.CloseClientResponse; + + /** + * Creates a plain object from a CloseClientResponse message. Also converts values to other types if specified. + * @param message CloseClientResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.CloseClientResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloseClientResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloseClientResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemoveClientRequest. */ + interface IRemoveClientRequest { + + /** RemoveClientRequest clientId */ + clientId?: (string|null); + } + + /** Represents a RemoveClientRequest. */ + class RemoveClientRequest implements IRemoveClientRequest { + + /** + * Constructs a new RemoveClientRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IRemoveClientRequest); + + /** RemoveClientRequest clientId. */ + public clientId: string; + + /** + * Creates a new RemoveClientRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveClientRequest instance + */ + public static create(properties?: google.bigtable.testproxy.IRemoveClientRequest): google.bigtable.testproxy.RemoveClientRequest; + + /** + * Encodes the specified RemoveClientRequest message. Does not implicitly {@link google.bigtable.testproxy.RemoveClientRequest.verify|verify} messages. + * @param message RemoveClientRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IRemoveClientRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveClientRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.RemoveClientRequest.verify|verify} messages. + * @param message RemoveClientRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IRemoveClientRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveClientRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveClientRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.RemoveClientRequest; + + /** + * Decodes a RemoveClientRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveClientRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.RemoveClientRequest; + + /** + * Verifies a RemoveClientRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveClientRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveClientRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.RemoveClientRequest; + + /** + * Creates a plain object from a RemoveClientRequest message. Also converts values to other types if specified. + * @param message RemoveClientRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.RemoveClientRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveClientRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveClientRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemoveClientResponse. */ + interface IRemoveClientResponse { + } + + /** Represents a RemoveClientResponse. */ + class RemoveClientResponse implements IRemoveClientResponse { + + /** + * Constructs a new RemoveClientResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IRemoveClientResponse); + + /** + * Creates a new RemoveClientResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveClientResponse instance + */ + public static create(properties?: google.bigtable.testproxy.IRemoveClientResponse): google.bigtable.testproxy.RemoveClientResponse; + + /** + * Encodes the specified RemoveClientResponse message. Does not implicitly {@link google.bigtable.testproxy.RemoveClientResponse.verify|verify} messages. + * @param message RemoveClientResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IRemoveClientResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveClientResponse message, length delimited. Does not implicitly {@link google.bigtable.testproxy.RemoveClientResponse.verify|verify} messages. + * @param message RemoveClientResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IRemoveClientResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveClientResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.RemoveClientResponse; + + /** + * Decodes a RemoveClientResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.RemoveClientResponse; + + /** + * Verifies a RemoveClientResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveClientResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveClientResponse + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.RemoveClientResponse; + + /** + * Creates a plain object from a RemoveClientResponse message. Also converts values to other types if specified. + * @param message RemoveClientResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.RemoveClientResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveClientResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveClientResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadRowRequest. */ + interface IReadRowRequest { + + /** ReadRowRequest clientId */ + clientId?: (string|null); + + /** ReadRowRequest tableName */ + tableName?: (string|null); + + /** ReadRowRequest rowKey */ + rowKey?: (string|null); + + /** ReadRowRequest filter */ + filter?: (google.bigtable.v2.IRowFilter|null); + } + + /** Represents a ReadRowRequest. */ + class ReadRowRequest implements IReadRowRequest { + + /** + * Constructs a new ReadRowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IReadRowRequest); + + /** ReadRowRequest clientId. */ + public clientId: string; + + /** ReadRowRequest tableName. */ + public tableName: string; + + /** ReadRowRequest rowKey. */ + public rowKey: string; + + /** ReadRowRequest filter. */ + public filter?: (google.bigtable.v2.IRowFilter|null); + + /** + * Creates a new ReadRowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRowRequest instance + */ + public static create(properties?: google.bigtable.testproxy.IReadRowRequest): google.bigtable.testproxy.ReadRowRequest; + + /** + * Encodes the specified ReadRowRequest message. Does not implicitly {@link google.bigtable.testproxy.ReadRowRequest.verify|verify} messages. + * @param message ReadRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IReadRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRowRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.ReadRowRequest.verify|verify} messages. + * @param message ReadRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IReadRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadRowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.ReadRowRequest; + + /** + * Decodes a ReadRowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.ReadRowRequest; + + /** + * Verifies a ReadRowRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadRowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadRowRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.ReadRowRequest; + + /** + * Creates a plain object from a ReadRowRequest message. Also converts values to other types if specified. + * @param message ReadRowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.ReadRowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RowResult. */ + interface IRowResult { + + /** RowResult status */ + status?: (google.rpc.IStatus|null); + + /** RowResult row */ + row?: (google.bigtable.v2.IRow|null); + } + + /** Represents a RowResult. */ + class RowResult implements IRowResult { + + /** + * Constructs a new RowResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IRowResult); + + /** RowResult status. */ + public status?: (google.rpc.IStatus|null); + + /** RowResult row. */ + public row?: (google.bigtable.v2.IRow|null); + + /** + * Creates a new RowResult instance using the specified properties. + * @param [properties] Properties to set + * @returns RowResult instance + */ + public static create(properties?: google.bigtable.testproxy.IRowResult): google.bigtable.testproxy.RowResult; + + /** + * Encodes the specified RowResult message. Does not implicitly {@link google.bigtable.testproxy.RowResult.verify|verify} messages. + * @param message RowResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IRowResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.RowResult.verify|verify} messages. + * @param message RowResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IRowResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.RowResult; + + /** + * Decodes a RowResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.RowResult; + + /** + * Verifies a RowResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowResult + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.RowResult; + + /** + * Creates a plain object from a RowResult message. Also converts values to other types if specified. + * @param message RowResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.RowResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadRowsRequest. */ + interface IReadRowsRequest { + + /** ReadRowsRequest clientId */ + clientId?: (string|null); + + /** ReadRowsRequest request */ + request?: (google.bigtable.v2.IReadRowsRequest|null); + + /** ReadRowsRequest cancelAfterRows */ + cancelAfterRows?: (number|null); + } + + /** Represents a ReadRowsRequest. */ + class ReadRowsRequest implements IReadRowsRequest { + + /** + * Constructs a new ReadRowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IReadRowsRequest); + + /** ReadRowsRequest clientId. */ + public clientId: string; + + /** ReadRowsRequest request. */ + public request?: (google.bigtable.v2.IReadRowsRequest|null); + + /** ReadRowsRequest cancelAfterRows. */ + public cancelAfterRows: number; + + /** + * Creates a new ReadRowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRowsRequest instance + */ + public static create(properties?: google.bigtable.testproxy.IReadRowsRequest): google.bigtable.testproxy.ReadRowsRequest; + + /** + * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.bigtable.testproxy.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.bigtable.testproxy.IReadRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.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.bigtable.testproxy.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.bigtable.testproxy.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.bigtable.testproxy.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.bigtable.testproxy.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.bigtable.testproxy.ReadRowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RowsResult. */ + interface IRowsResult { + + /** RowsResult status */ + status?: (google.rpc.IStatus|null); + + /** RowsResult rows */ + rows?: (google.bigtable.v2.IRow[]|null); + } + + /** Represents a RowsResult. */ + class RowsResult implements IRowsResult { + + /** + * Constructs a new RowsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IRowsResult); + + /** RowsResult status. */ + public status?: (google.rpc.IStatus|null); + + /** RowsResult rows. */ + public rows: google.bigtable.v2.IRow[]; + + /** + * Creates a new RowsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns RowsResult instance + */ + public static create(properties?: google.bigtable.testproxy.IRowsResult): google.bigtable.testproxy.RowsResult; + + /** + * Encodes the specified RowsResult message. Does not implicitly {@link google.bigtable.testproxy.RowsResult.verify|verify} messages. + * @param message RowsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IRowsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowsResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.RowsResult.verify|verify} messages. + * @param message RowsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IRowsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.RowsResult; + + /** + * Decodes a RowsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.RowsResult; + + /** + * Verifies a RowsResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowsResult + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.RowsResult; + + /** + * Creates a plain object from a RowsResult message. Also converts values to other types if specified. + * @param message RowsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.RowsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateRowRequest. */ + interface IMutateRowRequest { + + /** MutateRowRequest clientId */ + clientId?: (string|null); + + /** MutateRowRequest request */ + request?: (google.bigtable.v2.IMutateRowRequest|null); + } + + /** Represents a MutateRowRequest. */ + class MutateRowRequest implements IMutateRowRequest { + + /** + * Constructs a new MutateRowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IMutateRowRequest); + + /** MutateRowRequest clientId. */ + public clientId: string; + + /** MutateRowRequest request. */ + public request?: (google.bigtable.v2.IMutateRowRequest|null); + + /** + * Creates a new MutateRowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateRowRequest instance + */ + public static create(properties?: google.bigtable.testproxy.IMutateRowRequest): google.bigtable.testproxy.MutateRowRequest; + + /** + * Encodes the specified MutateRowRequest message. Does not implicitly {@link google.bigtable.testproxy.MutateRowRequest.verify|verify} messages. + * @param message MutateRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IMutateRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateRowRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.MutateRowRequest.verify|verify} messages. + * @param message MutateRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IMutateRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateRowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.MutateRowRequest; + + /** + * Decodes a MutateRowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.MutateRowRequest; + + /** + * Verifies a MutateRowRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateRowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateRowRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.MutateRowRequest; + + /** + * Creates a plain object from a MutateRowRequest message. Also converts values to other types if specified. + * @param message MutateRowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.MutateRowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateRowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateRowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateRowResult. */ + interface IMutateRowResult { + + /** MutateRowResult status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents a MutateRowResult. */ + class MutateRowResult implements IMutateRowResult { + + /** + * Constructs a new MutateRowResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IMutateRowResult); + + /** MutateRowResult status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new MutateRowResult instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateRowResult instance + */ + public static create(properties?: google.bigtable.testproxy.IMutateRowResult): google.bigtable.testproxy.MutateRowResult; + + /** + * Encodes the specified MutateRowResult message. Does not implicitly {@link google.bigtable.testproxy.MutateRowResult.verify|verify} messages. + * @param message MutateRowResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IMutateRowResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateRowResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.MutateRowResult.verify|verify} messages. + * @param message MutateRowResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IMutateRowResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateRowResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateRowResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.MutateRowResult; + + /** + * Decodes a MutateRowResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateRowResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.MutateRowResult; + + /** + * Verifies a MutateRowResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateRowResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateRowResult + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.MutateRowResult; + + /** + * Creates a plain object from a MutateRowResult message. Also converts values to other types if specified. + * @param message MutateRowResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.MutateRowResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateRowResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateRowResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateRowsRequest. */ + interface IMutateRowsRequest { + + /** MutateRowsRequest clientId */ + clientId?: (string|null); + + /** MutateRowsRequest request */ + request?: (google.bigtable.v2.IMutateRowsRequest|null); + } + + /** Represents a MutateRowsRequest. */ + class MutateRowsRequest implements IMutateRowsRequest { + + /** + * Constructs a new MutateRowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IMutateRowsRequest); + + /** MutateRowsRequest clientId. */ + public clientId: string; + + /** MutateRowsRequest request. */ + public request?: (google.bigtable.v2.IMutateRowsRequest|null); + + /** + * Creates a new MutateRowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateRowsRequest instance + */ + public static create(properties?: google.bigtable.testproxy.IMutateRowsRequest): google.bigtable.testproxy.MutateRowsRequest; + + /** + * Encodes the specified MutateRowsRequest message. Does not implicitly {@link google.bigtable.testproxy.MutateRowsRequest.verify|verify} messages. + * @param message MutateRowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IMutateRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateRowsRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.MutateRowsRequest.verify|verify} messages. + * @param message MutateRowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IMutateRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateRowsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.MutateRowsRequest; + + /** + * Decodes a MutateRowsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.MutateRowsRequest; + + /** + * Verifies a MutateRowsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateRowsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateRowsRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.MutateRowsRequest; + + /** + * Creates a plain object from a MutateRowsRequest message. Also converts values to other types if specified. + * @param message MutateRowsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.MutateRowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateRowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateRowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateRowsResult. */ + interface IMutateRowsResult { + + /** MutateRowsResult status */ + status?: (google.rpc.IStatus|null); + + /** MutateRowsResult entries */ + entries?: (google.bigtable.v2.MutateRowsResponse.IEntry[]|null); + } + + /** Represents a MutateRowsResult. */ + class MutateRowsResult implements IMutateRowsResult { + + /** + * Constructs a new MutateRowsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IMutateRowsResult); + + /** MutateRowsResult status. */ + public status?: (google.rpc.IStatus|null); + + /** MutateRowsResult entries. */ + public entries: google.bigtable.v2.MutateRowsResponse.IEntry[]; + + /** + * Creates a new MutateRowsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateRowsResult instance + */ + public static create(properties?: google.bigtable.testproxy.IMutateRowsResult): google.bigtable.testproxy.MutateRowsResult; + + /** + * Encodes the specified MutateRowsResult message. Does not implicitly {@link google.bigtable.testproxy.MutateRowsResult.verify|verify} messages. + * @param message MutateRowsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IMutateRowsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateRowsResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.MutateRowsResult.verify|verify} messages. + * @param message MutateRowsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IMutateRowsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateRowsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateRowsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.MutateRowsResult; + + /** + * Decodes a MutateRowsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateRowsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.MutateRowsResult; + + /** + * Verifies a MutateRowsResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateRowsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateRowsResult + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.MutateRowsResult; + + /** + * Creates a plain object from a MutateRowsResult message. Also converts values to other types if specified. + * @param message MutateRowsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.MutateRowsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateRowsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateRowsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckAndMutateRowRequest. */ + interface ICheckAndMutateRowRequest { + + /** CheckAndMutateRowRequest clientId */ + clientId?: (string|null); + + /** CheckAndMutateRowRequest request */ + request?: (google.bigtable.v2.ICheckAndMutateRowRequest|null); + } + + /** Represents a CheckAndMutateRowRequest. */ + class CheckAndMutateRowRequest implements ICheckAndMutateRowRequest { + + /** + * Constructs a new CheckAndMutateRowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.ICheckAndMutateRowRequest); + + /** CheckAndMutateRowRequest clientId. */ + public clientId: string; + + /** CheckAndMutateRowRequest request. */ + public request?: (google.bigtable.v2.ICheckAndMutateRowRequest|null); + + /** + * Creates a new CheckAndMutateRowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckAndMutateRowRequest instance + */ + public static create(properties?: google.bigtable.testproxy.ICheckAndMutateRowRequest): google.bigtable.testproxy.CheckAndMutateRowRequest; + + /** + * Encodes the specified CheckAndMutateRowRequest message. Does not implicitly {@link google.bigtable.testproxy.CheckAndMutateRowRequest.verify|verify} messages. + * @param message CheckAndMutateRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.ICheckAndMutateRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckAndMutateRowRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CheckAndMutateRowRequest.verify|verify} messages. + * @param message CheckAndMutateRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.ICheckAndMutateRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckAndMutateRowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckAndMutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.CheckAndMutateRowRequest; + + /** + * Decodes a CheckAndMutateRowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckAndMutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.CheckAndMutateRowRequest; + + /** + * Verifies a CheckAndMutateRowRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckAndMutateRowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckAndMutateRowRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.CheckAndMutateRowRequest; + + /** + * Creates a plain object from a CheckAndMutateRowRequest message. Also converts values to other types if specified. + * @param message CheckAndMutateRowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.CheckAndMutateRowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckAndMutateRowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckAndMutateRowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckAndMutateRowResult. */ + interface ICheckAndMutateRowResult { + + /** CheckAndMutateRowResult status */ + status?: (google.rpc.IStatus|null); + + /** CheckAndMutateRowResult result */ + result?: (google.bigtable.v2.ICheckAndMutateRowResponse|null); + } + + /** Represents a CheckAndMutateRowResult. */ + class CheckAndMutateRowResult implements ICheckAndMutateRowResult { + + /** + * Constructs a new CheckAndMutateRowResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.ICheckAndMutateRowResult); + + /** CheckAndMutateRowResult status. */ + public status?: (google.rpc.IStatus|null); + + /** CheckAndMutateRowResult result. */ + public result?: (google.bigtable.v2.ICheckAndMutateRowResponse|null); + + /** + * Creates a new CheckAndMutateRowResult instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckAndMutateRowResult instance + */ + public static create(properties?: google.bigtable.testproxy.ICheckAndMutateRowResult): google.bigtable.testproxy.CheckAndMutateRowResult; + + /** + * Encodes the specified CheckAndMutateRowResult message. Does not implicitly {@link google.bigtable.testproxy.CheckAndMutateRowResult.verify|verify} messages. + * @param message CheckAndMutateRowResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.ICheckAndMutateRowResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckAndMutateRowResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CheckAndMutateRowResult.verify|verify} messages. + * @param message CheckAndMutateRowResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.ICheckAndMutateRowResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckAndMutateRowResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckAndMutateRowResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.CheckAndMutateRowResult; + + /** + * Decodes a CheckAndMutateRowResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckAndMutateRowResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.CheckAndMutateRowResult; + + /** + * Verifies a CheckAndMutateRowResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckAndMutateRowResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckAndMutateRowResult + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.CheckAndMutateRowResult; + + /** + * Creates a plain object from a CheckAndMutateRowResult message. Also converts values to other types if specified. + * @param message CheckAndMutateRowResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.CheckAndMutateRowResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckAndMutateRowResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckAndMutateRowResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SampleRowKeysRequest. */ + interface ISampleRowKeysRequest { + + /** SampleRowKeysRequest clientId */ + clientId?: (string|null); + + /** SampleRowKeysRequest request */ + request?: (google.bigtable.v2.ISampleRowKeysRequest|null); + } + + /** Represents a SampleRowKeysRequest. */ + class SampleRowKeysRequest implements ISampleRowKeysRequest { + + /** + * Constructs a new SampleRowKeysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.ISampleRowKeysRequest); + + /** SampleRowKeysRequest clientId. */ + public clientId: string; + + /** SampleRowKeysRequest request. */ + public request?: (google.bigtable.v2.ISampleRowKeysRequest|null); + + /** + * Creates a new SampleRowKeysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SampleRowKeysRequest instance + */ + public static create(properties?: google.bigtable.testproxy.ISampleRowKeysRequest): google.bigtable.testproxy.SampleRowKeysRequest; + + /** + * Encodes the specified SampleRowKeysRequest message. Does not implicitly {@link google.bigtable.testproxy.SampleRowKeysRequest.verify|verify} messages. + * @param message SampleRowKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.ISampleRowKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SampleRowKeysRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.SampleRowKeysRequest.verify|verify} messages. + * @param message SampleRowKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.ISampleRowKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SampleRowKeysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SampleRowKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.SampleRowKeysRequest; + + /** + * Decodes a SampleRowKeysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SampleRowKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.SampleRowKeysRequest; + + /** + * Verifies a SampleRowKeysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SampleRowKeysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SampleRowKeysRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.SampleRowKeysRequest; + + /** + * Creates a plain object from a SampleRowKeysRequest message. Also converts values to other types if specified. + * @param message SampleRowKeysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.SampleRowKeysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SampleRowKeysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SampleRowKeysRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SampleRowKeysResult. */ + interface ISampleRowKeysResult { + + /** SampleRowKeysResult status */ + status?: (google.rpc.IStatus|null); + + /** SampleRowKeysResult samples */ + samples?: (google.bigtable.v2.ISampleRowKeysResponse[]|null); + } + + /** Represents a SampleRowKeysResult. */ + class SampleRowKeysResult implements ISampleRowKeysResult { + + /** + * Constructs a new SampleRowKeysResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.ISampleRowKeysResult); + + /** SampleRowKeysResult status. */ + public status?: (google.rpc.IStatus|null); + + /** SampleRowKeysResult samples. */ + public samples: google.bigtable.v2.ISampleRowKeysResponse[]; + + /** + * Creates a new SampleRowKeysResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SampleRowKeysResult instance + */ + public static create(properties?: google.bigtable.testproxy.ISampleRowKeysResult): google.bigtable.testproxy.SampleRowKeysResult; + + /** + * Encodes the specified SampleRowKeysResult message. Does not implicitly {@link google.bigtable.testproxy.SampleRowKeysResult.verify|verify} messages. + * @param message SampleRowKeysResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.ISampleRowKeysResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SampleRowKeysResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.SampleRowKeysResult.verify|verify} messages. + * @param message SampleRowKeysResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.ISampleRowKeysResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SampleRowKeysResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SampleRowKeysResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.SampleRowKeysResult; + + /** + * Decodes a SampleRowKeysResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SampleRowKeysResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.SampleRowKeysResult; + + /** + * Verifies a SampleRowKeysResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SampleRowKeysResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SampleRowKeysResult + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.SampleRowKeysResult; + + /** + * Creates a plain object from a SampleRowKeysResult message. Also converts values to other types if specified. + * @param message SampleRowKeysResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.SampleRowKeysResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SampleRowKeysResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SampleRowKeysResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadModifyWriteRowRequest. */ + interface IReadModifyWriteRowRequest { + + /** ReadModifyWriteRowRequest clientId */ + clientId?: (string|null); + + /** ReadModifyWriteRowRequest request */ + request?: (google.bigtable.v2.IReadModifyWriteRowRequest|null); + } + + /** Represents a ReadModifyWriteRowRequest. */ + class ReadModifyWriteRowRequest implements IReadModifyWriteRowRequest { + + /** + * Constructs a new ReadModifyWriteRowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IReadModifyWriteRowRequest); + + /** ReadModifyWriteRowRequest clientId. */ + public clientId: string; + + /** ReadModifyWriteRowRequest request. */ + public request?: (google.bigtable.v2.IReadModifyWriteRowRequest|null); + + /** + * Creates a new ReadModifyWriteRowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadModifyWriteRowRequest instance + */ + public static create(properties?: google.bigtable.testproxy.IReadModifyWriteRowRequest): google.bigtable.testproxy.ReadModifyWriteRowRequest; + + /** + * Encodes the specified ReadModifyWriteRowRequest message. Does not implicitly {@link google.bigtable.testproxy.ReadModifyWriteRowRequest.verify|verify} messages. + * @param message ReadModifyWriteRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IReadModifyWriteRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadModifyWriteRowRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.ReadModifyWriteRowRequest.verify|verify} messages. + * @param message ReadModifyWriteRowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IReadModifyWriteRowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadModifyWriteRowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadModifyWriteRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.ReadModifyWriteRowRequest; + + /** + * Decodes a ReadModifyWriteRowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadModifyWriteRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.ReadModifyWriteRowRequest; + + /** + * Verifies a ReadModifyWriteRowRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadModifyWriteRowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadModifyWriteRowRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.ReadModifyWriteRowRequest; + + /** + * Creates a plain object from a ReadModifyWriteRowRequest message. Also converts values to other types if specified. + * @param message ReadModifyWriteRowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.ReadModifyWriteRowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadModifyWriteRowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadModifyWriteRowRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteQueryRequest. */ + interface IExecuteQueryRequest { + + /** ExecuteQueryRequest clientId */ + clientId?: (string|null); + + /** ExecuteQueryRequest request */ + request?: (google.bigtable.v2.IExecuteQueryRequest|null); + } + + /** Represents an ExecuteQueryRequest. */ + class ExecuteQueryRequest implements IExecuteQueryRequest { + + /** + * Constructs a new ExecuteQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IExecuteQueryRequest); + + /** ExecuteQueryRequest clientId. */ + public clientId: string; + + /** ExecuteQueryRequest request. */ + public request?: (google.bigtable.v2.IExecuteQueryRequest|null); + + /** + * Creates a new ExecuteQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteQueryRequest instance + */ + public static create(properties?: google.bigtable.testproxy.IExecuteQueryRequest): google.bigtable.testproxy.ExecuteQueryRequest; + + /** + * Encodes the specified ExecuteQueryRequest message. Does not implicitly {@link google.bigtable.testproxy.ExecuteQueryRequest.verify|verify} messages. + * @param message ExecuteQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IExecuteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteQueryRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.ExecuteQueryRequest.verify|verify} messages. + * @param message ExecuteQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IExecuteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.ExecuteQueryRequest; + + /** + * Decodes an ExecuteQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.ExecuteQueryRequest; + + /** + * Verifies an ExecuteQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.ExecuteQueryRequest; + + /** + * Creates a plain object from an ExecuteQueryRequest message. Also converts values to other types if specified. + * @param message ExecuteQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.ExecuteQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteQueryResult. */ + interface IExecuteQueryResult { + + /** ExecuteQueryResult status */ + status?: (google.rpc.IStatus|null); + + /** ExecuteQueryResult metadata */ + metadata?: (google.bigtable.testproxy.IResultSetMetadata|null); + + /** ExecuteQueryResult rows */ + rows?: (google.bigtable.testproxy.ISqlRow[]|null); + } + + /** Represents an ExecuteQueryResult. */ + class ExecuteQueryResult implements IExecuteQueryResult { + + /** + * Constructs a new ExecuteQueryResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IExecuteQueryResult); + + /** ExecuteQueryResult status. */ + public status?: (google.rpc.IStatus|null); + + /** ExecuteQueryResult metadata. */ + public metadata?: (google.bigtable.testproxy.IResultSetMetadata|null); + + /** ExecuteQueryResult rows. */ + public rows: google.bigtable.testproxy.ISqlRow[]; + + /** + * Creates a new ExecuteQueryResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteQueryResult instance + */ + public static create(properties?: google.bigtable.testproxy.IExecuteQueryResult): google.bigtable.testproxy.ExecuteQueryResult; + + /** + * Encodes the specified ExecuteQueryResult message. Does not implicitly {@link google.bigtable.testproxy.ExecuteQueryResult.verify|verify} messages. + * @param message ExecuteQueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IExecuteQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteQueryResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.ExecuteQueryResult.verify|verify} messages. + * @param message ExecuteQueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IExecuteQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteQueryResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.ExecuteQueryResult; + + /** + * Decodes an ExecuteQueryResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.ExecuteQueryResult; + + /** + * Verifies an ExecuteQueryResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteQueryResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteQueryResult + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.ExecuteQueryResult; + + /** + * Creates a plain object from an ExecuteQueryResult message. Also converts values to other types if specified. + * @param message ExecuteQueryResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.ExecuteQueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteQueryResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteQueryResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResultSetMetadata. */ + interface IResultSetMetadata { + + /** ResultSetMetadata columns */ + columns?: (google.bigtable.v2.IColumnMetadata[]|null); + } + + /** Represents a ResultSetMetadata. */ + class ResultSetMetadata implements IResultSetMetadata { + + /** + * Constructs a new ResultSetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.IResultSetMetadata); + + /** ResultSetMetadata columns. */ + public columns: google.bigtable.v2.IColumnMetadata[]; + + /** + * Creates a new ResultSetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ResultSetMetadata instance + */ + public static create(properties?: google.bigtable.testproxy.IResultSetMetadata): google.bigtable.testproxy.ResultSetMetadata; + + /** + * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.bigtable.testproxy.ResultSetMetadata.verify|verify} messages. + * @param message ResultSetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.bigtable.testproxy.ResultSetMetadata.verify|verify} messages. + * @param message ResultSetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.ResultSetMetadata; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.ResultSetMetadata; + + /** + * Verifies a ResultSetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultSetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.ResultSetMetadata; + + /** + * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. + * @param message ResultSetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.ResultSetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultSetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultSetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlRow. */ + interface ISqlRow { + + /** SqlRow values */ + values?: (google.bigtable.v2.IValue[]|null); + } + + /** Represents a SqlRow. */ + class SqlRow implements ISqlRow { + + /** + * Constructs a new SqlRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.testproxy.ISqlRow); + + /** SqlRow values. */ + public values: google.bigtable.v2.IValue[]; + + /** + * Creates a new SqlRow instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlRow instance + */ + public static create(properties?: google.bigtable.testproxy.ISqlRow): google.bigtable.testproxy.SqlRow; + + /** + * Encodes the specified SqlRow message. Does not implicitly {@link google.bigtable.testproxy.SqlRow.verify|verify} messages. + * @param message SqlRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.testproxy.ISqlRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlRow message, length delimited. Does not implicitly {@link google.bigtable.testproxy.SqlRow.verify|verify} messages. + * @param message SqlRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.testproxy.ISqlRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlRow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.testproxy.SqlRow; + + /** + * Decodes a SqlRow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.testproxy.SqlRow; + + /** + * Verifies a SqlRow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlRow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlRow + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.testproxy.SqlRow; + + /** + * Creates a plain object from a SqlRow message. Also converts values to other types if specified. + * @param message SqlRow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.testproxy.SqlRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlRow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CloudBigtableV2TestProxy */ + class CloudBigtableV2TestProxy extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudBigtableV2TestProxy 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 CloudBigtableV2TestProxy 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): CloudBigtableV2TestProxy; + + /** + * Calls CreateClient. + * @param request CreateClientRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CreateClientResponse + */ + public createClient(request: google.bigtable.testproxy.ICreateClientRequest, callback: google.bigtable.testproxy.CloudBigtableV2TestProxy.CreateClientCallback): void; + + /** + * Calls CreateClient. + * @param request CreateClientRequest message or plain object + * @returns Promise + */ + public createClient(request: google.bigtable.testproxy.ICreateClientRequest): Promise; + + /** + * Calls CloseClient. + * @param request CloseClientRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CloseClientResponse + */ + public closeClient(request: google.bigtable.testproxy.ICloseClientRequest, callback: google.bigtable.testproxy.CloudBigtableV2TestProxy.CloseClientCallback): void; + + /** + * Calls CloseClient. + * @param request CloseClientRequest message or plain object + * @returns Promise + */ + public closeClient(request: google.bigtable.testproxy.ICloseClientRequest): Promise; + + /** + * Calls RemoveClient. + * @param request RemoveClientRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RemoveClientResponse + */ + public removeClient(request: google.bigtable.testproxy.IRemoveClientRequest, callback: google.bigtable.testproxy.CloudBigtableV2TestProxy.RemoveClientCallback): void; + + /** + * Calls RemoveClient. + * @param request RemoveClientRequest message or plain object + * @returns Promise + */ + public removeClient(request: google.bigtable.testproxy.IRemoveClientRequest): Promise; + + /** + * Calls ReadRow. + * @param request ReadRowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RowResult + */ + public readRow(request: google.bigtable.testproxy.IReadRowRequest, callback: google.bigtable.testproxy.CloudBigtableV2TestProxy.ReadRowCallback): void; + + /** + * Calls ReadRow. + * @param request ReadRowRequest message or plain object + * @returns Promise + */ + public readRow(request: google.bigtable.testproxy.IReadRowRequest): Promise; + + /** + * Calls ReadRows. + * @param request ReadRowsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RowsResult + */ + public readRows(request: google.bigtable.testproxy.IReadRowsRequest, callback: google.bigtable.testproxy.CloudBigtableV2TestProxy.ReadRowsCallback): void; + + /** + * Calls ReadRows. + * @param request ReadRowsRequest message or plain object + * @returns Promise + */ + public readRows(request: google.bigtable.testproxy.IReadRowsRequest): Promise; + + /** + * Calls MutateRow. + * @param request MutateRowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MutateRowResult + */ + public mutateRow(request: google.bigtable.testproxy.IMutateRowRequest, callback: google.bigtable.testproxy.CloudBigtableV2TestProxy.MutateRowCallback): void; + + /** + * Calls MutateRow. + * @param request MutateRowRequest message or plain object + * @returns Promise + */ + public mutateRow(request: google.bigtable.testproxy.IMutateRowRequest): Promise; + + /** + * Calls BulkMutateRows. + * @param request MutateRowsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MutateRowsResult + */ + public bulkMutateRows(request: google.bigtable.testproxy.IMutateRowsRequest, callback: google.bigtable.testproxy.CloudBigtableV2TestProxy.BulkMutateRowsCallback): void; + + /** + * Calls BulkMutateRows. + * @param request MutateRowsRequest message or plain object + * @returns Promise + */ + public bulkMutateRows(request: google.bigtable.testproxy.IMutateRowsRequest): Promise; + + /** + * Calls CheckAndMutateRow. + * @param request CheckAndMutateRowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckAndMutateRowResult + */ + public checkAndMutateRow(request: google.bigtable.testproxy.ICheckAndMutateRowRequest, callback: google.bigtable.testproxy.CloudBigtableV2TestProxy.CheckAndMutateRowCallback): void; + + /** + * Calls CheckAndMutateRow. + * @param request CheckAndMutateRowRequest message or plain object + * @returns Promise + */ + public checkAndMutateRow(request: google.bigtable.testproxy.ICheckAndMutateRowRequest): Promise; + + /** + * Calls SampleRowKeys. + * @param request SampleRowKeysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SampleRowKeysResult + */ + public sampleRowKeys(request: google.bigtable.testproxy.ISampleRowKeysRequest, callback: google.bigtable.testproxy.CloudBigtableV2TestProxy.SampleRowKeysCallback): void; + + /** + * Calls SampleRowKeys. + * @param request SampleRowKeysRequest message or plain object + * @returns Promise + */ + public sampleRowKeys(request: google.bigtable.testproxy.ISampleRowKeysRequest): Promise; + + /** + * Calls ReadModifyWriteRow. + * @param request ReadModifyWriteRowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RowResult + */ + public readModifyWriteRow(request: google.bigtable.testproxy.IReadModifyWriteRowRequest, callback: google.bigtable.testproxy.CloudBigtableV2TestProxy.ReadModifyWriteRowCallback): void; + + /** + * Calls ReadModifyWriteRow. + * @param request ReadModifyWriteRowRequest message or plain object + * @returns Promise + */ + public readModifyWriteRow(request: google.bigtable.testproxy.IReadModifyWriteRowRequest): Promise; + + /** + * Calls ExecuteQuery. + * @param request ExecuteQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteQueryResult + */ + public executeQuery(request: google.bigtable.testproxy.IExecuteQueryRequest, callback: google.bigtable.testproxy.CloudBigtableV2TestProxy.ExecuteQueryCallback): void; + + /** + * Calls ExecuteQuery. + * @param request ExecuteQueryRequest message or plain object + * @returns Promise + */ + public executeQuery(request: google.bigtable.testproxy.IExecuteQueryRequest): Promise; + } + + namespace CloudBigtableV2TestProxy { + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|createClient}. + * @param error Error, if any + * @param [response] CreateClientResponse + */ + type CreateClientCallback = (error: (Error|null), response?: google.bigtable.testproxy.CreateClientResponse) => void; + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|closeClient}. + * @param error Error, if any + * @param [response] CloseClientResponse + */ + type CloseClientCallback = (error: (Error|null), response?: google.bigtable.testproxy.CloseClientResponse) => void; + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|removeClient}. + * @param error Error, if any + * @param [response] RemoveClientResponse + */ + type RemoveClientCallback = (error: (Error|null), response?: google.bigtable.testproxy.RemoveClientResponse) => void; + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|readRow}. + * @param error Error, if any + * @param [response] RowResult + */ + type ReadRowCallback = (error: (Error|null), response?: google.bigtable.testproxy.RowResult) => void; + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|readRows}. + * @param error Error, if any + * @param [response] RowsResult + */ + type ReadRowsCallback = (error: (Error|null), response?: google.bigtable.testproxy.RowsResult) => void; + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|mutateRow}. + * @param error Error, if any + * @param [response] MutateRowResult + */ + type MutateRowCallback = (error: (Error|null), response?: google.bigtable.testproxy.MutateRowResult) => void; + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|bulkMutateRows}. + * @param error Error, if any + * @param [response] MutateRowsResult + */ + type BulkMutateRowsCallback = (error: (Error|null), response?: google.bigtable.testproxy.MutateRowsResult) => void; + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|checkAndMutateRow}. + * @param error Error, if any + * @param [response] CheckAndMutateRowResult + */ + type CheckAndMutateRowCallback = (error: (Error|null), response?: google.bigtable.testproxy.CheckAndMutateRowResult) => void; + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|sampleRowKeys}. + * @param error Error, if any + * @param [response] SampleRowKeysResult + */ + type SampleRowKeysCallback = (error: (Error|null), response?: google.bigtable.testproxy.SampleRowKeysResult) => void; + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|readModifyWriteRow}. + * @param error Error, if any + * @param [response] RowResult + */ + type ReadModifyWriteRowCallback = (error: (Error|null), response?: google.bigtable.testproxy.RowResult) => void; + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|executeQuery}. + * @param error Error, if any + * @param [response] ExecuteQueryResult + */ + type ExecuteQueryCallback = (error: (Error|null), response?: google.bigtable.testproxy.ExecuteQueryResult) => void; + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + 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|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** 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 }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + 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 }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not 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.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload 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.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not 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.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload 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.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not 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.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload 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.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not 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.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload 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.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not 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.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload 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.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not 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.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload 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.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not 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.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload 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.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not 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.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload 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.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not 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.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload 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.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not 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.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload 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.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not 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.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload 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.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not 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.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload 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.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not 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.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload 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.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not 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.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload 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.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not 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.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload 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.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * 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 }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of 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 }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingRule. */ + interface IRoutingRule { + + /** RoutingRule routingParameters */ + routingParameters?: (google.api.IRoutingParameter[]|null); + } + + /** Represents a RoutingRule. */ + class RoutingRule implements IRoutingRule { + + /** + * Constructs a new RoutingRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRoutingRule); + + /** RoutingRule routingParameters. */ + public routingParameters: google.api.IRoutingParameter[]; + + /** + * Creates a new RoutingRule instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingRule instance + */ + public static create(properties?: google.api.IRoutingRule): google.api.RoutingRule; + + /** + * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @param message RoutingRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @param message RoutingRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingRule + * @throws {Error} If the payload is not 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.RoutingRule; + + /** + * Decodes a RoutingRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingRule + * @throws {Error} If the payload 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.RoutingRule; + + /** + * Verifies a RoutingRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingRule + */ + public static fromObject(object: { [k: string]: any }): google.api.RoutingRule; + + /** + * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. + * @param message RoutingRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RoutingRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingParameter. */ + interface IRoutingParameter { + + /** RoutingParameter field */ + field?: (string|null); + + /** RoutingParameter pathTemplate */ + pathTemplate?: (string|null); + } + + /** Represents a RoutingParameter. */ + class RoutingParameter implements IRoutingParameter { + + /** + * Constructs a new RoutingParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRoutingParameter); + + /** RoutingParameter field. */ + public field: string; + + /** RoutingParameter pathTemplate. */ + public pathTemplate: string; + + /** + * Creates a new RoutingParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingParameter instance + */ + public static create(properties?: google.api.IRoutingParameter): google.api.RoutingParameter; + + /** + * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @param message RoutingParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @param message RoutingParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingParameter + * @throws {Error} If the payload is not 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.RoutingParameter; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingParameter + * @throws {Error} If the payload 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.RoutingParameter; + + /** + * Verifies a RoutingParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingParameter + */ + public static fromObject(object: { [k: string]: any }): google.api.RoutingParameter; + + /** + * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. + * @param message RoutingParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RoutingParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** 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 optionDependency */ + optionDependency?: (string[]|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); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|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 optionDependency. */ + public optionDependency: string[]; + + /** 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; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * 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 }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + 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); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|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[]; + + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * 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 }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** 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 }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + 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 }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|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[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * 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 }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not 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.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload 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.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** 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_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** 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 }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + 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); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|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[]; + + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * 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 }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** 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 }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + 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 }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** 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 }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions 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 features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions 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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** 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 deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|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 deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** 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 }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not 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.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload 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.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not 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.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload 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.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** 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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|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 deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** 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 }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** 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); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.api.routing */ + ".google.api.routing"?: (google.api.IRoutingRule|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** 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 }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not 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.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload 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.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not 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.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload 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.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not 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.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload 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.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not 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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload 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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** 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 }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** 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); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|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; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @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 }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + 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 }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy 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 IAMPolicy 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): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|Buffer|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/handwritten/bigtable/testproxy/protos/protos.js b/handwritten/bigtable/testproxy/protos/protos.js new file mode 100644 index 00000000000..6a678e6a96e --- /dev/null +++ b/handwritten/bigtable/testproxy/protos/protos.js @@ -0,0 +1,109604 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_bigtable_protos || ($protobuf.roots._google_cloud_bigtable_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.bigtable = (function() { + + /** + * Namespace bigtable. + * @memberof google + * @namespace + */ + var bigtable = {}; + + bigtable.admin = (function() { + + /** + * Namespace admin. + * @memberof google.bigtable + * @namespace + */ + var admin = {}; + + admin.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.bigtable.admin + * @namespace + */ + var v2 = {}; + + v2.BigtableInstanceAdmin = (function() { + + /** + * Constructs a new BigtableInstanceAdmin service. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a BigtableInstanceAdmin + * @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 BigtableInstanceAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BigtableInstanceAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BigtableInstanceAdmin; + + /** + * Creates new BigtableInstanceAdmin service using the specified rpc implementation. + * @function create + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @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 {BigtableInstanceAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + BigtableInstanceAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createInstance}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.bigtable.admin.v2.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getInstance}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.bigtable.admin.v2.GetInstanceRequest, $root.google.bigtable.admin.v2.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listInstances}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.bigtable.admin.v2.ListInstancesRequest, $root.google.bigtable.admin.v2.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateInstance}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Instance} [response] Instance + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IInstance} request Instance message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.bigtable.admin.v2.Instance, $root.google.bigtable.admin.v2.Instance, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IInstance} request Instance message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|partialUpdateInstance}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef PartialUpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PartialUpdateInstance. + * @function partialUpdateInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest} request PartialUpdateInstanceRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.partialUpdateInstance = function partialUpdateInstance(request, callback) { + return this.rpcCall(partialUpdateInstance, $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PartialUpdateInstance" }); + + /** + * Calls PartialUpdateInstance. + * @function partialUpdateInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest} request PartialUpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteInstance}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.bigtable.admin.v2.DeleteInstanceRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createCluster}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef CreateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.createCluster = function createCluster(request, callback) { + return this.rpcCall(createCluster, $root.google.bigtable.admin.v2.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCluster" }); + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getCluster}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef GetClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Cluster} [response] Cluster + */ + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetClusterRequest} request GetClusterRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.getCluster = function getCluster(request, callback) { + return this.rpcCall(getCluster, $root.google.bigtable.admin.v2.GetClusterRequest, $root.google.bigtable.admin.v2.Cluster, request, callback); + }, "name", { value: "GetCluster" }); + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetClusterRequest} request GetClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listClusters}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef ListClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListClustersResponse} [response] ListClustersResponse + */ + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListClustersRequest} request ListClustersRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.listClusters = function listClusters(request, callback) { + return this.rpcCall(listClusters, $root.google.bigtable.admin.v2.ListClustersRequest, $root.google.bigtable.admin.v2.ListClustersResponse, request, callback); + }, "name", { value: "ListClusters" }); + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListClustersRequest} request ListClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateCluster}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef UpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICluster} request Cluster message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.updateCluster = function updateCluster(request, callback) { + return this.rpcCall(updateCluster, $root.google.bigtable.admin.v2.Cluster, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCluster" }); + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICluster} request Cluster message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|partialUpdateCluster}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef PartialUpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PartialUpdateCluster. + * @function partialUpdateCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IPartialUpdateClusterRequest} request PartialUpdateClusterRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.partialUpdateCluster = function partialUpdateCluster(request, callback) { + return this.rpcCall(partialUpdateCluster, $root.google.bigtable.admin.v2.PartialUpdateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PartialUpdateCluster" }); + + /** + * Calls PartialUpdateCluster. + * @function partialUpdateCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IPartialUpdateClusterRequest} request PartialUpdateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteCluster}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef DeleteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { + return this.rpcCall(deleteCluster, $root.google.bigtable.admin.v2.DeleteClusterRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCluster" }); + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createAppProfile}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef CreateAppProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.AppProfile} [response] AppProfile + */ + + /** + * Calls CreateAppProfile. + * @function createAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest} request CreateAppProfileRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.CreateAppProfileCallback} callback Node-style callback called with the error, if any, and AppProfile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.createAppProfile = function createAppProfile(request, callback) { + return this.rpcCall(createAppProfile, $root.google.bigtable.admin.v2.CreateAppProfileRequest, $root.google.bigtable.admin.v2.AppProfile, request, callback); + }, "name", { value: "CreateAppProfile" }); + + /** + * Calls CreateAppProfile. + * @function createAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest} request CreateAppProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getAppProfile}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef GetAppProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.AppProfile} [response] AppProfile + */ + + /** + * Calls GetAppProfile. + * @function getAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetAppProfileRequest} request GetAppProfileRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.GetAppProfileCallback} callback Node-style callback called with the error, if any, and AppProfile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.getAppProfile = function getAppProfile(request, callback) { + return this.rpcCall(getAppProfile, $root.google.bigtable.admin.v2.GetAppProfileRequest, $root.google.bigtable.admin.v2.AppProfile, request, callback); + }, "name", { value: "GetAppProfile" }); + + /** + * Calls GetAppProfile. + * @function getAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetAppProfileRequest} request GetAppProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listAppProfiles}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef ListAppProfilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListAppProfilesResponse} [response] ListAppProfilesResponse + */ + + /** + * Calls ListAppProfiles. + * @function listAppProfiles + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListAppProfilesRequest} request ListAppProfilesRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.ListAppProfilesCallback} callback Node-style callback called with the error, if any, and ListAppProfilesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.listAppProfiles = function listAppProfiles(request, callback) { + return this.rpcCall(listAppProfiles, $root.google.bigtable.admin.v2.ListAppProfilesRequest, $root.google.bigtable.admin.v2.ListAppProfilesResponse, request, callback); + }, "name", { value: "ListAppProfiles" }); + + /** + * Calls ListAppProfiles. + * @function listAppProfiles + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListAppProfilesRequest} request ListAppProfilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateAppProfile}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef UpdateAppProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateAppProfile. + * @function updateAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest} request UpdateAppProfileRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateAppProfileCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.updateAppProfile = function updateAppProfile(request, callback) { + return this.rpcCall(updateAppProfile, $root.google.bigtable.admin.v2.UpdateAppProfileRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateAppProfile" }); + + /** + * Calls UpdateAppProfile. + * @function updateAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest} request UpdateAppProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteAppProfile}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef DeleteAppProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAppProfile. + * @function deleteAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest} request DeleteAppProfileRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteAppProfileCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.deleteAppProfile = function deleteAppProfile(request, callback) { + return this.rpcCall(deleteAppProfile, $root.google.bigtable.admin.v2.DeleteAppProfileRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAppProfile" }); + + /** + * Calls DeleteAppProfile. + * @function deleteAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest} request DeleteAppProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getIamPolicy}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|setIamPolicy}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|testIamPermissions}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listHotTablets}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef ListHotTabletsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListHotTabletsResponse} [response] ListHotTabletsResponse + */ + + /** + * Calls ListHotTablets. + * @function listHotTablets + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListHotTabletsRequest} request ListHotTabletsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.ListHotTabletsCallback} callback Node-style callback called with the error, if any, and ListHotTabletsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.listHotTablets = function listHotTablets(request, callback) { + return this.rpcCall(listHotTablets, $root.google.bigtable.admin.v2.ListHotTabletsRequest, $root.google.bigtable.admin.v2.ListHotTabletsResponse, request, callback); + }, "name", { value: "ListHotTablets" }); + + /** + * Calls ListHotTablets. + * @function listHotTablets + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListHotTabletsRequest} request ListHotTabletsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createLogicalView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef CreateLogicalViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateLogicalView. + * @function createLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateLogicalViewRequest} request CreateLogicalViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.CreateLogicalViewCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.createLogicalView = function createLogicalView(request, callback) { + return this.rpcCall(createLogicalView, $root.google.bigtable.admin.v2.CreateLogicalViewRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateLogicalView" }); + + /** + * Calls CreateLogicalView. + * @function createLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateLogicalViewRequest} request CreateLogicalViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getLogicalView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef GetLogicalViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.LogicalView} [response] LogicalView + */ + + /** + * Calls GetLogicalView. + * @function getLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetLogicalViewRequest} request GetLogicalViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.GetLogicalViewCallback} callback Node-style callback called with the error, if any, and LogicalView + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.getLogicalView = function getLogicalView(request, callback) { + return this.rpcCall(getLogicalView, $root.google.bigtable.admin.v2.GetLogicalViewRequest, $root.google.bigtable.admin.v2.LogicalView, request, callback); + }, "name", { value: "GetLogicalView" }); + + /** + * Calls GetLogicalView. + * @function getLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetLogicalViewRequest} request GetLogicalViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listLogicalViews}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef ListLogicalViewsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListLogicalViewsResponse} [response] ListLogicalViewsResponse + */ + + /** + * Calls ListLogicalViews. + * @function listLogicalViews + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListLogicalViewsRequest} request ListLogicalViewsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.ListLogicalViewsCallback} callback Node-style callback called with the error, if any, and ListLogicalViewsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.listLogicalViews = function listLogicalViews(request, callback) { + return this.rpcCall(listLogicalViews, $root.google.bigtable.admin.v2.ListLogicalViewsRequest, $root.google.bigtable.admin.v2.ListLogicalViewsResponse, request, callback); + }, "name", { value: "ListLogicalViews" }); + + /** + * Calls ListLogicalViews. + * @function listLogicalViews + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListLogicalViewsRequest} request ListLogicalViewsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateLogicalView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef UpdateLogicalViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateLogicalView. + * @function updateLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateLogicalViewRequest} request UpdateLogicalViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateLogicalViewCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.updateLogicalView = function updateLogicalView(request, callback) { + return this.rpcCall(updateLogicalView, $root.google.bigtable.admin.v2.UpdateLogicalViewRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateLogicalView" }); + + /** + * Calls UpdateLogicalView. + * @function updateLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateLogicalViewRequest} request UpdateLogicalViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteLogicalView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef DeleteLogicalViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteLogicalView. + * @function deleteLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteLogicalViewRequest} request DeleteLogicalViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteLogicalViewCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.deleteLogicalView = function deleteLogicalView(request, callback) { + return this.rpcCall(deleteLogicalView, $root.google.bigtable.admin.v2.DeleteLogicalViewRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteLogicalView" }); + + /** + * Calls DeleteLogicalView. + * @function deleteLogicalView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteLogicalViewRequest} request DeleteLogicalViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|createMaterializedView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef CreateMaterializedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateMaterializedView. + * @function createMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateMaterializedViewRequest} request CreateMaterializedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.CreateMaterializedViewCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.createMaterializedView = function createMaterializedView(request, callback) { + return this.rpcCall(createMaterializedView, $root.google.bigtable.admin.v2.CreateMaterializedViewRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateMaterializedView" }); + + /** + * Calls CreateMaterializedView. + * @function createMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateMaterializedViewRequest} request CreateMaterializedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|getMaterializedView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef GetMaterializedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.MaterializedView} [response] MaterializedView + */ + + /** + * Calls GetMaterializedView. + * @function getMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetMaterializedViewRequest} request GetMaterializedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.GetMaterializedViewCallback} callback Node-style callback called with the error, if any, and MaterializedView + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.getMaterializedView = function getMaterializedView(request, callback) { + return this.rpcCall(getMaterializedView, $root.google.bigtable.admin.v2.GetMaterializedViewRequest, $root.google.bigtable.admin.v2.MaterializedView, request, callback); + }, "name", { value: "GetMaterializedView" }); + + /** + * Calls GetMaterializedView. + * @function getMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetMaterializedViewRequest} request GetMaterializedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|listMaterializedViews}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef ListMaterializedViewsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListMaterializedViewsResponse} [response] ListMaterializedViewsResponse + */ + + /** + * Calls ListMaterializedViews. + * @function listMaterializedViews + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListMaterializedViewsRequest} request ListMaterializedViewsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.ListMaterializedViewsCallback} callback Node-style callback called with the error, if any, and ListMaterializedViewsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.listMaterializedViews = function listMaterializedViews(request, callback) { + return this.rpcCall(listMaterializedViews, $root.google.bigtable.admin.v2.ListMaterializedViewsRequest, $root.google.bigtable.admin.v2.ListMaterializedViewsResponse, request, callback); + }, "name", { value: "ListMaterializedViews" }); + + /** + * Calls ListMaterializedViews. + * @function listMaterializedViews + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IListMaterializedViewsRequest} request ListMaterializedViewsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|updateMaterializedView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef UpdateMaterializedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateMaterializedView. + * @function updateMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewRequest} request UpdateMaterializedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateMaterializedViewCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.updateMaterializedView = function updateMaterializedView(request, callback) { + return this.rpcCall(updateMaterializedView, $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateMaterializedView" }); + + /** + * Calls UpdateMaterializedView. + * @function updateMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewRequest} request UpdateMaterializedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin|deleteMaterializedView}. + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @typedef DeleteMaterializedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteMaterializedView. + * @function deleteMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteMaterializedViewRequest} request DeleteMaterializedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteMaterializedViewCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableInstanceAdmin.prototype.deleteMaterializedView = function deleteMaterializedView(request, callback) { + return this.rpcCall(deleteMaterializedView, $root.google.bigtable.admin.v2.DeleteMaterializedViewRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteMaterializedView" }); + + /** + * Calls DeleteMaterializedView. + * @function deleteMaterializedView + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteMaterializedViewRequest} request DeleteMaterializedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BigtableInstanceAdmin; + })(); + + v2.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.bigtable.admin.v2.IInstance|null} [instance] CreateInstanceRequest instance + * @property {Object.|null} [clusters] CreateInstanceRequest clusters + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + this.clusters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.bigtable.admin.v2.IInstance|null|undefined} instance + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * CreateInstanceRequest clusters. + * @member {Object.} clusters + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.clusters = $util.emptyObject; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.bigtable.admin.v2.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.clusters != null && Object.hasOwnProperty.call(message, "clusters")) + for (var keys = Object.keys(message.clusters), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.admin.v2.Cluster.encode(message.clusters[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateInstanceRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.bigtable.admin.v2.Instance.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.clusters === $util.emptyObject) + message.clusters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.clusters[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.bigtable.admin.v2.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!$util.isObject(message.clusters)) + return "clusters: object expected"; + var key = Object.keys(message.clusters); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.admin.v2.Cluster.verify(message.clusters[key[i]]); + if (error) + return "clusters." + error; + } + } + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateInstanceRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.bigtable.admin.v2.Instance.fromObject(object.instance); + } + if (object.clusters) { + if (typeof object.clusters !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateInstanceRequest.clusters: object expected"); + message.clusters = {}; + for (var keys = Object.keys(object.clusters), i = 0; i < keys.length; ++i) { + if (typeof object.clusters[keys[i]] !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateInstanceRequest.clusters: object expected"); + message.clusters[keys[i]] = $root.google.bigtable.admin.v2.Cluster.fromObject(object.clusters[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.clusters = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.bigtable.admin.v2.Instance.toObject(message.instance, options); + var keys2; + if (message.clusters && (keys2 = Object.keys(message.clusters)).length) { + object.clusters = {}; + for (var j = 0; j < keys2.length; ++j) + object.clusters[keys2[j]] = $root.google.bigtable.admin.v2.Cluster.toObject(message.clusters[keys2[j]], options); + } + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v2.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetInstanceRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {google.bigtable.admin.v2.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.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 GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v2.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {string|null} [pageToken] ListInstancesRequest pageToken + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.bigtable.admin.v2.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {google.bigtable.admin.v2.IListInstancesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {google.bigtable.admin.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {google.bigtable.admin.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListInstancesRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {google.bigtable.admin.v2.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v2.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {Array.|null} [failedLocations] ListInstancesResponse failedLocations + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.bigtable.admin.v2.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + this.failedLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse failedLocations. + * @member {Array.} failedLocations + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.failedLocations = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {google.bigtable.admin.v2.IListInstancesResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {google.bigtable.admin.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.bigtable.admin.v2.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.failedLocations != null && message.failedLocations.length) + for (var i = 0; i < message.failedLocations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.failedLocations[i]); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {google.bigtable.admin.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.bigtable.admin.v2.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.failedLocations && message.failedLocations.length)) + message.failedLocations = []; + message.failedLocations.push(reader.string()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.bigtable.admin.v2.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.failedLocations != null && message.hasOwnProperty("failedLocations")) { + if (!Array.isArray(message.failedLocations)) + return "failedLocations: array expected"; + for (var i = 0; i < message.failedLocations.length; ++i) + if (!$util.isString(message.failedLocations[i])) + return "failedLocations: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListInstancesResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.bigtable.admin.v2.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.bigtable.admin.v2.Instance.fromObject(object.instances[i]); + } + } + if (object.failedLocations) { + if (!Array.isArray(object.failedLocations)) + throw TypeError(".google.bigtable.admin.v2.ListInstancesResponse.failedLocations: array expected"); + message.failedLocations = []; + for (var i = 0; i < object.failedLocations.length; ++i) + message.failedLocations[i] = String(object.failedLocations[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {google.bigtable.admin.v2.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.failedLocations = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.bigtable.admin.v2.Instance.toObject(message.instances[j], options); + } + if (message.failedLocations && message.failedLocations.length) { + object.failedLocations = []; + for (var j = 0; j < message.failedLocations.length; ++j) + object.failedLocations[j] = message.failedLocations[j]; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v2.PartialUpdateInstanceRequest = (function() { + + /** + * Properties of a PartialUpdateInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @interface IPartialUpdateInstanceRequest + * @property {google.bigtable.admin.v2.IInstance|null} [instance] PartialUpdateInstanceRequest instance + * @property {google.protobuf.IFieldMask|null} [updateMask] PartialUpdateInstanceRequest updateMask + */ + + /** + * Constructs a new PartialUpdateInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a PartialUpdateInstanceRequest. + * @implements IPartialUpdateInstanceRequest + * @constructor + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest=} [properties] Properties to set + */ + function PartialUpdateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartialUpdateInstanceRequest instance. + * @member {google.bigtable.admin.v2.IInstance|null|undefined} instance + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @instance + */ + PartialUpdateInstanceRequest.prototype.instance = null; + + /** + * PartialUpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @instance + */ + PartialUpdateInstanceRequest.prototype.updateMask = null; + + /** + * Creates a new PartialUpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.PartialUpdateInstanceRequest} PartialUpdateInstanceRequest instance + */ + PartialUpdateInstanceRequest.create = function create(properties) { + return new PartialUpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified PartialUpdateInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest} message PartialUpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialUpdateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.bigtable.admin.v2.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartialUpdateInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest} message PartialUpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialUpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartialUpdateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.PartialUpdateInstanceRequest} PartialUpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialUpdateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instance = $root.google.bigtable.admin.v2.Instance.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartialUpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.PartialUpdateInstanceRequest} PartialUpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialUpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartialUpdateInstanceRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartialUpdateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.bigtable.admin.v2.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a PartialUpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.PartialUpdateInstanceRequest} PartialUpdateInstanceRequest + */ + PartialUpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest) + return object; + var message = new $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest(); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.bigtable.admin.v2.Instance.fromObject(object.instance); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a PartialUpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {google.bigtable.admin.v2.PartialUpdateInstanceRequest} message PartialUpdateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartialUpdateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = null; + object.updateMask = null; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.bigtable.admin.v2.Instance.toObject(message.instance, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this PartialUpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + PartialUpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartialUpdateInstanceRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartialUpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.PartialUpdateInstanceRequest"; + }; + + return PartialUpdateInstanceRequest; + })(); + + v2.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteInstanceRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {google.bigtable.admin.v2.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.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 DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v2.CreateClusterRequest = (function() { + + /** + * Properties of a CreateClusterRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateClusterRequest + * @property {string|null} [parent] CreateClusterRequest parent + * @property {string|null} [clusterId] CreateClusterRequest clusterId + * @property {google.bigtable.admin.v2.ICluster|null} [cluster] CreateClusterRequest cluster + */ + + /** + * Constructs a new CreateClusterRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateClusterRequest=} [properties] Properties to set + */ + function CreateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClusterRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.parent = ""; + + /** + * CreateClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.clusterId = ""; + + /** + * CreateClusterRequest cluster. + * @member {google.bigtable.admin.v2.ICluster|null|undefined} cluster + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.cluster = null; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {google.bigtable.admin.v2.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest instance + */ + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); + }; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {google.bigtable.admin.v2.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.bigtable.admin.v2.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {google.bigtable.admin.v2.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClusterRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.bigtable.admin.v2.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + return null; + }; + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest + */ + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateClusterRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterRequest.cluster: object expected"); + message.cluster = $root.google.bigtable.admin.v2.Cluster.fromObject(object.cluster); + } + return message; + }; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {google.bigtable.admin.v2.CreateClusterRequest} message CreateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.bigtable.admin.v2.Cluster.toObject(message.cluster, options); + return object; + }; + + /** + * Converts this CreateClusterRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClusterRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateClusterRequest"; + }; + + return CreateClusterRequest; + })(); + + v2.GetClusterRequest = (function() { + + /** + * Properties of a GetClusterRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetClusterRequest + * @property {string|null} [name] GetClusterRequest name + */ + + /** + * Constructs a new GetClusterRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetClusterRequest=} [properties] Properties to set + */ + function GetClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetClusterRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.name = ""; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {google.bigtable.admin.v2.IGetClusterRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest instance + */ + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); + }; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {google.bigtable.admin.v2.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {google.bigtable.admin.v2.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetClusterRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetClusterRequest.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 GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest + */ + GetClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetClusterRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetClusterRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {google.bigtable.admin.v2.GetClusterRequest} message GetClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetClusterRequest.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 GetClusterRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @instance + * @returns {Object.} JSON object + */ + GetClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetClusterRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetClusterRequest"; + }; + + return GetClusterRequest; + })(); + + v2.ListClustersRequest = (function() { + + /** + * Properties of a ListClustersRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListClustersRequest + * @property {string|null} [parent] ListClustersRequest parent + * @property {string|null} [pageToken] ListClustersRequest pageToken + */ + + /** + * Constructs a new ListClustersRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest + * @constructor + * @param {google.bigtable.admin.v2.IListClustersRequest=} [properties] Properties to set + */ + function ListClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.parent = ""; + + /** + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageToken = ""; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {google.bigtable.admin.v2.IListClustersRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest instance + */ + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); + }; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {google.bigtable.admin.v2.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {google.bigtable.admin.v2.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListClustersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest + */ + ListClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListClustersRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListClustersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {google.bigtable.admin.v2.ListClustersRequest} message ListClustersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListClustersRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListClustersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListClustersRequest"; + }; + + return ListClustersRequest; + })(); + + v2.ListClustersResponse = (function() { + + /** + * Properties of a ListClustersResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {Array.|null} [failedLocations] ListClustersResponse failedLocations + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken + */ + + /** + * Constructs a new ListClustersResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse + * @constructor + * @param {google.bigtable.admin.v2.IListClustersResponse=} [properties] Properties to set + */ + function ListClustersResponse(properties) { + this.clusters = []; + this.failedLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.clusters = $util.emptyArray; + + /** + * ListClustersResponse failedLocations. + * @member {Array.} failedLocations + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.failedLocations = $util.emptyArray; + + /** + * ListClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {google.bigtable.admin.v2.IListClustersResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse instance + */ + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); + }; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {google.bigtable.admin.v2.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.bigtable.admin.v2.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.failedLocations != null && message.failedLocations.length) + for (var i = 0; i < message.failedLocations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.failedLocations[i]); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {google.bigtable.admin.v2.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.failedLocations && message.failedLocations.length)) + message.failedLocations = []; + message.failedLocations.push(reader.string()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.bigtable.admin.v2.Cluster.verify(message.clusters[i]); + if (error) + return "clusters." + error; + } + } + if (message.failedLocations != null && message.hasOwnProperty("failedLocations")) { + if (!Array.isArray(message.failedLocations)) + return "failedLocations: array expected"; + for (var i = 0; i < message.failedLocations.length; ++i) + if (!$util.isString(message.failedLocations[i])) + return "failedLocations: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse + */ + ListClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListClustersResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListClustersResponse(); + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.bigtable.admin.v2.ListClustersResponse.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (typeof object.clusters[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListClustersResponse.clusters: object expected"); + message.clusters[i] = $root.google.bigtable.admin.v2.Cluster.fromObject(object.clusters[i]); + } + } + if (object.failedLocations) { + if (!Array.isArray(object.failedLocations)) + throw TypeError(".google.bigtable.admin.v2.ListClustersResponse.failedLocations: array expected"); + message.failedLocations = []; + for (var i = 0; i < object.failedLocations.length; ++i) + message.failedLocations[i] = String(object.failedLocations[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {google.bigtable.admin.v2.ListClustersResponse} message ListClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clusters = []; + object.failedLocations = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.bigtable.admin.v2.Cluster.toObject(message.clusters[j], options); + } + if (message.failedLocations && message.failedLocations.length) { + object.failedLocations = []; + for (var j = 0; j < message.failedLocations.length; ++j) + object.failedLocations[j] = message.failedLocations[j]; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListClustersResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @instance + * @returns {Object.} JSON object + */ + ListClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListClustersResponse"; + }; + + return ListClustersResponse; + })(); + + v2.DeleteClusterRequest = (function() { + + /** + * Properties of a DeleteClusterRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteClusterRequest + * @property {string|null} [name] DeleteClusterRequest name + */ + + /** + * Constructs a new DeleteClusterRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteClusterRequest=} [properties] Properties to set + */ + function DeleteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteClusterRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.name = ""; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest instance + */ + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); + }; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteClusterRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteClusterRequest.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 DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest + */ + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteClusterRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {google.bigtable.admin.v2.DeleteClusterRequest} message DeleteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteClusterRequest.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 DeleteClusterRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteClusterRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteClusterRequest"; + }; + + return DeleteClusterRequest; + })(); + + v2.CreateInstanceMetadata = (function() { + + /** + * Properties of a CreateInstanceMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateInstanceMetadata + * @property {google.bigtable.admin.v2.ICreateInstanceRequest|null} [originalRequest] CreateInstanceMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] CreateInstanceMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] CreateInstanceMetadata finishTime + */ + + /** + * Constructs a new CreateInstanceMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateInstanceMetadata. + * @implements ICreateInstanceMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateInstanceMetadata=} [properties] Properties to set + */ + function CreateInstanceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateInstanceRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.originalRequest = null; + + /** + * CreateInstanceMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.requestTime = null; + + /** + * CreateInstanceMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.finishTime = null; + + /** + * Creates a new CreateInstanceMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateInstanceMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateInstanceMetadata} CreateInstanceMetadata instance + */ + CreateInstanceMetadata.create = function create(properties) { + return new CreateInstanceMetadata(properties); + }; + + /** + * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.CreateInstanceRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateInstanceMetadata} CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateInstanceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.CreateInstanceRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateInstanceMetadata} CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateInstanceRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateInstanceMetadata} CreateInstanceMetadata + */ + CreateInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateInstanceMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateInstanceMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateInstanceMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.CreateInstanceRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateInstanceMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateInstanceMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.CreateInstanceMetadata} message CreateInstanceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.CreateInstanceRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this CreateInstanceMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateInstanceMetadata"; + }; + + return CreateInstanceMetadata; + })(); + + v2.UpdateInstanceMetadata = (function() { + + /** + * Properties of an UpdateInstanceMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateInstanceMetadata + * @property {google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null} [originalRequest] UpdateInstanceMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] UpdateInstanceMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] UpdateInstanceMetadata finishTime + */ + + /** + * Constructs a new UpdateInstanceMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateInstanceMetadata. + * @implements IUpdateInstanceMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata=} [properties] Properties to set + */ + function UpdateInstanceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceMetadata originalRequest. + * @member {google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.originalRequest = null; + + /** + * UpdateInstanceMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.requestTime = null; + + /** + * UpdateInstanceMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.finishTime = null; + + /** + * Creates a new UpdateInstanceMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata instance + */ + UpdateInstanceMetadata.create = function create(properties) { + return new UpdateInstanceMetadata(properties); + }; + + /** + * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateInstanceMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateInstanceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateInstanceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata + */ + UpdateInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateInstanceMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateInstanceMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateInstanceMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateInstanceMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateInstanceMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateInstanceMetadata} message UpdateInstanceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this UpdateInstanceMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateInstanceMetadata"; + }; + + return UpdateInstanceMetadata; + })(); + + v2.CreateClusterMetadata = (function() { + + /** + * Properties of a CreateClusterMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateClusterMetadata + * @property {google.bigtable.admin.v2.ICreateClusterRequest|null} [originalRequest] CreateClusterMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] CreateClusterMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] CreateClusterMetadata finishTime + * @property {Object.|null} [tables] CreateClusterMetadata tables + */ + + /** + * Constructs a new CreateClusterMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateClusterMetadata. + * @implements ICreateClusterMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateClusterMetadata=} [properties] Properties to set + */ + function CreateClusterMetadata(properties) { + this.tables = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClusterMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateClusterRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @instance + */ + CreateClusterMetadata.prototype.originalRequest = null; + + /** + * CreateClusterMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @instance + */ + CreateClusterMetadata.prototype.requestTime = null; + + /** + * CreateClusterMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @instance + */ + CreateClusterMetadata.prototype.finishTime = null; + + /** + * CreateClusterMetadata tables. + * @member {Object.} tables + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @instance + */ + CreateClusterMetadata.prototype.tables = $util.emptyObject; + + /** + * Creates a new CreateClusterMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateClusterMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata instance + */ + CreateClusterMetadata.create = function create(properties) { + return new CreateClusterMetadata(properties); + }; + + /** + * Encodes the specified CreateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateClusterMetadata} message CreateClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.CreateClusterRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tables != null && Object.hasOwnProperty.call(message, "tables")) + for (var keys = Object.keys(message.tables), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.encode(message.tables[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CreateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateClusterMetadata} message CreateClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClusterMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateClusterMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.CreateClusterRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.tables === $util.emptyObject) + message.tables = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tables[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClusterMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClusterMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClusterMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateClusterRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + if (message.tables != null && message.hasOwnProperty("tables")) { + if (!$util.isObject(message.tables)) + return "tables: object expected"; + var key = Object.keys(message.tables); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify(message.tables[key[i]]); + if (error) + return "tables." + error; + } + } + return null; + }; + + /** + * Creates a CreateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata + */ + CreateClusterMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateClusterMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateClusterMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.CreateClusterRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + if (object.tables) { + if (typeof object.tables !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.tables: object expected"); + message.tables = {}; + for (var keys = Object.keys(object.tables), i = 0; i < keys.length; ++i) { + if (typeof object.tables[keys[i]] !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.tables: object expected"); + message.tables[keys[i]] = $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.fromObject(object.tables[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateClusterMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata} message CreateClusterMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClusterMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.tables = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.CreateClusterRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + var keys2; + if (message.tables && (keys2 = Object.keys(message.tables)).length) { + object.tables = {}; + for (var j = 0; j < keys2.length; ++j) + object.tables[keys2[j]] = $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.toObject(message.tables[keys2[j]], options); + } + return object; + }; + + /** + * Converts this CreateClusterMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateClusterMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClusterMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClusterMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateClusterMetadata"; + }; + + CreateClusterMetadata.TableProgress = (function() { + + /** + * Properties of a TableProgress. + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @interface ITableProgress + * @property {number|Long|null} [estimatedSizeBytes] TableProgress estimatedSizeBytes + * @property {number|Long|null} [estimatedCopiedBytes] TableProgress estimatedCopiedBytes + * @property {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State|null} [state] TableProgress state + */ + + /** + * Constructs a new TableProgress. + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @classdesc Represents a TableProgress. + * @implements ITableProgress + * @constructor + * @param {google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress=} [properties] Properties to set + */ + function TableProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableProgress estimatedSizeBytes. + * @member {number|Long} estimatedSizeBytes + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @instance + */ + TableProgress.prototype.estimatedSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableProgress estimatedCopiedBytes. + * @member {number|Long} estimatedCopiedBytes + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @instance + */ + TableProgress.prototype.estimatedCopiedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableProgress state. + * @member {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State} state + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @instance + */ + TableProgress.prototype.state = 0; + + /** + * Creates a new TableProgress instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} TableProgress instance + */ + TableProgress.create = function create(properties) { + return new TableProgress(properties); + }; + + /** + * Encodes the specified TableProgress message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress} message TableProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.estimatedSizeBytes != null && Object.hasOwnProperty.call(message, "estimatedSizeBytes")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.estimatedSizeBytes); + if (message.estimatedCopiedBytes != null && Object.hasOwnProperty.call(message, "estimatedCopiedBytes")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.estimatedCopiedBytes); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + return writer; + }; + + /** + * Encodes the specified TableProgress message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress} message TableProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableProgress message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} TableProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableProgress.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.estimatedSizeBytes = reader.int64(); + break; + } + case 3: { + message.estimatedCopiedBytes = reader.int64(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} TableProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableProgress message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.estimatedSizeBytes != null && message.hasOwnProperty("estimatedSizeBytes")) + if (!$util.isInteger(message.estimatedSizeBytes) && !(message.estimatedSizeBytes && $util.isInteger(message.estimatedSizeBytes.low) && $util.isInteger(message.estimatedSizeBytes.high))) + return "estimatedSizeBytes: integer|Long expected"; + if (message.estimatedCopiedBytes != null && message.hasOwnProperty("estimatedCopiedBytes")) + if (!$util.isInteger(message.estimatedCopiedBytes) && !(message.estimatedCopiedBytes && $util.isInteger(message.estimatedCopiedBytes.low) && $util.isInteger(message.estimatedCopiedBytes.high))) + return "estimatedCopiedBytes: integer|Long expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a TableProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} TableProgress + */ + TableProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) + return object; + var message = new $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress(); + if (object.estimatedSizeBytes != null) + if ($util.Long) + (message.estimatedSizeBytes = $util.Long.fromValue(object.estimatedSizeBytes)).unsigned = false; + else if (typeof object.estimatedSizeBytes === "string") + message.estimatedSizeBytes = parseInt(object.estimatedSizeBytes, 10); + else if (typeof object.estimatedSizeBytes === "number") + message.estimatedSizeBytes = object.estimatedSizeBytes; + else if (typeof object.estimatedSizeBytes === "object") + message.estimatedSizeBytes = new $util.LongBits(object.estimatedSizeBytes.low >>> 0, object.estimatedSizeBytes.high >>> 0).toNumber(); + if (object.estimatedCopiedBytes != null) + if ($util.Long) + (message.estimatedCopiedBytes = $util.Long.fromValue(object.estimatedCopiedBytes)).unsigned = false; + else if (typeof object.estimatedCopiedBytes === "string") + message.estimatedCopiedBytes = parseInt(object.estimatedCopiedBytes, 10); + else if (typeof object.estimatedCopiedBytes === "number") + message.estimatedCopiedBytes = object.estimatedCopiedBytes; + else if (typeof object.estimatedCopiedBytes === "object") + message.estimatedCopiedBytes = new $util.LongBits(object.estimatedCopiedBytes.low >>> 0, object.estimatedCopiedBytes.high >>> 0).toNumber(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "COPYING": + case 2: + message.state = 2; + break; + case "COMPLETED": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a TableProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} message TableProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableProgress.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.estimatedSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.estimatedSizeBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.estimatedCopiedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.estimatedCopiedBytes = options.longs === String ? "0" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.estimatedSizeBytes != null && message.hasOwnProperty("estimatedSizeBytes")) + if (typeof message.estimatedSizeBytes === "number") + object.estimatedSizeBytes = options.longs === String ? String(message.estimatedSizeBytes) : message.estimatedSizeBytes; + else + object.estimatedSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedSizeBytes) : options.longs === Number ? new $util.LongBits(message.estimatedSizeBytes.low >>> 0, message.estimatedSizeBytes.high >>> 0).toNumber() : message.estimatedSizeBytes; + if (message.estimatedCopiedBytes != null && message.hasOwnProperty("estimatedCopiedBytes")) + if (typeof message.estimatedCopiedBytes === "number") + object.estimatedCopiedBytes = options.longs === String ? String(message.estimatedCopiedBytes) : message.estimatedCopiedBytes; + else + object.estimatedCopiedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedCopiedBytes) : options.longs === Number ? new $util.LongBits(message.estimatedCopiedBytes.low >>> 0, message.estimatedCopiedBytes.high >>> 0).toNumber() : message.estimatedCopiedBytes; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State[message.state] === undefined ? message.state : $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State[message.state] : message.state; + return object; + }; + + /** + * Converts this TableProgress to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @instance + * @returns {Object.} JSON object + */ + TableProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableProgress + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateClusterMetadata.TableProgress"; + }; + + /** + * State enum. + * @name google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} COPYING=2 COPYING value + * @property {number} COMPLETED=3 COMPLETED value + * @property {number} CANCELLED=4 CANCELLED value + */ + TableProgress.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "COPYING"] = 2; + values[valuesById[3] = "COMPLETED"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + return values; + })(); + + return TableProgress; + })(); + + return CreateClusterMetadata; + })(); + + v2.UpdateClusterMetadata = (function() { + + /** + * Properties of an UpdateClusterMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateClusterMetadata + * @property {google.bigtable.admin.v2.ICluster|null} [originalRequest] UpdateClusterMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] UpdateClusterMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] UpdateClusterMetadata finishTime + */ + + /** + * Constructs a new UpdateClusterMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateClusterMetadata. + * @implements IUpdateClusterMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateClusterMetadata=} [properties] Properties to set + */ + function UpdateClusterMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateClusterMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICluster|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @instance + */ + UpdateClusterMetadata.prototype.originalRequest = null; + + /** + * UpdateClusterMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @instance + */ + UpdateClusterMetadata.prototype.requestTime = null; + + /** + * UpdateClusterMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @instance + */ + UpdateClusterMetadata.prototype.finishTime = null; + + /** + * Creates a new UpdateClusterMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateClusterMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata instance + */ + UpdateClusterMetadata.create = function create(properties) { + return new UpdateClusterMetadata(properties); + }; + + /** + * Encodes the specified UpdateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateClusterMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateClusterMetadata} message UpdateClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.Cluster.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateClusterMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateClusterMetadata} message UpdateClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateClusterMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateClusterMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateClusterMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateClusterMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateClusterMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.Cluster.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates an UpdateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata + */ + UpdateClusterMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateClusterMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateClusterMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateClusterMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.Cluster.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateClusterMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateClusterMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateClusterMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateClusterMetadata} message UpdateClusterMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateClusterMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.Cluster.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this UpdateClusterMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateClusterMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateClusterMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateClusterMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateClusterMetadata"; + }; + + return UpdateClusterMetadata; + })(); + + v2.PartialUpdateClusterMetadata = (function() { + + /** + * Properties of a PartialUpdateClusterMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IPartialUpdateClusterMetadata + * @property {google.protobuf.ITimestamp|null} [requestTime] PartialUpdateClusterMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] PartialUpdateClusterMetadata finishTime + * @property {google.bigtable.admin.v2.IPartialUpdateClusterRequest|null} [originalRequest] PartialUpdateClusterMetadata originalRequest + */ + + /** + * Constructs a new PartialUpdateClusterMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a PartialUpdateClusterMetadata. + * @implements IPartialUpdateClusterMetadata + * @constructor + * @param {google.bigtable.admin.v2.IPartialUpdateClusterMetadata=} [properties] Properties to set + */ + function PartialUpdateClusterMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartialUpdateClusterMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @instance + */ + PartialUpdateClusterMetadata.prototype.requestTime = null; + + /** + * PartialUpdateClusterMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @instance + */ + PartialUpdateClusterMetadata.prototype.finishTime = null; + + /** + * PartialUpdateClusterMetadata originalRequest. + * @member {google.bigtable.admin.v2.IPartialUpdateClusterRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @instance + */ + PartialUpdateClusterMetadata.prototype.originalRequest = null; + + /** + * Creates a new PartialUpdateClusterMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateClusterMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.PartialUpdateClusterMetadata} PartialUpdateClusterMetadata instance + */ + PartialUpdateClusterMetadata.create = function create(properties) { + return new PartialUpdateClusterMetadata(properties); + }; + + /** + * Encodes the specified PartialUpdateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateClusterMetadata} message PartialUpdateClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialUpdateClusterMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.PartialUpdateClusterRequest.encode(message.originalRequest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartialUpdateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateClusterMetadata} message PartialUpdateClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialUpdateClusterMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartialUpdateClusterMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.PartialUpdateClusterMetadata} PartialUpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialUpdateClusterMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.PartialUpdateClusterMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.originalRequest = $root.google.bigtable.admin.v2.PartialUpdateClusterRequest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartialUpdateClusterMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.PartialUpdateClusterMetadata} PartialUpdateClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialUpdateClusterMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartialUpdateClusterMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartialUpdateClusterMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.PartialUpdateClusterRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + return null; + }; + + /** + * Creates a PartialUpdateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.PartialUpdateClusterMetadata} PartialUpdateClusterMetadata + */ + PartialUpdateClusterMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.PartialUpdateClusterMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.PartialUpdateClusterMetadata(); + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateClusterMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateClusterMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateClusterMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.PartialUpdateClusterRequest.fromObject(object.originalRequest); + } + return message; + }; + + /** + * Creates a plain object from a PartialUpdateClusterMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {google.bigtable.admin.v2.PartialUpdateClusterMetadata} message PartialUpdateClusterMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartialUpdateClusterMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requestTime = null; + object.finishTime = null; + object.originalRequest = null; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.PartialUpdateClusterRequest.toObject(message.originalRequest, options); + return object; + }; + + /** + * Converts this PartialUpdateClusterMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @instance + * @returns {Object.} JSON object + */ + PartialUpdateClusterMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartialUpdateClusterMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.PartialUpdateClusterMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartialUpdateClusterMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.PartialUpdateClusterMetadata"; + }; + + return PartialUpdateClusterMetadata; + })(); + + v2.PartialUpdateClusterRequest = (function() { + + /** + * Properties of a PartialUpdateClusterRequest. + * @memberof google.bigtable.admin.v2 + * @interface IPartialUpdateClusterRequest + * @property {google.bigtable.admin.v2.ICluster|null} [cluster] PartialUpdateClusterRequest cluster + * @property {google.protobuf.IFieldMask|null} [updateMask] PartialUpdateClusterRequest updateMask + */ + + /** + * Constructs a new PartialUpdateClusterRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a PartialUpdateClusterRequest. + * @implements IPartialUpdateClusterRequest + * @constructor + * @param {google.bigtable.admin.v2.IPartialUpdateClusterRequest=} [properties] Properties to set + */ + function PartialUpdateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartialUpdateClusterRequest cluster. + * @member {google.bigtable.admin.v2.ICluster|null|undefined} cluster + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @instance + */ + PartialUpdateClusterRequest.prototype.cluster = null; + + /** + * PartialUpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @instance + */ + PartialUpdateClusterRequest.prototype.updateMask = null; + + /** + * Creates a new PartialUpdateClusterRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateClusterRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.PartialUpdateClusterRequest} PartialUpdateClusterRequest instance + */ + PartialUpdateClusterRequest.create = function create(properties) { + return new PartialUpdateClusterRequest(properties); + }; + + /** + * Encodes the specified PartialUpdateClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateClusterRequest} message PartialUpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialUpdateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.bigtable.admin.v2.Cluster.encode(message.cluster, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartialUpdateClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {google.bigtable.admin.v2.IPartialUpdateClusterRequest} message PartialUpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialUpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartialUpdateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.PartialUpdateClusterRequest} PartialUpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialUpdateClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.PartialUpdateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cluster = $root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartialUpdateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.PartialUpdateClusterRequest} PartialUpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialUpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartialUpdateClusterRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartialUpdateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.bigtable.admin.v2.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a PartialUpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.PartialUpdateClusterRequest} PartialUpdateClusterRequest + */ + PartialUpdateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.PartialUpdateClusterRequest) + return object; + var message = new $root.google.bigtable.admin.v2.PartialUpdateClusterRequest(); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateClusterRequest.cluster: object expected"); + message.cluster = $root.google.bigtable.admin.v2.Cluster.fromObject(object.cluster); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.PartialUpdateClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a PartialUpdateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {google.bigtable.admin.v2.PartialUpdateClusterRequest} message PartialUpdateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartialUpdateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cluster = null; + object.updateMask = null; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.bigtable.admin.v2.Cluster.toObject(message.cluster, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this PartialUpdateClusterRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + PartialUpdateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartialUpdateClusterRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.PartialUpdateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartialUpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.PartialUpdateClusterRequest"; + }; + + return PartialUpdateClusterRequest; + })(); + + v2.CreateAppProfileRequest = (function() { + + /** + * Properties of a CreateAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateAppProfileRequest + * @property {string|null} [parent] CreateAppProfileRequest parent + * @property {string|null} [appProfileId] CreateAppProfileRequest appProfileId + * @property {google.bigtable.admin.v2.IAppProfile|null} [appProfile] CreateAppProfileRequest appProfile + * @property {boolean|null} [ignoreWarnings] CreateAppProfileRequest ignoreWarnings + */ + + /** + * Constructs a new CreateAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateAppProfileRequest. + * @implements ICreateAppProfileRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest=} [properties] Properties to set + */ + function CreateAppProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAppProfileRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @instance + */ + CreateAppProfileRequest.prototype.parent = ""; + + /** + * CreateAppProfileRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @instance + */ + CreateAppProfileRequest.prototype.appProfileId = ""; + + /** + * CreateAppProfileRequest appProfile. + * @member {google.bigtable.admin.v2.IAppProfile|null|undefined} appProfile + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @instance + */ + CreateAppProfileRequest.prototype.appProfile = null; + + /** + * CreateAppProfileRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @instance + */ + CreateAppProfileRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new CreateAppProfileRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest instance + */ + CreateAppProfileRequest.create = function create(properties) { + return new CreateAppProfileRequest(properties); + }; + + /** + * Encodes the specified CreateAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateAppProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest} message CreateAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + if (message.appProfile != null && Object.hasOwnProperty.call(message, "appProfile")) + $root.google.bigtable.admin.v2.AppProfile.encode(message.appProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified CreateAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAppProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest} message CreateAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAppProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppProfileRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateAppProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + case 3: { + message.appProfile = $root.google.bigtable.admin.v2.AppProfile.decode(reader, reader.uint32()); + break; + } + case 4: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAppProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAppProfileRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAppProfileRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.appProfile != null && message.hasOwnProperty("appProfile")) { + var error = $root.google.bigtable.admin.v2.AppProfile.verify(message.appProfile); + if (error) + return "appProfile." + error; + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates a CreateAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest + */ + CreateAppProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateAppProfileRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateAppProfileRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.appProfile != null) { + if (typeof object.appProfile !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateAppProfileRequest.appProfile: object expected"); + message.appProfile = $root.google.bigtable.admin.v2.AppProfile.fromObject(object.appProfile); + } + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from a CreateAppProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.CreateAppProfileRequest} message CreateAppProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAppProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.appProfileId = ""; + object.appProfile = null; + object.ignoreWarnings = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.appProfile != null && message.hasOwnProperty("appProfile")) + object.appProfile = $root.google.bigtable.admin.v2.AppProfile.toObject(message.appProfile, options); + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this CreateAppProfileRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAppProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAppProfileRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAppProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateAppProfileRequest"; + }; + + return CreateAppProfileRequest; + })(); + + v2.GetAppProfileRequest = (function() { + + /** + * Properties of a GetAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetAppProfileRequest + * @property {string|null} [name] GetAppProfileRequest name + */ + + /** + * Constructs a new GetAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetAppProfileRequest. + * @implements IGetAppProfileRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetAppProfileRequest=} [properties] Properties to set + */ + function GetAppProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAppProfileRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @instance + */ + GetAppProfileRequest.prototype.name = ""; + + /** + * Creates a new GetAppProfileRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IGetAppProfileRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetAppProfileRequest} GetAppProfileRequest instance + */ + GetAppProfileRequest.create = function create(properties) { + return new GetAppProfileRequest(properties); + }; + + /** + * Encodes the specified GetAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetAppProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IGetAppProfileRequest} message GetAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetAppProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IGetAppProfileRequest} message GetAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAppProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetAppProfileRequest} GetAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppProfileRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetAppProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAppProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetAppProfileRequest} GetAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAppProfileRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAppProfileRequest.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 GetAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetAppProfileRequest} GetAppProfileRequest + */ + GetAppProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetAppProfileRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetAppProfileRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAppProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.GetAppProfileRequest} message GetAppProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAppProfileRequest.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 GetAppProfileRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @instance + * @returns {Object.} JSON object + */ + GetAppProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAppProfileRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAppProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetAppProfileRequest"; + }; + + return GetAppProfileRequest; + })(); + + v2.ListAppProfilesRequest = (function() { + + /** + * Properties of a ListAppProfilesRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListAppProfilesRequest + * @property {string|null} [parent] ListAppProfilesRequest parent + * @property {number|null} [pageSize] ListAppProfilesRequest pageSize + * @property {string|null} [pageToken] ListAppProfilesRequest pageToken + */ + + /** + * Constructs a new ListAppProfilesRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListAppProfilesRequest. + * @implements IListAppProfilesRequest + * @constructor + * @param {google.bigtable.admin.v2.IListAppProfilesRequest=} [properties] Properties to set + */ + function ListAppProfilesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppProfilesRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @instance + */ + ListAppProfilesRequest.prototype.parent = ""; + + /** + * ListAppProfilesRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @instance + */ + ListAppProfilesRequest.prototype.pageSize = 0; + + /** + * ListAppProfilesRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @instance + */ + ListAppProfilesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAppProfilesRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {google.bigtable.admin.v2.IListAppProfilesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest instance + */ + ListAppProfilesRequest.create = function create(properties) { + return new ListAppProfilesRequest(properties); + }; + + /** + * Encodes the specified ListAppProfilesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {google.bigtable.admin.v2.IListAppProfilesRequest} message ListAppProfilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppProfilesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListAppProfilesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {google.bigtable.admin.v2.IListAppProfilesRequest} message ListAppProfilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppProfilesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppProfilesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppProfilesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListAppProfilesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppProfilesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppProfilesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppProfilesRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppProfilesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAppProfilesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest + */ + ListAppProfilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListAppProfilesRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListAppProfilesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAppProfilesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {google.bigtable.admin.v2.ListAppProfilesRequest} message ListAppProfilesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppProfilesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListAppProfilesRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAppProfilesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppProfilesRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppProfilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListAppProfilesRequest"; + }; + + return ListAppProfilesRequest; + })(); + + v2.ListAppProfilesResponse = (function() { + + /** + * Properties of a ListAppProfilesResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListAppProfilesResponse + * @property {Array.|null} [appProfiles] ListAppProfilesResponse appProfiles + * @property {string|null} [nextPageToken] ListAppProfilesResponse nextPageToken + * @property {Array.|null} [failedLocations] ListAppProfilesResponse failedLocations + */ + + /** + * Constructs a new ListAppProfilesResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListAppProfilesResponse. + * @implements IListAppProfilesResponse + * @constructor + * @param {google.bigtable.admin.v2.IListAppProfilesResponse=} [properties] Properties to set + */ + function ListAppProfilesResponse(properties) { + this.appProfiles = []; + this.failedLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppProfilesResponse appProfiles. + * @member {Array.} appProfiles + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @instance + */ + ListAppProfilesResponse.prototype.appProfiles = $util.emptyArray; + + /** + * ListAppProfilesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @instance + */ + ListAppProfilesResponse.prototype.nextPageToken = ""; + + /** + * ListAppProfilesResponse failedLocations. + * @member {Array.} failedLocations + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @instance + */ + ListAppProfilesResponse.prototype.failedLocations = $util.emptyArray; + + /** + * Creates a new ListAppProfilesResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {google.bigtable.admin.v2.IListAppProfilesResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse instance + */ + ListAppProfilesResponse.create = function create(properties) { + return new ListAppProfilesResponse(properties); + }; + + /** + * Encodes the specified ListAppProfilesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {google.bigtable.admin.v2.IListAppProfilesResponse} message ListAppProfilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppProfilesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appProfiles != null && message.appProfiles.length) + for (var i = 0; i < message.appProfiles.length; ++i) + $root.google.bigtable.admin.v2.AppProfile.encode(message.appProfiles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.failedLocations != null && message.failedLocations.length) + for (var i = 0; i < message.failedLocations.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.failedLocations[i]); + return writer; + }; + + /** + * Encodes the specified ListAppProfilesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {google.bigtable.admin.v2.IListAppProfilesResponse} message ListAppProfilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppProfilesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppProfilesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppProfilesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListAppProfilesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.appProfiles && message.appProfiles.length)) + message.appProfiles = []; + message.appProfiles.push($root.google.bigtable.admin.v2.AppProfile.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.failedLocations && message.failedLocations.length)) + message.failedLocations = []; + message.failedLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppProfilesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppProfilesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppProfilesResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppProfilesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appProfiles != null && message.hasOwnProperty("appProfiles")) { + if (!Array.isArray(message.appProfiles)) + return "appProfiles: array expected"; + for (var i = 0; i < message.appProfiles.length; ++i) { + var error = $root.google.bigtable.admin.v2.AppProfile.verify(message.appProfiles[i]); + if (error) + return "appProfiles." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.failedLocations != null && message.hasOwnProperty("failedLocations")) { + if (!Array.isArray(message.failedLocations)) + return "failedLocations: array expected"; + for (var i = 0; i < message.failedLocations.length; ++i) + if (!$util.isString(message.failedLocations[i])) + return "failedLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a ListAppProfilesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse + */ + ListAppProfilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListAppProfilesResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListAppProfilesResponse(); + if (object.appProfiles) { + if (!Array.isArray(object.appProfiles)) + throw TypeError(".google.bigtable.admin.v2.ListAppProfilesResponse.appProfiles: array expected"); + message.appProfiles = []; + for (var i = 0; i < object.appProfiles.length; ++i) { + if (typeof object.appProfiles[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListAppProfilesResponse.appProfiles: object expected"); + message.appProfiles[i] = $root.google.bigtable.admin.v2.AppProfile.fromObject(object.appProfiles[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.failedLocations) { + if (!Array.isArray(object.failedLocations)) + throw TypeError(".google.bigtable.admin.v2.ListAppProfilesResponse.failedLocations: array expected"); + message.failedLocations = []; + for (var i = 0; i < object.failedLocations.length; ++i) + message.failedLocations[i] = String(object.failedLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListAppProfilesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {google.bigtable.admin.v2.ListAppProfilesResponse} message ListAppProfilesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppProfilesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.appProfiles = []; + object.failedLocations = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.appProfiles && message.appProfiles.length) { + object.appProfiles = []; + for (var j = 0; j < message.appProfiles.length; ++j) + object.appProfiles[j] = $root.google.bigtable.admin.v2.AppProfile.toObject(message.appProfiles[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.failedLocations && message.failedLocations.length) { + object.failedLocations = []; + for (var j = 0; j < message.failedLocations.length; ++j) + object.failedLocations[j] = message.failedLocations[j]; + } + return object; + }; + + /** + * Converts this ListAppProfilesResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @instance + * @returns {Object.} JSON object + */ + ListAppProfilesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppProfilesResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppProfilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListAppProfilesResponse"; + }; + + return ListAppProfilesResponse; + })(); + + v2.UpdateAppProfileRequest = (function() { + + /** + * Properties of an UpdateAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateAppProfileRequest + * @property {google.bigtable.admin.v2.IAppProfile|null} [appProfile] UpdateAppProfileRequest appProfile + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAppProfileRequest updateMask + * @property {boolean|null} [ignoreWarnings] UpdateAppProfileRequest ignoreWarnings + */ + + /** + * Constructs a new UpdateAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateAppProfileRequest. + * @implements IUpdateAppProfileRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest=} [properties] Properties to set + */ + function UpdateAppProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAppProfileRequest appProfile. + * @member {google.bigtable.admin.v2.IAppProfile|null|undefined} appProfile + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @instance + */ + UpdateAppProfileRequest.prototype.appProfile = null; + + /** + * UpdateAppProfileRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @instance + */ + UpdateAppProfileRequest.prototype.updateMask = null; + + /** + * UpdateAppProfileRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @instance + */ + UpdateAppProfileRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new UpdateAppProfileRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest instance + */ + UpdateAppProfileRequest.create = function create(properties) { + return new UpdateAppProfileRequest(properties); + }; + + /** + * Encodes the specified UpdateAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest} message UpdateAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appProfile != null && Object.hasOwnProperty.call(message, "appProfile")) + $root.google.bigtable.admin.v2.AppProfile.encode(message.appProfile, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified UpdateAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest} message UpdateAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAppProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppProfileRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateAppProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.appProfile = $root.google.bigtable.admin.v2.AppProfile.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAppProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAppProfileRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAppProfileRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appProfile != null && message.hasOwnProperty("appProfile")) { + var error = $root.google.bigtable.admin.v2.AppProfile.verify(message.appProfile); + if (error) + return "appProfile." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates an UpdateAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest + */ + UpdateAppProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateAppProfileRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateAppProfileRequest(); + if (object.appProfile != null) { + if (typeof object.appProfile !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAppProfileRequest.appProfile: object expected"); + message.appProfile = $root.google.bigtable.admin.v2.AppProfile.fromObject(object.appProfile); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAppProfileRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from an UpdateAppProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.UpdateAppProfileRequest} message UpdateAppProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAppProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.appProfile = null; + object.updateMask = null; + object.ignoreWarnings = false; + } + if (message.appProfile != null && message.hasOwnProperty("appProfile")) + object.appProfile = $root.google.bigtable.admin.v2.AppProfile.toObject(message.appProfile, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this UpdateAppProfileRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAppProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAppProfileRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAppProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateAppProfileRequest"; + }; + + return UpdateAppProfileRequest; + })(); + + v2.DeleteAppProfileRequest = (function() { + + /** + * Properties of a DeleteAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteAppProfileRequest + * @property {string|null} [name] DeleteAppProfileRequest name + * @property {boolean|null} [ignoreWarnings] DeleteAppProfileRequest ignoreWarnings + */ + + /** + * Constructs a new DeleteAppProfileRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteAppProfileRequest. + * @implements IDeleteAppProfileRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest=} [properties] Properties to set + */ + function DeleteAppProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAppProfileRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @instance + */ + DeleteAppProfileRequest.prototype.name = ""; + + /** + * DeleteAppProfileRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @instance + */ + DeleteAppProfileRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new DeleteAppProfileRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteAppProfileRequest} DeleteAppProfileRequest instance + */ + DeleteAppProfileRequest.create = function create(properties) { + return new DeleteAppProfileRequest(properties); + }; + + /** + * Encodes the specified DeleteAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteAppProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest} message DeleteAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified DeleteAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteAppProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest} message DeleteAppProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAppProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteAppProfileRequest} DeleteAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppProfileRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteAppProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAppProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteAppProfileRequest} DeleteAppProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAppProfileRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAppProfileRequest.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.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates a DeleteAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteAppProfileRequest} DeleteAppProfileRequest + */ + DeleteAppProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteAppProfileRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteAppProfileRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from a DeleteAppProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {google.bigtable.admin.v2.DeleteAppProfileRequest} message DeleteAppProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAppProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ignoreWarnings = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this DeleteAppProfileRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAppProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAppProfileRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAppProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteAppProfileRequest"; + }; + + return DeleteAppProfileRequest; + })(); + + v2.UpdateAppProfileMetadata = (function() { + + /** + * Properties of an UpdateAppProfileMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateAppProfileMetadata + */ + + /** + * Constructs a new UpdateAppProfileMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateAppProfileMetadata. + * @implements IUpdateAppProfileMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateAppProfileMetadata=} [properties] Properties to set + */ + function UpdateAppProfileMetadata(properties) { + if (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 UpdateAppProfileMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateAppProfileMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateAppProfileMetadata} UpdateAppProfileMetadata instance + */ + UpdateAppProfileMetadata.create = function create(properties) { + return new UpdateAppProfileMetadata(properties); + }; + + /** + * Encodes the specified UpdateAppProfileMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateAppProfileMetadata} message UpdateAppProfileMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppProfileMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateAppProfileMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateAppProfileMetadata} message UpdateAppProfileMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppProfileMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAppProfileMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateAppProfileMetadata} UpdateAppProfileMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppProfileMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateAppProfileMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAppProfileMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateAppProfileMetadata} UpdateAppProfileMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppProfileMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAppProfileMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAppProfileMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UpdateAppProfileMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateAppProfileMetadata} UpdateAppProfileMetadata + */ + UpdateAppProfileMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateAppProfileMetadata) + return object; + return new $root.google.bigtable.admin.v2.UpdateAppProfileMetadata(); + }; + + /** + * Creates a plain object from an UpdateAppProfileMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateAppProfileMetadata} message UpdateAppProfileMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAppProfileMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateAppProfileMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateAppProfileMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAppProfileMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAppProfileMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateAppProfileMetadata"; + }; + + return UpdateAppProfileMetadata; + })(); + + v2.ListHotTabletsRequest = (function() { + + /** + * Properties of a ListHotTabletsRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListHotTabletsRequest + * @property {string|null} [parent] ListHotTabletsRequest parent + * @property {google.protobuf.ITimestamp|null} [startTime] ListHotTabletsRequest startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ListHotTabletsRequest endTime + * @property {number|null} [pageSize] ListHotTabletsRequest pageSize + * @property {string|null} [pageToken] ListHotTabletsRequest pageToken + */ + + /** + * Constructs a new ListHotTabletsRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListHotTabletsRequest. + * @implements IListHotTabletsRequest + * @constructor + * @param {google.bigtable.admin.v2.IListHotTabletsRequest=} [properties] Properties to set + */ + function ListHotTabletsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListHotTabletsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @instance + */ + ListHotTabletsRequest.prototype.parent = ""; + + /** + * ListHotTabletsRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @instance + */ + ListHotTabletsRequest.prototype.startTime = null; + + /** + * ListHotTabletsRequest endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @instance + */ + ListHotTabletsRequest.prototype.endTime = null; + + /** + * ListHotTabletsRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @instance + */ + ListHotTabletsRequest.prototype.pageSize = 0; + + /** + * ListHotTabletsRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @instance + */ + ListHotTabletsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListHotTabletsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {google.bigtable.admin.v2.IListHotTabletsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListHotTabletsRequest} ListHotTabletsRequest instance + */ + ListHotTabletsRequest.create = function create(properties) { + return new ListHotTabletsRequest(properties); + }; + + /** + * Encodes the specified ListHotTabletsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {google.bigtable.admin.v2.IListHotTabletsRequest} message ListHotTabletsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHotTabletsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListHotTabletsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {google.bigtable.admin.v2.IListHotTabletsRequest} message ListHotTabletsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHotTabletsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHotTabletsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListHotTabletsRequest} ListHotTabletsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHotTabletsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListHotTabletsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListHotTabletsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListHotTabletsRequest} ListHotTabletsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHotTabletsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHotTabletsRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHotTabletsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListHotTabletsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListHotTabletsRequest} ListHotTabletsRequest + */ + ListHotTabletsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListHotTabletsRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListHotTabletsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.ListHotTabletsRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.ListHotTabletsRequest.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListHotTabletsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {google.bigtable.admin.v2.ListHotTabletsRequest} message ListHotTabletsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHotTabletsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.startTime = null; + object.endTime = null; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListHotTabletsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @instance + * @returns {Object.} JSON object + */ + ListHotTabletsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListHotTabletsRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListHotTabletsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListHotTabletsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListHotTabletsRequest"; + }; + + return ListHotTabletsRequest; + })(); + + v2.ListHotTabletsResponse = (function() { + + /** + * Properties of a ListHotTabletsResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListHotTabletsResponse + * @property {Array.|null} [hotTablets] ListHotTabletsResponse hotTablets + * @property {string|null} [nextPageToken] ListHotTabletsResponse nextPageToken + */ + + /** + * Constructs a new ListHotTabletsResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListHotTabletsResponse. + * @implements IListHotTabletsResponse + * @constructor + * @param {google.bigtable.admin.v2.IListHotTabletsResponse=} [properties] Properties to set + */ + function ListHotTabletsResponse(properties) { + this.hotTablets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListHotTabletsResponse hotTablets. + * @member {Array.} hotTablets + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @instance + */ + ListHotTabletsResponse.prototype.hotTablets = $util.emptyArray; + + /** + * ListHotTabletsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @instance + */ + ListHotTabletsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListHotTabletsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {google.bigtable.admin.v2.IListHotTabletsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListHotTabletsResponse} ListHotTabletsResponse instance + */ + ListHotTabletsResponse.create = function create(properties) { + return new ListHotTabletsResponse(properties); + }; + + /** + * Encodes the specified ListHotTabletsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {google.bigtable.admin.v2.IListHotTabletsResponse} message ListHotTabletsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHotTabletsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hotTablets != null && message.hotTablets.length) + for (var i = 0; i < message.hotTablets.length; ++i) + $root.google.bigtable.admin.v2.HotTablet.encode(message.hotTablets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListHotTabletsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListHotTabletsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {google.bigtable.admin.v2.IListHotTabletsResponse} message ListHotTabletsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHotTabletsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHotTabletsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListHotTabletsResponse} ListHotTabletsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHotTabletsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListHotTabletsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.hotTablets && message.hotTablets.length)) + message.hotTablets = []; + message.hotTablets.push($root.google.bigtable.admin.v2.HotTablet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListHotTabletsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListHotTabletsResponse} ListHotTabletsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHotTabletsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHotTabletsResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHotTabletsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hotTablets != null && message.hasOwnProperty("hotTablets")) { + if (!Array.isArray(message.hotTablets)) + return "hotTablets: array expected"; + for (var i = 0; i < message.hotTablets.length; ++i) { + var error = $root.google.bigtable.admin.v2.HotTablet.verify(message.hotTablets[i]); + if (error) + return "hotTablets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListHotTabletsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListHotTabletsResponse} ListHotTabletsResponse + */ + ListHotTabletsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListHotTabletsResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListHotTabletsResponse(); + if (object.hotTablets) { + if (!Array.isArray(object.hotTablets)) + throw TypeError(".google.bigtable.admin.v2.ListHotTabletsResponse.hotTablets: array expected"); + message.hotTablets = []; + for (var i = 0; i < object.hotTablets.length; ++i) { + if (typeof object.hotTablets[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListHotTabletsResponse.hotTablets: object expected"); + message.hotTablets[i] = $root.google.bigtable.admin.v2.HotTablet.fromObject(object.hotTablets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListHotTabletsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {google.bigtable.admin.v2.ListHotTabletsResponse} message ListHotTabletsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHotTabletsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.hotTablets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.hotTablets && message.hotTablets.length) { + object.hotTablets = []; + for (var j = 0; j < message.hotTablets.length; ++j) + object.hotTablets[j] = $root.google.bigtable.admin.v2.HotTablet.toObject(message.hotTablets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListHotTabletsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @instance + * @returns {Object.} JSON object + */ + ListHotTabletsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListHotTabletsResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListHotTabletsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListHotTabletsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListHotTabletsResponse"; + }; + + return ListHotTabletsResponse; + })(); + + v2.CreateLogicalViewRequest = (function() { + + /** + * Properties of a CreateLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateLogicalViewRequest + * @property {string|null} [parent] CreateLogicalViewRequest parent + * @property {string|null} [logicalViewId] CreateLogicalViewRequest logicalViewId + * @property {google.bigtable.admin.v2.ILogicalView|null} [logicalView] CreateLogicalViewRequest logicalView + */ + + /** + * Constructs a new CreateLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateLogicalViewRequest. + * @implements ICreateLogicalViewRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateLogicalViewRequest=} [properties] Properties to set + */ + function CreateLogicalViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateLogicalViewRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @instance + */ + CreateLogicalViewRequest.prototype.parent = ""; + + /** + * CreateLogicalViewRequest logicalViewId. + * @member {string} logicalViewId + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @instance + */ + CreateLogicalViewRequest.prototype.logicalViewId = ""; + + /** + * CreateLogicalViewRequest logicalView. + * @member {google.bigtable.admin.v2.ILogicalView|null|undefined} logicalView + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @instance + */ + CreateLogicalViewRequest.prototype.logicalView = null; + + /** + * Creates a new CreateLogicalViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateLogicalViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateLogicalViewRequest} CreateLogicalViewRequest instance + */ + CreateLogicalViewRequest.create = function create(properties) { + return new CreateLogicalViewRequest(properties); + }; + + /** + * Encodes the specified CreateLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateLogicalViewRequest} message CreateLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLogicalViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.logicalViewId != null && Object.hasOwnProperty.call(message, "logicalViewId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.logicalViewId); + if (message.logicalView != null && Object.hasOwnProperty.call(message, "logicalView")) + $root.google.bigtable.admin.v2.LogicalView.encode(message.logicalView, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateLogicalViewRequest} message CreateLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLogicalViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateLogicalViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateLogicalViewRequest} CreateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLogicalViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateLogicalViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.logicalViewId = reader.string(); + break; + } + case 3: { + message.logicalView = $root.google.bigtable.admin.v2.LogicalView.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateLogicalViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateLogicalViewRequest} CreateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLogicalViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateLogicalViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateLogicalViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.logicalViewId != null && message.hasOwnProperty("logicalViewId")) + if (!$util.isString(message.logicalViewId)) + return "logicalViewId: string expected"; + if (message.logicalView != null && message.hasOwnProperty("logicalView")) { + var error = $root.google.bigtable.admin.v2.LogicalView.verify(message.logicalView); + if (error) + return "logicalView." + error; + } + return null; + }; + + /** + * Creates a CreateLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateLogicalViewRequest} CreateLogicalViewRequest + */ + CreateLogicalViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateLogicalViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateLogicalViewRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.logicalViewId != null) + message.logicalViewId = String(object.logicalViewId); + if (object.logicalView != null) { + if (typeof object.logicalView !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateLogicalViewRequest.logicalView: object expected"); + message.logicalView = $root.google.bigtable.admin.v2.LogicalView.fromObject(object.logicalView); + } + return message; + }; + + /** + * Creates a plain object from a CreateLogicalViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.CreateLogicalViewRequest} message CreateLogicalViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateLogicalViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.logicalViewId = ""; + object.logicalView = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.logicalViewId != null && message.hasOwnProperty("logicalViewId")) + object.logicalViewId = message.logicalViewId; + if (message.logicalView != null && message.hasOwnProperty("logicalView")) + object.logicalView = $root.google.bigtable.admin.v2.LogicalView.toObject(message.logicalView, options); + return object; + }; + + /** + * Converts this CreateLogicalViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @instance + * @returns {Object.} JSON object + */ + CreateLogicalViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateLogicalViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateLogicalViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateLogicalViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateLogicalViewRequest"; + }; + + return CreateLogicalViewRequest; + })(); + + v2.CreateLogicalViewMetadata = (function() { + + /** + * Properties of a CreateLogicalViewMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateLogicalViewMetadata + * @property {google.bigtable.admin.v2.ICreateLogicalViewRequest|null} [originalRequest] CreateLogicalViewMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [startTime] CreateLogicalViewMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] CreateLogicalViewMetadata endTime + */ + + /** + * Constructs a new CreateLogicalViewMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateLogicalViewMetadata. + * @implements ICreateLogicalViewMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateLogicalViewMetadata=} [properties] Properties to set + */ + function CreateLogicalViewMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateLogicalViewMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateLogicalViewRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @instance + */ + CreateLogicalViewMetadata.prototype.originalRequest = null; + + /** + * CreateLogicalViewMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @instance + */ + CreateLogicalViewMetadata.prototype.startTime = null; + + /** + * CreateLogicalViewMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @instance + */ + CreateLogicalViewMetadata.prototype.endTime = null; + + /** + * Creates a new CreateLogicalViewMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateLogicalViewMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateLogicalViewMetadata} CreateLogicalViewMetadata instance + */ + CreateLogicalViewMetadata.create = function create(properties) { + return new CreateLogicalViewMetadata(properties); + }; + + /** + * Encodes the specified CreateLogicalViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateLogicalViewMetadata} message CreateLogicalViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLogicalViewMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.CreateLogicalViewRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateLogicalViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateLogicalViewMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateLogicalViewMetadata} message CreateLogicalViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLogicalViewMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateLogicalViewMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateLogicalViewMetadata} CreateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLogicalViewMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateLogicalViewMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.CreateLogicalViewRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateLogicalViewMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateLogicalViewMetadata} CreateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLogicalViewMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateLogicalViewMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateLogicalViewMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateLogicalViewRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a CreateLogicalViewMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateLogicalViewMetadata} CreateLogicalViewMetadata + */ + CreateLogicalViewMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateLogicalViewMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateLogicalViewMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateLogicalViewMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.CreateLogicalViewRequest.fromObject(object.originalRequest); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateLogicalViewMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateLogicalViewMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateLogicalViewMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.CreateLogicalViewMetadata} message CreateLogicalViewMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateLogicalViewMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.startTime = null; + object.endTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.CreateLogicalViewRequest.toObject(message.originalRequest, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this CreateLogicalViewMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateLogicalViewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateLogicalViewMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateLogicalViewMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateLogicalViewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateLogicalViewMetadata"; + }; + + return CreateLogicalViewMetadata; + })(); + + v2.GetLogicalViewRequest = (function() { + + /** + * Properties of a GetLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetLogicalViewRequest + * @property {string|null} [name] GetLogicalViewRequest name + */ + + /** + * Constructs a new GetLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetLogicalViewRequest. + * @implements IGetLogicalViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetLogicalViewRequest=} [properties] Properties to set + */ + function GetLogicalViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetLogicalViewRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @instance + */ + GetLogicalViewRequest.prototype.name = ""; + + /** + * Creates a new GetLogicalViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetLogicalViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetLogicalViewRequest} GetLogicalViewRequest instance + */ + GetLogicalViewRequest.create = function create(properties) { + return new GetLogicalViewRequest(properties); + }; + + /** + * Encodes the specified GetLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetLogicalViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetLogicalViewRequest} message GetLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLogicalViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetLogicalViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetLogicalViewRequest} message GetLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLogicalViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLogicalViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetLogicalViewRequest} GetLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLogicalViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetLogicalViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetLogicalViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetLogicalViewRequest} GetLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLogicalViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLogicalViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLogicalViewRequest.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 GetLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetLogicalViewRequest} GetLogicalViewRequest + */ + GetLogicalViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetLogicalViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetLogicalViewRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetLogicalViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.GetLogicalViewRequest} message GetLogicalViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLogicalViewRequest.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 GetLogicalViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @instance + * @returns {Object.} JSON object + */ + GetLogicalViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetLogicalViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetLogicalViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetLogicalViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetLogicalViewRequest"; + }; + + return GetLogicalViewRequest; + })(); + + v2.ListLogicalViewsRequest = (function() { + + /** + * Properties of a ListLogicalViewsRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListLogicalViewsRequest + * @property {string|null} [parent] ListLogicalViewsRequest parent + * @property {number|null} [pageSize] ListLogicalViewsRequest pageSize + * @property {string|null} [pageToken] ListLogicalViewsRequest pageToken + */ + + /** + * Constructs a new ListLogicalViewsRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListLogicalViewsRequest. + * @implements IListLogicalViewsRequest + * @constructor + * @param {google.bigtable.admin.v2.IListLogicalViewsRequest=} [properties] Properties to set + */ + function ListLogicalViewsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLogicalViewsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @instance + */ + ListLogicalViewsRequest.prototype.parent = ""; + + /** + * ListLogicalViewsRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @instance + */ + ListLogicalViewsRequest.prototype.pageSize = 0; + + /** + * ListLogicalViewsRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @instance + */ + ListLogicalViewsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListLogicalViewsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListLogicalViewsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListLogicalViewsRequest} ListLogicalViewsRequest instance + */ + ListLogicalViewsRequest.create = function create(properties) { + return new ListLogicalViewsRequest(properties); + }; + + /** + * Encodes the specified ListLogicalViewsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListLogicalViewsRequest} message ListLogicalViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogicalViewsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListLogicalViewsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListLogicalViewsRequest} message ListLogicalViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogicalViewsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLogicalViewsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListLogicalViewsRequest} ListLogicalViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogicalViewsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListLogicalViewsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLogicalViewsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListLogicalViewsRequest} ListLogicalViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogicalViewsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLogicalViewsRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLogicalViewsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListLogicalViewsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListLogicalViewsRequest} ListLogicalViewsRequest + */ + ListLogicalViewsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListLogicalViewsRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListLogicalViewsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListLogicalViewsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {google.bigtable.admin.v2.ListLogicalViewsRequest} message ListLogicalViewsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLogicalViewsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListLogicalViewsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @instance + * @returns {Object.} JSON object + */ + ListLogicalViewsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLogicalViewsRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListLogicalViewsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLogicalViewsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListLogicalViewsRequest"; + }; + + return ListLogicalViewsRequest; + })(); + + v2.ListLogicalViewsResponse = (function() { + + /** + * Properties of a ListLogicalViewsResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListLogicalViewsResponse + * @property {Array.|null} [logicalViews] ListLogicalViewsResponse logicalViews + * @property {string|null} [nextPageToken] ListLogicalViewsResponse nextPageToken + */ + + /** + * Constructs a new ListLogicalViewsResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListLogicalViewsResponse. + * @implements IListLogicalViewsResponse + * @constructor + * @param {google.bigtable.admin.v2.IListLogicalViewsResponse=} [properties] Properties to set + */ + function ListLogicalViewsResponse(properties) { + this.logicalViews = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLogicalViewsResponse logicalViews. + * @member {Array.} logicalViews + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @instance + */ + ListLogicalViewsResponse.prototype.logicalViews = $util.emptyArray; + + /** + * ListLogicalViewsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @instance + */ + ListLogicalViewsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListLogicalViewsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListLogicalViewsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListLogicalViewsResponse} ListLogicalViewsResponse instance + */ + ListLogicalViewsResponse.create = function create(properties) { + return new ListLogicalViewsResponse(properties); + }; + + /** + * Encodes the specified ListLogicalViewsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListLogicalViewsResponse} message ListLogicalViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogicalViewsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logicalViews != null && message.logicalViews.length) + for (var i = 0; i < message.logicalViews.length; ++i) + $root.google.bigtable.admin.v2.LogicalView.encode(message.logicalViews[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListLogicalViewsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListLogicalViewsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListLogicalViewsResponse} message ListLogicalViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogicalViewsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLogicalViewsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListLogicalViewsResponse} ListLogicalViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogicalViewsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListLogicalViewsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.logicalViews && message.logicalViews.length)) + message.logicalViews = []; + message.logicalViews.push($root.google.bigtable.admin.v2.LogicalView.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLogicalViewsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListLogicalViewsResponse} ListLogicalViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogicalViewsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLogicalViewsResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLogicalViewsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logicalViews != null && message.hasOwnProperty("logicalViews")) { + if (!Array.isArray(message.logicalViews)) + return "logicalViews: array expected"; + for (var i = 0; i < message.logicalViews.length; ++i) { + var error = $root.google.bigtable.admin.v2.LogicalView.verify(message.logicalViews[i]); + if (error) + return "logicalViews." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListLogicalViewsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListLogicalViewsResponse} ListLogicalViewsResponse + */ + ListLogicalViewsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListLogicalViewsResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListLogicalViewsResponse(); + if (object.logicalViews) { + if (!Array.isArray(object.logicalViews)) + throw TypeError(".google.bigtable.admin.v2.ListLogicalViewsResponse.logicalViews: array expected"); + message.logicalViews = []; + for (var i = 0; i < object.logicalViews.length; ++i) { + if (typeof object.logicalViews[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListLogicalViewsResponse.logicalViews: object expected"); + message.logicalViews[i] = $root.google.bigtable.admin.v2.LogicalView.fromObject(object.logicalViews[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListLogicalViewsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {google.bigtable.admin.v2.ListLogicalViewsResponse} message ListLogicalViewsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLogicalViewsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.logicalViews = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.logicalViews && message.logicalViews.length) { + object.logicalViews = []; + for (var j = 0; j < message.logicalViews.length; ++j) + object.logicalViews[j] = $root.google.bigtable.admin.v2.LogicalView.toObject(message.logicalViews[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListLogicalViewsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @instance + * @returns {Object.} JSON object + */ + ListLogicalViewsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLogicalViewsResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListLogicalViewsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLogicalViewsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListLogicalViewsResponse"; + }; + + return ListLogicalViewsResponse; + })(); + + v2.UpdateLogicalViewRequest = (function() { + + /** + * Properties of an UpdateLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateLogicalViewRequest + * @property {google.bigtable.admin.v2.ILogicalView|null} [logicalView] UpdateLogicalViewRequest logicalView + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateLogicalViewRequest updateMask + */ + + /** + * Constructs a new UpdateLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateLogicalViewRequest. + * @implements IUpdateLogicalViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateLogicalViewRequest=} [properties] Properties to set + */ + function UpdateLogicalViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateLogicalViewRequest logicalView. + * @member {google.bigtable.admin.v2.ILogicalView|null|undefined} logicalView + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @instance + */ + UpdateLogicalViewRequest.prototype.logicalView = null; + + /** + * UpdateLogicalViewRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @instance + */ + UpdateLogicalViewRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateLogicalViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateLogicalViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateLogicalViewRequest} UpdateLogicalViewRequest instance + */ + UpdateLogicalViewRequest.create = function create(properties) { + return new UpdateLogicalViewRequest(properties); + }; + + /** + * Encodes the specified UpdateLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateLogicalViewRequest} message UpdateLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateLogicalViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logicalView != null && Object.hasOwnProperty.call(message, "logicalView")) + $root.google.bigtable.admin.v2.LogicalView.encode(message.logicalView, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateLogicalViewRequest} message UpdateLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateLogicalViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateLogicalViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateLogicalViewRequest} UpdateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateLogicalViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateLogicalViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logicalView = $root.google.bigtable.admin.v2.LogicalView.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateLogicalViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateLogicalViewRequest} UpdateLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateLogicalViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateLogicalViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateLogicalViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logicalView != null && message.hasOwnProperty("logicalView")) { + var error = $root.google.bigtable.admin.v2.LogicalView.verify(message.logicalView); + if (error) + return "logicalView." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateLogicalViewRequest} UpdateLogicalViewRequest + */ + UpdateLogicalViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateLogicalViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateLogicalViewRequest(); + if (object.logicalView != null) { + if (typeof object.logicalView !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateLogicalViewRequest.logicalView: object expected"); + message.logicalView = $root.google.bigtable.admin.v2.LogicalView.fromObject(object.logicalView); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateLogicalViewRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateLogicalViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.UpdateLogicalViewRequest} message UpdateLogicalViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateLogicalViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.logicalView = null; + object.updateMask = null; + } + if (message.logicalView != null && message.hasOwnProperty("logicalView")) + object.logicalView = $root.google.bigtable.admin.v2.LogicalView.toObject(message.logicalView, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateLogicalViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateLogicalViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateLogicalViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateLogicalViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateLogicalViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateLogicalViewRequest"; + }; + + return UpdateLogicalViewRequest; + })(); + + v2.UpdateLogicalViewMetadata = (function() { + + /** + * Properties of an UpdateLogicalViewMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateLogicalViewMetadata + * @property {google.bigtable.admin.v2.IUpdateLogicalViewRequest|null} [originalRequest] UpdateLogicalViewMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateLogicalViewMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] UpdateLogicalViewMetadata endTime + */ + + /** + * Constructs a new UpdateLogicalViewMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateLogicalViewMetadata. + * @implements IUpdateLogicalViewMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateLogicalViewMetadata=} [properties] Properties to set + */ + function UpdateLogicalViewMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateLogicalViewMetadata originalRequest. + * @member {google.bigtable.admin.v2.IUpdateLogicalViewRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @instance + */ + UpdateLogicalViewMetadata.prototype.originalRequest = null; + + /** + * UpdateLogicalViewMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @instance + */ + UpdateLogicalViewMetadata.prototype.startTime = null; + + /** + * UpdateLogicalViewMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @instance + */ + UpdateLogicalViewMetadata.prototype.endTime = null; + + /** + * Creates a new UpdateLogicalViewMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateLogicalViewMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateLogicalViewMetadata} UpdateLogicalViewMetadata instance + */ + UpdateLogicalViewMetadata.create = function create(properties) { + return new UpdateLogicalViewMetadata(properties); + }; + + /** + * Encodes the specified UpdateLogicalViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateLogicalViewMetadata} message UpdateLogicalViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateLogicalViewMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.UpdateLogicalViewRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateLogicalViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateLogicalViewMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateLogicalViewMetadata} message UpdateLogicalViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateLogicalViewMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateLogicalViewMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateLogicalViewMetadata} UpdateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateLogicalViewMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateLogicalViewMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.UpdateLogicalViewRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateLogicalViewMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateLogicalViewMetadata} UpdateLogicalViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateLogicalViewMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateLogicalViewMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateLogicalViewMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.UpdateLogicalViewRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an UpdateLogicalViewMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateLogicalViewMetadata} UpdateLogicalViewMetadata + */ + UpdateLogicalViewMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateLogicalViewMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateLogicalViewMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateLogicalViewMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.UpdateLogicalViewRequest.fromObject(object.originalRequest); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateLogicalViewMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateLogicalViewMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateLogicalViewMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateLogicalViewMetadata} message UpdateLogicalViewMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateLogicalViewMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.startTime = null; + object.endTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.UpdateLogicalViewRequest.toObject(message.originalRequest, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this UpdateLogicalViewMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateLogicalViewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateLogicalViewMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateLogicalViewMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateLogicalViewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateLogicalViewMetadata"; + }; + + return UpdateLogicalViewMetadata; + })(); + + v2.DeleteLogicalViewRequest = (function() { + + /** + * Properties of a DeleteLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteLogicalViewRequest + * @property {string|null} [name] DeleteLogicalViewRequest name + * @property {string|null} [etag] DeleteLogicalViewRequest etag + */ + + /** + * Constructs a new DeleteLogicalViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteLogicalViewRequest. + * @implements IDeleteLogicalViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteLogicalViewRequest=} [properties] Properties to set + */ + function DeleteLogicalViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteLogicalViewRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @instance + */ + DeleteLogicalViewRequest.prototype.name = ""; + + /** + * DeleteLogicalViewRequest etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @instance + */ + DeleteLogicalViewRequest.prototype.etag = ""; + + /** + * Creates a new DeleteLogicalViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteLogicalViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteLogicalViewRequest} DeleteLogicalViewRequest instance + */ + DeleteLogicalViewRequest.create = function create(properties) { + return new DeleteLogicalViewRequest(properties); + }; + + /** + * Encodes the specified DeleteLogicalViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteLogicalViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteLogicalViewRequest} message DeleteLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLogicalViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteLogicalViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteLogicalViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteLogicalViewRequest} message DeleteLogicalViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLogicalViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteLogicalViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteLogicalViewRequest} DeleteLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLogicalViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteLogicalViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteLogicalViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteLogicalViewRequest} DeleteLogicalViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLogicalViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteLogicalViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteLogicalViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteLogicalViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteLogicalViewRequest} DeleteLogicalViewRequest + */ + DeleteLogicalViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteLogicalViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteLogicalViewRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteLogicalViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {google.bigtable.admin.v2.DeleteLogicalViewRequest} message DeleteLogicalViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteLogicalViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteLogicalViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteLogicalViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteLogicalViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteLogicalViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteLogicalViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteLogicalViewRequest"; + }; + + return DeleteLogicalViewRequest; + })(); + + v2.CreateMaterializedViewRequest = (function() { + + /** + * Properties of a CreateMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateMaterializedViewRequest + * @property {string|null} [parent] CreateMaterializedViewRequest parent + * @property {string|null} [materializedViewId] CreateMaterializedViewRequest materializedViewId + * @property {google.bigtable.admin.v2.IMaterializedView|null} [materializedView] CreateMaterializedViewRequest materializedView + */ + + /** + * Constructs a new CreateMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateMaterializedViewRequest. + * @implements ICreateMaterializedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateMaterializedViewRequest=} [properties] Properties to set + */ + function CreateMaterializedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMaterializedViewRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @instance + */ + CreateMaterializedViewRequest.prototype.parent = ""; + + /** + * CreateMaterializedViewRequest materializedViewId. + * @member {string} materializedViewId + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @instance + */ + CreateMaterializedViewRequest.prototype.materializedViewId = ""; + + /** + * CreateMaterializedViewRequest materializedView. + * @member {google.bigtable.admin.v2.IMaterializedView|null|undefined} materializedView + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @instance + */ + CreateMaterializedViewRequest.prototype.materializedView = null; + + /** + * Creates a new CreateMaterializedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateMaterializedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateMaterializedViewRequest} CreateMaterializedViewRequest instance + */ + CreateMaterializedViewRequest.create = function create(properties) { + return new CreateMaterializedViewRequest(properties); + }; + + /** + * Encodes the specified CreateMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateMaterializedViewRequest} message CreateMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMaterializedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.materializedViewId != null && Object.hasOwnProperty.call(message, "materializedViewId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.materializedViewId); + if (message.materializedView != null && Object.hasOwnProperty.call(message, "materializedView")) + $root.google.bigtable.admin.v2.MaterializedView.encode(message.materializedView, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateMaterializedViewRequest} message CreateMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMaterializedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMaterializedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateMaterializedViewRequest} CreateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMaterializedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateMaterializedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.materializedViewId = reader.string(); + break; + } + case 3: { + message.materializedView = $root.google.bigtable.admin.v2.MaterializedView.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateMaterializedViewRequest} CreateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMaterializedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMaterializedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMaterializedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.materializedViewId != null && message.hasOwnProperty("materializedViewId")) + if (!$util.isString(message.materializedViewId)) + return "materializedViewId: string expected"; + if (message.materializedView != null && message.hasOwnProperty("materializedView")) { + var error = $root.google.bigtable.admin.v2.MaterializedView.verify(message.materializedView); + if (error) + return "materializedView." + error; + } + return null; + }; + + /** + * Creates a CreateMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateMaterializedViewRequest} CreateMaterializedViewRequest + */ + CreateMaterializedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateMaterializedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateMaterializedViewRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.materializedViewId != null) + message.materializedViewId = String(object.materializedViewId); + if (object.materializedView != null) { + if (typeof object.materializedView !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateMaterializedViewRequest.materializedView: object expected"); + message.materializedView = $root.google.bigtable.admin.v2.MaterializedView.fromObject(object.materializedView); + } + return message; + }; + + /** + * Creates a plain object from a CreateMaterializedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.CreateMaterializedViewRequest} message CreateMaterializedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMaterializedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.materializedViewId = ""; + object.materializedView = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.materializedViewId != null && message.hasOwnProperty("materializedViewId")) + object.materializedViewId = message.materializedViewId; + if (message.materializedView != null && message.hasOwnProperty("materializedView")) + object.materializedView = $root.google.bigtable.admin.v2.MaterializedView.toObject(message.materializedView, options); + return object; + }; + + /** + * Converts this CreateMaterializedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMaterializedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMaterializedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateMaterializedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMaterializedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateMaterializedViewRequest"; + }; + + return CreateMaterializedViewRequest; + })(); + + v2.CreateMaterializedViewMetadata = (function() { + + /** + * Properties of a CreateMaterializedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateMaterializedViewMetadata + * @property {google.bigtable.admin.v2.ICreateMaterializedViewRequest|null} [originalRequest] CreateMaterializedViewMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [startTime] CreateMaterializedViewMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] CreateMaterializedViewMetadata endTime + */ + + /** + * Constructs a new CreateMaterializedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateMaterializedViewMetadata. + * @implements ICreateMaterializedViewMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateMaterializedViewMetadata=} [properties] Properties to set + */ + function CreateMaterializedViewMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMaterializedViewMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateMaterializedViewRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @instance + */ + CreateMaterializedViewMetadata.prototype.originalRequest = null; + + /** + * CreateMaterializedViewMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @instance + */ + CreateMaterializedViewMetadata.prototype.startTime = null; + + /** + * CreateMaterializedViewMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @instance + */ + CreateMaterializedViewMetadata.prototype.endTime = null; + + /** + * Creates a new CreateMaterializedViewMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateMaterializedViewMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateMaterializedViewMetadata} CreateMaterializedViewMetadata instance + */ + CreateMaterializedViewMetadata.create = function create(properties) { + return new CreateMaterializedViewMetadata(properties); + }; + + /** + * Encodes the specified CreateMaterializedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateMaterializedViewMetadata} message CreateMaterializedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMaterializedViewMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.CreateMaterializedViewRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateMaterializedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateMaterializedViewMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateMaterializedViewMetadata} message CreateMaterializedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMaterializedViewMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMaterializedViewMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateMaterializedViewMetadata} CreateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMaterializedViewMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateMaterializedViewMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.CreateMaterializedViewRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMaterializedViewMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateMaterializedViewMetadata} CreateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMaterializedViewMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMaterializedViewMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMaterializedViewMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateMaterializedViewRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a CreateMaterializedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateMaterializedViewMetadata} CreateMaterializedViewMetadata + */ + CreateMaterializedViewMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateMaterializedViewMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateMaterializedViewMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateMaterializedViewMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.CreateMaterializedViewRequest.fromObject(object.originalRequest); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateMaterializedViewMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateMaterializedViewMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateMaterializedViewMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.CreateMaterializedViewMetadata} message CreateMaterializedViewMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMaterializedViewMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.startTime = null; + object.endTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.CreateMaterializedViewRequest.toObject(message.originalRequest, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this CreateMaterializedViewMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateMaterializedViewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMaterializedViewMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateMaterializedViewMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMaterializedViewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateMaterializedViewMetadata"; + }; + + return CreateMaterializedViewMetadata; + })(); + + v2.GetMaterializedViewRequest = (function() { + + /** + * Properties of a GetMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetMaterializedViewRequest + * @property {string|null} [name] GetMaterializedViewRequest name + */ + + /** + * Constructs a new GetMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetMaterializedViewRequest. + * @implements IGetMaterializedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetMaterializedViewRequest=} [properties] Properties to set + */ + function GetMaterializedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMaterializedViewRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @instance + */ + GetMaterializedViewRequest.prototype.name = ""; + + /** + * Creates a new GetMaterializedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetMaterializedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetMaterializedViewRequest} GetMaterializedViewRequest instance + */ + GetMaterializedViewRequest.create = function create(properties) { + return new GetMaterializedViewRequest(properties); + }; + + /** + * Encodes the specified GetMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetMaterializedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetMaterializedViewRequest} message GetMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMaterializedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetMaterializedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetMaterializedViewRequest} message GetMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMaterializedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMaterializedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetMaterializedViewRequest} GetMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMaterializedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetMaterializedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetMaterializedViewRequest} GetMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMaterializedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMaterializedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMaterializedViewRequest.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 GetMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetMaterializedViewRequest} GetMaterializedViewRequest + */ + GetMaterializedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetMaterializedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetMaterializedViewRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMaterializedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.GetMaterializedViewRequest} message GetMaterializedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMaterializedViewRequest.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 GetMaterializedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @instance + * @returns {Object.} JSON object + */ + GetMaterializedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMaterializedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetMaterializedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMaterializedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetMaterializedViewRequest"; + }; + + return GetMaterializedViewRequest; + })(); + + v2.ListMaterializedViewsRequest = (function() { + + /** + * Properties of a ListMaterializedViewsRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListMaterializedViewsRequest + * @property {string|null} [parent] ListMaterializedViewsRequest parent + * @property {number|null} [pageSize] ListMaterializedViewsRequest pageSize + * @property {string|null} [pageToken] ListMaterializedViewsRequest pageToken + */ + + /** + * Constructs a new ListMaterializedViewsRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListMaterializedViewsRequest. + * @implements IListMaterializedViewsRequest + * @constructor + * @param {google.bigtable.admin.v2.IListMaterializedViewsRequest=} [properties] Properties to set + */ + function ListMaterializedViewsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMaterializedViewsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @instance + */ + ListMaterializedViewsRequest.prototype.parent = ""; + + /** + * ListMaterializedViewsRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @instance + */ + ListMaterializedViewsRequest.prototype.pageSize = 0; + + /** + * ListMaterializedViewsRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @instance + */ + ListMaterializedViewsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListMaterializedViewsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListMaterializedViewsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListMaterializedViewsRequest} ListMaterializedViewsRequest instance + */ + ListMaterializedViewsRequest.create = function create(properties) { + return new ListMaterializedViewsRequest(properties); + }; + + /** + * Encodes the specified ListMaterializedViewsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListMaterializedViewsRequest} message ListMaterializedViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMaterializedViewsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListMaterializedViewsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListMaterializedViewsRequest} message ListMaterializedViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMaterializedViewsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMaterializedViewsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListMaterializedViewsRequest} ListMaterializedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMaterializedViewsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListMaterializedViewsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMaterializedViewsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListMaterializedViewsRequest} ListMaterializedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMaterializedViewsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMaterializedViewsRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMaterializedViewsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListMaterializedViewsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListMaterializedViewsRequest} ListMaterializedViewsRequest + */ + ListMaterializedViewsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListMaterializedViewsRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListMaterializedViewsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListMaterializedViewsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {google.bigtable.admin.v2.ListMaterializedViewsRequest} message ListMaterializedViewsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMaterializedViewsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListMaterializedViewsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMaterializedViewsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMaterializedViewsRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListMaterializedViewsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMaterializedViewsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListMaterializedViewsRequest"; + }; + + return ListMaterializedViewsRequest; + })(); + + v2.ListMaterializedViewsResponse = (function() { + + /** + * Properties of a ListMaterializedViewsResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListMaterializedViewsResponse + * @property {Array.|null} [materializedViews] ListMaterializedViewsResponse materializedViews + * @property {string|null} [nextPageToken] ListMaterializedViewsResponse nextPageToken + */ + + /** + * Constructs a new ListMaterializedViewsResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListMaterializedViewsResponse. + * @implements IListMaterializedViewsResponse + * @constructor + * @param {google.bigtable.admin.v2.IListMaterializedViewsResponse=} [properties] Properties to set + */ + function ListMaterializedViewsResponse(properties) { + this.materializedViews = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMaterializedViewsResponse materializedViews. + * @member {Array.} materializedViews + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @instance + */ + ListMaterializedViewsResponse.prototype.materializedViews = $util.emptyArray; + + /** + * ListMaterializedViewsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @instance + */ + ListMaterializedViewsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMaterializedViewsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListMaterializedViewsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListMaterializedViewsResponse} ListMaterializedViewsResponse instance + */ + ListMaterializedViewsResponse.create = function create(properties) { + return new ListMaterializedViewsResponse(properties); + }; + + /** + * Encodes the specified ListMaterializedViewsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListMaterializedViewsResponse} message ListMaterializedViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMaterializedViewsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.materializedViews != null && message.materializedViews.length) + for (var i = 0; i < message.materializedViews.length; ++i) + $root.google.bigtable.admin.v2.MaterializedView.encode(message.materializedViews[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListMaterializedViewsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListMaterializedViewsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListMaterializedViewsResponse} message ListMaterializedViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMaterializedViewsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMaterializedViewsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListMaterializedViewsResponse} ListMaterializedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMaterializedViewsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListMaterializedViewsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.materializedViews && message.materializedViews.length)) + message.materializedViews = []; + message.materializedViews.push($root.google.bigtable.admin.v2.MaterializedView.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMaterializedViewsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListMaterializedViewsResponse} ListMaterializedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMaterializedViewsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMaterializedViewsResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMaterializedViewsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.materializedViews != null && message.hasOwnProperty("materializedViews")) { + if (!Array.isArray(message.materializedViews)) + return "materializedViews: array expected"; + for (var i = 0; i < message.materializedViews.length; ++i) { + var error = $root.google.bigtable.admin.v2.MaterializedView.verify(message.materializedViews[i]); + if (error) + return "materializedViews." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMaterializedViewsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListMaterializedViewsResponse} ListMaterializedViewsResponse + */ + ListMaterializedViewsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListMaterializedViewsResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListMaterializedViewsResponse(); + if (object.materializedViews) { + if (!Array.isArray(object.materializedViews)) + throw TypeError(".google.bigtable.admin.v2.ListMaterializedViewsResponse.materializedViews: array expected"); + message.materializedViews = []; + for (var i = 0; i < object.materializedViews.length; ++i) { + if (typeof object.materializedViews[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListMaterializedViewsResponse.materializedViews: object expected"); + message.materializedViews[i] = $root.google.bigtable.admin.v2.MaterializedView.fromObject(object.materializedViews[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMaterializedViewsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {google.bigtable.admin.v2.ListMaterializedViewsResponse} message ListMaterializedViewsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMaterializedViewsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.materializedViews = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.materializedViews && message.materializedViews.length) { + object.materializedViews = []; + for (var j = 0; j < message.materializedViews.length; ++j) + object.materializedViews[j] = $root.google.bigtable.admin.v2.MaterializedView.toObject(message.materializedViews[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMaterializedViewsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMaterializedViewsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMaterializedViewsResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListMaterializedViewsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMaterializedViewsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListMaterializedViewsResponse"; + }; + + return ListMaterializedViewsResponse; + })(); + + v2.UpdateMaterializedViewRequest = (function() { + + /** + * Properties of an UpdateMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateMaterializedViewRequest + * @property {google.bigtable.admin.v2.IMaterializedView|null} [materializedView] UpdateMaterializedViewRequest materializedView + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMaterializedViewRequest updateMask + */ + + /** + * Constructs a new UpdateMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateMaterializedViewRequest. + * @implements IUpdateMaterializedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewRequest=} [properties] Properties to set + */ + function UpdateMaterializedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMaterializedViewRequest materializedView. + * @member {google.bigtable.admin.v2.IMaterializedView|null|undefined} materializedView + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @instance + */ + UpdateMaterializedViewRequest.prototype.materializedView = null; + + /** + * UpdateMaterializedViewRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @instance + */ + UpdateMaterializedViewRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateMaterializedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewRequest} UpdateMaterializedViewRequest instance + */ + UpdateMaterializedViewRequest.create = function create(properties) { + return new UpdateMaterializedViewRequest(properties); + }; + + /** + * Encodes the specified UpdateMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewRequest} message UpdateMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMaterializedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.materializedView != null && Object.hasOwnProperty.call(message, "materializedView")) + $root.google.bigtable.admin.v2.MaterializedView.encode(message.materializedView, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewRequest} message UpdateMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMaterializedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMaterializedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewRequest} UpdateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMaterializedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.materializedView = $root.google.bigtable.admin.v2.MaterializedView.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewRequest} UpdateMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMaterializedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMaterializedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMaterializedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.materializedView != null && message.hasOwnProperty("materializedView")) { + var error = $root.google.bigtable.admin.v2.MaterializedView.verify(message.materializedView); + if (error) + return "materializedView." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewRequest} UpdateMaterializedViewRequest + */ + UpdateMaterializedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest(); + if (object.materializedView != null) { + if (typeof object.materializedView !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateMaterializedViewRequest.materializedView: object expected"); + message.materializedView = $root.google.bigtable.admin.v2.MaterializedView.fromObject(object.materializedView); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateMaterializedViewRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateMaterializedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.UpdateMaterializedViewRequest} message UpdateMaterializedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMaterializedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.materializedView = null; + object.updateMask = null; + } + if (message.materializedView != null && message.hasOwnProperty("materializedView")) + object.materializedView = $root.google.bigtable.admin.v2.MaterializedView.toObject(message.materializedView, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateMaterializedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMaterializedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMaterializedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMaterializedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateMaterializedViewRequest"; + }; + + return UpdateMaterializedViewRequest; + })(); + + v2.UpdateMaterializedViewMetadata = (function() { + + /** + * Properties of an UpdateMaterializedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateMaterializedViewMetadata + * @property {google.bigtable.admin.v2.IUpdateMaterializedViewRequest|null} [originalRequest] UpdateMaterializedViewMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateMaterializedViewMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] UpdateMaterializedViewMetadata endTime + */ + + /** + * Constructs a new UpdateMaterializedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateMaterializedViewMetadata. + * @implements IUpdateMaterializedViewMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewMetadata=} [properties] Properties to set + */ + function UpdateMaterializedViewMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMaterializedViewMetadata originalRequest. + * @member {google.bigtable.admin.v2.IUpdateMaterializedViewRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @instance + */ + UpdateMaterializedViewMetadata.prototype.originalRequest = null; + + /** + * UpdateMaterializedViewMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @instance + */ + UpdateMaterializedViewMetadata.prototype.startTime = null; + + /** + * UpdateMaterializedViewMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @instance + */ + UpdateMaterializedViewMetadata.prototype.endTime = null; + + /** + * Creates a new UpdateMaterializedViewMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewMetadata} UpdateMaterializedViewMetadata instance + */ + UpdateMaterializedViewMetadata.create = function create(properties) { + return new UpdateMaterializedViewMetadata(properties); + }; + + /** + * Encodes the specified UpdateMaterializedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewMetadata} message UpdateMaterializedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMaterializedViewMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateMaterializedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateMaterializedViewMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateMaterializedViewMetadata} message UpdateMaterializedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMaterializedViewMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMaterializedViewMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewMetadata} UpdateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMaterializedViewMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateMaterializedViewMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMaterializedViewMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewMetadata} UpdateMaterializedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMaterializedViewMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMaterializedViewMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMaterializedViewMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an UpdateMaterializedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateMaterializedViewMetadata} UpdateMaterializedViewMetadata + */ + UpdateMaterializedViewMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateMaterializedViewMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateMaterializedViewMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateMaterializedViewMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest.fromObject(object.originalRequest); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateMaterializedViewMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateMaterializedViewMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateMaterializedViewMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateMaterializedViewMetadata} message UpdateMaterializedViewMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMaterializedViewMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.startTime = null; + object.endTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.UpdateMaterializedViewRequest.toObject(message.originalRequest, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this UpdateMaterializedViewMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateMaterializedViewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMaterializedViewMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateMaterializedViewMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMaterializedViewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateMaterializedViewMetadata"; + }; + + return UpdateMaterializedViewMetadata; + })(); + + v2.DeleteMaterializedViewRequest = (function() { + + /** + * Properties of a DeleteMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteMaterializedViewRequest + * @property {string|null} [name] DeleteMaterializedViewRequest name + * @property {string|null} [etag] DeleteMaterializedViewRequest etag + */ + + /** + * Constructs a new DeleteMaterializedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteMaterializedViewRequest. + * @implements IDeleteMaterializedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteMaterializedViewRequest=} [properties] Properties to set + */ + function DeleteMaterializedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteMaterializedViewRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @instance + */ + DeleteMaterializedViewRequest.prototype.name = ""; + + /** + * DeleteMaterializedViewRequest etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @instance + */ + DeleteMaterializedViewRequest.prototype.etag = ""; + + /** + * Creates a new DeleteMaterializedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteMaterializedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteMaterializedViewRequest} DeleteMaterializedViewRequest instance + */ + DeleteMaterializedViewRequest.create = function create(properties) { + return new DeleteMaterializedViewRequest(properties); + }; + + /** + * Encodes the specified DeleteMaterializedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteMaterializedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteMaterializedViewRequest} message DeleteMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMaterializedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteMaterializedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteMaterializedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteMaterializedViewRequest} message DeleteMaterializedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMaterializedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteMaterializedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteMaterializedViewRequest} DeleteMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMaterializedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteMaterializedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteMaterializedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteMaterializedViewRequest} DeleteMaterializedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMaterializedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMaterializedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMaterializedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteMaterializedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteMaterializedViewRequest} DeleteMaterializedViewRequest + */ + DeleteMaterializedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteMaterializedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteMaterializedViewRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteMaterializedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {google.bigtable.admin.v2.DeleteMaterializedViewRequest} message DeleteMaterializedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMaterializedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteMaterializedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMaterializedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMaterializedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteMaterializedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMaterializedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteMaterializedViewRequest"; + }; + + return DeleteMaterializedViewRequest; + })(); + + v2.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.bigtable.admin.v2 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {google.bigtable.admin.v2.Instance.State|null} [state] Instance state + * @property {google.bigtable.admin.v2.Instance.Type|null} [type] Instance type + * @property {Object.|null} [labels] Instance labels + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Instance satisfiesPzi + * @property {Object.|null} [tags] Instance tags + */ + + /** + * Constructs a new Instance. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.bigtable.admin.v2.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.tags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance state. + * @member {google.bigtable.admin.v2.Instance.State} state + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance type. + * @member {google.bigtable.admin.v2.Instance.Type} type + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.type = 0; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance satisfiesPzs. + * @member {boolean|null|undefined} satisfiesPzs + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.satisfiesPzs = null; + + /** + * Instance satisfiesPzi. + * @member {boolean|null|undefined} satisfiesPzi + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.satisfiesPzi = null; + + /** + * Instance tags. + * @member {Object.} tags + * @memberof google.bigtable.admin.v2.Instance + * @instance + */ + Instance.prototype.tags = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Instance.prototype, "_satisfiesPzs", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Instance.prototype, "_satisfiesPzi", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {google.bigtable.admin.v2.IInstance=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.bigtable.admin.v2.Instance.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {google.bigtable.admin.v2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.satisfiesPzi); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {google.bigtable.admin.v2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.type = reader.int32(); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.satisfiesPzs = reader.bool(); + break; + } + case 11: { + message.satisfiesPzi = reader.bool(); + break; + } + case 12: { + if (message.tags === $util.emptyObject) + message.tags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tags[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + properties._satisfiesPzs = 1; + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + properties._satisfiesPzi = 1; + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!$util.isObject(message.tags)) + return "tags: object expected"; + var key = Object.keys(message.tags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.tags[key[i]])) + return "tags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Instance) + return object; + var message = new $root.google.bigtable.admin.v2.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_NOT_KNOWN": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PRODUCTION": + case 1: + message.type = 1; + break; + case "DEVELOPMENT": + case 2: + message.type = 2; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.bigtable.admin.v2.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + if (object.tags) { + if (typeof object.tags !== "object") + throw TypeError(".google.bigtable.admin.v2.Instance.tags: object expected"); + message.tags = {}; + for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) + message.tags[keys[i]] = String(object.tags[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {google.bigtable.admin.v2.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.tags = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_NOT_KNOWN" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.bigtable.admin.v2.Instance.State[message.state] === undefined ? message.state : $root.google.bigtable.admin.v2.Instance.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.bigtable.admin.v2.Instance.Type[message.type] === undefined ? message.type : $root.google.bigtable.admin.v2.Instance.Type[message.type] : message.type; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + object.satisfiesPzs = message.satisfiesPzs; + if (options.oneofs) + object._satisfiesPzs = "satisfiesPzs"; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + object.satisfiesPzi = message.satisfiesPzi; + if (options.oneofs) + object._satisfiesPzi = "satisfiesPzi"; + } + if (message.tags && (keys2 = Object.keys(message.tags)).length) { + object.tags = {}; + for (var j = 0; j < keys2.length; ++j) + object.tags[keys2[j]] = message.tags[keys2[j]]; + } + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Instance"; + }; + + /** + * State enum. + * @name google.bigtable.admin.v2.Instance.State + * @enum {number} + * @property {number} STATE_NOT_KNOWN=0 STATE_NOT_KNOWN value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_NOT_KNOWN"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + return values; + })(); + + /** + * Type enum. + * @name google.bigtable.admin.v2.Instance.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} PRODUCTION=1 PRODUCTION value + * @property {number} DEVELOPMENT=2 DEVELOPMENT value + */ + Instance.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRODUCTION"] = 1; + values[valuesById[2] = "DEVELOPMENT"] = 2; + return values; + })(); + + return Instance; + })(); + + v2.AutoscalingTargets = (function() { + + /** + * Properties of an AutoscalingTargets. + * @memberof google.bigtable.admin.v2 + * @interface IAutoscalingTargets + * @property {number|null} [cpuUtilizationPercent] AutoscalingTargets cpuUtilizationPercent + * @property {number|null} [storageUtilizationGibPerNode] AutoscalingTargets storageUtilizationGibPerNode + */ + + /** + * Constructs a new AutoscalingTargets. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an AutoscalingTargets. + * @implements IAutoscalingTargets + * @constructor + * @param {google.bigtable.admin.v2.IAutoscalingTargets=} [properties] Properties to set + */ + function AutoscalingTargets(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingTargets cpuUtilizationPercent. + * @member {number} cpuUtilizationPercent + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @instance + */ + AutoscalingTargets.prototype.cpuUtilizationPercent = 0; + + /** + * AutoscalingTargets storageUtilizationGibPerNode. + * @member {number} storageUtilizationGibPerNode + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @instance + */ + AutoscalingTargets.prototype.storageUtilizationGibPerNode = 0; + + /** + * Creates a new AutoscalingTargets instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {google.bigtable.admin.v2.IAutoscalingTargets=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AutoscalingTargets} AutoscalingTargets instance + */ + AutoscalingTargets.create = function create(properties) { + return new AutoscalingTargets(properties); + }; + + /** + * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingTargets.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {google.bigtable.admin.v2.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingTargets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "cpuUtilizationPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.cpuUtilizationPercent); + if (message.storageUtilizationGibPerNode != null && Object.hasOwnProperty.call(message, "storageUtilizationGibPerNode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.storageUtilizationGibPerNode); + return writer; + }; + + /** + * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingTargets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {google.bigtable.admin.v2.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingTargets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AutoscalingTargets} AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingTargets.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AutoscalingTargets(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.cpuUtilizationPercent = reader.int32(); + break; + } + case 3: { + message.storageUtilizationGibPerNode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AutoscalingTargets} AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingTargets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingTargets message. + * @function verify + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingTargets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuUtilizationPercent != null && message.hasOwnProperty("cpuUtilizationPercent")) + if (!$util.isInteger(message.cpuUtilizationPercent)) + return "cpuUtilizationPercent: integer expected"; + if (message.storageUtilizationGibPerNode != null && message.hasOwnProperty("storageUtilizationGibPerNode")) + if (!$util.isInteger(message.storageUtilizationGibPerNode)) + return "storageUtilizationGibPerNode: integer expected"; + return null; + }; + + /** + * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AutoscalingTargets} AutoscalingTargets + */ + AutoscalingTargets.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AutoscalingTargets) + return object; + var message = new $root.google.bigtable.admin.v2.AutoscalingTargets(); + if (object.cpuUtilizationPercent != null) + message.cpuUtilizationPercent = object.cpuUtilizationPercent | 0; + if (object.storageUtilizationGibPerNode != null) + message.storageUtilizationGibPerNode = object.storageUtilizationGibPerNode | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {google.bigtable.admin.v2.AutoscalingTargets} message AutoscalingTargets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingTargets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpuUtilizationPercent = 0; + object.storageUtilizationGibPerNode = 0; + } + if (message.cpuUtilizationPercent != null && message.hasOwnProperty("cpuUtilizationPercent")) + object.cpuUtilizationPercent = message.cpuUtilizationPercent; + if (message.storageUtilizationGibPerNode != null && message.hasOwnProperty("storageUtilizationGibPerNode")) + object.storageUtilizationGibPerNode = message.storageUtilizationGibPerNode; + return object; + }; + + /** + * Converts this AutoscalingTargets to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @instance + * @returns {Object.} JSON object + */ + AutoscalingTargets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingTargets + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AutoscalingTargets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingTargets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AutoscalingTargets"; + }; + + return AutoscalingTargets; + })(); + + v2.AutoscalingLimits = (function() { + + /** + * Properties of an AutoscalingLimits. + * @memberof google.bigtable.admin.v2 + * @interface IAutoscalingLimits + * @property {number|null} [minServeNodes] AutoscalingLimits minServeNodes + * @property {number|null} [maxServeNodes] AutoscalingLimits maxServeNodes + */ + + /** + * Constructs a new AutoscalingLimits. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an AutoscalingLimits. + * @implements IAutoscalingLimits + * @constructor + * @param {google.bigtable.admin.v2.IAutoscalingLimits=} [properties] Properties to set + */ + function AutoscalingLimits(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingLimits minServeNodes. + * @member {number} minServeNodes + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.minServeNodes = 0; + + /** + * AutoscalingLimits maxServeNodes. + * @member {number} maxServeNodes + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.maxServeNodes = 0; + + /** + * Creates a new AutoscalingLimits instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {google.bigtable.admin.v2.IAutoscalingLimits=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AutoscalingLimits} AutoscalingLimits instance + */ + AutoscalingLimits.create = function create(properties) { + return new AutoscalingLimits(properties); + }; + + /** + * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingLimits.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {google.bigtable.admin.v2.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingLimits.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minServeNodes != null && Object.hasOwnProperty.call(message, "minServeNodes")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minServeNodes); + if (message.maxServeNodes != null && Object.hasOwnProperty.call(message, "maxServeNodes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxServeNodes); + return writer; + }; + + /** + * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AutoscalingLimits.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {google.bigtable.admin.v2.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingLimits.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AutoscalingLimits} AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingLimits.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AutoscalingLimits(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minServeNodes = reader.int32(); + break; + } + case 2: { + message.maxServeNodes = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AutoscalingLimits} AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingLimits.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingLimits message. + * @function verify + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingLimits.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minServeNodes != null && message.hasOwnProperty("minServeNodes")) + if (!$util.isInteger(message.minServeNodes)) + return "minServeNodes: integer expected"; + if (message.maxServeNodes != null && message.hasOwnProperty("maxServeNodes")) + if (!$util.isInteger(message.maxServeNodes)) + return "maxServeNodes: integer expected"; + return null; + }; + + /** + * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AutoscalingLimits} AutoscalingLimits + */ + AutoscalingLimits.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AutoscalingLimits) + return object; + var message = new $root.google.bigtable.admin.v2.AutoscalingLimits(); + if (object.minServeNodes != null) + message.minServeNodes = object.minServeNodes | 0; + if (object.maxServeNodes != null) + message.maxServeNodes = object.maxServeNodes | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {google.bigtable.admin.v2.AutoscalingLimits} message AutoscalingLimits + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingLimits.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minServeNodes = 0; + object.maxServeNodes = 0; + } + if (message.minServeNodes != null && message.hasOwnProperty("minServeNodes")) + object.minServeNodes = message.minServeNodes; + if (message.maxServeNodes != null && message.hasOwnProperty("maxServeNodes")) + object.maxServeNodes = message.maxServeNodes; + return object; + }; + + /** + * Converts this AutoscalingLimits to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @instance + * @returns {Object.} JSON object + */ + AutoscalingLimits.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingLimits + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AutoscalingLimits + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingLimits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AutoscalingLimits"; + }; + + return AutoscalingLimits; + })(); + + v2.Cluster = (function() { + + /** + * Properties of a Cluster. + * @memberof google.bigtable.admin.v2 + * @interface ICluster + * @property {string|null} [name] Cluster name + * @property {string|null} [location] Cluster location + * @property {google.bigtable.admin.v2.Cluster.State|null} [state] Cluster state + * @property {number|null} [serveNodes] Cluster serveNodes + * @property {google.bigtable.admin.v2.Cluster.NodeScalingFactor|null} [nodeScalingFactor] Cluster nodeScalingFactor + * @property {google.bigtable.admin.v2.Cluster.IClusterConfig|null} [clusterConfig] Cluster clusterConfig + * @property {google.bigtable.admin.v2.StorageType|null} [defaultStorageType] Cluster defaultStorageType + * @property {google.bigtable.admin.v2.Cluster.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig + */ + + /** + * Constructs a new Cluster. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.bigtable.admin.v2.ICluster=} [properties] Properties to set + */ + function Cluster(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cluster name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.name = ""; + + /** + * Cluster location. + * @member {string} location + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.location = ""; + + /** + * Cluster state. + * @member {google.bigtable.admin.v2.Cluster.State} state + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.state = 0; + + /** + * Cluster serveNodes. + * @member {number} serveNodes + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.serveNodes = 0; + + /** + * Cluster nodeScalingFactor. + * @member {google.bigtable.admin.v2.Cluster.NodeScalingFactor} nodeScalingFactor + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.nodeScalingFactor = 0; + + /** + * Cluster clusterConfig. + * @member {google.bigtable.admin.v2.Cluster.IClusterConfig|null|undefined} clusterConfig + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.clusterConfig = null; + + /** + * Cluster defaultStorageType. + * @member {google.bigtable.admin.v2.StorageType} defaultStorageType + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.defaultStorageType = 0; + + /** + * Cluster encryptionConfig. + * @member {google.bigtable.admin.v2.Cluster.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.encryptionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Cluster config. + * @member {"clusterConfig"|undefined} config + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Object.defineProperty(Cluster.prototype, "config", { + get: $util.oneOfGetter($oneOfFields = ["clusterConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {google.bigtable.admin.v2.ICluster=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Cluster} Cluster instance + */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {google.bigtable.admin.v2.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.serveNodes != null && Object.hasOwnProperty.call(message, "serveNodes")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.serveNodes); + if (message.defaultStorageType != null && Object.hasOwnProperty.call(message, "defaultStorageType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.defaultStorageType); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.bigtable.admin.v2.Cluster.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.clusterConfig != null && Object.hasOwnProperty.call(message, "clusterConfig")) + $root.google.bigtable.admin.v2.Cluster.ClusterConfig.encode(message.clusterConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.nodeScalingFactor != null && Object.hasOwnProperty.call(message, "nodeScalingFactor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.nodeScalingFactor); + return writer; + }; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {google.bigtable.admin.v2.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Cluster(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.serveNodes = reader.int32(); + break; + } + case 9: { + message.nodeScalingFactor = reader.int32(); + break; + } + case 7: { + message.clusterConfig = $root.google.bigtable.admin.v2.Cluster.ClusterConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.defaultStorageType = reader.int32(); + break; + } + case 6: { + message.encryptionConfig = $root.google.bigtable.admin.v2.Cluster.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cluster message. + * @function verify + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cluster.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.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.serveNodes != null && message.hasOwnProperty("serveNodes")) + if (!$util.isInteger(message.serveNodes)) + return "serveNodes: integer expected"; + if (message.nodeScalingFactor != null && message.hasOwnProperty("nodeScalingFactor")) + switch (message.nodeScalingFactor) { + default: + return "nodeScalingFactor: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.clusterConfig != null && message.hasOwnProperty("clusterConfig")) { + properties.config = 1; + { + var error = $root.google.bigtable.admin.v2.Cluster.ClusterConfig.verify(message.clusterConfig); + if (error) + return "clusterConfig." + error; + } + } + if (message.defaultStorageType != null && message.hasOwnProperty("defaultStorageType")) + switch (message.defaultStorageType) { + default: + return "defaultStorageType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.bigtable.admin.v2.Cluster.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Cluster} Cluster + */ + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Cluster) + return object; + var message = new $root.google.bigtable.admin.v2.Cluster(); + if (object.name != null) + message.name = String(object.name); + if (object.location != null) + message.location = String(object.location); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_NOT_KNOWN": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "RESIZING": + case 3: + message.state = 3; + break; + case "DISABLED": + case 4: + message.state = 4; + break; + } + if (object.serveNodes != null) + message.serveNodes = object.serveNodes | 0; + switch (object.nodeScalingFactor) { + default: + if (typeof object.nodeScalingFactor === "number") { + message.nodeScalingFactor = object.nodeScalingFactor; + break; + } + break; + case "NODE_SCALING_FACTOR_UNSPECIFIED": + case 0: + message.nodeScalingFactor = 0; + break; + case "NODE_SCALING_FACTOR_1X": + case 1: + message.nodeScalingFactor = 1; + break; + case "NODE_SCALING_FACTOR_2X": + case 2: + message.nodeScalingFactor = 2; + break; + } + if (object.clusterConfig != null) { + if (typeof object.clusterConfig !== "object") + throw TypeError(".google.bigtable.admin.v2.Cluster.clusterConfig: object expected"); + message.clusterConfig = $root.google.bigtable.admin.v2.Cluster.ClusterConfig.fromObject(object.clusterConfig); + } + switch (object.defaultStorageType) { + default: + if (typeof object.defaultStorageType === "number") { + message.defaultStorageType = object.defaultStorageType; + break; + } + break; + case "STORAGE_TYPE_UNSPECIFIED": + case 0: + message.defaultStorageType = 0; + break; + case "SSD": + case 1: + message.defaultStorageType = 1; + break; + case "HDD": + case 2: + message.defaultStorageType = 2; + break; + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.bigtable.admin.v2.Cluster.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.bigtable.admin.v2.Cluster.EncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {google.bigtable.admin.v2.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.location = ""; + object.state = options.enums === String ? "STATE_NOT_KNOWN" : 0; + object.serveNodes = 0; + object.defaultStorageType = options.enums === String ? "STORAGE_TYPE_UNSPECIFIED" : 0; + object.encryptionConfig = null; + object.nodeScalingFactor = options.enums === String ? "NODE_SCALING_FACTOR_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.bigtable.admin.v2.Cluster.State[message.state] === undefined ? message.state : $root.google.bigtable.admin.v2.Cluster.State[message.state] : message.state; + if (message.serveNodes != null && message.hasOwnProperty("serveNodes")) + object.serveNodes = message.serveNodes; + if (message.defaultStorageType != null && message.hasOwnProperty("defaultStorageType")) + object.defaultStorageType = options.enums === String ? $root.google.bigtable.admin.v2.StorageType[message.defaultStorageType] === undefined ? message.defaultStorageType : $root.google.bigtable.admin.v2.StorageType[message.defaultStorageType] : message.defaultStorageType; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.bigtable.admin.v2.Cluster.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.clusterConfig != null && message.hasOwnProperty("clusterConfig")) { + object.clusterConfig = $root.google.bigtable.admin.v2.Cluster.ClusterConfig.toObject(message.clusterConfig, options); + if (options.oneofs) + object.config = "clusterConfig"; + } + if (message.nodeScalingFactor != null && message.hasOwnProperty("nodeScalingFactor")) + object.nodeScalingFactor = options.enums === String ? $root.google.bigtable.admin.v2.Cluster.NodeScalingFactor[message.nodeScalingFactor] === undefined ? message.nodeScalingFactor : $root.google.bigtable.admin.v2.Cluster.NodeScalingFactor[message.nodeScalingFactor] : message.nodeScalingFactor; + return object; + }; + + /** + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Cluster + * @instance + * @returns {Object.} JSON object + */ + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Cluster"; + }; + + /** + * State enum. + * @name google.bigtable.admin.v2.Cluster.State + * @enum {number} + * @property {number} STATE_NOT_KNOWN=0 STATE_NOT_KNOWN value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + * @property {number} RESIZING=3 RESIZING value + * @property {number} DISABLED=4 DISABLED value + */ + Cluster.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_NOT_KNOWN"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "RESIZING"] = 3; + values[valuesById[4] = "DISABLED"] = 4; + return values; + })(); + + /** + * NodeScalingFactor enum. + * @name google.bigtable.admin.v2.Cluster.NodeScalingFactor + * @enum {number} + * @property {number} NODE_SCALING_FACTOR_UNSPECIFIED=0 NODE_SCALING_FACTOR_UNSPECIFIED value + * @property {number} NODE_SCALING_FACTOR_1X=1 NODE_SCALING_FACTOR_1X value + * @property {number} NODE_SCALING_FACTOR_2X=2 NODE_SCALING_FACTOR_2X value + */ + Cluster.NodeScalingFactor = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NODE_SCALING_FACTOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "NODE_SCALING_FACTOR_1X"] = 1; + values[valuesById[2] = "NODE_SCALING_FACTOR_2X"] = 2; + return values; + })(); + + Cluster.ClusterAutoscalingConfig = (function() { + + /** + * Properties of a ClusterAutoscalingConfig. + * @memberof google.bigtable.admin.v2.Cluster + * @interface IClusterAutoscalingConfig + * @property {google.bigtable.admin.v2.IAutoscalingLimits|null} [autoscalingLimits] ClusterAutoscalingConfig autoscalingLimits + * @property {google.bigtable.admin.v2.IAutoscalingTargets|null} [autoscalingTargets] ClusterAutoscalingConfig autoscalingTargets + */ + + /** + * Constructs a new ClusterAutoscalingConfig. + * @memberof google.bigtable.admin.v2.Cluster + * @classdesc Represents a ClusterAutoscalingConfig. + * @implements IClusterAutoscalingConfig + * @constructor + * @param {google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig=} [properties] Properties to set + */ + function ClusterAutoscalingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterAutoscalingConfig autoscalingLimits. + * @member {google.bigtable.admin.v2.IAutoscalingLimits|null|undefined} autoscalingLimits + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @instance + */ + ClusterAutoscalingConfig.prototype.autoscalingLimits = null; + + /** + * ClusterAutoscalingConfig autoscalingTargets. + * @member {google.bigtable.admin.v2.IAutoscalingTargets|null|undefined} autoscalingTargets + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @instance + */ + ClusterAutoscalingConfig.prototype.autoscalingTargets = null; + + /** + * Creates a new ClusterAutoscalingConfig instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} ClusterAutoscalingConfig instance + */ + ClusterAutoscalingConfig.create = function create(properties) { + return new ClusterAutoscalingConfig(properties); + }; + + /** + * Encodes the specified ClusterAutoscalingConfig message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig} message ClusterAutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterAutoscalingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) + $root.google.bigtable.admin.v2.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoscalingTargets != null && Object.hasOwnProperty.call(message, "autoscalingTargets")) + $root.google.bigtable.admin.v2.AutoscalingTargets.encode(message.autoscalingTargets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterAutoscalingConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig} message ClusterAutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterAutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterAutoscalingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} ClusterAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterAutoscalingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.autoscalingLimits = $root.google.bigtable.admin.v2.AutoscalingLimits.decode(reader, reader.uint32()); + break; + } + case 2: { + message.autoscalingTargets = $root.google.bigtable.admin.v2.AutoscalingTargets.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterAutoscalingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} ClusterAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterAutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterAutoscalingConfig message. + * @function verify + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterAutoscalingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { + var error = $root.google.bigtable.admin.v2.AutoscalingLimits.verify(message.autoscalingLimits); + if (error) + return "autoscalingLimits." + error; + } + if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) { + var error = $root.google.bigtable.admin.v2.AutoscalingTargets.verify(message.autoscalingTargets); + if (error) + return "autoscalingTargets." + error; + } + return null; + }; + + /** + * Creates a ClusterAutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} ClusterAutoscalingConfig + */ + ClusterAutoscalingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig) + return object; + var message = new $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig(); + if (object.autoscalingLimits != null) { + if (typeof object.autoscalingLimits !== "object") + throw TypeError(".google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.autoscalingLimits: object expected"); + message.autoscalingLimits = $root.google.bigtable.admin.v2.AutoscalingLimits.fromObject(object.autoscalingLimits); + } + if (object.autoscalingTargets != null) { + if (typeof object.autoscalingTargets !== "object") + throw TypeError(".google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.autoscalingTargets: object expected"); + message.autoscalingTargets = $root.google.bigtable.admin.v2.AutoscalingTargets.fromObject(object.autoscalingTargets); + } + return message; + }; + + /** + * Creates a plain object from a ClusterAutoscalingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} message ClusterAutoscalingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterAutoscalingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.autoscalingLimits = null; + object.autoscalingTargets = null; + } + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) + object.autoscalingLimits = $root.google.bigtable.admin.v2.AutoscalingLimits.toObject(message.autoscalingLimits, options); + if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) + object.autoscalingTargets = $root.google.bigtable.admin.v2.AutoscalingTargets.toObject(message.autoscalingTargets, options); + return object; + }; + + /** + * Converts this ClusterAutoscalingConfig to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @instance + * @returns {Object.} JSON object + */ + ClusterAutoscalingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterAutoscalingConfig + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterAutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig"; + }; + + return ClusterAutoscalingConfig; + })(); + + Cluster.ClusterConfig = (function() { + + /** + * Properties of a ClusterConfig. + * @memberof google.bigtable.admin.v2.Cluster + * @interface IClusterConfig + * @property {google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig|null} [clusterAutoscalingConfig] ClusterConfig clusterAutoscalingConfig + */ + + /** + * Constructs a new ClusterConfig. + * @memberof google.bigtable.admin.v2.Cluster + * @classdesc Represents a ClusterConfig. + * @implements IClusterConfig + * @constructor + * @param {google.bigtable.admin.v2.Cluster.IClusterConfig=} [properties] Properties to set + */ + function ClusterConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterConfig clusterAutoscalingConfig. + * @member {google.bigtable.admin.v2.Cluster.IClusterAutoscalingConfig|null|undefined} clusterAutoscalingConfig + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @instance + */ + ClusterConfig.prototype.clusterAutoscalingConfig = null; + + /** + * Creates a new ClusterConfig instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IClusterConfig=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Cluster.ClusterConfig} ClusterConfig instance + */ + ClusterConfig.create = function create(properties) { + return new ClusterConfig(properties); + }; + + /** + * Encodes the specified ClusterConfig message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterConfig.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IClusterConfig} message ClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterAutoscalingConfig != null && Object.hasOwnProperty.call(message, "clusterAutoscalingConfig")) + $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.encode(message.clusterAutoscalingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.ClusterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IClusterConfig} message ClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Cluster.ClusterConfig} ClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Cluster.ClusterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clusterAutoscalingConfig = $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Cluster.ClusterConfig} ClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterConfig message. + * @function verify + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterAutoscalingConfig != null && message.hasOwnProperty("clusterAutoscalingConfig")) { + var error = $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.verify(message.clusterAutoscalingConfig); + if (error) + return "clusterAutoscalingConfig." + error; + } + return null; + }; + + /** + * Creates a ClusterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Cluster.ClusterConfig} ClusterConfig + */ + ClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Cluster.ClusterConfig) + return object; + var message = new $root.google.bigtable.admin.v2.Cluster.ClusterConfig(); + if (object.clusterAutoscalingConfig != null) { + if (typeof object.clusterAutoscalingConfig !== "object") + throw TypeError(".google.bigtable.admin.v2.Cluster.ClusterConfig.clusterAutoscalingConfig: object expected"); + message.clusterAutoscalingConfig = $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.fromObject(object.clusterAutoscalingConfig); + } + return message; + }; + + /** + * Creates a plain object from a ClusterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.ClusterConfig} message ClusterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.clusterAutoscalingConfig = null; + if (message.clusterAutoscalingConfig != null && message.hasOwnProperty("clusterAutoscalingConfig")) + object.clusterAutoscalingConfig = $root.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.toObject(message.clusterAutoscalingConfig, options); + return object; + }; + + /** + * Converts this ClusterConfig to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @instance + * @returns {Object.} JSON object + */ + ClusterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterConfig + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Cluster.ClusterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Cluster.ClusterConfig"; + }; + + return ClusterConfig; + })(); + + Cluster.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.bigtable.admin.v2.Cluster + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.bigtable.admin.v2.Cluster + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.bigtable.admin.v2.Cluster.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IEncryptionConfig=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Cluster.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Cluster.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Cluster.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Cluster.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Cluster.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + return null; + }; + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Cluster.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Cluster.EncryptionConfig) + return object; + var message = new $root.google.bigtable.admin.v2.Cluster.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + return message; + }; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {google.bigtable.admin.v2.Cluster.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + return object; + }; + + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Cluster.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Cluster.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + return Cluster; + })(); + + v2.AppProfile = (function() { + + /** + * Properties of an AppProfile. + * @memberof google.bigtable.admin.v2 + * @interface IAppProfile + * @property {string|null} [name] AppProfile name + * @property {string|null} [etag] AppProfile etag + * @property {string|null} [description] AppProfile description + * @property {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny|null} [multiClusterRoutingUseAny] AppProfile multiClusterRoutingUseAny + * @property {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting|null} [singleClusterRouting] AppProfile singleClusterRouting + * @property {google.bigtable.admin.v2.AppProfile.Priority|null} [priority] AppProfile priority + * @property {google.bigtable.admin.v2.AppProfile.IStandardIsolation|null} [standardIsolation] AppProfile standardIsolation + * @property {google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly|null} [dataBoostIsolationReadOnly] AppProfile dataBoostIsolationReadOnly + */ + + /** + * Constructs a new AppProfile. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an AppProfile. + * @implements IAppProfile + * @constructor + * @param {google.bigtable.admin.v2.IAppProfile=} [properties] Properties to set + */ + function AppProfile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppProfile name. + * @member {string} name + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.name = ""; + + /** + * AppProfile etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.etag = ""; + + /** + * AppProfile description. + * @member {string} description + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.description = ""; + + /** + * AppProfile multiClusterRoutingUseAny. + * @member {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny|null|undefined} multiClusterRoutingUseAny + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.multiClusterRoutingUseAny = null; + + /** + * AppProfile singleClusterRouting. + * @member {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting|null|undefined} singleClusterRouting + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.singleClusterRouting = null; + + /** + * AppProfile priority. + * @member {google.bigtable.admin.v2.AppProfile.Priority|null|undefined} priority + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.priority = null; + + /** + * AppProfile standardIsolation. + * @member {google.bigtable.admin.v2.AppProfile.IStandardIsolation|null|undefined} standardIsolation + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.standardIsolation = null; + + /** + * AppProfile dataBoostIsolationReadOnly. + * @member {google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly|null|undefined} dataBoostIsolationReadOnly + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + AppProfile.prototype.dataBoostIsolationReadOnly = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AppProfile routingPolicy. + * @member {"multiClusterRoutingUseAny"|"singleClusterRouting"|undefined} routingPolicy + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + Object.defineProperty(AppProfile.prototype, "routingPolicy", { + get: $util.oneOfGetter($oneOfFields = ["multiClusterRoutingUseAny", "singleClusterRouting"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AppProfile isolation. + * @member {"priority"|"standardIsolation"|"dataBoostIsolationReadOnly"|undefined} isolation + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + */ + Object.defineProperty(AppProfile.prototype, "isolation", { + get: $util.oneOfGetter($oneOfFields = ["priority", "standardIsolation", "dataBoostIsolationReadOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AppProfile instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {google.bigtable.admin.v2.IAppProfile=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile} AppProfile instance + */ + AppProfile.create = function create(properties) { + return new AppProfile(properties); + }; + + /** + * Encodes the specified AppProfile message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {google.bigtable.admin.v2.IAppProfile} message AppProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.multiClusterRoutingUseAny != null && Object.hasOwnProperty.call(message, "multiClusterRoutingUseAny")) + $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.encode(message.multiClusterRoutingUseAny, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.singleClusterRouting != null && Object.hasOwnProperty.call(message, "singleClusterRouting")) + $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.encode(message.singleClusterRouting, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.priority); + if (message.dataBoostIsolationReadOnly != null && Object.hasOwnProperty.call(message, "dataBoostIsolationReadOnly")) + $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.encode(message.dataBoostIsolationReadOnly, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.standardIsolation != null && Object.hasOwnProperty.call(message, "standardIsolation")) + $root.google.bigtable.admin.v2.AppProfile.StandardIsolation.encode(message.standardIsolation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppProfile message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {google.bigtable.admin.v2.IAppProfile} message AppProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppProfile message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile} AppProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppProfile.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 5: { + message.multiClusterRoutingUseAny = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.decode(reader, reader.uint32()); + break; + } + case 6: { + message.singleClusterRouting = $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.decode(reader, reader.uint32()); + break; + } + case 7: { + message.priority = reader.int32(); + break; + } + case 11: { + message.standardIsolation = $root.google.bigtable.admin.v2.AppProfile.StandardIsolation.decode(reader, reader.uint32()); + break; + } + case 10: { + message.dataBoostIsolationReadOnly = $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile} AppProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppProfile message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppProfile.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.multiClusterRoutingUseAny != null && message.hasOwnProperty("multiClusterRoutingUseAny")) { + properties.routingPolicy = 1; + { + var error = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.verify(message.multiClusterRoutingUseAny); + if (error) + return "multiClusterRoutingUseAny." + error; + } + } + if (message.singleClusterRouting != null && message.hasOwnProperty("singleClusterRouting")) { + if (properties.routingPolicy === 1) + return "routingPolicy: multiple values"; + properties.routingPolicy = 1; + { + var error = $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.verify(message.singleClusterRouting); + if (error) + return "singleClusterRouting." + error; + } + } + if (message.priority != null && message.hasOwnProperty("priority")) { + properties.isolation = 1; + switch (message.priority) { + default: + return "priority: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.standardIsolation != null && message.hasOwnProperty("standardIsolation")) { + if (properties.isolation === 1) + return "isolation: multiple values"; + properties.isolation = 1; + { + var error = $root.google.bigtable.admin.v2.AppProfile.StandardIsolation.verify(message.standardIsolation); + if (error) + return "standardIsolation." + error; + } + } + if (message.dataBoostIsolationReadOnly != null && message.hasOwnProperty("dataBoostIsolationReadOnly")) { + if (properties.isolation === 1) + return "isolation: multiple values"; + properties.isolation = 1; + { + var error = $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.verify(message.dataBoostIsolationReadOnly); + if (error) + return "dataBoostIsolationReadOnly." + error; + } + } + return null; + }; + + /** + * Creates an AppProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile} AppProfile + */ + AppProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile) + return object; + var message = new $root.google.bigtable.admin.v2.AppProfile(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + if (object.description != null) + message.description = String(object.description); + if (object.multiClusterRoutingUseAny != null) { + if (typeof object.multiClusterRoutingUseAny !== "object") + throw TypeError(".google.bigtable.admin.v2.AppProfile.multiClusterRoutingUseAny: object expected"); + message.multiClusterRoutingUseAny = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.fromObject(object.multiClusterRoutingUseAny); + } + if (object.singleClusterRouting != null) { + if (typeof object.singleClusterRouting !== "object") + throw TypeError(".google.bigtable.admin.v2.AppProfile.singleClusterRouting: object expected"); + message.singleClusterRouting = $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.fromObject(object.singleClusterRouting); + } + switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; + case "PRIORITY_UNSPECIFIED": + case 0: + message.priority = 0; + break; + case "PRIORITY_LOW": + case 1: + message.priority = 1; + break; + case "PRIORITY_MEDIUM": + case 2: + message.priority = 2; + break; + case "PRIORITY_HIGH": + case 3: + message.priority = 3; + break; + } + if (object.standardIsolation != null) { + if (typeof object.standardIsolation !== "object") + throw TypeError(".google.bigtable.admin.v2.AppProfile.standardIsolation: object expected"); + message.standardIsolation = $root.google.bigtable.admin.v2.AppProfile.StandardIsolation.fromObject(object.standardIsolation); + } + if (object.dataBoostIsolationReadOnly != null) { + if (typeof object.dataBoostIsolationReadOnly !== "object") + throw TypeError(".google.bigtable.admin.v2.AppProfile.dataBoostIsolationReadOnly: object expected"); + message.dataBoostIsolationReadOnly = $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.fromObject(object.dataBoostIsolationReadOnly); + } + return message; + }; + + /** + * Creates a plain object from an AppProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {google.bigtable.admin.v2.AppProfile} message AppProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.multiClusterRoutingUseAny != null && message.hasOwnProperty("multiClusterRoutingUseAny")) { + object.multiClusterRoutingUseAny = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.toObject(message.multiClusterRoutingUseAny, options); + if (options.oneofs) + object.routingPolicy = "multiClusterRoutingUseAny"; + } + if (message.singleClusterRouting != null && message.hasOwnProperty("singleClusterRouting")) { + object.singleClusterRouting = $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.toObject(message.singleClusterRouting, options); + if (options.oneofs) + object.routingPolicy = "singleClusterRouting"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = options.enums === String ? $root.google.bigtable.admin.v2.AppProfile.Priority[message.priority] === undefined ? message.priority : $root.google.bigtable.admin.v2.AppProfile.Priority[message.priority] : message.priority; + if (options.oneofs) + object.isolation = "priority"; + } + if (message.dataBoostIsolationReadOnly != null && message.hasOwnProperty("dataBoostIsolationReadOnly")) { + object.dataBoostIsolationReadOnly = $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.toObject(message.dataBoostIsolationReadOnly, options); + if (options.oneofs) + object.isolation = "dataBoostIsolationReadOnly"; + } + if (message.standardIsolation != null && message.hasOwnProperty("standardIsolation")) { + object.standardIsolation = $root.google.bigtable.admin.v2.AppProfile.StandardIsolation.toObject(message.standardIsolation, options); + if (options.oneofs) + object.isolation = "standardIsolation"; + } + return object; + }; + + /** + * Converts this AppProfile to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile + * @instance + * @returns {Object.} JSON object + */ + AppProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppProfile + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile"; + }; + + AppProfile.MultiClusterRoutingUseAny = (function() { + + /** + * Properties of a MultiClusterRoutingUseAny. + * @memberof google.bigtable.admin.v2.AppProfile + * @interface IMultiClusterRoutingUseAny + * @property {Array.|null} [clusterIds] MultiClusterRoutingUseAny clusterIds + * @property {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity|null} [rowAffinity] MultiClusterRoutingUseAny rowAffinity + */ + + /** + * Constructs a new MultiClusterRoutingUseAny. + * @memberof google.bigtable.admin.v2.AppProfile + * @classdesc Represents a MultiClusterRoutingUseAny. + * @implements IMultiClusterRoutingUseAny + * @constructor + * @param {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny=} [properties] Properties to set + */ + function MultiClusterRoutingUseAny(properties) { + this.clusterIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiClusterRoutingUseAny clusterIds. + * @member {Array.} clusterIds + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @instance + */ + MultiClusterRoutingUseAny.prototype.clusterIds = $util.emptyArray; + + /** + * MultiClusterRoutingUseAny rowAffinity. + * @member {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity|null|undefined} rowAffinity + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @instance + */ + MultiClusterRoutingUseAny.prototype.rowAffinity = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MultiClusterRoutingUseAny affinity. + * @member {"rowAffinity"|undefined} affinity + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @instance + */ + Object.defineProperty(MultiClusterRoutingUseAny.prototype, "affinity", { + get: $util.oneOfGetter($oneOfFields = ["rowAffinity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MultiClusterRoutingUseAny instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} MultiClusterRoutingUseAny instance + */ + MultiClusterRoutingUseAny.create = function create(properties) { + return new MultiClusterRoutingUseAny(properties); + }; + + /** + * Encodes the specified MultiClusterRoutingUseAny message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny} message MultiClusterRoutingUseAny message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiClusterRoutingUseAny.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterIds != null && message.clusterIds.length) + for (var i = 0; i < message.clusterIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterIds[i]); + if (message.rowAffinity != null && Object.hasOwnProperty.call(message, "rowAffinity")) + $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.encode(message.rowAffinity, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MultiClusterRoutingUseAny message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny} message MultiClusterRoutingUseAny message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiClusterRoutingUseAny.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiClusterRoutingUseAny message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} MultiClusterRoutingUseAny + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiClusterRoutingUseAny.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.clusterIds && message.clusterIds.length)) + message.clusterIds = []; + message.clusterIds.push(reader.string()); + break; + } + case 3: { + message.rowAffinity = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiClusterRoutingUseAny message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} MultiClusterRoutingUseAny + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiClusterRoutingUseAny.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiClusterRoutingUseAny message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiClusterRoutingUseAny.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.clusterIds != null && message.hasOwnProperty("clusterIds")) { + if (!Array.isArray(message.clusterIds)) + return "clusterIds: array expected"; + for (var i = 0; i < message.clusterIds.length; ++i) + if (!$util.isString(message.clusterIds[i])) + return "clusterIds: string[] expected"; + } + if (message.rowAffinity != null && message.hasOwnProperty("rowAffinity")) { + properties.affinity = 1; + { + var error = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify(message.rowAffinity); + if (error) + return "rowAffinity." + error; + } + } + return null; + }; + + /** + * Creates a MultiClusterRoutingUseAny message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} MultiClusterRoutingUseAny + */ + MultiClusterRoutingUseAny.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) + return object; + var message = new $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny(); + if (object.clusterIds) { + if (!Array.isArray(object.clusterIds)) + throw TypeError(".google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.clusterIds: array expected"); + message.clusterIds = []; + for (var i = 0; i < object.clusterIds.length; ++i) + message.clusterIds[i] = String(object.clusterIds[i]); + } + if (object.rowAffinity != null) { + if (typeof object.rowAffinity !== "object") + throw TypeError(".google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.rowAffinity: object expected"); + message.rowAffinity = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.fromObject(object.rowAffinity); + } + return message; + }; + + /** + * Creates a plain object from a MultiClusterRoutingUseAny message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} message MultiClusterRoutingUseAny + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiClusterRoutingUseAny.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.clusterIds = []; + if (message.clusterIds && message.clusterIds.length) { + object.clusterIds = []; + for (var j = 0; j < message.clusterIds.length; ++j) + object.clusterIds[j] = message.clusterIds[j]; + } + if (message.rowAffinity != null && message.hasOwnProperty("rowAffinity")) { + object.rowAffinity = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.toObject(message.rowAffinity, options); + if (options.oneofs) + object.affinity = "rowAffinity"; + } + return object; + }; + + /** + * Converts this MultiClusterRoutingUseAny to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @instance + * @returns {Object.} JSON object + */ + MultiClusterRoutingUseAny.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiClusterRoutingUseAny + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiClusterRoutingUseAny.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny"; + }; + + MultiClusterRoutingUseAny.RowAffinity = (function() { + + /** + * Properties of a RowAffinity. + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @interface IRowAffinity + */ + + /** + * Constructs a new RowAffinity. + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @classdesc Represents a RowAffinity. + * @implements IRowAffinity + * @constructor + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity=} [properties] Properties to set + */ + function RowAffinity(properties) { + if (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 RowAffinity instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} RowAffinity instance + */ + RowAffinity.create = function create(properties) { + return new RowAffinity(properties); + }; + + /** + * Encodes the specified RowAffinity message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity} message RowAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RowAffinity message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity} message RowAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} RowAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowAffinity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} RowAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowAffinity message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RowAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} RowAffinity + */ + RowAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + return object; + return new $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity(); + }; + + /** + * Creates a plain object from a RowAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} message RowAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowAffinity.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RowAffinity to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @instance + * @returns {Object.} JSON object + */ + RowAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowAffinity + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity"; + }; + + return RowAffinity; + })(); + + return MultiClusterRoutingUseAny; + })(); + + AppProfile.SingleClusterRouting = (function() { + + /** + * Properties of a SingleClusterRouting. + * @memberof google.bigtable.admin.v2.AppProfile + * @interface ISingleClusterRouting + * @property {string|null} [clusterId] SingleClusterRouting clusterId + * @property {boolean|null} [allowTransactionalWrites] SingleClusterRouting allowTransactionalWrites + */ + + /** + * Constructs a new SingleClusterRouting. + * @memberof google.bigtable.admin.v2.AppProfile + * @classdesc Represents a SingleClusterRouting. + * @implements ISingleClusterRouting + * @constructor + * @param {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting=} [properties] Properties to set + */ + function SingleClusterRouting(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SingleClusterRouting clusterId. + * @member {string} clusterId + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @instance + */ + SingleClusterRouting.prototype.clusterId = ""; + + /** + * SingleClusterRouting allowTransactionalWrites. + * @member {boolean} allowTransactionalWrites + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @instance + */ + SingleClusterRouting.prototype.allowTransactionalWrites = false; + + /** + * Creates a new SingleClusterRouting instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} SingleClusterRouting instance + */ + SingleClusterRouting.create = function create(properties) { + return new SingleClusterRouting(properties); + }; + + /** + * Encodes the specified SingleClusterRouting message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.SingleClusterRouting.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting} message SingleClusterRouting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SingleClusterRouting.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterId); + if (message.allowTransactionalWrites != null && Object.hasOwnProperty.call(message, "allowTransactionalWrites")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowTransactionalWrites); + return writer; + }; + + /** + * Encodes the specified SingleClusterRouting message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.SingleClusterRouting.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting} message SingleClusterRouting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SingleClusterRouting.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SingleClusterRouting message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} SingleClusterRouting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SingleClusterRouting.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clusterId = reader.string(); + break; + } + case 2: { + message.allowTransactionalWrites = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SingleClusterRouting message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} SingleClusterRouting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SingleClusterRouting.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SingleClusterRouting message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SingleClusterRouting.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.allowTransactionalWrites != null && message.hasOwnProperty("allowTransactionalWrites")) + if (typeof message.allowTransactionalWrites !== "boolean") + return "allowTransactionalWrites: boolean expected"; + return null; + }; + + /** + * Creates a SingleClusterRouting message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} SingleClusterRouting + */ + SingleClusterRouting.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) + return object; + var message = new $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting(); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.allowTransactionalWrites != null) + message.allowTransactionalWrites = Boolean(object.allowTransactionalWrites); + return message; + }; + + /** + * Creates a plain object from a SingleClusterRouting message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} message SingleClusterRouting + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SingleClusterRouting.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clusterId = ""; + object.allowTransactionalWrites = false; + } + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.allowTransactionalWrites != null && message.hasOwnProperty("allowTransactionalWrites")) + object.allowTransactionalWrites = message.allowTransactionalWrites; + return object; + }; + + /** + * Converts this SingleClusterRouting to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @instance + * @returns {Object.} JSON object + */ + SingleClusterRouting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SingleClusterRouting + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SingleClusterRouting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile.SingleClusterRouting"; + }; + + return SingleClusterRouting; + })(); + + /** + * Priority enum. + * @name google.bigtable.admin.v2.AppProfile.Priority + * @enum {number} + * @property {number} PRIORITY_UNSPECIFIED=0 PRIORITY_UNSPECIFIED value + * @property {number} PRIORITY_LOW=1 PRIORITY_LOW value + * @property {number} PRIORITY_MEDIUM=2 PRIORITY_MEDIUM value + * @property {number} PRIORITY_HIGH=3 PRIORITY_HIGH value + */ + AppProfile.Priority = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIORITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIORITY_LOW"] = 1; + values[valuesById[2] = "PRIORITY_MEDIUM"] = 2; + values[valuesById[3] = "PRIORITY_HIGH"] = 3; + return values; + })(); + + AppProfile.StandardIsolation = (function() { + + /** + * Properties of a StandardIsolation. + * @memberof google.bigtable.admin.v2.AppProfile + * @interface IStandardIsolation + * @property {google.bigtable.admin.v2.AppProfile.Priority|null} [priority] StandardIsolation priority + */ + + /** + * Constructs a new StandardIsolation. + * @memberof google.bigtable.admin.v2.AppProfile + * @classdesc Represents a StandardIsolation. + * @implements IStandardIsolation + * @constructor + * @param {google.bigtable.admin.v2.AppProfile.IStandardIsolation=} [properties] Properties to set + */ + function StandardIsolation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StandardIsolation priority. + * @member {google.bigtable.admin.v2.AppProfile.Priority} priority + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @instance + */ + StandardIsolation.prototype.priority = 0; + + /** + * Creates a new StandardIsolation instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {google.bigtable.admin.v2.AppProfile.IStandardIsolation=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile.StandardIsolation} StandardIsolation instance + */ + StandardIsolation.create = function create(properties) { + return new StandardIsolation(properties); + }; + + /** + * Encodes the specified StandardIsolation message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.StandardIsolation.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {google.bigtable.admin.v2.AppProfile.IStandardIsolation} message StandardIsolation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardIsolation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.priority); + return writer; + }; + + /** + * Encodes the specified StandardIsolation message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.StandardIsolation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {google.bigtable.admin.v2.AppProfile.IStandardIsolation} message StandardIsolation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardIsolation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StandardIsolation message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile.StandardIsolation} StandardIsolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardIsolation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile.StandardIsolation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.priority = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StandardIsolation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile.StandardIsolation} StandardIsolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardIsolation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardIsolation message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardIsolation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + switch (message.priority) { + default: + return "priority: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a StandardIsolation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile.StandardIsolation} StandardIsolation + */ + StandardIsolation.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile.StandardIsolation) + return object; + var message = new $root.google.bigtable.admin.v2.AppProfile.StandardIsolation(); + switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; + case "PRIORITY_UNSPECIFIED": + case 0: + message.priority = 0; + break; + case "PRIORITY_LOW": + case 1: + message.priority = 1; + break; + case "PRIORITY_MEDIUM": + case 2: + message.priority = 2; + break; + case "PRIORITY_HIGH": + case 3: + message.priority = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a StandardIsolation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {google.bigtable.admin.v2.AppProfile.StandardIsolation} message StandardIsolation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardIsolation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = options.enums === String ? $root.google.bigtable.admin.v2.AppProfile.Priority[message.priority] === undefined ? message.priority : $root.google.bigtable.admin.v2.AppProfile.Priority[message.priority] : message.priority; + return object; + }; + + /** + * Converts this StandardIsolation to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @instance + * @returns {Object.} JSON object + */ + StandardIsolation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardIsolation + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile.StandardIsolation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardIsolation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile.StandardIsolation"; + }; + + return StandardIsolation; + })(); + + AppProfile.DataBoostIsolationReadOnly = (function() { + + /** + * Properties of a DataBoostIsolationReadOnly. + * @memberof google.bigtable.admin.v2.AppProfile + * @interface IDataBoostIsolationReadOnly + * @property {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner|null} [computeBillingOwner] DataBoostIsolationReadOnly computeBillingOwner + */ + + /** + * Constructs a new DataBoostIsolationReadOnly. + * @memberof google.bigtable.admin.v2.AppProfile + * @classdesc Represents a DataBoostIsolationReadOnly. + * @implements IDataBoostIsolationReadOnly + * @constructor + * @param {google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly=} [properties] Properties to set + */ + function DataBoostIsolationReadOnly(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataBoostIsolationReadOnly computeBillingOwner. + * @member {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner|null|undefined} computeBillingOwner + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @instance + */ + DataBoostIsolationReadOnly.prototype.computeBillingOwner = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataBoostIsolationReadOnly.prototype, "_computeBillingOwner", { + get: $util.oneOfGetter($oneOfFields = ["computeBillingOwner"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataBoostIsolationReadOnly instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} DataBoostIsolationReadOnly instance + */ + DataBoostIsolationReadOnly.create = function create(properties) { + return new DataBoostIsolationReadOnly(properties); + }; + + /** + * Encodes the specified DataBoostIsolationReadOnly message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly} message DataBoostIsolationReadOnly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataBoostIsolationReadOnly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.computeBillingOwner != null && Object.hasOwnProperty.call(message, "computeBillingOwner")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.computeBillingOwner); + return writer; + }; + + /** + * Encodes the specified DataBoostIsolationReadOnly message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {google.bigtable.admin.v2.AppProfile.IDataBoostIsolationReadOnly} message DataBoostIsolationReadOnly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataBoostIsolationReadOnly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataBoostIsolationReadOnly message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} DataBoostIsolationReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataBoostIsolationReadOnly.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.computeBillingOwner = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataBoostIsolationReadOnly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} DataBoostIsolationReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataBoostIsolationReadOnly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataBoostIsolationReadOnly message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataBoostIsolationReadOnly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.computeBillingOwner != null && message.hasOwnProperty("computeBillingOwner")) { + properties._computeBillingOwner = 1; + switch (message.computeBillingOwner) { + default: + return "computeBillingOwner: enum value expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a DataBoostIsolationReadOnly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} DataBoostIsolationReadOnly + */ + DataBoostIsolationReadOnly.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) + return object; + var message = new $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly(); + switch (object.computeBillingOwner) { + default: + if (typeof object.computeBillingOwner === "number") { + message.computeBillingOwner = object.computeBillingOwner; + break; + } + break; + case "COMPUTE_BILLING_OWNER_UNSPECIFIED": + case 0: + message.computeBillingOwner = 0; + break; + case "HOST_PAYS": + case 1: + message.computeBillingOwner = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a DataBoostIsolationReadOnly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} message DataBoostIsolationReadOnly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataBoostIsolationReadOnly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.computeBillingOwner != null && message.hasOwnProperty("computeBillingOwner")) { + object.computeBillingOwner = options.enums === String ? $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner[message.computeBillingOwner] === undefined ? message.computeBillingOwner : $root.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner[message.computeBillingOwner] : message.computeBillingOwner; + if (options.oneofs) + object._computeBillingOwner = "computeBillingOwner"; + } + return object; + }; + + /** + * Converts this DataBoostIsolationReadOnly to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @instance + * @returns {Object.} JSON object + */ + DataBoostIsolationReadOnly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataBoostIsolationReadOnly + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataBoostIsolationReadOnly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly"; + }; + + /** + * ComputeBillingOwner enum. + * @name google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + * @enum {number} + * @property {number} COMPUTE_BILLING_OWNER_UNSPECIFIED=0 COMPUTE_BILLING_OWNER_UNSPECIFIED value + * @property {number} HOST_PAYS=1 HOST_PAYS value + */ + DataBoostIsolationReadOnly.ComputeBillingOwner = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPUTE_BILLING_OWNER_UNSPECIFIED"] = 0; + values[valuesById[1] = "HOST_PAYS"] = 1; + return values; + })(); + + return DataBoostIsolationReadOnly; + })(); + + return AppProfile; + })(); + + v2.HotTablet = (function() { + + /** + * Properties of a HotTablet. + * @memberof google.bigtable.admin.v2 + * @interface IHotTablet + * @property {string|null} [name] HotTablet name + * @property {string|null} [tableName] HotTablet tableName + * @property {google.protobuf.ITimestamp|null} [startTime] HotTablet startTime + * @property {google.protobuf.ITimestamp|null} [endTime] HotTablet endTime + * @property {string|null} [startKey] HotTablet startKey + * @property {string|null} [endKey] HotTablet endKey + * @property {number|null} [nodeCpuUsagePercent] HotTablet nodeCpuUsagePercent + */ + + /** + * Constructs a new HotTablet. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a HotTablet. + * @implements IHotTablet + * @constructor + * @param {google.bigtable.admin.v2.IHotTablet=} [properties] Properties to set + */ + function HotTablet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HotTablet name. + * @member {string} name + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.name = ""; + + /** + * HotTablet tableName. + * @member {string} tableName + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.tableName = ""; + + /** + * HotTablet startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.startTime = null; + + /** + * HotTablet endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.endTime = null; + + /** + * HotTablet startKey. + * @member {string} startKey + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.startKey = ""; + + /** + * HotTablet endKey. + * @member {string} endKey + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.endKey = ""; + + /** + * HotTablet nodeCpuUsagePercent. + * @member {number} nodeCpuUsagePercent + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + */ + HotTablet.prototype.nodeCpuUsagePercent = 0; + + /** + * Creates a new HotTablet instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {google.bigtable.admin.v2.IHotTablet=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.HotTablet} HotTablet instance + */ + HotTablet.create = function create(properties) { + return new HotTablet(properties); + }; + + /** + * Encodes the specified HotTablet message. Does not implicitly {@link google.bigtable.admin.v2.HotTablet.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {google.bigtable.admin.v2.IHotTablet} message HotTablet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HotTablet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableName); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.startKey != null && Object.hasOwnProperty.call(message, "startKey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.startKey); + if (message.endKey != null && Object.hasOwnProperty.call(message, "endKey")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.endKey); + if (message.nodeCpuUsagePercent != null && Object.hasOwnProperty.call(message, "nodeCpuUsagePercent")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.nodeCpuUsagePercent); + return writer; + }; + + /** + * Encodes the specified HotTablet message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.HotTablet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {google.bigtable.admin.v2.IHotTablet} message HotTablet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HotTablet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HotTablet message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.HotTablet} HotTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HotTablet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.HotTablet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.tableName = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.startKey = reader.string(); + break; + } + case 6: { + message.endKey = reader.string(); + break; + } + case 7: { + message.nodeCpuUsagePercent = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HotTablet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.HotTablet} HotTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HotTablet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HotTablet message. + * @function verify + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HotTablet.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.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.startKey != null && message.hasOwnProperty("startKey")) + if (!$util.isString(message.startKey)) + return "startKey: string expected"; + if (message.endKey != null && message.hasOwnProperty("endKey")) + if (!$util.isString(message.endKey)) + return "endKey: string expected"; + if (message.nodeCpuUsagePercent != null && message.hasOwnProperty("nodeCpuUsagePercent")) + if (typeof message.nodeCpuUsagePercent !== "number") + return "nodeCpuUsagePercent: number expected"; + return null; + }; + + /** + * Creates a HotTablet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.HotTablet} HotTablet + */ + HotTablet.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.HotTablet) + return object; + var message = new $root.google.bigtable.admin.v2.HotTablet(); + if (object.name != null) + message.name = String(object.name); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.HotTablet.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.HotTablet.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.startKey != null) + message.startKey = String(object.startKey); + if (object.endKey != null) + message.endKey = String(object.endKey); + if (object.nodeCpuUsagePercent != null) + message.nodeCpuUsagePercent = Number(object.nodeCpuUsagePercent); + return message; + }; + + /** + * Creates a plain object from a HotTablet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {google.bigtable.admin.v2.HotTablet} message HotTablet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HotTablet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.tableName = ""; + object.startTime = null; + object.endTime = null; + object.startKey = ""; + object.endKey = ""; + object.nodeCpuUsagePercent = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.startKey != null && message.hasOwnProperty("startKey")) + object.startKey = message.startKey; + if (message.endKey != null && message.hasOwnProperty("endKey")) + object.endKey = message.endKey; + if (message.nodeCpuUsagePercent != null && message.hasOwnProperty("nodeCpuUsagePercent")) + object.nodeCpuUsagePercent = options.json && !isFinite(message.nodeCpuUsagePercent) ? String(message.nodeCpuUsagePercent) : message.nodeCpuUsagePercent; + return object; + }; + + /** + * Converts this HotTablet to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.HotTablet + * @instance + * @returns {Object.} JSON object + */ + HotTablet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HotTablet + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.HotTablet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HotTablet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.HotTablet"; + }; + + return HotTablet; + })(); + + v2.LogicalView = (function() { + + /** + * Properties of a LogicalView. + * @memberof google.bigtable.admin.v2 + * @interface ILogicalView + * @property {string|null} [name] LogicalView name + * @property {string|null} [query] LogicalView query + * @property {string|null} [etag] LogicalView etag + * @property {boolean|null} [deletionProtection] LogicalView deletionProtection + */ + + /** + * Constructs a new LogicalView. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a LogicalView. + * @implements ILogicalView + * @constructor + * @param {google.bigtable.admin.v2.ILogicalView=} [properties] Properties to set + */ + function LogicalView(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogicalView name. + * @member {string} name + * @memberof google.bigtable.admin.v2.LogicalView + * @instance + */ + LogicalView.prototype.name = ""; + + /** + * LogicalView query. + * @member {string} query + * @memberof google.bigtable.admin.v2.LogicalView + * @instance + */ + LogicalView.prototype.query = ""; + + /** + * LogicalView etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.LogicalView + * @instance + */ + LogicalView.prototype.etag = ""; + + /** + * LogicalView deletionProtection. + * @member {boolean} deletionProtection + * @memberof google.bigtable.admin.v2.LogicalView + * @instance + */ + LogicalView.prototype.deletionProtection = false; + + /** + * Creates a new LogicalView instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {google.bigtable.admin.v2.ILogicalView=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.LogicalView} LogicalView instance + */ + LogicalView.create = function create(properties) { + return new LogicalView(properties); + }; + + /** + * Encodes the specified LogicalView message. Does not implicitly {@link google.bigtable.admin.v2.LogicalView.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {google.bigtable.admin.v2.ILogicalView} message LogicalView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogicalView.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deletionProtection); + return writer; + }; + + /** + * Encodes the specified LogicalView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.LogicalView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {google.bigtable.admin.v2.ILogicalView} message LogicalView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogicalView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogicalView message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.LogicalView} LogicalView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogicalView.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.LogicalView(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 6: { + message.deletionProtection = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogicalView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.LogicalView} LogicalView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogicalView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogicalView message. + * @function verify + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogicalView.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.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + return null; + }; + + /** + * Creates a LogicalView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.LogicalView} LogicalView + */ + LogicalView.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.LogicalView) + return object; + var message = new $root.google.bigtable.admin.v2.LogicalView(); + if (object.name != null) + message.name = String(object.name); + if (object.query != null) + message.query = String(object.query); + if (object.etag != null) + message.etag = String(object.etag); + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + return message; + }; + + /** + * Creates a plain object from a LogicalView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {google.bigtable.admin.v2.LogicalView} message LogicalView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogicalView.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.query = ""; + object.etag = ""; + object.deletionProtection = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + object.deletionProtection = message.deletionProtection; + return object; + }; + + /** + * Converts this LogicalView to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.LogicalView + * @instance + * @returns {Object.} JSON object + */ + LogicalView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogicalView + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.LogicalView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogicalView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.LogicalView"; + }; + + return LogicalView; + })(); + + v2.MaterializedView = (function() { + + /** + * Properties of a MaterializedView. + * @memberof google.bigtable.admin.v2 + * @interface IMaterializedView + * @property {string|null} [name] MaterializedView name + * @property {string|null} [query] MaterializedView query + * @property {string|null} [etag] MaterializedView etag + * @property {boolean|null} [deletionProtection] MaterializedView deletionProtection + */ + + /** + * Constructs a new MaterializedView. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a MaterializedView. + * @implements IMaterializedView + * @constructor + * @param {google.bigtable.admin.v2.IMaterializedView=} [properties] Properties to set + */ + function MaterializedView(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaterializedView name. + * @member {string} name + * @memberof google.bigtable.admin.v2.MaterializedView + * @instance + */ + MaterializedView.prototype.name = ""; + + /** + * MaterializedView query. + * @member {string} query + * @memberof google.bigtable.admin.v2.MaterializedView + * @instance + */ + MaterializedView.prototype.query = ""; + + /** + * MaterializedView etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.MaterializedView + * @instance + */ + MaterializedView.prototype.etag = ""; + + /** + * MaterializedView deletionProtection. + * @member {boolean} deletionProtection + * @memberof google.bigtable.admin.v2.MaterializedView + * @instance + */ + MaterializedView.prototype.deletionProtection = false; + + /** + * Creates a new MaterializedView instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {google.bigtable.admin.v2.IMaterializedView=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.MaterializedView} MaterializedView instance + */ + MaterializedView.create = function create(properties) { + return new MaterializedView(properties); + }; + + /** + * Encodes the specified MaterializedView message. Does not implicitly {@link google.bigtable.admin.v2.MaterializedView.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {google.bigtable.admin.v2.IMaterializedView} message MaterializedView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializedView.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deletionProtection); + return writer; + }; + + /** + * Encodes the specified MaterializedView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.MaterializedView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {google.bigtable.admin.v2.IMaterializedView} message MaterializedView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializedView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaterializedView message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.MaterializedView} MaterializedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializedView.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.MaterializedView(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 6: { + message.deletionProtection = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaterializedView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.MaterializedView} MaterializedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializedView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaterializedView message. + * @function verify + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaterializedView.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.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + return null; + }; + + /** + * Creates a MaterializedView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.MaterializedView} MaterializedView + */ + MaterializedView.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.MaterializedView) + return object; + var message = new $root.google.bigtable.admin.v2.MaterializedView(); + if (object.name != null) + message.name = String(object.name); + if (object.query != null) + message.query = String(object.query); + if (object.etag != null) + message.etag = String(object.etag); + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + return message; + }; + + /** + * Creates a plain object from a MaterializedView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {google.bigtable.admin.v2.MaterializedView} message MaterializedView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaterializedView.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.query = ""; + object.etag = ""; + object.deletionProtection = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + object.deletionProtection = message.deletionProtection; + return object; + }; + + /** + * Converts this MaterializedView to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.MaterializedView + * @instance + * @returns {Object.} JSON object + */ + MaterializedView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaterializedView + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.MaterializedView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaterializedView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.MaterializedView"; + }; + + return MaterializedView; + })(); + + /** + * StorageType enum. + * @name google.bigtable.admin.v2.StorageType + * @enum {number} + * @property {number} STORAGE_TYPE_UNSPECIFIED=0 STORAGE_TYPE_UNSPECIFIED value + * @property {number} SSD=1 SSD value + * @property {number} HDD=2 HDD value + */ + v2.StorageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STORAGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SSD"] = 1; + values[valuesById[2] = "HDD"] = 2; + return values; + })(); + + v2.OperationProgress = (function() { + + /** + * Properties of an OperationProgress. + * @memberof google.bigtable.admin.v2 + * @interface IOperationProgress + * @property {number|null} [progressPercent] OperationProgress progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] OperationProgress startTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationProgress endTime + */ + + /** + * Constructs a new OperationProgress. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an OperationProgress. + * @implements IOperationProgress + * @constructor + * @param {google.bigtable.admin.v2.IOperationProgress=} [properties] Properties to set + */ + function OperationProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationProgress progressPercent. + * @member {number} progressPercent + * @memberof google.bigtable.admin.v2.OperationProgress + * @instance + */ + OperationProgress.prototype.progressPercent = 0; + + /** + * OperationProgress startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.OperationProgress + * @instance + */ + OperationProgress.prototype.startTime = null; + + /** + * OperationProgress endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.OperationProgress + * @instance + */ + OperationProgress.prototype.endTime = null; + + /** + * Creates a new OperationProgress instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {google.bigtable.admin.v2.IOperationProgress=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.OperationProgress} OperationProgress instance + */ + OperationProgress.create = function create(properties) { + return new OperationProgress(properties); + }; + + /** + * Encodes the specified OperationProgress message. Does not implicitly {@link google.bigtable.admin.v2.OperationProgress.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {google.bigtable.admin.v2.IOperationProgress} message OperationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.OperationProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {google.bigtable.admin.v2.IOperationProgress} message OperationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationProgress message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.OperationProgress} OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationProgress.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.OperationProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.OperationProgress} OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationProgress message. + * @function verify + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.OperationProgress} OperationProgress + */ + OperationProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.OperationProgress) + return object; + var message = new $root.google.bigtable.admin.v2.OperationProgress(); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.OperationProgress.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.OperationProgress.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {google.bigtable.admin.v2.OperationProgress} message OperationProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.progressPercent = 0; + object.startTime = null; + object.endTime = null; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this OperationProgress to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.OperationProgress + * @instance + * @returns {Object.} JSON object + */ + OperationProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationProgress + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.OperationProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.OperationProgress"; + }; + + return OperationProgress; + })(); + + v2.BigtableTableAdmin = (function() { + + /** + * Constructs a new BigtableTableAdmin service. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a BigtableTableAdmin + * @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 BigtableTableAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BigtableTableAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BigtableTableAdmin; + + /** + * Creates new BigtableTableAdmin service using the specified rpc implementation. + * @function create + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @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 {BigtableTableAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + BigtableTableAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CreateTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Table} [response] Table + */ + + /** + * Calls CreateTable. + * @function createTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateTableRequest} request CreateTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CreateTableCallback} callback Node-style callback called with the error, if any, and Table + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.createTable = function createTable(request, callback) { + return this.rpcCall(createTable, $root.google.bigtable.admin.v2.CreateTableRequest, $root.google.bigtable.admin.v2.Table, request, callback); + }, "name", { value: "CreateTable" }); + + /** + * Calls CreateTable. + * @function createTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateTableRequest} request CreateTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createTableFromSnapshot}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CreateTableFromSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTableFromSnapshot. + * @function createTableFromSnapshot + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest} request CreateTableFromSnapshotRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.createTableFromSnapshot = function createTableFromSnapshot(request, callback) { + return this.rpcCall(createTableFromSnapshot, $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTableFromSnapshot" }); + + /** + * Calls CreateTableFromSnapshot. + * @function createTableFromSnapshot + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest} request CreateTableFromSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listTables}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef ListTablesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListTablesResponse} [response] ListTablesResponse + */ + + /** + * Calls ListTables. + * @function listTables + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListTablesRequest} request ListTablesRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.ListTablesCallback} callback Node-style callback called with the error, if any, and ListTablesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.listTables = function listTables(request, callback) { + return this.rpcCall(listTables, $root.google.bigtable.admin.v2.ListTablesRequest, $root.google.bigtable.admin.v2.ListTablesResponse, request, callback); + }, "name", { value: "ListTables" }); + + /** + * Calls ListTables. + * @function listTables + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListTablesRequest} request ListTablesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GetTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Table} [response] Table + */ + + /** + * Calls GetTable. + * @function getTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetTableRequest} request GetTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GetTableCallback} callback Node-style callback called with the error, if any, and Table + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.getTable = function getTable(request, callback) { + return this.rpcCall(getTable, $root.google.bigtable.admin.v2.GetTableRequest, $root.google.bigtable.admin.v2.Table, request, callback); + }, "name", { value: "GetTable" }); + + /** + * Calls GetTable. + * @function getTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetTableRequest} request GetTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef UpdateTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateTable. + * @function updateTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateTableRequest} request UpdateTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.UpdateTableCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.updateTable = function updateTable(request, callback) { + return this.rpcCall(updateTable, $root.google.bigtable.admin.v2.UpdateTableRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateTable" }); + + /** + * Calls UpdateTable. + * @function updateTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateTableRequest} request UpdateTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef DeleteTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTable. + * @function deleteTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteTableRequest} request DeleteTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.DeleteTableCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.deleteTable = function deleteTable(request, callback) { + return this.rpcCall(deleteTable, $root.google.bigtable.admin.v2.DeleteTableRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTable" }); + + /** + * Calls DeleteTable. + * @function deleteTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteTableRequest} request DeleteTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|undeleteTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef UndeleteTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeleteTable. + * @function undeleteTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUndeleteTableRequest} request UndeleteTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTableCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.undeleteTable = function undeleteTable(request, callback) { + return this.rpcCall(undeleteTable, $root.google.bigtable.admin.v2.UndeleteTableRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeleteTable" }); + + /** + * Calls UndeleteTable. + * @function undeleteTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUndeleteTableRequest} request UndeleteTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createAuthorizedView}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CreateAuthorizedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateAuthorizedView. + * @function createAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewRequest} request CreateAuthorizedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedViewCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.createAuthorizedView = function createAuthorizedView(request, callback) { + return this.rpcCall(createAuthorizedView, $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateAuthorizedView" }); + + /** + * Calls CreateAuthorizedView. + * @function createAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewRequest} request CreateAuthorizedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listAuthorizedViews}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef ListAuthorizedViewsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListAuthorizedViewsResponse} [response] ListAuthorizedViewsResponse + */ + + /** + * Calls ListAuthorizedViews. + * @function listAuthorizedViews + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListAuthorizedViewsRequest} request ListAuthorizedViewsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViewsCallback} callback Node-style callback called with the error, if any, and ListAuthorizedViewsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.listAuthorizedViews = function listAuthorizedViews(request, callback) { + return this.rpcCall(listAuthorizedViews, $root.google.bigtable.admin.v2.ListAuthorizedViewsRequest, $root.google.bigtable.admin.v2.ListAuthorizedViewsResponse, request, callback); + }, "name", { value: "ListAuthorizedViews" }); + + /** + * Calls ListAuthorizedViews. + * @function listAuthorizedViews + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListAuthorizedViewsRequest} request ListAuthorizedViewsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getAuthorizedView}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GetAuthorizedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.AuthorizedView} [response] AuthorizedView + */ + + /** + * Calls GetAuthorizedView. + * @function getAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetAuthorizedViewRequest} request GetAuthorizedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedViewCallback} callback Node-style callback called with the error, if any, and AuthorizedView + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.getAuthorizedView = function getAuthorizedView(request, callback) { + return this.rpcCall(getAuthorizedView, $root.google.bigtable.admin.v2.GetAuthorizedViewRequest, $root.google.bigtable.admin.v2.AuthorizedView, request, callback); + }, "name", { value: "GetAuthorizedView" }); + + /** + * Calls GetAuthorizedView. + * @function getAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetAuthorizedViewRequest} request GetAuthorizedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateAuthorizedView}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef UpdateAuthorizedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateAuthorizedView. + * @function updateAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest} request UpdateAuthorizedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedViewCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.updateAuthorizedView = function updateAuthorizedView(request, callback) { + return this.rpcCall(updateAuthorizedView, $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateAuthorizedView" }); + + /** + * Calls UpdateAuthorizedView. + * @function updateAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest} request UpdateAuthorizedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteAuthorizedView}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef DeleteAuthorizedViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAuthorizedView. + * @function deleteAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteAuthorizedViewRequest} request DeleteAuthorizedViewRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedViewCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.deleteAuthorizedView = function deleteAuthorizedView(request, callback) { + return this.rpcCall(deleteAuthorizedView, $root.google.bigtable.admin.v2.DeleteAuthorizedViewRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAuthorizedView" }); + + /** + * Calls DeleteAuthorizedView. + * @function deleteAuthorizedView + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteAuthorizedViewRequest} request DeleteAuthorizedViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|modifyColumnFamilies}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef ModifyColumnFamiliesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Table} [response] Table + */ + + /** + * Calls ModifyColumnFamilies. + * @function modifyColumnFamilies + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest} request ModifyColumnFamiliesRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamiliesCallback} callback Node-style callback called with the error, if any, and Table + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.modifyColumnFamilies = function modifyColumnFamilies(request, callback) { + return this.rpcCall(modifyColumnFamilies, $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest, $root.google.bigtable.admin.v2.Table, request, callback); + }, "name", { value: "ModifyColumnFamilies" }); + + /** + * Calls ModifyColumnFamilies. + * @function modifyColumnFamilies + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest} request ModifyColumnFamiliesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|dropRowRange}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef DropRowRangeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DropRowRange. + * @function dropRowRange + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDropRowRangeRequest} request DropRowRangeRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.DropRowRangeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.dropRowRange = function dropRowRange(request, callback) { + return this.rpcCall(dropRowRange, $root.google.bigtable.admin.v2.DropRowRangeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DropRowRange" }); + + /** + * Calls DropRowRange. + * @function dropRowRange + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDropRowRangeRequest} request DropRowRangeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|generateConsistencyToken}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GenerateConsistencyTokenCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} [response] GenerateConsistencyTokenResponse + */ + + /** + * Calls GenerateConsistencyToken. + * @function generateConsistencyToken + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest} request GenerateConsistencyTokenRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyTokenCallback} callback Node-style callback called with the error, if any, and GenerateConsistencyTokenResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.generateConsistencyToken = function generateConsistencyToken(request, callback) { + return this.rpcCall(generateConsistencyToken, $root.google.bigtable.admin.v2.GenerateConsistencyTokenRequest, $root.google.bigtable.admin.v2.GenerateConsistencyTokenResponse, request, callback); + }, "name", { value: "GenerateConsistencyToken" }); + + /** + * Calls GenerateConsistencyToken. + * @function generateConsistencyToken + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest} request GenerateConsistencyTokenRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|checkConsistency}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CheckConsistencyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.CheckConsistencyResponse} [response] CheckConsistencyResponse + */ + + /** + * Calls CheckConsistency. + * @function checkConsistency + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest} request CheckConsistencyRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistencyCallback} callback Node-style callback called with the error, if any, and CheckConsistencyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.checkConsistency = function checkConsistency(request, callback) { + return this.rpcCall(checkConsistency, $root.google.bigtable.admin.v2.CheckConsistencyRequest, $root.google.bigtable.admin.v2.CheckConsistencyResponse, request, callback); + }, "name", { value: "CheckConsistency" }); + + /** + * Calls CheckConsistency. + * @function checkConsistency + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest} request CheckConsistencyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|snapshotTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef SnapshotTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SnapshotTable. + * @function snapshotTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ISnapshotTableRequest} request SnapshotTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTableCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.snapshotTable = function snapshotTable(request, callback) { + return this.rpcCall(snapshotTable, $root.google.bigtable.admin.v2.SnapshotTableRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SnapshotTable" }); + + /** + * Calls SnapshotTable. + * @function snapshotTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ISnapshotTableRequest} request SnapshotTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getSnapshot}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GetSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Snapshot} [response] Snapshot + */ + + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.getSnapshot = function getSnapshot(request, callback) { + return this.rpcCall(getSnapshot, $root.google.bigtable.admin.v2.GetSnapshotRequest, $root.google.bigtable.admin.v2.Snapshot, request, callback); + }, "name", { value: "GetSnapshot" }); + + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listSnapshots}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef ListSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListSnapshotsResponse} [response] ListSnapshotsResponse + */ + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ListSnapshotsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.listSnapshots = function listSnapshots(request, callback) { + return this.rpcCall(listSnapshots, $root.google.bigtable.admin.v2.ListSnapshotsRequest, $root.google.bigtable.admin.v2.ListSnapshotsResponse, request, callback); + }, "name", { value: "ListSnapshots" }); + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteSnapshot}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef DeleteSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshotCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.deleteSnapshot = function deleteSnapshot(request, callback) { + return this.rpcCall(deleteSnapshot, $root.google.bigtable.admin.v2.DeleteSnapshotRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSnapshot" }); + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createBackup}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.bigtable.admin.v2.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getBackup}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.bigtable.admin.v2.GetBackupRequest, $root.google.bigtable.admin.v2.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateBackup}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.Backup} [response] Backup + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.bigtable.admin.v2.UpdateBackupRequest, $root.google.bigtable.admin.v2.Backup, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteBackup}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.bigtable.admin.v2.DeleteBackupRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listBackups}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.bigtable.admin.v2.ListBackupsRequest, $root.google.bigtable.admin.v2.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|restoreTable}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef RestoreTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreTable. + * @function restoreTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IRestoreTableRequest} request RestoreTableRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.RestoreTableCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.restoreTable = function restoreTable(request, callback) { + return this.rpcCall(restoreTable, $root.google.bigtable.admin.v2.RestoreTableRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreTable" }); + + /** + * Calls RestoreTable. + * @function restoreTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IRestoreTableRequest} request RestoreTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|copyBackup}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CopyBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CopyBackup. + * @function copyBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICopyBackupRequest} request CopyBackupRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CopyBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.copyBackup = function copyBackup(request, callback) { + return this.rpcCall(copyBackup, $root.google.bigtable.admin.v2.CopyBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CopyBackup" }); + + /** + * Calls CopyBackup. + * @function copyBackup + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICopyBackupRequest} request CopyBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getIamPolicy}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|setIamPolicy}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|testIamPermissions}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|createSchemaBundle}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef CreateSchemaBundleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSchemaBundle. + * @function createSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateSchemaBundleRequest} request CreateSchemaBundleRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.createSchemaBundle = function createSchemaBundle(request, callback) { + return this.rpcCall(createSchemaBundle, $root.google.bigtable.admin.v2.CreateSchemaBundleRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSchemaBundle" }); + + /** + * Calls CreateSchemaBundle. + * @function createSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.ICreateSchemaBundleRequest} request CreateSchemaBundleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|updateSchemaBundle}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef UpdateSchemaBundleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateSchemaBundle. + * @function updateSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleRequest} request UpdateSchemaBundleRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.updateSchemaBundle = function updateSchemaBundle(request, callback) { + return this.rpcCall(updateSchemaBundle, $root.google.bigtable.admin.v2.UpdateSchemaBundleRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateSchemaBundle" }); + + /** + * Calls UpdateSchemaBundle. + * @function updateSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleRequest} request UpdateSchemaBundleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|getSchemaBundle}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef GetSchemaBundleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.SchemaBundle} [response] SchemaBundle + */ + + /** + * Calls GetSchemaBundle. + * @function getSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetSchemaBundleRequest} request GetSchemaBundleRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundleCallback} callback Node-style callback called with the error, if any, and SchemaBundle + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.getSchemaBundle = function getSchemaBundle(request, callback) { + return this.rpcCall(getSchemaBundle, $root.google.bigtable.admin.v2.GetSchemaBundleRequest, $root.google.bigtable.admin.v2.SchemaBundle, request, callback); + }, "name", { value: "GetSchemaBundle" }); + + /** + * Calls GetSchemaBundle. + * @function getSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IGetSchemaBundleRequest} request GetSchemaBundleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|listSchemaBundles}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef ListSchemaBundlesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.admin.v2.ListSchemaBundlesResponse} [response] ListSchemaBundlesResponse + */ + + /** + * Calls ListSchemaBundles. + * @function listSchemaBundles + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListSchemaBundlesRequest} request ListSchemaBundlesRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundlesCallback} callback Node-style callback called with the error, if any, and ListSchemaBundlesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.listSchemaBundles = function listSchemaBundles(request, callback) { + return this.rpcCall(listSchemaBundles, $root.google.bigtable.admin.v2.ListSchemaBundlesRequest, $root.google.bigtable.admin.v2.ListSchemaBundlesResponse, request, callback); + }, "name", { value: "ListSchemaBundles" }); + + /** + * Calls ListSchemaBundles. + * @function listSchemaBundles + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IListSchemaBundlesRequest} request ListSchemaBundlesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin|deleteSchemaBundle}. + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @typedef DeleteSchemaBundleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSchemaBundle. + * @function deleteSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteSchemaBundleRequest} request DeleteSchemaBundleRequest message or plain object + * @param {google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigtableTableAdmin.prototype.deleteSchemaBundle = function deleteSchemaBundle(request, callback) { + return this.rpcCall(deleteSchemaBundle, $root.google.bigtable.admin.v2.DeleteSchemaBundleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSchemaBundle" }); + + /** + * Calls DeleteSchemaBundle. + * @function deleteSchemaBundle + * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * @instance + * @param {google.bigtable.admin.v2.IDeleteSchemaBundleRequest} request DeleteSchemaBundleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BigtableTableAdmin; + })(); + + v2.RestoreTableRequest = (function() { + + /** + * Properties of a RestoreTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface IRestoreTableRequest + * @property {string|null} [parent] RestoreTableRequest parent + * @property {string|null} [tableId] RestoreTableRequest tableId + * @property {string|null} [backup] RestoreTableRequest backup + */ + + /** + * Constructs a new RestoreTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a RestoreTableRequest. + * @implements IRestoreTableRequest + * @constructor + * @param {google.bigtable.admin.v2.IRestoreTableRequest=} [properties] Properties to set + */ + function RestoreTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreTableRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @instance + */ + RestoreTableRequest.prototype.parent = ""; + + /** + * RestoreTableRequest tableId. + * @member {string} tableId + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @instance + */ + RestoreTableRequest.prototype.tableId = ""; + + /** + * RestoreTableRequest backup. + * @member {string|null|undefined} backup + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @instance + */ + RestoreTableRequest.prototype.backup = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreTableRequest source. + * @member {"backup"|undefined} source + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @instance + */ + Object.defineProperty(RestoreTableRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {google.bigtable.admin.v2.IRestoreTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.RestoreTableRequest} RestoreTableRequest instance + */ + RestoreTableRequest.create = function create(properties) { + return new RestoreTableRequest(properties); + }; + + /** + * Encodes the specified RestoreTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {google.bigtable.admin.v2.IRestoreTableRequest} message RestoreTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backup); + return writer; + }; + + /** + * Encodes the specified RestoreTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {google.bigtable.admin.v2.IRestoreTableRequest} message RestoreTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.RestoreTableRequest} RestoreTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.RestoreTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tableId = reader.string(); + break; + } + case 3: { + message.backup = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.RestoreTableRequest} RestoreTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreTableRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + properties.source = 1; + if (!$util.isString(message.backup)) + return "backup: string expected"; + } + return null; + }; + + /** + * Creates a RestoreTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.RestoreTableRequest} RestoreTableRequest + */ + RestoreTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.RestoreTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.RestoreTableRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.backup != null) + message.backup = String(object.backup); + return message; + }; + + /** + * Creates a plain object from a RestoreTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {google.bigtable.admin.v2.RestoreTableRequest} message RestoreTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreTableRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tableId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.backup != null && message.hasOwnProperty("backup")) { + object.backup = message.backup; + if (options.oneofs) + object.source = "backup"; + } + return object; + }; + + /** + * Converts this RestoreTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.RestoreTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.RestoreTableRequest"; + }; + + return RestoreTableRequest; + })(); + + v2.RestoreTableMetadata = (function() { + + /** + * Properties of a RestoreTableMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IRestoreTableMetadata + * @property {string|null} [name] RestoreTableMetadata name + * @property {google.bigtable.admin.v2.RestoreSourceType|null} [sourceType] RestoreTableMetadata sourceType + * @property {google.bigtable.admin.v2.IBackupInfo|null} [backupInfo] RestoreTableMetadata backupInfo + * @property {string|null} [optimizeTableOperationName] RestoreTableMetadata optimizeTableOperationName + * @property {google.bigtable.admin.v2.IOperationProgress|null} [progress] RestoreTableMetadata progress + */ + + /** + * Constructs a new RestoreTableMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a RestoreTableMetadata. + * @implements IRestoreTableMetadata + * @constructor + * @param {google.bigtable.admin.v2.IRestoreTableMetadata=} [properties] Properties to set + */ + function RestoreTableMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreTableMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + */ + RestoreTableMetadata.prototype.name = ""; + + /** + * RestoreTableMetadata sourceType. + * @member {google.bigtable.admin.v2.RestoreSourceType} sourceType + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + */ + RestoreTableMetadata.prototype.sourceType = 0; + + /** + * RestoreTableMetadata backupInfo. + * @member {google.bigtable.admin.v2.IBackupInfo|null|undefined} backupInfo + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + */ + RestoreTableMetadata.prototype.backupInfo = null; + + /** + * RestoreTableMetadata optimizeTableOperationName. + * @member {string} optimizeTableOperationName + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + */ + RestoreTableMetadata.prototype.optimizeTableOperationName = ""; + + /** + * RestoreTableMetadata progress. + * @member {google.bigtable.admin.v2.IOperationProgress|null|undefined} progress + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + */ + RestoreTableMetadata.prototype.progress = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreTableMetadata sourceInfo. + * @member {"backupInfo"|undefined} sourceInfo + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + */ + Object.defineProperty(RestoreTableMetadata.prototype, "sourceInfo", { + get: $util.oneOfGetter($oneOfFields = ["backupInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreTableMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {google.bigtable.admin.v2.IRestoreTableMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.RestoreTableMetadata} RestoreTableMetadata instance + */ + RestoreTableMetadata.create = function create(properties) { + return new RestoreTableMetadata(properties); + }; + + /** + * Encodes the specified RestoreTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {google.bigtable.admin.v2.IRestoreTableMetadata} message RestoreTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreTableMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sourceType); + if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) + $root.google.bigtable.admin.v2.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.optimizeTableOperationName != null && Object.hasOwnProperty.call(message, "optimizeTableOperationName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.optimizeTableOperationName); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.bigtable.admin.v2.OperationProgress.encode(message.progress, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.RestoreTableMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {google.bigtable.admin.v2.IRestoreTableMetadata} message RestoreTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreTableMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreTableMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.RestoreTableMetadata} RestoreTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreTableMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.RestoreTableMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceType = reader.int32(); + break; + } + case 3: { + message.backupInfo = $root.google.bigtable.admin.v2.BackupInfo.decode(reader, reader.uint32()); + break; + } + case 4: { + message.optimizeTableOperationName = reader.string(); + break; + } + case 5: { + message.progress = $root.google.bigtable.admin.v2.OperationProgress.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreTableMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.RestoreTableMetadata} RestoreTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreTableMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreTableMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreTableMetadata.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.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + properties.sourceInfo = 1; + { + var error = $root.google.bigtable.admin.v2.BackupInfo.verify(message.backupInfo); + if (error) + return "backupInfo." + error; + } + } + if (message.optimizeTableOperationName != null && message.hasOwnProperty("optimizeTableOperationName")) + if (!$util.isString(message.optimizeTableOperationName)) + return "optimizeTableOperationName: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.bigtable.admin.v2.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + return null; + }; + + /** + * Creates a RestoreTableMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.RestoreTableMetadata} RestoreTableMetadata + */ + RestoreTableMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.RestoreTableMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.RestoreTableMetadata(); + if (object.name != null) + message.name = String(object.name); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "RESTORE_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "BACKUP": + case 1: + message.sourceType = 1; + break; + } + if (object.backupInfo != null) { + if (typeof object.backupInfo !== "object") + throw TypeError(".google.bigtable.admin.v2.RestoreTableMetadata.backupInfo: object expected"); + message.backupInfo = $root.google.bigtable.admin.v2.BackupInfo.fromObject(object.backupInfo); + } + if (object.optimizeTableOperationName != null) + message.optimizeTableOperationName = String(object.optimizeTableOperationName); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.bigtable.admin.v2.RestoreTableMetadata.progress: object expected"); + message.progress = $root.google.bigtable.admin.v2.OperationProgress.fromObject(object.progress); + } + return message; + }; + + /** + * Creates a plain object from a RestoreTableMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {google.bigtable.admin.v2.RestoreTableMetadata} message RestoreTableMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreTableMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceType = options.enums === String ? "RESTORE_SOURCE_TYPE_UNSPECIFIED" : 0; + object.optimizeTableOperationName = ""; + object.progress = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.bigtable.admin.v2.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.bigtable.admin.v2.RestoreSourceType[message.sourceType] : message.sourceType; + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + object.backupInfo = $root.google.bigtable.admin.v2.BackupInfo.toObject(message.backupInfo, options); + if (options.oneofs) + object.sourceInfo = "backupInfo"; + } + if (message.optimizeTableOperationName != null && message.hasOwnProperty("optimizeTableOperationName")) + object.optimizeTableOperationName = message.optimizeTableOperationName; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.bigtable.admin.v2.OperationProgress.toObject(message.progress, options); + return object; + }; + + /** + * Converts this RestoreTableMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @instance + * @returns {Object.} JSON object + */ + RestoreTableMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreTableMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.RestoreTableMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreTableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.RestoreTableMetadata"; + }; + + return RestoreTableMetadata; + })(); + + v2.OptimizeRestoredTableMetadata = (function() { + + /** + * Properties of an OptimizeRestoredTableMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IOptimizeRestoredTableMetadata + * @property {string|null} [name] OptimizeRestoredTableMetadata name + * @property {google.bigtable.admin.v2.IOperationProgress|null} [progress] OptimizeRestoredTableMetadata progress + */ + + /** + * Constructs a new OptimizeRestoredTableMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an OptimizeRestoredTableMetadata. + * @implements IOptimizeRestoredTableMetadata + * @constructor + * @param {google.bigtable.admin.v2.IOptimizeRestoredTableMetadata=} [properties] Properties to set + */ + function OptimizeRestoredTableMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OptimizeRestoredTableMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @instance + */ + OptimizeRestoredTableMetadata.prototype.name = ""; + + /** + * OptimizeRestoredTableMetadata progress. + * @member {google.bigtable.admin.v2.IOperationProgress|null|undefined} progress + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @instance + */ + OptimizeRestoredTableMetadata.prototype.progress = null; + + /** + * Creates a new OptimizeRestoredTableMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {google.bigtable.admin.v2.IOptimizeRestoredTableMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.OptimizeRestoredTableMetadata} OptimizeRestoredTableMetadata instance + */ + OptimizeRestoredTableMetadata.create = function create(properties) { + return new OptimizeRestoredTableMetadata(properties); + }; + + /** + * Encodes the specified OptimizeRestoredTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.OptimizeRestoredTableMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {google.bigtable.admin.v2.IOptimizeRestoredTableMetadata} message OptimizeRestoredTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeRestoredTableMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.bigtable.admin.v2.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OptimizeRestoredTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.OptimizeRestoredTableMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {google.bigtable.admin.v2.IOptimizeRestoredTableMetadata} message OptimizeRestoredTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeRestoredTableMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OptimizeRestoredTableMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.OptimizeRestoredTableMetadata} OptimizeRestoredTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeRestoredTableMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.OptimizeRestoredTableMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.progress = $root.google.bigtable.admin.v2.OperationProgress.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OptimizeRestoredTableMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.OptimizeRestoredTableMetadata} OptimizeRestoredTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeRestoredTableMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OptimizeRestoredTableMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OptimizeRestoredTableMetadata.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.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.bigtable.admin.v2.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + return null; + }; + + /** + * Creates an OptimizeRestoredTableMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.OptimizeRestoredTableMetadata} OptimizeRestoredTableMetadata + */ + OptimizeRestoredTableMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.OptimizeRestoredTableMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.OptimizeRestoredTableMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.bigtable.admin.v2.OptimizeRestoredTableMetadata.progress: object expected"); + message.progress = $root.google.bigtable.admin.v2.OperationProgress.fromObject(object.progress); + } + return message; + }; + + /** + * Creates a plain object from an OptimizeRestoredTableMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {google.bigtable.admin.v2.OptimizeRestoredTableMetadata} message OptimizeRestoredTableMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OptimizeRestoredTableMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.progress = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.bigtable.admin.v2.OperationProgress.toObject(message.progress, options); + return object; + }; + + /** + * Converts this OptimizeRestoredTableMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @instance + * @returns {Object.} JSON object + */ + OptimizeRestoredTableMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OptimizeRestoredTableMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.OptimizeRestoredTableMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OptimizeRestoredTableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.OptimizeRestoredTableMetadata"; + }; + + return OptimizeRestoredTableMetadata; + })(); + + v2.CreateTableRequest = (function() { + + /** + * Properties of a CreateTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateTableRequest + * @property {string|null} [parent] CreateTableRequest parent + * @property {string|null} [tableId] CreateTableRequest tableId + * @property {google.bigtable.admin.v2.ITable|null} [table] CreateTableRequest table + * @property {Array.|null} [initialSplits] CreateTableRequest initialSplits + */ + + /** + * Constructs a new CreateTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateTableRequest. + * @implements ICreateTableRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateTableRequest=} [properties] Properties to set + */ + function CreateTableRequest(properties) { + this.initialSplits = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTableRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @instance + */ + CreateTableRequest.prototype.parent = ""; + + /** + * CreateTableRequest tableId. + * @member {string} tableId + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @instance + */ + CreateTableRequest.prototype.tableId = ""; + + /** + * CreateTableRequest table. + * @member {google.bigtable.admin.v2.ITable|null|undefined} table + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @instance + */ + CreateTableRequest.prototype.table = null; + + /** + * CreateTableRequest initialSplits. + * @member {Array.} initialSplits + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @instance + */ + CreateTableRequest.prototype.initialSplits = $util.emptyArray; + + /** + * Creates a new CreateTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {google.bigtable.admin.v2.ICreateTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest instance + */ + CreateTableRequest.create = function create(properties) { + return new CreateTableRequest(properties); + }; + + /** + * Encodes the specified CreateTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {google.bigtable.admin.v2.ICreateTableRequest} message CreateTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.google.bigtable.admin.v2.Table.encode(message.table, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.initialSplits != null && message.initialSplits.length) + for (var i = 0; i < message.initialSplits.length; ++i) + $root.google.bigtable.admin.v2.CreateTableRequest.Split.encode(message.initialSplits[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {google.bigtable.admin.v2.ICreateTableRequest} message CreateTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tableId = reader.string(); + break; + } + case 3: { + message.table = $root.google.bigtable.admin.v2.Table.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.initialSplits && message.initialSplits.length)) + message.initialSplits = []; + message.initialSplits.push($root.google.bigtable.admin.v2.CreateTableRequest.Split.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTableRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.table != null && message.hasOwnProperty("table")) { + var error = $root.google.bigtable.admin.v2.Table.verify(message.table); + if (error) + return "table." + error; + } + if (message.initialSplits != null && message.hasOwnProperty("initialSplits")) { + if (!Array.isArray(message.initialSplits)) + return "initialSplits: array expected"; + for (var i = 0; i < message.initialSplits.length; ++i) { + var error = $root.google.bigtable.admin.v2.CreateTableRequest.Split.verify(message.initialSplits[i]); + if (error) + return "initialSplits." + error; + } + } + return null; + }; + + /** + * Creates a CreateTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest + */ + CreateTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateTableRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.table != null) { + if (typeof object.table !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateTableRequest.table: object expected"); + message.table = $root.google.bigtable.admin.v2.Table.fromObject(object.table); + } + if (object.initialSplits) { + if (!Array.isArray(object.initialSplits)) + throw TypeError(".google.bigtable.admin.v2.CreateTableRequest.initialSplits: array expected"); + message.initialSplits = []; + for (var i = 0; i < object.initialSplits.length; ++i) { + if (typeof object.initialSplits[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateTableRequest.initialSplits: object expected"); + message.initialSplits[i] = $root.google.bigtable.admin.v2.CreateTableRequest.Split.fromObject(object.initialSplits[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {google.bigtable.admin.v2.CreateTableRequest} message CreateTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTableRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.initialSplits = []; + if (options.defaults) { + object.parent = ""; + object.tableId = ""; + object.table = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.table != null && message.hasOwnProperty("table")) + object.table = $root.google.bigtable.admin.v2.Table.toObject(message.table, options); + if (message.initialSplits && message.initialSplits.length) { + object.initialSplits = []; + for (var j = 0; j < message.initialSplits.length; ++j) + object.initialSplits[j] = $root.google.bigtable.admin.v2.CreateTableRequest.Split.toObject(message.initialSplits[j], options); + } + return object; + }; + + /** + * Converts this CreateTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateTableRequest"; + }; + + CreateTableRequest.Split = (function() { + + /** + * Properties of a Split. + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @interface ISplit + * @property {Uint8Array|null} [key] Split key + */ + + /** + * Constructs a new Split. + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @classdesc Represents a Split. + * @implements ISplit + * @constructor + * @param {google.bigtable.admin.v2.CreateTableRequest.ISplit=} [properties] Properties to set + */ + function Split(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Split key. + * @member {Uint8Array} key + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @instance + */ + Split.prototype.key = $util.newBuffer([]); + + /** + * Creates a new Split instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {google.bigtable.admin.v2.CreateTableRequest.ISplit=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateTableRequest.Split} Split instance + */ + Split.create = function create(properties) { + return new Split(properties); + }; + + /** + * Encodes the specified Split message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.Split.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {google.bigtable.admin.v2.CreateTableRequest.ISplit} message Split message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Split.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + return writer; + }; + + /** + * Encodes the specified Split message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.Split.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {google.bigtable.admin.v2.CreateTableRequest.ISplit} message Split message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Split.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Split message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateTableRequest.Split} Split + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Split.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateTableRequest.Split(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.key = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Split message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateTableRequest.Split} Split + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Split.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Split message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Split.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + return null; + }; + + /** + * Creates a Split message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateTableRequest.Split} Split + */ + Split.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateTableRequest.Split) + return object; + var message = new $root.google.bigtable.admin.v2.CreateTableRequest.Split(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length >= 0) + message.key = object.key; + return message; + }; + + /** + * Creates a plain object from a Split message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {google.bigtable.admin.v2.CreateTableRequest.Split} message Split + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Split.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + return object; + }; + + /** + * Converts this Split to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @instance + * @returns {Object.} JSON object + */ + Split.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Split + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Split.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateTableRequest.Split"; + }; + + return Split; + })(); + + return CreateTableRequest; + })(); + + v2.CreateTableFromSnapshotRequest = (function() { + + /** + * Properties of a CreateTableFromSnapshotRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateTableFromSnapshotRequest + * @property {string|null} [parent] CreateTableFromSnapshotRequest parent + * @property {string|null} [tableId] CreateTableFromSnapshotRequest tableId + * @property {string|null} [sourceSnapshot] CreateTableFromSnapshotRequest sourceSnapshot + */ + + /** + * Constructs a new CreateTableFromSnapshotRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateTableFromSnapshotRequest. + * @implements ICreateTableFromSnapshotRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest=} [properties] Properties to set + */ + function CreateTableFromSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTableFromSnapshotRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @instance + */ + CreateTableFromSnapshotRequest.prototype.parent = ""; + + /** + * CreateTableFromSnapshotRequest tableId. + * @member {string} tableId + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @instance + */ + CreateTableFromSnapshotRequest.prototype.tableId = ""; + + /** + * CreateTableFromSnapshotRequest sourceSnapshot. + * @member {string} sourceSnapshot + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @instance + */ + CreateTableFromSnapshotRequest.prototype.sourceSnapshot = ""; + + /** + * Creates a new CreateTableFromSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} CreateTableFromSnapshotRequest instance + */ + CreateTableFromSnapshotRequest.create = function create(properties) { + return new CreateTableFromSnapshotRequest(properties); + }; + + /** + * Encodes the specified CreateTableFromSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest} message CreateTableFromSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableFromSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); + if (message.sourceSnapshot != null && Object.hasOwnProperty.call(message, "sourceSnapshot")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceSnapshot); + return writer; + }; + + /** + * Encodes the specified CreateTableFromSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest} message CreateTableFromSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableFromSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTableFromSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} CreateTableFromSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableFromSnapshotRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tableId = reader.string(); + break; + } + case 3: { + message.sourceSnapshot = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTableFromSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} CreateTableFromSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableFromSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTableFromSnapshotRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTableFromSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) + if (!$util.isString(message.sourceSnapshot)) + return "sourceSnapshot: string expected"; + return null; + }; + + /** + * Creates a CreateTableFromSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} CreateTableFromSnapshotRequest + */ + CreateTableFromSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.sourceSnapshot != null) + message.sourceSnapshot = String(object.sourceSnapshot); + return message; + }; + + /** + * Creates a plain object from a CreateTableFromSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} message CreateTableFromSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTableFromSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tableId = ""; + object.sourceSnapshot = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) + object.sourceSnapshot = message.sourceSnapshot; + return object; + }; + + /** + * Converts this CreateTableFromSnapshotRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTableFromSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTableFromSnapshotRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTableFromSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateTableFromSnapshotRequest"; + }; + + return CreateTableFromSnapshotRequest; + })(); + + v2.DropRowRangeRequest = (function() { + + /** + * Properties of a DropRowRangeRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDropRowRangeRequest + * @property {string|null} [name] DropRowRangeRequest name + * @property {Uint8Array|null} [rowKeyPrefix] DropRowRangeRequest rowKeyPrefix + * @property {boolean|null} [deleteAllDataFromTable] DropRowRangeRequest deleteAllDataFromTable + */ + + /** + * Constructs a new DropRowRangeRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DropRowRangeRequest. + * @implements IDropRowRangeRequest + * @constructor + * @param {google.bigtable.admin.v2.IDropRowRangeRequest=} [properties] Properties to set + */ + function DropRowRangeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DropRowRangeRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @instance + */ + DropRowRangeRequest.prototype.name = ""; + + /** + * DropRowRangeRequest rowKeyPrefix. + * @member {Uint8Array|null|undefined} rowKeyPrefix + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @instance + */ + DropRowRangeRequest.prototype.rowKeyPrefix = null; + + /** + * DropRowRangeRequest deleteAllDataFromTable. + * @member {boolean|null|undefined} deleteAllDataFromTable + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @instance + */ + DropRowRangeRequest.prototype.deleteAllDataFromTable = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DropRowRangeRequest target. + * @member {"rowKeyPrefix"|"deleteAllDataFromTable"|undefined} target + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @instance + */ + Object.defineProperty(DropRowRangeRequest.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["rowKeyPrefix", "deleteAllDataFromTable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DropRowRangeRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {google.bigtable.admin.v2.IDropRowRangeRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DropRowRangeRequest} DropRowRangeRequest instance + */ + DropRowRangeRequest.create = function create(properties) { + return new DropRowRangeRequest(properties); + }; + + /** + * Encodes the specified DropRowRangeRequest message. Does not implicitly {@link google.bigtable.admin.v2.DropRowRangeRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {google.bigtable.admin.v2.IDropRowRangeRequest} message DropRowRangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropRowRangeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.rowKeyPrefix != null && Object.hasOwnProperty.call(message, "rowKeyPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rowKeyPrefix); + if (message.deleteAllDataFromTable != null && Object.hasOwnProperty.call(message, "deleteAllDataFromTable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deleteAllDataFromTable); + return writer; + }; + + /** + * Encodes the specified DropRowRangeRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DropRowRangeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {google.bigtable.admin.v2.IDropRowRangeRequest} message DropRowRangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropRowRangeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DropRowRangeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DropRowRangeRequest} DropRowRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropRowRangeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DropRowRangeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.rowKeyPrefix = reader.bytes(); + break; + } + case 3: { + message.deleteAllDataFromTable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DropRowRangeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DropRowRangeRequest} DropRowRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropRowRangeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DropRowRangeRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DropRowRangeRequest.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.rowKeyPrefix != null && message.hasOwnProperty("rowKeyPrefix")) { + properties.target = 1; + if (!(message.rowKeyPrefix && typeof message.rowKeyPrefix.length === "number" || $util.isString(message.rowKeyPrefix))) + return "rowKeyPrefix: buffer expected"; + } + if (message.deleteAllDataFromTable != null && message.hasOwnProperty("deleteAllDataFromTable")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (typeof message.deleteAllDataFromTable !== "boolean") + return "deleteAllDataFromTable: boolean expected"; + } + return null; + }; + + /** + * Creates a DropRowRangeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DropRowRangeRequest} DropRowRangeRequest + */ + DropRowRangeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DropRowRangeRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DropRowRangeRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.rowKeyPrefix != null) + if (typeof object.rowKeyPrefix === "string") + $util.base64.decode(object.rowKeyPrefix, message.rowKeyPrefix = $util.newBuffer($util.base64.length(object.rowKeyPrefix)), 0); + else if (object.rowKeyPrefix.length >= 0) + message.rowKeyPrefix = object.rowKeyPrefix; + if (object.deleteAllDataFromTable != null) + message.deleteAllDataFromTable = Boolean(object.deleteAllDataFromTable); + return message; + }; + + /** + * Creates a plain object from a DropRowRangeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {google.bigtable.admin.v2.DropRowRangeRequest} message DropRowRangeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DropRowRangeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.rowKeyPrefix != null && message.hasOwnProperty("rowKeyPrefix")) { + object.rowKeyPrefix = options.bytes === String ? $util.base64.encode(message.rowKeyPrefix, 0, message.rowKeyPrefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKeyPrefix) : message.rowKeyPrefix; + if (options.oneofs) + object.target = "rowKeyPrefix"; + } + if (message.deleteAllDataFromTable != null && message.hasOwnProperty("deleteAllDataFromTable")) { + object.deleteAllDataFromTable = message.deleteAllDataFromTable; + if (options.oneofs) + object.target = "deleteAllDataFromTable"; + } + return object; + }; + + /** + * Converts this DropRowRangeRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @instance + * @returns {Object.} JSON object + */ + DropRowRangeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DropRowRangeRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DropRowRangeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DropRowRangeRequest"; + }; + + return DropRowRangeRequest; + })(); + + v2.ListTablesRequest = (function() { + + /** + * Properties of a ListTablesRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListTablesRequest + * @property {string|null} [parent] ListTablesRequest parent + * @property {google.bigtable.admin.v2.Table.View|null} [view] ListTablesRequest view + * @property {number|null} [pageSize] ListTablesRequest pageSize + * @property {string|null} [pageToken] ListTablesRequest pageToken + */ + + /** + * Constructs a new ListTablesRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListTablesRequest. + * @implements IListTablesRequest + * @constructor + * @param {google.bigtable.admin.v2.IListTablesRequest=} [properties] Properties to set + */ + function ListTablesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTablesRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @instance + */ + ListTablesRequest.prototype.parent = ""; + + /** + * ListTablesRequest view. + * @member {google.bigtable.admin.v2.Table.View} view + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @instance + */ + ListTablesRequest.prototype.view = 0; + + /** + * ListTablesRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @instance + */ + ListTablesRequest.prototype.pageSize = 0; + + /** + * ListTablesRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @instance + */ + ListTablesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTablesRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {google.bigtable.admin.v2.IListTablesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListTablesRequest} ListTablesRequest instance + */ + ListTablesRequest.create = function create(properties) { + return new ListTablesRequest(properties); + }; + + /** + * Encodes the specified ListTablesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListTablesRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {google.bigtable.admin.v2.IListTablesRequest} message ListTablesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTablesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListTablesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListTablesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {google.bigtable.admin.v2.IListTablesRequest} message ListTablesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTablesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTablesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListTablesRequest} ListTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTablesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListTablesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTablesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListTablesRequest} ListTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTablesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTablesRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTablesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + case 4: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTablesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListTablesRequest} ListTablesRequest + */ + ListTablesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListTablesRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListTablesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "NAME_ONLY": + case 1: + message.view = 1; + break; + case "SCHEMA_VIEW": + case 2: + message.view = 2; + break; + case "REPLICATION_VIEW": + case 3: + message.view = 3; + break; + case "ENCRYPTION_VIEW": + case 5: + message.view = 5; + break; + case "FULL": + case 4: + message.view = 4; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTablesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {google.bigtable.admin.v2.ListTablesRequest} message ListTablesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTablesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.bigtable.admin.v2.Table.View[message.view] === undefined ? message.view : $root.google.bigtable.admin.v2.Table.View[message.view] : message.view; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListTablesRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTablesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTablesRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTablesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListTablesRequest"; + }; + + return ListTablesRequest; + })(); + + v2.ListTablesResponse = (function() { + + /** + * Properties of a ListTablesResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListTablesResponse + * @property {Array.|null} [tables] ListTablesResponse tables + * @property {string|null} [nextPageToken] ListTablesResponse nextPageToken + */ + + /** + * Constructs a new ListTablesResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListTablesResponse. + * @implements IListTablesResponse + * @constructor + * @param {google.bigtable.admin.v2.IListTablesResponse=} [properties] Properties to set + */ + function ListTablesResponse(properties) { + this.tables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTablesResponse tables. + * @member {Array.} tables + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @instance + */ + ListTablesResponse.prototype.tables = $util.emptyArray; + + /** + * ListTablesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @instance + */ + ListTablesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTablesResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {google.bigtable.admin.v2.IListTablesResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse instance + */ + ListTablesResponse.create = function create(properties) { + return new ListTablesResponse(properties); + }; + + /** + * Encodes the specified ListTablesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListTablesResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {google.bigtable.admin.v2.IListTablesResponse} message ListTablesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTablesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tables != null && message.tables.length) + for (var i = 0; i < message.tables.length; ++i) + $root.google.bigtable.admin.v2.Table.encode(message.tables[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListTablesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListTablesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {google.bigtable.admin.v2.IListTablesResponse} message ListTablesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTablesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTablesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTablesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListTablesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tables && message.tables.length)) + message.tables = []; + message.tables.push($root.google.bigtable.admin.v2.Table.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTablesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTablesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTablesResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTablesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tables != null && message.hasOwnProperty("tables")) { + if (!Array.isArray(message.tables)) + return "tables: array expected"; + for (var i = 0; i < message.tables.length; ++i) { + var error = $root.google.bigtable.admin.v2.Table.verify(message.tables[i]); + if (error) + return "tables." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTablesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse + */ + ListTablesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListTablesResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListTablesResponse(); + if (object.tables) { + if (!Array.isArray(object.tables)) + throw TypeError(".google.bigtable.admin.v2.ListTablesResponse.tables: array expected"); + message.tables = []; + for (var i = 0; i < object.tables.length; ++i) { + if (typeof object.tables[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListTablesResponse.tables: object expected"); + message.tables[i] = $root.google.bigtable.admin.v2.Table.fromObject(object.tables[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTablesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {google.bigtable.admin.v2.ListTablesResponse} message ListTablesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTablesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tables = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tables && message.tables.length) { + object.tables = []; + for (var j = 0; j < message.tables.length; ++j) + object.tables[j] = $root.google.bigtable.admin.v2.Table.toObject(message.tables[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTablesResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @instance + * @returns {Object.} JSON object + */ + ListTablesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTablesResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListTablesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTablesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListTablesResponse"; + }; + + return ListTablesResponse; + })(); + + v2.GetTableRequest = (function() { + + /** + * Properties of a GetTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetTableRequest + * @property {string|null} [name] GetTableRequest name + * @property {google.bigtable.admin.v2.Table.View|null} [view] GetTableRequest view + */ + + /** + * Constructs a new GetTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetTableRequest. + * @implements IGetTableRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetTableRequest=} [properties] Properties to set + */ + function GetTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTableRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetTableRequest + * @instance + */ + GetTableRequest.prototype.name = ""; + + /** + * GetTableRequest view. + * @member {google.bigtable.admin.v2.Table.View} view + * @memberof google.bigtable.admin.v2.GetTableRequest + * @instance + */ + GetTableRequest.prototype.view = 0; + + /** + * Creates a new GetTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {google.bigtable.admin.v2.IGetTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetTableRequest} GetTableRequest instance + */ + GetTableRequest.create = function create(properties) { + return new GetTableRequest(properties); + }; + + /** + * Encodes the specified GetTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {google.bigtable.admin.v2.IGetTableRequest} message GetTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {google.bigtable.admin.v2.IGetTableRequest} message GetTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetTableRequest} GetTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetTableRequest} GetTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTableRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + case 4: + break; + } + return null; + }; + + /** + * Creates a GetTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetTableRequest} GetTableRequest + */ + GetTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetTableRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "NAME_ONLY": + case 1: + message.view = 1; + break; + case "SCHEMA_VIEW": + case 2: + message.view = 2; + break; + case "REPLICATION_VIEW": + case 3: + message.view = 3; + break; + case "ENCRYPTION_VIEW": + case 5: + message.view = 5; + break; + case "FULL": + case 4: + message.view = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {google.bigtable.admin.v2.GetTableRequest} message GetTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTableRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.bigtable.admin.v2.Table.View[message.view] === undefined ? message.view : $root.google.bigtable.admin.v2.Table.View[message.view] : message.view; + return object; + }; + + /** + * Converts this GetTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetTableRequest + * @instance + * @returns {Object.} JSON object + */ + GetTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetTableRequest"; + }; + + return GetTableRequest; + })(); + + v2.UpdateTableRequest = (function() { + + /** + * Properties of an UpdateTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateTableRequest + * @property {google.bigtable.admin.v2.ITable|null} [table] UpdateTableRequest table + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTableRequest updateMask + * @property {boolean|null} [ignoreWarnings] UpdateTableRequest ignoreWarnings + */ + + /** + * Constructs a new UpdateTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateTableRequest. + * @implements IUpdateTableRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateTableRequest=} [properties] Properties to set + */ + function UpdateTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTableRequest table. + * @member {google.bigtable.admin.v2.ITable|null|undefined} table + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @instance + */ + UpdateTableRequest.prototype.table = null; + + /** + * UpdateTableRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @instance + */ + UpdateTableRequest.prototype.updateMask = null; + + /** + * UpdateTableRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @instance + */ + UpdateTableRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new UpdateTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateTableRequest} UpdateTableRequest instance + */ + UpdateTableRequest.create = function create(properties) { + return new UpdateTableRequest(properties); + }; + + /** + * Encodes the specified UpdateTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateTableRequest} message UpdateTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.google.bigtable.admin.v2.Table.encode(message.table, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified UpdateTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateTableRequest} message UpdateTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateTableRequest} UpdateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = $root.google.bigtable.admin.v2.Table.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateTableRequest} UpdateTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTableRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) { + var error = $root.google.bigtable.admin.v2.Table.verify(message.table); + if (error) + return "table." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates an UpdateTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateTableRequest} UpdateTableRequest + */ + UpdateTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateTableRequest(); + if (object.table != null) { + if (typeof object.table !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateTableRequest.table: object expected"); + message.table = $root.google.bigtable.admin.v2.Table.fromObject(object.table); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateTableRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from an UpdateTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {google.bigtable.admin.v2.UpdateTableRequest} message UpdateTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTableRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.table = null; + object.updateMask = null; + object.ignoreWarnings = false; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = $root.google.bigtable.admin.v2.Table.toObject(message.table, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this UpdateTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateTableRequest"; + }; + + return UpdateTableRequest; + })(); + + v2.UpdateTableMetadata = (function() { + + /** + * Properties of an UpdateTableMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateTableMetadata + * @property {string|null} [name] UpdateTableMetadata name + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateTableMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] UpdateTableMetadata endTime + */ + + /** + * Constructs a new UpdateTableMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateTableMetadata. + * @implements IUpdateTableMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateTableMetadata=} [properties] Properties to set + */ + function UpdateTableMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTableMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @instance + */ + UpdateTableMetadata.prototype.name = ""; + + /** + * UpdateTableMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @instance + */ + UpdateTableMetadata.prototype.startTime = null; + + /** + * UpdateTableMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @instance + */ + UpdateTableMetadata.prototype.endTime = null; + + /** + * Creates a new UpdateTableMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateTableMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateTableMetadata} UpdateTableMetadata instance + */ + UpdateTableMetadata.create = function create(properties) { + return new UpdateTableMetadata(properties); + }; + + /** + * Encodes the specified UpdateTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateTableMetadata} message UpdateTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTableMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateTableMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateTableMetadata} message UpdateTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTableMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTableMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateTableMetadata} UpdateTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTableMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateTableMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTableMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateTableMetadata} UpdateTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTableMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTableMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTableMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an UpdateTableMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateTableMetadata} UpdateTableMetadata + */ + UpdateTableMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateTableMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateTableMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateTableMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateTableMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTableMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateTableMetadata} message UpdateTableMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTableMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this UpdateTableMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateTableMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTableMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateTableMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateTableMetadata"; + }; + + return UpdateTableMetadata; + })(); + + v2.DeleteTableRequest = (function() { + + /** + * Properties of a DeleteTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteTableRequest + * @property {string|null} [name] DeleteTableRequest name + */ + + /** + * Constructs a new DeleteTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteTableRequest. + * @implements IDeleteTableRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteTableRequest=} [properties] Properties to set + */ + function DeleteTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTableRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @instance + */ + DeleteTableRequest.prototype.name = ""; + + /** + * Creates a new DeleteTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest instance + */ + DeleteTableRequest.create = function create(properties) { + return new DeleteTableRequest(properties); + }; + + /** + * Encodes the specified DeleteTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteTableRequest} message DeleteTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteTableRequest} message DeleteTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTableRequest.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 DeleteTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest + */ + DeleteTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteTableRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.DeleteTableRequest} message DeleteTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTableRequest.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 DeleteTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteTableRequest"; + }; + + return DeleteTableRequest; + })(); + + v2.UndeleteTableRequest = (function() { + + /** + * Properties of an UndeleteTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUndeleteTableRequest + * @property {string|null} [name] UndeleteTableRequest name + */ + + /** + * Constructs a new UndeleteTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UndeleteTableRequest. + * @implements IUndeleteTableRequest + * @constructor + * @param {google.bigtable.admin.v2.IUndeleteTableRequest=} [properties] Properties to set + */ + function UndeleteTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeleteTableRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @instance + */ + UndeleteTableRequest.prototype.name = ""; + + /** + * Creates a new UndeleteTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.IUndeleteTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UndeleteTableRequest} UndeleteTableRequest instance + */ + UndeleteTableRequest.create = function create(properties) { + return new UndeleteTableRequest(properties); + }; + + /** + * Encodes the specified UndeleteTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.IUndeleteTableRequest} message UndeleteTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified UndeleteTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.IUndeleteTableRequest} message UndeleteTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UndeleteTableRequest} UndeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UndeleteTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UndeleteTableRequest} UndeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteTableRequest.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 UndeleteTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UndeleteTableRequest} UndeleteTableRequest + */ + UndeleteTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UndeleteTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UndeleteTableRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UndeleteTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {google.bigtable.admin.v2.UndeleteTableRequest} message UndeleteTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteTableRequest.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 UndeleteTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @instance + * @returns {Object.} JSON object + */ + UndeleteTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UndeleteTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UndeleteTableRequest"; + }; + + return UndeleteTableRequest; + })(); + + v2.UndeleteTableMetadata = (function() { + + /** + * Properties of an UndeleteTableMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUndeleteTableMetadata + * @property {string|null} [name] UndeleteTableMetadata name + * @property {google.protobuf.ITimestamp|null} [startTime] UndeleteTableMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] UndeleteTableMetadata endTime + */ + + /** + * Constructs a new UndeleteTableMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UndeleteTableMetadata. + * @implements IUndeleteTableMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUndeleteTableMetadata=} [properties] Properties to set + */ + function UndeleteTableMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeleteTableMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @instance + */ + UndeleteTableMetadata.prototype.name = ""; + + /** + * UndeleteTableMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @instance + */ + UndeleteTableMetadata.prototype.startTime = null; + + /** + * UndeleteTableMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @instance + */ + UndeleteTableMetadata.prototype.endTime = null; + + /** + * Creates a new UndeleteTableMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {google.bigtable.admin.v2.IUndeleteTableMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UndeleteTableMetadata} UndeleteTableMetadata instance + */ + UndeleteTableMetadata.create = function create(properties) { + return new UndeleteTableMetadata(properties); + }; + + /** + * Encodes the specified UndeleteTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {google.bigtable.admin.v2.IUndeleteTableMetadata} message UndeleteTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteTableMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UndeleteTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UndeleteTableMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {google.bigtable.admin.v2.IUndeleteTableMetadata} message UndeleteTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteTableMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteTableMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UndeleteTableMetadata} UndeleteTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteTableMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UndeleteTableMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteTableMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UndeleteTableMetadata} UndeleteTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteTableMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteTableMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteTableMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an UndeleteTableMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UndeleteTableMetadata} UndeleteTableMetadata + */ + UndeleteTableMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UndeleteTableMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UndeleteTableMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UndeleteTableMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UndeleteTableMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an UndeleteTableMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {google.bigtable.admin.v2.UndeleteTableMetadata} message UndeleteTableMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteTableMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this UndeleteTableMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @instance + * @returns {Object.} JSON object + */ + UndeleteTableMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteTableMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UndeleteTableMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteTableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UndeleteTableMetadata"; + }; + + return UndeleteTableMetadata; + })(); + + v2.ModifyColumnFamiliesRequest = (function() { + + /** + * Properties of a ModifyColumnFamiliesRequest. + * @memberof google.bigtable.admin.v2 + * @interface IModifyColumnFamiliesRequest + * @property {string|null} [name] ModifyColumnFamiliesRequest name + * @property {Array.|null} [modifications] ModifyColumnFamiliesRequest modifications + * @property {boolean|null} [ignoreWarnings] ModifyColumnFamiliesRequest ignoreWarnings + */ + + /** + * Constructs a new ModifyColumnFamiliesRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ModifyColumnFamiliesRequest. + * @implements IModifyColumnFamiliesRequest + * @constructor + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest=} [properties] Properties to set + */ + function ModifyColumnFamiliesRequest(properties) { + this.modifications = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModifyColumnFamiliesRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @instance + */ + ModifyColumnFamiliesRequest.prototype.name = ""; + + /** + * ModifyColumnFamiliesRequest modifications. + * @member {Array.} modifications + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @instance + */ + ModifyColumnFamiliesRequest.prototype.modifications = $util.emptyArray; + + /** + * ModifyColumnFamiliesRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @instance + */ + ModifyColumnFamiliesRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new ModifyColumnFamiliesRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest instance + */ + ModifyColumnFamiliesRequest.create = function create(properties) { + return new ModifyColumnFamiliesRequest(properties); + }; + + /** + * Encodes the specified ModifyColumnFamiliesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest} message ModifyColumnFamiliesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyColumnFamiliesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.modifications != null && message.modifications.length) + for (var i = 0; i < message.modifications.length; ++i) + $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.encode(message.modifications[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified ModifyColumnFamiliesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest} message ModifyColumnFamiliesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyColumnFamiliesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyColumnFamiliesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.modifications && message.modifications.length)) + message.modifications = []; + message.modifications.push($root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.decode(reader, reader.uint32())); + break; + } + case 3: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyColumnFamiliesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModifyColumnFamiliesRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModifyColumnFamiliesRequest.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.modifications != null && message.hasOwnProperty("modifications")) { + if (!Array.isArray(message.modifications)) + return "modifications: array expected"; + for (var i = 0; i < message.modifications.length; ++i) { + var error = $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.verify(message.modifications[i]); + if (error) + return "modifications." + error; + } + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates a ModifyColumnFamiliesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest + */ + ModifyColumnFamiliesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.modifications) { + if (!Array.isArray(object.modifications)) + throw TypeError(".google.bigtable.admin.v2.ModifyColumnFamiliesRequest.modifications: array expected"); + message.modifications = []; + for (var i = 0; i < object.modifications.length; ++i) { + if (typeof object.modifications[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ModifyColumnFamiliesRequest.modifications: object expected"); + message.modifications[i] = $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.fromObject(object.modifications[i]); + } + } + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from a ModifyColumnFamiliesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} message ModifyColumnFamiliesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModifyColumnFamiliesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.modifications = []; + if (options.defaults) { + object.name = ""; + object.ignoreWarnings = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.modifications && message.modifications.length) { + object.modifications = []; + for (var j = 0; j < message.modifications.length; ++j) + object.modifications[j] = $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.toObject(message.modifications[j], options); + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this ModifyColumnFamiliesRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @instance + * @returns {Object.} JSON object + */ + ModifyColumnFamiliesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModifyColumnFamiliesRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModifyColumnFamiliesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ModifyColumnFamiliesRequest"; + }; + + ModifyColumnFamiliesRequest.Modification = (function() { + + /** + * Properties of a Modification. + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @interface IModification + * @property {string|null} [id] Modification id + * @property {google.bigtable.admin.v2.IColumnFamily|null} [create] Modification create + * @property {google.bigtable.admin.v2.IColumnFamily|null} [update] Modification update + * @property {boolean|null} [drop] Modification drop + * @property {google.protobuf.IFieldMask|null} [updateMask] Modification updateMask + */ + + /** + * Constructs a new Modification. + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @classdesc Represents a Modification. + * @implements IModification + * @constructor + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification=} [properties] Properties to set + */ + function Modification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Modification id. + * @member {string} id + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Modification.prototype.id = ""; + + /** + * Modification create. + * @member {google.bigtable.admin.v2.IColumnFamily|null|undefined} create + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Modification.prototype.create = null; + + /** + * Modification update. + * @member {google.bigtable.admin.v2.IColumnFamily|null|undefined} update + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Modification.prototype.update = null; + + /** + * Modification drop. + * @member {boolean|null|undefined} drop + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Modification.prototype.drop = null; + + /** + * Modification updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Modification.prototype.updateMask = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Modification mod. + * @member {"create"|"update"|"drop"|undefined} mod + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Object.defineProperty(Modification.prototype, "mod", { + get: $util.oneOfGetter($oneOfFields = ["create", "update", "drop"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Modification instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} Modification instance + */ + Modification.create = function create(properties) { + return new Modification(properties); + }; + + /** + * Encodes the specified Modification message. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification} message Modification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Modification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.create != null && Object.hasOwnProperty.call(message, "create")) + $root.google.bigtable.admin.v2.ColumnFamily.encode(message.create, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.google.bigtable.admin.v2.ColumnFamily.encode(message.update, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.drop != null && Object.hasOwnProperty.call(message, "drop")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.drop); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Modification message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification} message Modification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Modification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Modification message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} Modification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Modification.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.create = $root.google.bigtable.admin.v2.ColumnFamily.decode(reader, reader.uint32()); + break; + } + case 3: { + message.update = $root.google.bigtable.admin.v2.ColumnFamily.decode(reader, reader.uint32()); + break; + } + case 4: { + message.drop = reader.bool(); + break; + } + case 6: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Modification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} Modification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Modification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Modification message. + * @function verify + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Modification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.create != null && message.hasOwnProperty("create")) { + properties.mod = 1; + { + var error = $root.google.bigtable.admin.v2.ColumnFamily.verify(message.create); + if (error) + return "create." + error; + } + } + if (message.update != null && message.hasOwnProperty("update")) { + if (properties.mod === 1) + return "mod: multiple values"; + properties.mod = 1; + { + var error = $root.google.bigtable.admin.v2.ColumnFamily.verify(message.update); + if (error) + return "update." + error; + } + } + if (message.drop != null && message.hasOwnProperty("drop")) { + if (properties.mod === 1) + return "mod: multiple values"; + properties.mod = 1; + if (typeof message.drop !== "boolean") + return "drop: boolean expected"; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a Modification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} Modification + */ + Modification.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification) + return object; + var message = new $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification(); + if (object.id != null) + message.id = String(object.id); + if (object.create != null) { + if (typeof object.create !== "object") + throw TypeError(".google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.create: object expected"); + message.create = $root.google.bigtable.admin.v2.ColumnFamily.fromObject(object.create); + } + if (object.update != null) { + if (typeof object.update !== "object") + throw TypeError(".google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.update: object expected"); + message.update = $root.google.bigtable.admin.v2.ColumnFamily.fromObject(object.update); + } + if (object.drop != null) + message.drop = Boolean(object.drop); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a Modification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} message Modification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Modification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.updateMask = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.create != null && message.hasOwnProperty("create")) { + object.create = $root.google.bigtable.admin.v2.ColumnFamily.toObject(message.create, options); + if (options.oneofs) + object.mod = "create"; + } + if (message.update != null && message.hasOwnProperty("update")) { + object.update = $root.google.bigtable.admin.v2.ColumnFamily.toObject(message.update, options); + if (options.oneofs) + object.mod = "update"; + } + if (message.drop != null && message.hasOwnProperty("drop")) { + object.drop = message.drop; + if (options.oneofs) + object.mod = "drop"; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this Modification to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + * @returns {Object.} JSON object + */ + Modification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Modification + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Modification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification"; + }; + + return Modification; + })(); + + return ModifyColumnFamiliesRequest; + })(); + + v2.GenerateConsistencyTokenRequest = (function() { + + /** + * Properties of a GenerateConsistencyTokenRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGenerateConsistencyTokenRequest + * @property {string|null} [name] GenerateConsistencyTokenRequest name + */ + + /** + * Constructs a new GenerateConsistencyTokenRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GenerateConsistencyTokenRequest. + * @implements IGenerateConsistencyTokenRequest + * @constructor + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest=} [properties] Properties to set + */ + function GenerateConsistencyTokenRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateConsistencyTokenRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @instance + */ + GenerateConsistencyTokenRequest.prototype.name = ""; + + /** + * Creates a new GenerateConsistencyTokenRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest instance + */ + GenerateConsistencyTokenRequest.create = function create(properties) { + return new GenerateConsistencyTokenRequest(properties); + }; + + /** + * Encodes the specified GenerateConsistencyTokenRequest message. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest} message GenerateConsistencyTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateConsistencyTokenRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GenerateConsistencyTokenRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest} message GenerateConsistencyTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateConsistencyTokenRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateConsistencyTokenRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GenerateConsistencyTokenRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateConsistencyTokenRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateConsistencyTokenRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateConsistencyTokenRequest.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 GenerateConsistencyTokenRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest + */ + GenerateConsistencyTokenRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GenerateConsistencyTokenRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GenerateConsistencyTokenRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GenerateConsistencyTokenRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} message GenerateConsistencyTokenRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateConsistencyTokenRequest.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 GenerateConsistencyTokenRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateConsistencyTokenRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateConsistencyTokenRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateConsistencyTokenRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GenerateConsistencyTokenRequest"; + }; + + return GenerateConsistencyTokenRequest; + })(); + + v2.GenerateConsistencyTokenResponse = (function() { + + /** + * Properties of a GenerateConsistencyTokenResponse. + * @memberof google.bigtable.admin.v2 + * @interface IGenerateConsistencyTokenResponse + * @property {string|null} [consistencyToken] GenerateConsistencyTokenResponse consistencyToken + */ + + /** + * Constructs a new GenerateConsistencyTokenResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GenerateConsistencyTokenResponse. + * @implements IGenerateConsistencyTokenResponse + * @constructor + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse=} [properties] Properties to set + */ + function GenerateConsistencyTokenResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateConsistencyTokenResponse consistencyToken. + * @member {string} consistencyToken + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @instance + */ + GenerateConsistencyTokenResponse.prototype.consistencyToken = ""; + + /** + * Creates a new GenerateConsistencyTokenResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse instance + */ + GenerateConsistencyTokenResponse.create = function create(properties) { + return new GenerateConsistencyTokenResponse(properties); + }; + + /** + * Encodes the specified GenerateConsistencyTokenResponse message. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse} message GenerateConsistencyTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateConsistencyTokenResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consistencyToken != null && Object.hasOwnProperty.call(message, "consistencyToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.consistencyToken); + return writer; + }; + + /** + * Encodes the specified GenerateConsistencyTokenResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse} message GenerateConsistencyTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateConsistencyTokenResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateConsistencyTokenResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GenerateConsistencyTokenResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.consistencyToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateConsistencyTokenResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateConsistencyTokenResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateConsistencyTokenResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + if (!$util.isString(message.consistencyToken)) + return "consistencyToken: string expected"; + return null; + }; + + /** + * Creates a GenerateConsistencyTokenResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse + */ + GenerateConsistencyTokenResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GenerateConsistencyTokenResponse) + return object; + var message = new $root.google.bigtable.admin.v2.GenerateConsistencyTokenResponse(); + if (object.consistencyToken != null) + message.consistencyToken = String(object.consistencyToken); + return message; + }; + + /** + * Creates a plain object from a GenerateConsistencyTokenResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} message GenerateConsistencyTokenResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateConsistencyTokenResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.consistencyToken = ""; + if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + object.consistencyToken = message.consistencyToken; + return object; + }; + + /** + * Converts this GenerateConsistencyTokenResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateConsistencyTokenResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateConsistencyTokenResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateConsistencyTokenResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GenerateConsistencyTokenResponse"; + }; + + return GenerateConsistencyTokenResponse; + })(); + + v2.CheckConsistencyRequest = (function() { + + /** + * Properties of a CheckConsistencyRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICheckConsistencyRequest + * @property {string|null} [name] CheckConsistencyRequest name + * @property {string|null} [consistencyToken] CheckConsistencyRequest consistencyToken + * @property {google.bigtable.admin.v2.IStandardReadRemoteWrites|null} [standardReadRemoteWrites] CheckConsistencyRequest standardReadRemoteWrites + * @property {google.bigtable.admin.v2.IDataBoostReadLocalWrites|null} [dataBoostReadLocalWrites] CheckConsistencyRequest dataBoostReadLocalWrites + */ + + /** + * Constructs a new CheckConsistencyRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CheckConsistencyRequest. + * @implements ICheckConsistencyRequest + * @constructor + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest=} [properties] Properties to set + */ + function CheckConsistencyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckConsistencyRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @instance + */ + CheckConsistencyRequest.prototype.name = ""; + + /** + * CheckConsistencyRequest consistencyToken. + * @member {string} consistencyToken + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @instance + */ + CheckConsistencyRequest.prototype.consistencyToken = ""; + + /** + * CheckConsistencyRequest standardReadRemoteWrites. + * @member {google.bigtable.admin.v2.IStandardReadRemoteWrites|null|undefined} standardReadRemoteWrites + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @instance + */ + CheckConsistencyRequest.prototype.standardReadRemoteWrites = null; + + /** + * CheckConsistencyRequest dataBoostReadLocalWrites. + * @member {google.bigtable.admin.v2.IDataBoostReadLocalWrites|null|undefined} dataBoostReadLocalWrites + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @instance + */ + CheckConsistencyRequest.prototype.dataBoostReadLocalWrites = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CheckConsistencyRequest mode. + * @member {"standardReadRemoteWrites"|"dataBoostReadLocalWrites"|undefined} mode + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @instance + */ + Object.defineProperty(CheckConsistencyRequest.prototype, "mode", { + get: $util.oneOfGetter($oneOfFields = ["standardReadRemoteWrites", "dataBoostReadLocalWrites"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CheckConsistencyRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest instance + */ + CheckConsistencyRequest.create = function create(properties) { + return new CheckConsistencyRequest(properties); + }; + + /** + * Encodes the specified CheckConsistencyRequest message. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest} message CheckConsistencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckConsistencyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.consistencyToken != null && Object.hasOwnProperty.call(message, "consistencyToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.consistencyToken); + if (message.standardReadRemoteWrites != null && Object.hasOwnProperty.call(message, "standardReadRemoteWrites")) + $root.google.bigtable.admin.v2.StandardReadRemoteWrites.encode(message.standardReadRemoteWrites, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dataBoostReadLocalWrites != null && Object.hasOwnProperty.call(message, "dataBoostReadLocalWrites")) + $root.google.bigtable.admin.v2.DataBoostReadLocalWrites.encode(message.dataBoostReadLocalWrites, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CheckConsistencyRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest} message CheckConsistencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckConsistencyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckConsistencyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckConsistencyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CheckConsistencyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.consistencyToken = reader.string(); + break; + } + case 3: { + message.standardReadRemoteWrites = $root.google.bigtable.admin.v2.StandardReadRemoteWrites.decode(reader, reader.uint32()); + break; + } + case 4: { + message.dataBoostReadLocalWrites = $root.google.bigtable.admin.v2.DataBoostReadLocalWrites.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckConsistencyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckConsistencyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckConsistencyRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckConsistencyRequest.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.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + if (!$util.isString(message.consistencyToken)) + return "consistencyToken: string expected"; + if (message.standardReadRemoteWrites != null && message.hasOwnProperty("standardReadRemoteWrites")) { + properties.mode = 1; + { + var error = $root.google.bigtable.admin.v2.StandardReadRemoteWrites.verify(message.standardReadRemoteWrites); + if (error) + return "standardReadRemoteWrites." + error; + } + } + if (message.dataBoostReadLocalWrites != null && message.hasOwnProperty("dataBoostReadLocalWrites")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + { + var error = $root.google.bigtable.admin.v2.DataBoostReadLocalWrites.verify(message.dataBoostReadLocalWrites); + if (error) + return "dataBoostReadLocalWrites." + error; + } + } + return null; + }; + + /** + * Creates a CheckConsistencyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest + */ + CheckConsistencyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CheckConsistencyRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CheckConsistencyRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.consistencyToken != null) + message.consistencyToken = String(object.consistencyToken); + if (object.standardReadRemoteWrites != null) { + if (typeof object.standardReadRemoteWrites !== "object") + throw TypeError(".google.bigtable.admin.v2.CheckConsistencyRequest.standardReadRemoteWrites: object expected"); + message.standardReadRemoteWrites = $root.google.bigtable.admin.v2.StandardReadRemoteWrites.fromObject(object.standardReadRemoteWrites); + } + if (object.dataBoostReadLocalWrites != null) { + if (typeof object.dataBoostReadLocalWrites !== "object") + throw TypeError(".google.bigtable.admin.v2.CheckConsistencyRequest.dataBoostReadLocalWrites: object expected"); + message.dataBoostReadLocalWrites = $root.google.bigtable.admin.v2.DataBoostReadLocalWrites.fromObject(object.dataBoostReadLocalWrites); + } + return message; + }; + + /** + * Creates a plain object from a CheckConsistencyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {google.bigtable.admin.v2.CheckConsistencyRequest} message CheckConsistencyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckConsistencyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.consistencyToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + object.consistencyToken = message.consistencyToken; + if (message.standardReadRemoteWrites != null && message.hasOwnProperty("standardReadRemoteWrites")) { + object.standardReadRemoteWrites = $root.google.bigtable.admin.v2.StandardReadRemoteWrites.toObject(message.standardReadRemoteWrites, options); + if (options.oneofs) + object.mode = "standardReadRemoteWrites"; + } + if (message.dataBoostReadLocalWrites != null && message.hasOwnProperty("dataBoostReadLocalWrites")) { + object.dataBoostReadLocalWrites = $root.google.bigtable.admin.v2.DataBoostReadLocalWrites.toObject(message.dataBoostReadLocalWrites, options); + if (options.oneofs) + object.mode = "dataBoostReadLocalWrites"; + } + return object; + }; + + /** + * Converts this CheckConsistencyRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @instance + * @returns {Object.} JSON object + */ + CheckConsistencyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckConsistencyRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckConsistencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CheckConsistencyRequest"; + }; + + return CheckConsistencyRequest; + })(); + + v2.StandardReadRemoteWrites = (function() { + + /** + * Properties of a StandardReadRemoteWrites. + * @memberof google.bigtable.admin.v2 + * @interface IStandardReadRemoteWrites + */ + + /** + * Constructs a new StandardReadRemoteWrites. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a StandardReadRemoteWrites. + * @implements IStandardReadRemoteWrites + * @constructor + * @param {google.bigtable.admin.v2.IStandardReadRemoteWrites=} [properties] Properties to set + */ + function StandardReadRemoteWrites(properties) { + if (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 StandardReadRemoteWrites instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {google.bigtable.admin.v2.IStandardReadRemoteWrites=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.StandardReadRemoteWrites} StandardReadRemoteWrites instance + */ + StandardReadRemoteWrites.create = function create(properties) { + return new StandardReadRemoteWrites(properties); + }; + + /** + * Encodes the specified StandardReadRemoteWrites message. Does not implicitly {@link google.bigtable.admin.v2.StandardReadRemoteWrites.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {google.bigtable.admin.v2.IStandardReadRemoteWrites} message StandardReadRemoteWrites message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardReadRemoteWrites.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified StandardReadRemoteWrites message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.StandardReadRemoteWrites.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {google.bigtable.admin.v2.IStandardReadRemoteWrites} message StandardReadRemoteWrites message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardReadRemoteWrites.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StandardReadRemoteWrites message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.StandardReadRemoteWrites} StandardReadRemoteWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardReadRemoteWrites.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.StandardReadRemoteWrites(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StandardReadRemoteWrites message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.StandardReadRemoteWrites} StandardReadRemoteWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardReadRemoteWrites.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardReadRemoteWrites message. + * @function verify + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardReadRemoteWrites.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a StandardReadRemoteWrites message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.StandardReadRemoteWrites} StandardReadRemoteWrites + */ + StandardReadRemoteWrites.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.StandardReadRemoteWrites) + return object; + return new $root.google.bigtable.admin.v2.StandardReadRemoteWrites(); + }; + + /** + * Creates a plain object from a StandardReadRemoteWrites message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {google.bigtable.admin.v2.StandardReadRemoteWrites} message StandardReadRemoteWrites + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardReadRemoteWrites.toObject = function toObject() { + return {}; + }; + + /** + * Converts this StandardReadRemoteWrites to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @instance + * @returns {Object.} JSON object + */ + StandardReadRemoteWrites.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardReadRemoteWrites + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.StandardReadRemoteWrites + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardReadRemoteWrites.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.StandardReadRemoteWrites"; + }; + + return StandardReadRemoteWrites; + })(); + + v2.DataBoostReadLocalWrites = (function() { + + /** + * Properties of a DataBoostReadLocalWrites. + * @memberof google.bigtable.admin.v2 + * @interface IDataBoostReadLocalWrites + */ + + /** + * Constructs a new DataBoostReadLocalWrites. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DataBoostReadLocalWrites. + * @implements IDataBoostReadLocalWrites + * @constructor + * @param {google.bigtable.admin.v2.IDataBoostReadLocalWrites=} [properties] Properties to set + */ + function DataBoostReadLocalWrites(properties) { + if (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 DataBoostReadLocalWrites instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {google.bigtable.admin.v2.IDataBoostReadLocalWrites=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DataBoostReadLocalWrites} DataBoostReadLocalWrites instance + */ + DataBoostReadLocalWrites.create = function create(properties) { + return new DataBoostReadLocalWrites(properties); + }; + + /** + * Encodes the specified DataBoostReadLocalWrites message. Does not implicitly {@link google.bigtable.admin.v2.DataBoostReadLocalWrites.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {google.bigtable.admin.v2.IDataBoostReadLocalWrites} message DataBoostReadLocalWrites message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataBoostReadLocalWrites.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DataBoostReadLocalWrites message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DataBoostReadLocalWrites.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {google.bigtable.admin.v2.IDataBoostReadLocalWrites} message DataBoostReadLocalWrites message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataBoostReadLocalWrites.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataBoostReadLocalWrites message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DataBoostReadLocalWrites} DataBoostReadLocalWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataBoostReadLocalWrites.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DataBoostReadLocalWrites(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataBoostReadLocalWrites message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DataBoostReadLocalWrites} DataBoostReadLocalWrites + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataBoostReadLocalWrites.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataBoostReadLocalWrites message. + * @function verify + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataBoostReadLocalWrites.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DataBoostReadLocalWrites message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DataBoostReadLocalWrites} DataBoostReadLocalWrites + */ + DataBoostReadLocalWrites.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DataBoostReadLocalWrites) + return object; + return new $root.google.bigtable.admin.v2.DataBoostReadLocalWrites(); + }; + + /** + * Creates a plain object from a DataBoostReadLocalWrites message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {google.bigtable.admin.v2.DataBoostReadLocalWrites} message DataBoostReadLocalWrites + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataBoostReadLocalWrites.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DataBoostReadLocalWrites to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @instance + * @returns {Object.} JSON object + */ + DataBoostReadLocalWrites.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataBoostReadLocalWrites + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DataBoostReadLocalWrites + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataBoostReadLocalWrites.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DataBoostReadLocalWrites"; + }; + + return DataBoostReadLocalWrites; + })(); + + v2.CheckConsistencyResponse = (function() { + + /** + * Properties of a CheckConsistencyResponse. + * @memberof google.bigtable.admin.v2 + * @interface ICheckConsistencyResponse + * @property {boolean|null} [consistent] CheckConsistencyResponse consistent + */ + + /** + * Constructs a new CheckConsistencyResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CheckConsistencyResponse. + * @implements ICheckConsistencyResponse + * @constructor + * @param {google.bigtable.admin.v2.ICheckConsistencyResponse=} [properties] Properties to set + */ + function CheckConsistencyResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckConsistencyResponse consistent. + * @member {boolean} consistent + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @instance + */ + CheckConsistencyResponse.prototype.consistent = false; + + /** + * Creates a new CheckConsistencyResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {google.bigtable.admin.v2.ICheckConsistencyResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse instance + */ + CheckConsistencyResponse.create = function create(properties) { + return new CheckConsistencyResponse(properties); + }; + + /** + * Encodes the specified CheckConsistencyResponse message. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {google.bigtable.admin.v2.ICheckConsistencyResponse} message CheckConsistencyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckConsistencyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consistent != null && Object.hasOwnProperty.call(message, "consistent")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.consistent); + return writer; + }; + + /** + * Encodes the specified CheckConsistencyResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {google.bigtable.admin.v2.ICheckConsistencyResponse} message CheckConsistencyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckConsistencyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckConsistencyResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckConsistencyResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CheckConsistencyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.consistent = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckConsistencyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckConsistencyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckConsistencyResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckConsistencyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consistent != null && message.hasOwnProperty("consistent")) + if (typeof message.consistent !== "boolean") + return "consistent: boolean expected"; + return null; + }; + + /** + * Creates a CheckConsistencyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse + */ + CheckConsistencyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CheckConsistencyResponse) + return object; + var message = new $root.google.bigtable.admin.v2.CheckConsistencyResponse(); + if (object.consistent != null) + message.consistent = Boolean(object.consistent); + return message; + }; + + /** + * Creates a plain object from a CheckConsistencyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {google.bigtable.admin.v2.CheckConsistencyResponse} message CheckConsistencyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckConsistencyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.consistent = false; + if (message.consistent != null && message.hasOwnProperty("consistent")) + object.consistent = message.consistent; + return object; + }; + + /** + * Converts this CheckConsistencyResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @instance + * @returns {Object.} JSON object + */ + CheckConsistencyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckConsistencyResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckConsistencyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CheckConsistencyResponse"; + }; + + return CheckConsistencyResponse; + })(); + + v2.SnapshotTableRequest = (function() { + + /** + * Properties of a SnapshotTableRequest. + * @memberof google.bigtable.admin.v2 + * @interface ISnapshotTableRequest + * @property {string|null} [name] SnapshotTableRequest name + * @property {string|null} [cluster] SnapshotTableRequest cluster + * @property {string|null} [snapshotId] SnapshotTableRequest snapshotId + * @property {google.protobuf.IDuration|null} [ttl] SnapshotTableRequest ttl + * @property {string|null} [description] SnapshotTableRequest description + */ + + /** + * Constructs a new SnapshotTableRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a SnapshotTableRequest. + * @implements ISnapshotTableRequest + * @constructor + * @param {google.bigtable.admin.v2.ISnapshotTableRequest=} [properties] Properties to set + */ + function SnapshotTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SnapshotTableRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @instance + */ + SnapshotTableRequest.prototype.name = ""; + + /** + * SnapshotTableRequest cluster. + * @member {string} cluster + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @instance + */ + SnapshotTableRequest.prototype.cluster = ""; + + /** + * SnapshotTableRequest snapshotId. + * @member {string} snapshotId + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @instance + */ + SnapshotTableRequest.prototype.snapshotId = ""; + + /** + * SnapshotTableRequest ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @instance + */ + SnapshotTableRequest.prototype.ttl = null; + + /** + * SnapshotTableRequest description. + * @member {string} description + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @instance + */ + SnapshotTableRequest.prototype.description = ""; + + /** + * Creates a new SnapshotTableRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {google.bigtable.admin.v2.ISnapshotTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest instance + */ + SnapshotTableRequest.create = function create(properties) { + return new SnapshotTableRequest(properties); + }; + + /** + * Encodes the specified SnapshotTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {google.bigtable.admin.v2.ISnapshotTableRequest} message SnapshotTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cluster); + if (message.snapshotId != null && Object.hasOwnProperty.call(message, "snapshotId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshotId); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + return writer; + }; + + /** + * Encodes the specified SnapshotTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {google.bigtable.admin.v2.ISnapshotTableRequest} message SnapshotTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SnapshotTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotTableRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.SnapshotTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.cluster = reader.string(); + break; + } + case 3: { + message.snapshotId = reader.string(); + break; + } + case 4: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SnapshotTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SnapshotTableRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SnapshotTableRequest.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.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.snapshotId != null && message.hasOwnProperty("snapshotId")) + if (!$util.isString(message.snapshotId)) + return "snapshotId: string expected"; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a SnapshotTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest + */ + SnapshotTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.SnapshotTableRequest) + return object; + var message = new $root.google.bigtable.admin.v2.SnapshotTableRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.snapshotId != null) + message.snapshotId = String(object.snapshotId); + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.bigtable.admin.v2.SnapshotTableRequest.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a SnapshotTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {google.bigtable.admin.v2.SnapshotTableRequest} message SnapshotTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SnapshotTableRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.cluster = ""; + object.snapshotId = ""; + object.ttl = null; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.snapshotId != null && message.hasOwnProperty("snapshotId")) + object.snapshotId = message.snapshotId; + if (message.ttl != null && message.hasOwnProperty("ttl")) + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this SnapshotTableRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @instance + * @returns {Object.} JSON object + */ + SnapshotTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SnapshotTableRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SnapshotTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.SnapshotTableRequest"; + }; + + return SnapshotTableRequest; + })(); + + v2.GetSnapshotRequest = (function() { + + /** + * Properties of a GetSnapshotRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetSnapshotRequest + * @property {string|null} [name] GetSnapshotRequest name + */ + + /** + * Constructs a new GetSnapshotRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetSnapshotRequest. + * @implements IGetSnapshotRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetSnapshotRequest=} [properties] Properties to set + */ + function GetSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSnapshotRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @instance + */ + GetSnapshotRequest.prototype.name = ""; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.IGetSnapshotRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest instance + */ + GetSnapshotRequest.create = function create(properties) { + return new GetSnapshotRequest(properties); + }; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSnapshotRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSnapshotRequest.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 GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest + */ + GetSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetSnapshotRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetSnapshotRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.GetSnapshotRequest} message GetSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSnapshotRequest.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 GetSnapshotRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + GetSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSnapshotRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetSnapshotRequest"; + }; + + return GetSnapshotRequest; + })(); + + v2.ListSnapshotsRequest = (function() { + + /** + * Properties of a ListSnapshotsRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListSnapshotsRequest + * @property {string|null} [parent] ListSnapshotsRequest parent + * @property {number|null} [pageSize] ListSnapshotsRequest pageSize + * @property {string|null} [pageToken] ListSnapshotsRequest pageToken + */ + + /** + * Constructs a new ListSnapshotsRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListSnapshotsRequest. + * @implements IListSnapshotsRequest + * @constructor + * @param {google.bigtable.admin.v2.IListSnapshotsRequest=} [properties] Properties to set + */ + function ListSnapshotsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSnapshotsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.parent = ""; + + /** + * ListSnapshotsRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.pageSize = 0; + + /** + * ListSnapshotsRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {google.bigtable.admin.v2.IListSnapshotsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListSnapshotsRequest} ListSnapshotsRequest instance + */ + ListSnapshotsRequest.create = function create(properties) { + return new ListSnapshotsRequest(properties); + }; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {google.bigtable.admin.v2.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {google.bigtable.admin.v2.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListSnapshotsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListSnapshotsRequest} ListSnapshotsRequest + */ + ListSnapshotsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListSnapshotsRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListSnapshotsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {google.bigtable.admin.v2.ListSnapshotsRequest} message ListSnapshotsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSnapshotsRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSnapshotsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListSnapshotsRequest"; + }; + + return ListSnapshotsRequest; + })(); + + v2.ListSnapshotsResponse = (function() { + + /** + * Properties of a ListSnapshotsResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListSnapshotsResponse + * @property {Array.|null} [snapshots] ListSnapshotsResponse snapshots + * @property {string|null} [nextPageToken] ListSnapshotsResponse nextPageToken + */ + + /** + * Constructs a new ListSnapshotsResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListSnapshotsResponse. + * @implements IListSnapshotsResponse + * @constructor + * @param {google.bigtable.admin.v2.IListSnapshotsResponse=} [properties] Properties to set + */ + function ListSnapshotsResponse(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSnapshotsResponse snapshots. + * @member {Array.} snapshots + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @instance + */ + ListSnapshotsResponse.prototype.snapshots = $util.emptyArray; + + /** + * ListSnapshotsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @instance + */ + ListSnapshotsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSnapshotsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {google.bigtable.admin.v2.IListSnapshotsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse instance + */ + ListSnapshotsResponse.create = function create(properties) { + return new ListSnapshotsResponse(properties); + }; + + /** + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {google.bigtable.admin.v2.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.google.bigtable.admin.v2.Snapshot.encode(message.snapshots[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {google.bigtable.admin.v2.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListSnapshotsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.google.bigtable.admin.v2.Snapshot.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.google.bigtable.admin.v2.Snapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse + */ + ListSnapshotsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListSnapshotsResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListSnapshotsResponse(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.bigtable.admin.v2.ListSnapshotsResponse.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListSnapshotsResponse.snapshots: object expected"); + message.snapshots[i] = $root.google.bigtable.admin.v2.Snapshot.fromObject(object.snapshots[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {google.bigtable.admin.v2.ListSnapshotsResponse} message ListSnapshotsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.google.bigtable.admin.v2.Snapshot.toObject(message.snapshots[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSnapshotsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSnapshotsResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSnapshotsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListSnapshotsResponse"; + }; + + return ListSnapshotsResponse; + })(); + + v2.DeleteSnapshotRequest = (function() { + + /** + * Properties of a DeleteSnapshotRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteSnapshotRequest + * @property {string|null} [name] DeleteSnapshotRequest name + */ + + /** + * Constructs a new DeleteSnapshotRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteSnapshotRequest. + * @implements IDeleteSnapshotRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest=} [properties] Properties to set + */ + function DeleteSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSnapshotRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @instance + */ + DeleteSnapshotRequest.prototype.name = ""; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest instance + */ + DeleteSnapshotRequest.create = function create(properties) { + return new DeleteSnapshotRequest(properties); + }; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSnapshotRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSnapshotRequest.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 DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest + */ + DeleteSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteSnapshotRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteSnapshotRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {google.bigtable.admin.v2.DeleteSnapshotRequest} message DeleteSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSnapshotRequest.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 DeleteSnapshotRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSnapshotRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteSnapshotRequest"; + }; + + return DeleteSnapshotRequest; + })(); + + v2.SnapshotTableMetadata = (function() { + + /** + * Properties of a SnapshotTableMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ISnapshotTableMetadata + * @property {google.bigtable.admin.v2.ISnapshotTableRequest|null} [originalRequest] SnapshotTableMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] SnapshotTableMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] SnapshotTableMetadata finishTime + */ + + /** + * Constructs a new SnapshotTableMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a SnapshotTableMetadata. + * @implements ISnapshotTableMetadata + * @constructor + * @param {google.bigtable.admin.v2.ISnapshotTableMetadata=} [properties] Properties to set + */ + function SnapshotTableMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SnapshotTableMetadata originalRequest. + * @member {google.bigtable.admin.v2.ISnapshotTableRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @instance + */ + SnapshotTableMetadata.prototype.originalRequest = null; + + /** + * SnapshotTableMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @instance + */ + SnapshotTableMetadata.prototype.requestTime = null; + + /** + * SnapshotTableMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @instance + */ + SnapshotTableMetadata.prototype.finishTime = null; + + /** + * Creates a new SnapshotTableMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {google.bigtable.admin.v2.ISnapshotTableMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.SnapshotTableMetadata} SnapshotTableMetadata instance + */ + SnapshotTableMetadata.create = function create(properties) { + return new SnapshotTableMetadata(properties); + }; + + /** + * Encodes the specified SnapshotTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {google.bigtable.admin.v2.ISnapshotTableMetadata} message SnapshotTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotTableMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.SnapshotTableRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SnapshotTableMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {google.bigtable.admin.v2.ISnapshotTableMetadata} message SnapshotTableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotTableMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SnapshotTableMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.SnapshotTableMetadata} SnapshotTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotTableMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.SnapshotTableMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.SnapshotTableRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SnapshotTableMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.SnapshotTableMetadata} SnapshotTableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotTableMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SnapshotTableMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SnapshotTableMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.SnapshotTableRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates a SnapshotTableMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.SnapshotTableMetadata} SnapshotTableMetadata + */ + SnapshotTableMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.SnapshotTableMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.SnapshotTableMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.SnapshotTableMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.SnapshotTableRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.SnapshotTableMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.SnapshotTableMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from a SnapshotTableMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {google.bigtable.admin.v2.SnapshotTableMetadata} message SnapshotTableMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SnapshotTableMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.SnapshotTableRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this SnapshotTableMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @instance + * @returns {Object.} JSON object + */ + SnapshotTableMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SnapshotTableMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SnapshotTableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.SnapshotTableMetadata"; + }; + + return SnapshotTableMetadata; + })(); + + v2.CreateTableFromSnapshotMetadata = (function() { + + /** + * Properties of a CreateTableFromSnapshotMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateTableFromSnapshotMetadata + * @property {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest|null} [originalRequest] CreateTableFromSnapshotMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] CreateTableFromSnapshotMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] CreateTableFromSnapshotMetadata finishTime + */ + + /** + * Constructs a new CreateTableFromSnapshotMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateTableFromSnapshotMetadata. + * @implements ICreateTableFromSnapshotMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata=} [properties] Properties to set + */ + function CreateTableFromSnapshotMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTableFromSnapshotMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @instance + */ + CreateTableFromSnapshotMetadata.prototype.originalRequest = null; + + /** + * CreateTableFromSnapshotMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @instance + */ + CreateTableFromSnapshotMetadata.prototype.requestTime = null; + + /** + * CreateTableFromSnapshotMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @instance + */ + CreateTableFromSnapshotMetadata.prototype.finishTime = null; + + /** + * Creates a new CreateTableFromSnapshotMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata instance + */ + CreateTableFromSnapshotMetadata.create = function create(properties) { + return new CreateTableFromSnapshotMetadata(properties); + }; + + /** + * Encodes the specified CreateTableFromSnapshotMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata} message CreateTableFromSnapshotMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableFromSnapshotMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTableFromSnapshotMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata} message CreateTableFromSnapshotMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableFromSnapshotMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableFromSnapshotMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableFromSnapshotMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTableFromSnapshotMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTableFromSnapshotMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates a CreateTableFromSnapshotMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata + */ + CreateTableFromSnapshotMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateTableFromSnapshotMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} message CreateTableFromSnapshotMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTableFromSnapshotMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this CreateTableFromSnapshotMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateTableFromSnapshotMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTableFromSnapshotMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTableFromSnapshotMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateTableFromSnapshotMetadata"; + }; + + return CreateTableFromSnapshotMetadata; + })(); + + v2.CreateBackupRequest = (function() { + + /** + * Properties of a CreateBackupRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {string|null} [backupId] CreateBackupRequest backupId + * @property {google.bigtable.admin.v2.IBackup|null} [backup] CreateBackupRequest backup + */ + + /** + * Constructs a new CreateBackupRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateBackupRequest=} [properties] Properties to set + */ + function CreateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.parent = ""; + + /** + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backupId = ""; + + /** + * CreateBackupRequest backup. + * @member {google.bigtable.admin.v2.IBackup|null|undefined} backup + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backup = null; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {google.bigtable.admin.v2.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateBackupRequest} CreateBackupRequest instance + */ + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); + }; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {google.bigtable.admin.v2.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.bigtable.admin.v2.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {google.bigtable.admin.v2.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupId = reader.string(); + break; + } + case 3: { + message.backup = $root.google.bigtable.admin.v2.Backup.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.bigtable.admin.v2.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + return null; + }; + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateBackupRequest} CreateBackupRequest + */ + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateBackupRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.bigtable.admin.v2.Backup.fromObject(object.backup); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {google.bigtable.admin.v2.CreateBackupRequest} message CreateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupId = ""; + object.backup = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.bigtable.admin.v2.Backup.toObject(message.backup, options); + return object; + }; + + /** + * Converts this CreateBackupRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateBackupRequest"; + }; + + return CreateBackupRequest; + })(); + + v2.CreateBackupMetadata = (function() { + + /** + * Properties of a CreateBackupMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateBackupMetadata + * @property {string|null} [name] CreateBackupMetadata name + * @property {string|null} [sourceTable] CreateBackupMetadata sourceTable + * @property {google.protobuf.ITimestamp|null} [startTime] CreateBackupMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] CreateBackupMetadata endTime + */ + + /** + * Constructs a new CreateBackupMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateBackupMetadata. + * @implements ICreateBackupMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateBackupMetadata=} [properties] Properties to set + */ + function CreateBackupMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.name = ""; + + /** + * CreateBackupMetadata sourceTable. + * @member {string} sourceTable + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.sourceTable = ""; + + /** + * CreateBackupMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.startTime = null; + + /** + * CreateBackupMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.endTime = null; + + /** + * Creates a new CreateBackupMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateBackupMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateBackupMetadata} CreateBackupMetadata instance + */ + CreateBackupMetadata.create = function create(properties) { + return new CreateBackupMetadata(properties); + }; + + /** + * Encodes the specified CreateBackupMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateBackupMetadata} message CreateBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceTable); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateBackupMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateBackupMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateBackupMetadata} message CreateBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateBackupMetadata} CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateBackupMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceTable = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateBackupMetadata} CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupMetadata.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.sourceTable != null && message.hasOwnProperty("sourceTable")) + if (!$util.isString(message.sourceTable)) + return "sourceTable: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a CreateBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateBackupMetadata} CreateBackupMetadata + */ + CreateBackupMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateBackupMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateBackupMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.sourceTable != null) + message.sourceTable = String(object.sourceTable); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateBackupMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateBackupMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackupMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {google.bigtable.admin.v2.CreateBackupMetadata} message CreateBackupMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceTable = ""; + object.startTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) + object.sourceTable = message.sourceTable; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this CreateBackupMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateBackupMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateBackupMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateBackupMetadata"; + }; + + return CreateBackupMetadata; + })(); + + v2.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateBackupRequest + * @property {google.bigtable.admin.v2.IBackup|null} [backup] UpdateBackupRequest backup + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupRequest backup. + * @member {google.bigtable.admin.v2.IBackup|null|undefined} backup + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.bigtable.admin.v2.Backup.encode(message.backup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backup = $root.google.bigtable.admin.v2.Backup.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.bigtable.admin.v2.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateBackupRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateBackupRequest(); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.bigtable.admin.v2.Backup.fromObject(object.backup); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {google.bigtable.admin.v2.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backup = null; + object.updateMask = null; + } + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.bigtable.admin.v2.Backup.toObject(message.backup, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateBackupRequest"; + }; + + return UpdateBackupRequest; + })(); + + v2.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {google.bigtable.admin.v2.IGetBackupRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {google.bigtable.admin.v2.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {google.bigtable.admin.v2.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.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 GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetBackupRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {google.bigtable.admin.v2.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.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 GetBackupRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v2.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.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 DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteBackupRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {google.bigtable.admin.v2.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.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 DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v2.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {string|null} [filter] ListBackupsRequest filter + * @property {string|null} [orderBy] ListBackupsRequest orderBy + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.bigtable.admin.v2.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {google.bigtable.admin.v2.IListBackupsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {google.bigtable.admin.v2.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {google.bigtable.admin.v2.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListBackupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.orderBy = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListBackupsRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {google.bigtable.admin.v2.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v2.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.bigtable.admin.v2.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {google.bigtable.admin.v2.IListBackupsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {google.bigtable.admin.v2.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.bigtable.admin.v2.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {google.bigtable.admin.v2.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.bigtable.admin.v2.Backup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.bigtable.admin.v2.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListBackupsResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.bigtable.admin.v2.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.bigtable.admin.v2.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {google.bigtable.admin.v2.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.bigtable.admin.v2.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v2.CopyBackupRequest = (function() { + + /** + * Properties of a CopyBackupRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICopyBackupRequest + * @property {string|null} [parent] CopyBackupRequest parent + * @property {string|null} [backupId] CopyBackupRequest backupId + * @property {string|null} [sourceBackup] CopyBackupRequest sourceBackup + * @property {google.protobuf.ITimestamp|null} [expireTime] CopyBackupRequest expireTime + */ + + /** + * Constructs a new CopyBackupRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CopyBackupRequest. + * @implements ICopyBackupRequest + * @constructor + * @param {google.bigtable.admin.v2.ICopyBackupRequest=} [properties] Properties to set + */ + function CopyBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyBackupRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.parent = ""; + + /** + * CopyBackupRequest backupId. + * @member {string} backupId + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.backupId = ""; + + /** + * CopyBackupRequest sourceBackup. + * @member {string} sourceBackup + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.sourceBackup = ""; + + /** + * CopyBackupRequest expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.expireTime = null; + + /** + * Creates a new CopyBackupRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {google.bigtable.admin.v2.ICopyBackupRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CopyBackupRequest} CopyBackupRequest instance + */ + CopyBackupRequest.create = function create(properties) { + return new CopyBackupRequest(properties); + }; + + /** + * Encodes the specified CopyBackupRequest message. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {google.bigtable.admin.v2.ICopyBackupRequest} message CopyBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceBackup); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CopyBackupRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {google.bigtable.admin.v2.ICopyBackupRequest} message CopyBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CopyBackupRequest} CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CopyBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupId = reader.string(); + break; + } + case 3: { + message.sourceBackup = reader.string(); + break; + } + case 4: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CopyBackupRequest} CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyBackupRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a CopyBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CopyBackupRequest} CopyBackupRequest + */ + CopyBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CopyBackupRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CopyBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CopyBackupRequest.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a CopyBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {google.bigtable.admin.v2.CopyBackupRequest} message CopyBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupId = ""; + object.sourceBackup = ""; + object.expireTime = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + object.sourceBackup = message.sourceBackup; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this CopyBackupRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CopyBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyBackupRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CopyBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CopyBackupRequest"; + }; + + return CopyBackupRequest; + })(); + + v2.CopyBackupMetadata = (function() { + + /** + * Properties of a CopyBackupMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICopyBackupMetadata + * @property {string|null} [name] CopyBackupMetadata name + * @property {google.bigtable.admin.v2.IBackupInfo|null} [sourceBackupInfo] CopyBackupMetadata sourceBackupInfo + * @property {google.bigtable.admin.v2.IOperationProgress|null} [progress] CopyBackupMetadata progress + */ + + /** + * Constructs a new CopyBackupMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CopyBackupMetadata. + * @implements ICopyBackupMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICopyBackupMetadata=} [properties] Properties to set + */ + function CopyBackupMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyBackupMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.name = ""; + + /** + * CopyBackupMetadata sourceBackupInfo. + * @member {google.bigtable.admin.v2.IBackupInfo|null|undefined} sourceBackupInfo + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.sourceBackupInfo = null; + + /** + * CopyBackupMetadata progress. + * @member {google.bigtable.admin.v2.IOperationProgress|null|undefined} progress + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.progress = null; + + /** + * Creates a new CopyBackupMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {google.bigtable.admin.v2.ICopyBackupMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CopyBackupMetadata} CopyBackupMetadata instance + */ + CopyBackupMetadata.create = function create(properties) { + return new CopyBackupMetadata(properties); + }; + + /** + * Encodes the specified CopyBackupMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {google.bigtable.admin.v2.ICopyBackupMetadata} message CopyBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceBackupInfo != null && Object.hasOwnProperty.call(message, "sourceBackupInfo")) + $root.google.bigtable.admin.v2.BackupInfo.encode(message.sourceBackupInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.bigtable.admin.v2.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CopyBackupMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CopyBackupMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {google.bigtable.admin.v2.ICopyBackupMetadata} message CopyBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CopyBackupMetadata} CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CopyBackupMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceBackupInfo = $root.google.bigtable.admin.v2.BackupInfo.decode(reader, reader.uint32()); + break; + } + case 3: { + message.progress = $root.google.bigtable.admin.v2.OperationProgress.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CopyBackupMetadata} CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyBackupMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyBackupMetadata.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.sourceBackupInfo != null && message.hasOwnProperty("sourceBackupInfo")) { + var error = $root.google.bigtable.admin.v2.BackupInfo.verify(message.sourceBackupInfo); + if (error) + return "sourceBackupInfo." + error; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.bigtable.admin.v2.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + return null; + }; + + /** + * Creates a CopyBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CopyBackupMetadata} CopyBackupMetadata + */ + CopyBackupMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CopyBackupMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CopyBackupMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.sourceBackupInfo != null) { + if (typeof object.sourceBackupInfo !== "object") + throw TypeError(".google.bigtable.admin.v2.CopyBackupMetadata.sourceBackupInfo: object expected"); + message.sourceBackupInfo = $root.google.bigtable.admin.v2.BackupInfo.fromObject(object.sourceBackupInfo); + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.bigtable.admin.v2.CopyBackupMetadata.progress: object expected"); + message.progress = $root.google.bigtable.admin.v2.OperationProgress.fromObject(object.progress); + } + return message; + }; + + /** + * Creates a plain object from a CopyBackupMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {google.bigtable.admin.v2.CopyBackupMetadata} message CopyBackupMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyBackupMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceBackupInfo = null; + object.progress = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceBackupInfo != null && message.hasOwnProperty("sourceBackupInfo")) + object.sourceBackupInfo = $root.google.bigtable.admin.v2.BackupInfo.toObject(message.sourceBackupInfo, options); + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.bigtable.admin.v2.OperationProgress.toObject(message.progress, options); + return object; + }; + + /** + * Converts this CopyBackupMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @instance + * @returns {Object.} JSON object + */ + CopyBackupMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyBackupMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CopyBackupMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyBackupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CopyBackupMetadata"; + }; + + return CopyBackupMetadata; + })(); + + v2.CreateAuthorizedViewRequest = (function() { + + /** + * Properties of a CreateAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateAuthorizedViewRequest + * @property {string|null} [parent] CreateAuthorizedViewRequest parent + * @property {string|null} [authorizedViewId] CreateAuthorizedViewRequest authorizedViewId + * @property {google.bigtable.admin.v2.IAuthorizedView|null} [authorizedView] CreateAuthorizedViewRequest authorizedView + */ + + /** + * Constructs a new CreateAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateAuthorizedViewRequest. + * @implements ICreateAuthorizedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewRequest=} [properties] Properties to set + */ + function CreateAuthorizedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAuthorizedViewRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @instance + */ + CreateAuthorizedViewRequest.prototype.parent = ""; + + /** + * CreateAuthorizedViewRequest authorizedViewId. + * @member {string} authorizedViewId + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @instance + */ + CreateAuthorizedViewRequest.prototype.authorizedViewId = ""; + + /** + * CreateAuthorizedViewRequest authorizedView. + * @member {google.bigtable.admin.v2.IAuthorizedView|null|undefined} authorizedView + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @instance + */ + CreateAuthorizedViewRequest.prototype.authorizedView = null; + + /** + * Creates a new CreateAuthorizedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewRequest} CreateAuthorizedViewRequest instance + */ + CreateAuthorizedViewRequest.create = function create(properties) { + return new CreateAuthorizedViewRequest(properties); + }; + + /** + * Encodes the specified CreateAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewRequest} message CreateAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAuthorizedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.authorizedViewId != null && Object.hasOwnProperty.call(message, "authorizedViewId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.authorizedViewId); + if (message.authorizedView != null && Object.hasOwnProperty.call(message, "authorizedView")) + $root.google.bigtable.admin.v2.AuthorizedView.encode(message.authorizedView, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewRequest} message CreateAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAuthorizedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAuthorizedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewRequest} CreateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAuthorizedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.authorizedViewId = reader.string(); + break; + } + case 3: { + message.authorizedView = $root.google.bigtable.admin.v2.AuthorizedView.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewRequest} CreateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAuthorizedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAuthorizedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAuthorizedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.authorizedViewId != null && message.hasOwnProperty("authorizedViewId")) + if (!$util.isString(message.authorizedViewId)) + return "authorizedViewId: string expected"; + if (message.authorizedView != null && message.hasOwnProperty("authorizedView")) { + var error = $root.google.bigtable.admin.v2.AuthorizedView.verify(message.authorizedView); + if (error) + return "authorizedView." + error; + } + return null; + }; + + /** + * Creates a CreateAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewRequest} CreateAuthorizedViewRequest + */ + CreateAuthorizedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.authorizedViewId != null) + message.authorizedViewId = String(object.authorizedViewId); + if (object.authorizedView != null) { + if (typeof object.authorizedView !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateAuthorizedViewRequest.authorizedView: object expected"); + message.authorizedView = $root.google.bigtable.admin.v2.AuthorizedView.fromObject(object.authorizedView); + } + return message; + }; + + /** + * Creates a plain object from a CreateAuthorizedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.CreateAuthorizedViewRequest} message CreateAuthorizedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAuthorizedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.authorizedViewId = ""; + object.authorizedView = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.authorizedViewId != null && message.hasOwnProperty("authorizedViewId")) + object.authorizedViewId = message.authorizedViewId; + if (message.authorizedView != null && message.hasOwnProperty("authorizedView")) + object.authorizedView = $root.google.bigtable.admin.v2.AuthorizedView.toObject(message.authorizedView, options); + return object; + }; + + /** + * Converts this CreateAuthorizedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAuthorizedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAuthorizedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAuthorizedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateAuthorizedViewRequest"; + }; + + return CreateAuthorizedViewRequest; + })(); + + v2.CreateAuthorizedViewMetadata = (function() { + + /** + * Properties of a CreateAuthorizedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateAuthorizedViewMetadata + * @property {google.bigtable.admin.v2.ICreateAuthorizedViewRequest|null} [originalRequest] CreateAuthorizedViewMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] CreateAuthorizedViewMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] CreateAuthorizedViewMetadata finishTime + */ + + /** + * Constructs a new CreateAuthorizedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateAuthorizedViewMetadata. + * @implements ICreateAuthorizedViewMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewMetadata=} [properties] Properties to set + */ + function CreateAuthorizedViewMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAuthorizedViewMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateAuthorizedViewRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @instance + */ + CreateAuthorizedViewMetadata.prototype.originalRequest = null; + + /** + * CreateAuthorizedViewMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @instance + */ + CreateAuthorizedViewMetadata.prototype.requestTime = null; + + /** + * CreateAuthorizedViewMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @instance + */ + CreateAuthorizedViewMetadata.prototype.finishTime = null; + + /** + * Creates a new CreateAuthorizedViewMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewMetadata} CreateAuthorizedViewMetadata instance + */ + CreateAuthorizedViewMetadata.create = function create(properties) { + return new CreateAuthorizedViewMetadata(properties); + }; + + /** + * Encodes the specified CreateAuthorizedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewMetadata} message CreateAuthorizedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAuthorizedViewMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAuthorizedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAuthorizedViewMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateAuthorizedViewMetadata} message CreateAuthorizedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAuthorizedViewMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAuthorizedViewMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewMetadata} CreateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAuthorizedViewMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateAuthorizedViewMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAuthorizedViewMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewMetadata} CreateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAuthorizedViewMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAuthorizedViewMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAuthorizedViewMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates a CreateAuthorizedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateAuthorizedViewMetadata} CreateAuthorizedViewMetadata + */ + CreateAuthorizedViewMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateAuthorizedViewMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateAuthorizedViewMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateAuthorizedViewMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateAuthorizedViewMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateAuthorizedViewMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateAuthorizedViewMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.CreateAuthorizedViewMetadata} message CreateAuthorizedViewMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAuthorizedViewMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.CreateAuthorizedViewRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this CreateAuthorizedViewMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateAuthorizedViewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAuthorizedViewMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateAuthorizedViewMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAuthorizedViewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateAuthorizedViewMetadata"; + }; + + return CreateAuthorizedViewMetadata; + })(); + + v2.ListAuthorizedViewsRequest = (function() { + + /** + * Properties of a ListAuthorizedViewsRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListAuthorizedViewsRequest + * @property {string|null} [parent] ListAuthorizedViewsRequest parent + * @property {number|null} [pageSize] ListAuthorizedViewsRequest pageSize + * @property {string|null} [pageToken] ListAuthorizedViewsRequest pageToken + * @property {google.bigtable.admin.v2.AuthorizedView.ResponseView|null} [view] ListAuthorizedViewsRequest view + */ + + /** + * Constructs a new ListAuthorizedViewsRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListAuthorizedViewsRequest. + * @implements IListAuthorizedViewsRequest + * @constructor + * @param {google.bigtable.admin.v2.IListAuthorizedViewsRequest=} [properties] Properties to set + */ + function ListAuthorizedViewsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAuthorizedViewsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @instance + */ + ListAuthorizedViewsRequest.prototype.parent = ""; + + /** + * ListAuthorizedViewsRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @instance + */ + ListAuthorizedViewsRequest.prototype.pageSize = 0; + + /** + * ListAuthorizedViewsRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @instance + */ + ListAuthorizedViewsRequest.prototype.pageToken = ""; + + /** + * ListAuthorizedViewsRequest view. + * @member {google.bigtable.admin.v2.AuthorizedView.ResponseView} view + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @instance + */ + ListAuthorizedViewsRequest.prototype.view = 0; + + /** + * Creates a new ListAuthorizedViewsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListAuthorizedViewsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsRequest} ListAuthorizedViewsRequest instance + */ + ListAuthorizedViewsRequest.create = function create(properties) { + return new ListAuthorizedViewsRequest(properties); + }; + + /** + * Encodes the specified ListAuthorizedViewsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListAuthorizedViewsRequest} message ListAuthorizedViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedViewsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListAuthorizedViewsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {google.bigtable.admin.v2.IListAuthorizedViewsRequest} message ListAuthorizedViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedViewsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAuthorizedViewsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsRequest} ListAuthorizedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedViewsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListAuthorizedViewsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAuthorizedViewsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsRequest} ListAuthorizedViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedViewsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAuthorizedViewsRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAuthorizedViewsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ListAuthorizedViewsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsRequest} ListAuthorizedViewsRequest + */ + ListAuthorizedViewsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListAuthorizedViewsRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListAuthorizedViewsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "RESPONSE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "NAME_ONLY": + case 1: + message.view = 1; + break; + case "BASIC": + case 2: + message.view = 2; + break; + case "FULL": + case 3: + message.view = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListAuthorizedViewsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {google.bigtable.admin.v2.ListAuthorizedViewsRequest} message ListAuthorizedViewsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAuthorizedViewsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "RESPONSE_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.bigtable.admin.v2.AuthorizedView.ResponseView[message.view] === undefined ? message.view : $root.google.bigtable.admin.v2.AuthorizedView.ResponseView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListAuthorizedViewsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAuthorizedViewsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAuthorizedViewsRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAuthorizedViewsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListAuthorizedViewsRequest"; + }; + + return ListAuthorizedViewsRequest; + })(); + + v2.ListAuthorizedViewsResponse = (function() { + + /** + * Properties of a ListAuthorizedViewsResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListAuthorizedViewsResponse + * @property {Array.|null} [authorizedViews] ListAuthorizedViewsResponse authorizedViews + * @property {string|null} [nextPageToken] ListAuthorizedViewsResponse nextPageToken + */ + + /** + * Constructs a new ListAuthorizedViewsResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListAuthorizedViewsResponse. + * @implements IListAuthorizedViewsResponse + * @constructor + * @param {google.bigtable.admin.v2.IListAuthorizedViewsResponse=} [properties] Properties to set + */ + function ListAuthorizedViewsResponse(properties) { + this.authorizedViews = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAuthorizedViewsResponse authorizedViews. + * @member {Array.} authorizedViews + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @instance + */ + ListAuthorizedViewsResponse.prototype.authorizedViews = $util.emptyArray; + + /** + * ListAuthorizedViewsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @instance + */ + ListAuthorizedViewsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAuthorizedViewsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListAuthorizedViewsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsResponse} ListAuthorizedViewsResponse instance + */ + ListAuthorizedViewsResponse.create = function create(properties) { + return new ListAuthorizedViewsResponse(properties); + }; + + /** + * Encodes the specified ListAuthorizedViewsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListAuthorizedViewsResponse} message ListAuthorizedViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedViewsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authorizedViews != null && message.authorizedViews.length) + for (var i = 0; i < message.authorizedViews.length; ++i) + $root.google.bigtable.admin.v2.AuthorizedView.encode(message.authorizedViews[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListAuthorizedViewsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAuthorizedViewsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {google.bigtable.admin.v2.IListAuthorizedViewsResponse} message ListAuthorizedViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedViewsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAuthorizedViewsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsResponse} ListAuthorizedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedViewsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListAuthorizedViewsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.authorizedViews && message.authorizedViews.length)) + message.authorizedViews = []; + message.authorizedViews.push($root.google.bigtable.admin.v2.AuthorizedView.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAuthorizedViewsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsResponse} ListAuthorizedViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedViewsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAuthorizedViewsResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAuthorizedViewsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.authorizedViews != null && message.hasOwnProperty("authorizedViews")) { + if (!Array.isArray(message.authorizedViews)) + return "authorizedViews: array expected"; + for (var i = 0; i < message.authorizedViews.length; ++i) { + var error = $root.google.bigtable.admin.v2.AuthorizedView.verify(message.authorizedViews[i]); + if (error) + return "authorizedViews." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAuthorizedViewsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListAuthorizedViewsResponse} ListAuthorizedViewsResponse + */ + ListAuthorizedViewsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListAuthorizedViewsResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListAuthorizedViewsResponse(); + if (object.authorizedViews) { + if (!Array.isArray(object.authorizedViews)) + throw TypeError(".google.bigtable.admin.v2.ListAuthorizedViewsResponse.authorizedViews: array expected"); + message.authorizedViews = []; + for (var i = 0; i < object.authorizedViews.length; ++i) { + if (typeof object.authorizedViews[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListAuthorizedViewsResponse.authorizedViews: object expected"); + message.authorizedViews[i] = $root.google.bigtable.admin.v2.AuthorizedView.fromObject(object.authorizedViews[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAuthorizedViewsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {google.bigtable.admin.v2.ListAuthorizedViewsResponse} message ListAuthorizedViewsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAuthorizedViewsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.authorizedViews = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.authorizedViews && message.authorizedViews.length) { + object.authorizedViews = []; + for (var j = 0; j < message.authorizedViews.length; ++j) + object.authorizedViews[j] = $root.google.bigtable.admin.v2.AuthorizedView.toObject(message.authorizedViews[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAuthorizedViewsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAuthorizedViewsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAuthorizedViewsResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListAuthorizedViewsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAuthorizedViewsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListAuthorizedViewsResponse"; + }; + + return ListAuthorizedViewsResponse; + })(); + + v2.GetAuthorizedViewRequest = (function() { + + /** + * Properties of a GetAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetAuthorizedViewRequest + * @property {string|null} [name] GetAuthorizedViewRequest name + * @property {google.bigtable.admin.v2.AuthorizedView.ResponseView|null} [view] GetAuthorizedViewRequest view + */ + + /** + * Constructs a new GetAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetAuthorizedViewRequest. + * @implements IGetAuthorizedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetAuthorizedViewRequest=} [properties] Properties to set + */ + function GetAuthorizedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAuthorizedViewRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @instance + */ + GetAuthorizedViewRequest.prototype.name = ""; + + /** + * GetAuthorizedViewRequest view. + * @member {google.bigtable.admin.v2.AuthorizedView.ResponseView} view + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @instance + */ + GetAuthorizedViewRequest.prototype.view = 0; + + /** + * Creates a new GetAuthorizedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetAuthorizedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetAuthorizedViewRequest} GetAuthorizedViewRequest instance + */ + GetAuthorizedViewRequest.create = function create(properties) { + return new GetAuthorizedViewRequest(properties); + }; + + /** + * Encodes the specified GetAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetAuthorizedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetAuthorizedViewRequest} message GetAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAuthorizedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetAuthorizedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IGetAuthorizedViewRequest} message GetAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAuthorizedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAuthorizedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetAuthorizedViewRequest} GetAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAuthorizedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetAuthorizedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetAuthorizedViewRequest} GetAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAuthorizedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAuthorizedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAuthorizedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a GetAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetAuthorizedViewRequest} GetAuthorizedViewRequest + */ + GetAuthorizedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetAuthorizedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetAuthorizedViewRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "RESPONSE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "NAME_ONLY": + case 1: + message.view = 1; + break; + case "BASIC": + case 2: + message.view = 2; + break; + case "FULL": + case 3: + message.view = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetAuthorizedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.GetAuthorizedViewRequest} message GetAuthorizedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAuthorizedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "RESPONSE_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.bigtable.admin.v2.AuthorizedView.ResponseView[message.view] === undefined ? message.view : $root.google.bigtable.admin.v2.AuthorizedView.ResponseView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetAuthorizedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @instance + * @returns {Object.} JSON object + */ + GetAuthorizedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAuthorizedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetAuthorizedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAuthorizedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetAuthorizedViewRequest"; + }; + + return GetAuthorizedViewRequest; + })(); + + v2.UpdateAuthorizedViewRequest = (function() { + + /** + * Properties of an UpdateAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateAuthorizedViewRequest + * @property {google.bigtable.admin.v2.IAuthorizedView|null} [authorizedView] UpdateAuthorizedViewRequest authorizedView + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAuthorizedViewRequest updateMask + * @property {boolean|null} [ignoreWarnings] UpdateAuthorizedViewRequest ignoreWarnings + */ + + /** + * Constructs a new UpdateAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateAuthorizedViewRequest. + * @implements IUpdateAuthorizedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest=} [properties] Properties to set + */ + function UpdateAuthorizedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAuthorizedViewRequest authorizedView. + * @member {google.bigtable.admin.v2.IAuthorizedView|null|undefined} authorizedView + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @instance + */ + UpdateAuthorizedViewRequest.prototype.authorizedView = null; + + /** + * UpdateAuthorizedViewRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @instance + */ + UpdateAuthorizedViewRequest.prototype.updateMask = null; + + /** + * UpdateAuthorizedViewRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @instance + */ + UpdateAuthorizedViewRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new UpdateAuthorizedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewRequest} UpdateAuthorizedViewRequest instance + */ + UpdateAuthorizedViewRequest.create = function create(properties) { + return new UpdateAuthorizedViewRequest(properties); + }; + + /** + * Encodes the specified UpdateAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest} message UpdateAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAuthorizedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authorizedView != null && Object.hasOwnProperty.call(message, "authorizedView")) + $root.google.bigtable.admin.v2.AuthorizedView.encode(message.authorizedView, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified UpdateAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest} message UpdateAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAuthorizedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAuthorizedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewRequest} UpdateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAuthorizedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.authorizedView = $root.google.bigtable.admin.v2.AuthorizedView.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewRequest} UpdateAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAuthorizedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAuthorizedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAuthorizedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.authorizedView != null && message.hasOwnProperty("authorizedView")) { + var error = $root.google.bigtable.admin.v2.AuthorizedView.verify(message.authorizedView); + if (error) + return "authorizedView." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates an UpdateAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewRequest} UpdateAuthorizedViewRequest + */ + UpdateAuthorizedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest(); + if (object.authorizedView != null) { + if (typeof object.authorizedView !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAuthorizedViewRequest.authorizedView: object expected"); + message.authorizedView = $root.google.bigtable.admin.v2.AuthorizedView.fromObject(object.authorizedView); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAuthorizedViewRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from an UpdateAuthorizedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.UpdateAuthorizedViewRequest} message UpdateAuthorizedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAuthorizedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.authorizedView = null; + object.updateMask = null; + object.ignoreWarnings = false; + } + if (message.authorizedView != null && message.hasOwnProperty("authorizedView")) + object.authorizedView = $root.google.bigtable.admin.v2.AuthorizedView.toObject(message.authorizedView, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this UpdateAuthorizedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAuthorizedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAuthorizedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAuthorizedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateAuthorizedViewRequest"; + }; + + return UpdateAuthorizedViewRequest; + })(); + + v2.UpdateAuthorizedViewMetadata = (function() { + + /** + * Properties of an UpdateAuthorizedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateAuthorizedViewMetadata + * @property {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest|null} [originalRequest] UpdateAuthorizedViewMetadata originalRequest + * @property {google.protobuf.ITimestamp|null} [requestTime] UpdateAuthorizedViewMetadata requestTime + * @property {google.protobuf.ITimestamp|null} [finishTime] UpdateAuthorizedViewMetadata finishTime + */ + + /** + * Constructs a new UpdateAuthorizedViewMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateAuthorizedViewMetadata. + * @implements IUpdateAuthorizedViewMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata=} [properties] Properties to set + */ + function UpdateAuthorizedViewMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAuthorizedViewMetadata originalRequest. + * @member {google.bigtable.admin.v2.IUpdateAuthorizedViewRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @instance + */ + UpdateAuthorizedViewMetadata.prototype.originalRequest = null; + + /** + * UpdateAuthorizedViewMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @instance + */ + UpdateAuthorizedViewMetadata.prototype.requestTime = null; + + /** + * UpdateAuthorizedViewMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @instance + */ + UpdateAuthorizedViewMetadata.prototype.finishTime = null; + + /** + * Creates a new UpdateAuthorizedViewMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewMetadata} UpdateAuthorizedViewMetadata instance + */ + UpdateAuthorizedViewMetadata.create = function create(properties) { + return new UpdateAuthorizedViewMetadata(properties); + }; + + /** + * Encodes the specified UpdateAuthorizedViewMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata} message UpdateAuthorizedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAuthorizedViewMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalRequest != null && Object.hasOwnProperty.call(message, "originalRequest")) + $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && Object.hasOwnProperty.call(message, "requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAuthorizedViewMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateAuthorizedViewMetadata} message UpdateAuthorizedViewMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAuthorizedViewMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAuthorizedViewMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewMetadata} UpdateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAuthorizedViewMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originalRequest = $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAuthorizedViewMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewMetadata} UpdateAuthorizedViewMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAuthorizedViewMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAuthorizedViewMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAuthorizedViewMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.verify(message.originalRequest); + if (error) + return "originalRequest." + error; + } + if (message.requestTime != null && message.hasOwnProperty("requestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + if (error) + return "requestTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + return null; + }; + + /** + * Creates an UpdateAuthorizedViewMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateAuthorizedViewMetadata} UpdateAuthorizedViewMetadata + */ + UpdateAuthorizedViewMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata(); + if (object.originalRequest != null) { + if (typeof object.originalRequest !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.originalRequest: object expected"); + message.originalRequest = $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.fromObject(object.originalRequest); + } + if (object.requestTime != null) { + if (typeof object.requestTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.requestTime: object expected"); + message.requestTime = $root.google.protobuf.Timestamp.fromObject(object.requestTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAuthorizedViewMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateAuthorizedViewMetadata} message UpdateAuthorizedViewMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAuthorizedViewMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; + } + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + object.originalRequest = $root.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.toObject(message.originalRequest, options); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + return object; + }; + + /** + * Converts this UpdateAuthorizedViewMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateAuthorizedViewMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAuthorizedViewMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateAuthorizedViewMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAuthorizedViewMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateAuthorizedViewMetadata"; + }; + + return UpdateAuthorizedViewMetadata; + })(); + + v2.DeleteAuthorizedViewRequest = (function() { + + /** + * Properties of a DeleteAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteAuthorizedViewRequest + * @property {string|null} [name] DeleteAuthorizedViewRequest name + * @property {string|null} [etag] DeleteAuthorizedViewRequest etag + */ + + /** + * Constructs a new DeleteAuthorizedViewRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteAuthorizedViewRequest. + * @implements IDeleteAuthorizedViewRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteAuthorizedViewRequest=} [properties] Properties to set + */ + function DeleteAuthorizedViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAuthorizedViewRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @instance + */ + DeleteAuthorizedViewRequest.prototype.name = ""; + + /** + * DeleteAuthorizedViewRequest etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @instance + */ + DeleteAuthorizedViewRequest.prototype.etag = ""; + + /** + * Creates a new DeleteAuthorizedViewRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteAuthorizedViewRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteAuthorizedViewRequest} DeleteAuthorizedViewRequest instance + */ + DeleteAuthorizedViewRequest.create = function create(properties) { + return new DeleteAuthorizedViewRequest(properties); + }; + + /** + * Encodes the specified DeleteAuthorizedViewRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteAuthorizedViewRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteAuthorizedViewRequest} message DeleteAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAuthorizedViewRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteAuthorizedViewRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteAuthorizedViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteAuthorizedViewRequest} message DeleteAuthorizedViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAuthorizedViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAuthorizedViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteAuthorizedViewRequest} DeleteAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAuthorizedViewRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteAuthorizedViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAuthorizedViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteAuthorizedViewRequest} DeleteAuthorizedViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAuthorizedViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAuthorizedViewRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAuthorizedViewRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteAuthorizedViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteAuthorizedViewRequest} DeleteAuthorizedViewRequest + */ + DeleteAuthorizedViewRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteAuthorizedViewRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteAuthorizedViewRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteAuthorizedViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {google.bigtable.admin.v2.DeleteAuthorizedViewRequest} message DeleteAuthorizedViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAuthorizedViewRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteAuthorizedViewRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAuthorizedViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAuthorizedViewRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteAuthorizedViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAuthorizedViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteAuthorizedViewRequest"; + }; + + return DeleteAuthorizedViewRequest; + })(); + + v2.CreateSchemaBundleRequest = (function() { + + /** + * Properties of a CreateSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @interface ICreateSchemaBundleRequest + * @property {string|null} [parent] CreateSchemaBundleRequest parent + * @property {string|null} [schemaBundleId] CreateSchemaBundleRequest schemaBundleId + * @property {google.bigtable.admin.v2.ISchemaBundle|null} [schemaBundle] CreateSchemaBundleRequest schemaBundle + */ + + /** + * Constructs a new CreateSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateSchemaBundleRequest. + * @implements ICreateSchemaBundleRequest + * @constructor + * @param {google.bigtable.admin.v2.ICreateSchemaBundleRequest=} [properties] Properties to set + */ + function CreateSchemaBundleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSchemaBundleRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @instance + */ + CreateSchemaBundleRequest.prototype.parent = ""; + + /** + * CreateSchemaBundleRequest schemaBundleId. + * @member {string} schemaBundleId + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @instance + */ + CreateSchemaBundleRequest.prototype.schemaBundleId = ""; + + /** + * CreateSchemaBundleRequest schemaBundle. + * @member {google.bigtable.admin.v2.ISchemaBundle|null|undefined} schemaBundle + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @instance + */ + CreateSchemaBundleRequest.prototype.schemaBundle = null; + + /** + * Creates a new CreateSchemaBundleRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.ICreateSchemaBundleRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateSchemaBundleRequest} CreateSchemaBundleRequest instance + */ + CreateSchemaBundleRequest.create = function create(properties) { + return new CreateSchemaBundleRequest(properties); + }; + + /** + * Encodes the specified CreateSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.ICreateSchemaBundleRequest} message CreateSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaBundleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.schemaBundleId); + if (message.schemaBundle != null && Object.hasOwnProperty.call(message, "schemaBundle")) + $root.google.bigtable.admin.v2.SchemaBundle.encode(message.schemaBundle, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.ICreateSchemaBundleRequest} message CreateSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaBundleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSchemaBundleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateSchemaBundleRequest} CreateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaBundleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateSchemaBundleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.schemaBundleId = reader.string(); + break; + } + case 3: { + message.schemaBundle = $root.google.bigtable.admin.v2.SchemaBundle.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateSchemaBundleRequest} CreateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaBundleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSchemaBundleRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSchemaBundleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + if (!$util.isString(message.schemaBundleId)) + return "schemaBundleId: string expected"; + if (message.schemaBundle != null && message.hasOwnProperty("schemaBundle")) { + var error = $root.google.bigtable.admin.v2.SchemaBundle.verify(message.schemaBundle); + if (error) + return "schemaBundle." + error; + } + return null; + }; + + /** + * Creates a CreateSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateSchemaBundleRequest} CreateSchemaBundleRequest + */ + CreateSchemaBundleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateSchemaBundleRequest) + return object; + var message = new $root.google.bigtable.admin.v2.CreateSchemaBundleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.schemaBundleId != null) + message.schemaBundleId = String(object.schemaBundleId); + if (object.schemaBundle != null) { + if (typeof object.schemaBundle !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateSchemaBundleRequest.schemaBundle: object expected"); + message.schemaBundle = $root.google.bigtable.admin.v2.SchemaBundle.fromObject(object.schemaBundle); + } + return message; + }; + + /** + * Creates a plain object from a CreateSchemaBundleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.CreateSchemaBundleRequest} message CreateSchemaBundleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSchemaBundleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.schemaBundleId = ""; + object.schemaBundle = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + object.schemaBundleId = message.schemaBundleId; + if (message.schemaBundle != null && message.hasOwnProperty("schemaBundle")) + object.schemaBundle = $root.google.bigtable.admin.v2.SchemaBundle.toObject(message.schemaBundle, options); + return object; + }; + + /** + * Converts this CreateSchemaBundleRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSchemaBundleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSchemaBundleRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateSchemaBundleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSchemaBundleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateSchemaBundleRequest"; + }; + + return CreateSchemaBundleRequest; + })(); + + v2.CreateSchemaBundleMetadata = (function() { + + /** + * Properties of a CreateSchemaBundleMetadata. + * @memberof google.bigtable.admin.v2 + * @interface ICreateSchemaBundleMetadata + * @property {string|null} [name] CreateSchemaBundleMetadata name + * @property {google.protobuf.ITimestamp|null} [startTime] CreateSchemaBundleMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] CreateSchemaBundleMetadata endTime + */ + + /** + * Constructs a new CreateSchemaBundleMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a CreateSchemaBundleMetadata. + * @implements ICreateSchemaBundleMetadata + * @constructor + * @param {google.bigtable.admin.v2.ICreateSchemaBundleMetadata=} [properties] Properties to set + */ + function CreateSchemaBundleMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSchemaBundleMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @instance + */ + CreateSchemaBundleMetadata.prototype.name = ""; + + /** + * CreateSchemaBundleMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @instance + */ + CreateSchemaBundleMetadata.prototype.startTime = null; + + /** + * CreateSchemaBundleMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @instance + */ + CreateSchemaBundleMetadata.prototype.endTime = null; + + /** + * Creates a new CreateSchemaBundleMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateSchemaBundleMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateSchemaBundleMetadata} CreateSchemaBundleMetadata instance + */ + CreateSchemaBundleMetadata.create = function create(properties) { + return new CreateSchemaBundleMetadata(properties); + }; + + /** + * Encodes the specified CreateSchemaBundleMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateSchemaBundleMetadata} message CreateSchemaBundleMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaBundleMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSchemaBundleMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateSchemaBundleMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.ICreateSchemaBundleMetadata} message CreateSchemaBundleMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaBundleMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSchemaBundleMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateSchemaBundleMetadata} CreateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaBundleMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateSchemaBundleMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSchemaBundleMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateSchemaBundleMetadata} CreateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaBundleMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSchemaBundleMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSchemaBundleMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a CreateSchemaBundleMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateSchemaBundleMetadata} CreateSchemaBundleMetadata + */ + CreateSchemaBundleMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateSchemaBundleMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.CreateSchemaBundleMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateSchemaBundleMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateSchemaBundleMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateSchemaBundleMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.CreateSchemaBundleMetadata} message CreateSchemaBundleMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSchemaBundleMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this CreateSchemaBundleMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateSchemaBundleMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSchemaBundleMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.CreateSchemaBundleMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSchemaBundleMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.CreateSchemaBundleMetadata"; + }; + + return CreateSchemaBundleMetadata; + })(); + + v2.UpdateSchemaBundleRequest = (function() { + + /** + * Properties of an UpdateSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateSchemaBundleRequest + * @property {google.bigtable.admin.v2.ISchemaBundle|null} [schemaBundle] UpdateSchemaBundleRequest schemaBundle + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSchemaBundleRequest updateMask + * @property {boolean|null} [ignoreWarnings] UpdateSchemaBundleRequest ignoreWarnings + */ + + /** + * Constructs a new UpdateSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateSchemaBundleRequest. + * @implements IUpdateSchemaBundleRequest + * @constructor + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleRequest=} [properties] Properties to set + */ + function UpdateSchemaBundleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSchemaBundleRequest schemaBundle. + * @member {google.bigtable.admin.v2.ISchemaBundle|null|undefined} schemaBundle + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @instance + */ + UpdateSchemaBundleRequest.prototype.schemaBundle = null; + + /** + * UpdateSchemaBundleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @instance + */ + UpdateSchemaBundleRequest.prototype.updateMask = null; + + /** + * UpdateSchemaBundleRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @instance + */ + UpdateSchemaBundleRequest.prototype.ignoreWarnings = false; + + /** + * Creates a new UpdateSchemaBundleRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleRequest} UpdateSchemaBundleRequest instance + */ + UpdateSchemaBundleRequest.create = function create(properties) { + return new UpdateSchemaBundleRequest(properties); + }; + + /** + * Encodes the specified UpdateSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleRequest} message UpdateSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSchemaBundleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaBundle != null && Object.hasOwnProperty.call(message, "schemaBundle")) + $root.google.bigtable.admin.v2.SchemaBundle.encode(message.schemaBundle, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreWarnings != null && Object.hasOwnProperty.call(message, "ignoreWarnings")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreWarnings); + return writer; + }; + + /** + * Encodes the specified UpdateSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleRequest} message UpdateSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSchemaBundleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSchemaBundleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleRequest} UpdateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSchemaBundleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateSchemaBundleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schemaBundle = $root.google.bigtable.admin.v2.SchemaBundle.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ignoreWarnings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleRequest} UpdateSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSchemaBundleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSchemaBundleRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSchemaBundleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaBundle != null && message.hasOwnProperty("schemaBundle")) { + var error = $root.google.bigtable.admin.v2.SchemaBundle.verify(message.schemaBundle); + if (error) + return "schemaBundle." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; + return null; + }; + + /** + * Creates an UpdateSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleRequest} UpdateSchemaBundleRequest + */ + UpdateSchemaBundleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateSchemaBundleRequest) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateSchemaBundleRequest(); + if (object.schemaBundle != null) { + if (typeof object.schemaBundle !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateSchemaBundleRequest.schemaBundle: object expected"); + message.schemaBundle = $root.google.bigtable.admin.v2.SchemaBundle.fromObject(object.schemaBundle); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateSchemaBundleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.ignoreWarnings != null) + message.ignoreWarnings = Boolean(object.ignoreWarnings); + return message; + }; + + /** + * Creates a plain object from an UpdateSchemaBundleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.UpdateSchemaBundleRequest} message UpdateSchemaBundleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSchemaBundleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schemaBundle = null; + object.updateMask = null; + object.ignoreWarnings = false; + } + if (message.schemaBundle != null && message.hasOwnProperty("schemaBundle")) + object.schemaBundle = $root.google.bigtable.admin.v2.SchemaBundle.toObject(message.schemaBundle, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + object.ignoreWarnings = message.ignoreWarnings; + return object; + }; + + /** + * Converts this UpdateSchemaBundleRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSchemaBundleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSchemaBundleRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSchemaBundleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateSchemaBundleRequest"; + }; + + return UpdateSchemaBundleRequest; + })(); + + v2.UpdateSchemaBundleMetadata = (function() { + + /** + * Properties of an UpdateSchemaBundleMetadata. + * @memberof google.bigtable.admin.v2 + * @interface IUpdateSchemaBundleMetadata + * @property {string|null} [name] UpdateSchemaBundleMetadata name + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSchemaBundleMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] UpdateSchemaBundleMetadata endTime + */ + + /** + * Constructs a new UpdateSchemaBundleMetadata. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an UpdateSchemaBundleMetadata. + * @implements IUpdateSchemaBundleMetadata + * @constructor + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleMetadata=} [properties] Properties to set + */ + function UpdateSchemaBundleMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSchemaBundleMetadata name. + * @member {string} name + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @instance + */ + UpdateSchemaBundleMetadata.prototype.name = ""; + + /** + * UpdateSchemaBundleMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @instance + */ + UpdateSchemaBundleMetadata.prototype.startTime = null; + + /** + * UpdateSchemaBundleMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @instance + */ + UpdateSchemaBundleMetadata.prototype.endTime = null; + + /** + * Creates a new UpdateSchemaBundleMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleMetadata} UpdateSchemaBundleMetadata instance + */ + UpdateSchemaBundleMetadata.create = function create(properties) { + return new UpdateSchemaBundleMetadata(properties); + }; + + /** + * Encodes the specified UpdateSchemaBundleMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleMetadata} message UpdateSchemaBundleMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSchemaBundleMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSchemaBundleMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateSchemaBundleMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.IUpdateSchemaBundleMetadata} message UpdateSchemaBundleMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSchemaBundleMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSchemaBundleMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleMetadata} UpdateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSchemaBundleMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.UpdateSchemaBundleMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSchemaBundleMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleMetadata} UpdateSchemaBundleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSchemaBundleMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSchemaBundleMetadata message. + * @function verify + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSchemaBundleMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an UpdateSchemaBundleMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.UpdateSchemaBundleMetadata} UpdateSchemaBundleMetadata + */ + UpdateSchemaBundleMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateSchemaBundleMetadata) + return object; + var message = new $root.google.bigtable.admin.v2.UpdateSchemaBundleMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateSchemaBundleMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.UpdateSchemaBundleMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSchemaBundleMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {google.bigtable.admin.v2.UpdateSchemaBundleMetadata} message UpdateSchemaBundleMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSchemaBundleMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this UpdateSchemaBundleMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateSchemaBundleMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSchemaBundleMetadata + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.UpdateSchemaBundleMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSchemaBundleMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.UpdateSchemaBundleMetadata"; + }; + + return UpdateSchemaBundleMetadata; + })(); + + v2.GetSchemaBundleRequest = (function() { + + /** + * Properties of a GetSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @interface IGetSchemaBundleRequest + * @property {string|null} [name] GetSchemaBundleRequest name + */ + + /** + * Constructs a new GetSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GetSchemaBundleRequest. + * @implements IGetSchemaBundleRequest + * @constructor + * @param {google.bigtable.admin.v2.IGetSchemaBundleRequest=} [properties] Properties to set + */ + function GetSchemaBundleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSchemaBundleRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @instance + */ + GetSchemaBundleRequest.prototype.name = ""; + + /** + * Creates a new GetSchemaBundleRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IGetSchemaBundleRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetSchemaBundleRequest} GetSchemaBundleRequest instance + */ + GetSchemaBundleRequest.create = function create(properties) { + return new GetSchemaBundleRequest(properties); + }; + + /** + * Encodes the specified GetSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetSchemaBundleRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IGetSchemaBundleRequest} message GetSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaBundleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetSchemaBundleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IGetSchemaBundleRequest} message GetSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaBundleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSchemaBundleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GetSchemaBundleRequest} GetSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaBundleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GetSchemaBundleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GetSchemaBundleRequest} GetSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaBundleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSchemaBundleRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSchemaBundleRequest.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 GetSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GetSchemaBundleRequest} GetSchemaBundleRequest + */ + GetSchemaBundleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetSchemaBundleRequest) + return object; + var message = new $root.google.bigtable.admin.v2.GetSchemaBundleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSchemaBundleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.GetSchemaBundleRequest} message GetSchemaBundleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSchemaBundleRequest.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 GetSchemaBundleRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @instance + * @returns {Object.} JSON object + */ + GetSchemaBundleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSchemaBundleRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GetSchemaBundleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSchemaBundleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GetSchemaBundleRequest"; + }; + + return GetSchemaBundleRequest; + })(); + + v2.ListSchemaBundlesRequest = (function() { + + /** + * Properties of a ListSchemaBundlesRequest. + * @memberof google.bigtable.admin.v2 + * @interface IListSchemaBundlesRequest + * @property {string|null} [parent] ListSchemaBundlesRequest parent + * @property {number|null} [pageSize] ListSchemaBundlesRequest pageSize + * @property {string|null} [pageToken] ListSchemaBundlesRequest pageToken + */ + + /** + * Constructs a new ListSchemaBundlesRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListSchemaBundlesRequest. + * @implements IListSchemaBundlesRequest + * @constructor + * @param {google.bigtable.admin.v2.IListSchemaBundlesRequest=} [properties] Properties to set + */ + function ListSchemaBundlesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSchemaBundlesRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @instance + */ + ListSchemaBundlesRequest.prototype.parent = ""; + + /** + * ListSchemaBundlesRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @instance + */ + ListSchemaBundlesRequest.prototype.pageSize = 0; + + /** + * ListSchemaBundlesRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @instance + */ + ListSchemaBundlesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSchemaBundlesRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {google.bigtable.admin.v2.IListSchemaBundlesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListSchemaBundlesRequest} ListSchemaBundlesRequest instance + */ + ListSchemaBundlesRequest.create = function create(properties) { + return new ListSchemaBundlesRequest(properties); + }; + + /** + * Encodes the specified ListSchemaBundlesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {google.bigtable.admin.v2.IListSchemaBundlesRequest} message ListSchemaBundlesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaBundlesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSchemaBundlesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {google.bigtable.admin.v2.IListSchemaBundlesRequest} message ListSchemaBundlesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaBundlesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemaBundlesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListSchemaBundlesRequest} ListSchemaBundlesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaBundlesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListSchemaBundlesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemaBundlesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListSchemaBundlesRequest} ListSchemaBundlesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaBundlesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemaBundlesRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemaBundlesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchemaBundlesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListSchemaBundlesRequest} ListSchemaBundlesRequest + */ + ListSchemaBundlesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListSchemaBundlesRequest) + return object; + var message = new $root.google.bigtable.admin.v2.ListSchemaBundlesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemaBundlesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {google.bigtable.admin.v2.ListSchemaBundlesRequest} message ListSchemaBundlesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemaBundlesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSchemaBundlesRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSchemaBundlesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemaBundlesRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListSchemaBundlesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemaBundlesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListSchemaBundlesRequest"; + }; + + return ListSchemaBundlesRequest; + })(); + + v2.ListSchemaBundlesResponse = (function() { + + /** + * Properties of a ListSchemaBundlesResponse. + * @memberof google.bigtable.admin.v2 + * @interface IListSchemaBundlesResponse + * @property {Array.|null} [schemaBundles] ListSchemaBundlesResponse schemaBundles + * @property {string|null} [nextPageToken] ListSchemaBundlesResponse nextPageToken + */ + + /** + * Constructs a new ListSchemaBundlesResponse. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ListSchemaBundlesResponse. + * @implements IListSchemaBundlesResponse + * @constructor + * @param {google.bigtable.admin.v2.IListSchemaBundlesResponse=} [properties] Properties to set + */ + function ListSchemaBundlesResponse(properties) { + this.schemaBundles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSchemaBundlesResponse schemaBundles. + * @member {Array.} schemaBundles + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @instance + */ + ListSchemaBundlesResponse.prototype.schemaBundles = $util.emptyArray; + + /** + * ListSchemaBundlesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @instance + */ + ListSchemaBundlesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSchemaBundlesResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {google.bigtable.admin.v2.IListSchemaBundlesResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListSchemaBundlesResponse} ListSchemaBundlesResponse instance + */ + ListSchemaBundlesResponse.create = function create(properties) { + return new ListSchemaBundlesResponse(properties); + }; + + /** + * Encodes the specified ListSchemaBundlesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {google.bigtable.admin.v2.IListSchemaBundlesResponse} message ListSchemaBundlesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaBundlesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaBundles != null && message.schemaBundles.length) + for (var i = 0; i < message.schemaBundles.length; ++i) + $root.google.bigtable.admin.v2.SchemaBundle.encode(message.schemaBundles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSchemaBundlesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSchemaBundlesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {google.bigtable.admin.v2.IListSchemaBundlesResponse} message ListSchemaBundlesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaBundlesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemaBundlesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ListSchemaBundlesResponse} ListSchemaBundlesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaBundlesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ListSchemaBundlesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.schemaBundles && message.schemaBundles.length)) + message.schemaBundles = []; + message.schemaBundles.push($root.google.bigtable.admin.v2.SchemaBundle.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemaBundlesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ListSchemaBundlesResponse} ListSchemaBundlesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaBundlesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemaBundlesResponse message. + * @function verify + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemaBundlesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaBundles != null && message.hasOwnProperty("schemaBundles")) { + if (!Array.isArray(message.schemaBundles)) + return "schemaBundles: array expected"; + for (var i = 0; i < message.schemaBundles.length; ++i) { + var error = $root.google.bigtable.admin.v2.SchemaBundle.verify(message.schemaBundles[i]); + if (error) + return "schemaBundles." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchemaBundlesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ListSchemaBundlesResponse} ListSchemaBundlesResponse + */ + ListSchemaBundlesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListSchemaBundlesResponse) + return object; + var message = new $root.google.bigtable.admin.v2.ListSchemaBundlesResponse(); + if (object.schemaBundles) { + if (!Array.isArray(object.schemaBundles)) + throw TypeError(".google.bigtable.admin.v2.ListSchemaBundlesResponse.schemaBundles: array expected"); + message.schemaBundles = []; + for (var i = 0; i < object.schemaBundles.length; ++i) { + if (typeof object.schemaBundles[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.ListSchemaBundlesResponse.schemaBundles: object expected"); + message.schemaBundles[i] = $root.google.bigtable.admin.v2.SchemaBundle.fromObject(object.schemaBundles[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemaBundlesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {google.bigtable.admin.v2.ListSchemaBundlesResponse} message ListSchemaBundlesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemaBundlesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schemaBundles = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.schemaBundles && message.schemaBundles.length) { + object.schemaBundles = []; + for (var j = 0; j < message.schemaBundles.length; ++j) + object.schemaBundles[j] = $root.google.bigtable.admin.v2.SchemaBundle.toObject(message.schemaBundles[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSchemaBundlesResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSchemaBundlesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemaBundlesResponse + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ListSchemaBundlesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemaBundlesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ListSchemaBundlesResponse"; + }; + + return ListSchemaBundlesResponse; + })(); + + v2.DeleteSchemaBundleRequest = (function() { + + /** + * Properties of a DeleteSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @interface IDeleteSchemaBundleRequest + * @property {string|null} [name] DeleteSchemaBundleRequest name + * @property {string|null} [etag] DeleteSchemaBundleRequest etag + */ + + /** + * Constructs a new DeleteSchemaBundleRequest. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a DeleteSchemaBundleRequest. + * @implements IDeleteSchemaBundleRequest + * @constructor + * @param {google.bigtable.admin.v2.IDeleteSchemaBundleRequest=} [properties] Properties to set + */ + function DeleteSchemaBundleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSchemaBundleRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @instance + */ + DeleteSchemaBundleRequest.prototype.name = ""; + + /** + * DeleteSchemaBundleRequest etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @instance + */ + DeleteSchemaBundleRequest.prototype.etag = ""; + + /** + * Creates a new DeleteSchemaBundleRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteSchemaBundleRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteSchemaBundleRequest} DeleteSchemaBundleRequest instance + */ + DeleteSchemaBundleRequest.create = function create(properties) { + return new DeleteSchemaBundleRequest(properties); + }; + + /** + * Encodes the specified DeleteSchemaBundleRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteSchemaBundleRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteSchemaBundleRequest} message DeleteSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaBundleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteSchemaBundleRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteSchemaBundleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.IDeleteSchemaBundleRequest} message DeleteSchemaBundleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaBundleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSchemaBundleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.DeleteSchemaBundleRequest} DeleteSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaBundleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.DeleteSchemaBundleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSchemaBundleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.DeleteSchemaBundleRequest} DeleteSchemaBundleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaBundleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSchemaBundleRequest message. + * @function verify + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSchemaBundleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteSchemaBundleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.DeleteSchemaBundleRequest} DeleteSchemaBundleRequest + */ + DeleteSchemaBundleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteSchemaBundleRequest) + return object; + var message = new $root.google.bigtable.admin.v2.DeleteSchemaBundleRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteSchemaBundleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {google.bigtable.admin.v2.DeleteSchemaBundleRequest} message DeleteSchemaBundleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSchemaBundleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteSchemaBundleRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSchemaBundleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSchemaBundleRequest + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.DeleteSchemaBundleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSchemaBundleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.DeleteSchemaBundleRequest"; + }; + + return DeleteSchemaBundleRequest; + })(); + + v2.RestoreInfo = (function() { + + /** + * Properties of a RestoreInfo. + * @memberof google.bigtable.admin.v2 + * @interface IRestoreInfo + * @property {google.bigtable.admin.v2.RestoreSourceType|null} [sourceType] RestoreInfo sourceType + * @property {google.bigtable.admin.v2.IBackupInfo|null} [backupInfo] RestoreInfo backupInfo + */ + + /** + * Constructs a new RestoreInfo. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a RestoreInfo. + * @implements IRestoreInfo + * @constructor + * @param {google.bigtable.admin.v2.IRestoreInfo=} [properties] Properties to set + */ + function RestoreInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreInfo sourceType. + * @member {google.bigtable.admin.v2.RestoreSourceType} sourceType + * @memberof google.bigtable.admin.v2.RestoreInfo + * @instance + */ + RestoreInfo.prototype.sourceType = 0; + + /** + * RestoreInfo backupInfo. + * @member {google.bigtable.admin.v2.IBackupInfo|null|undefined} backupInfo + * @memberof google.bigtable.admin.v2.RestoreInfo + * @instance + */ + RestoreInfo.prototype.backupInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreInfo sourceInfo. + * @member {"backupInfo"|undefined} sourceInfo + * @memberof google.bigtable.admin.v2.RestoreInfo + * @instance + */ + Object.defineProperty(RestoreInfo.prototype, "sourceInfo", { + get: $util.oneOfGetter($oneOfFields = ["backupInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreInfo instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {google.bigtable.admin.v2.IRestoreInfo=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.RestoreInfo} RestoreInfo instance + */ + RestoreInfo.create = function create(properties) { + return new RestoreInfo(properties); + }; + + /** + * Encodes the specified RestoreInfo message. Does not implicitly {@link google.bigtable.admin.v2.RestoreInfo.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {google.bigtable.admin.v2.IRestoreInfo} message RestoreInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sourceType); + if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) + $root.google.bigtable.admin.v2.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreInfo message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.RestoreInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {google.bigtable.admin.v2.IRestoreInfo} message RestoreInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.RestoreInfo} RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.RestoreInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sourceType = reader.int32(); + break; + } + case 2: { + message.backupInfo = $root.google.bigtable.admin.v2.BackupInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.RestoreInfo} RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreInfo message. + * @function verify + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + properties.sourceInfo = 1; + { + var error = $root.google.bigtable.admin.v2.BackupInfo.verify(message.backupInfo); + if (error) + return "backupInfo." + error; + } + } + return null; + }; + + /** + * Creates a RestoreInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.RestoreInfo} RestoreInfo + */ + RestoreInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.RestoreInfo) + return object; + var message = new $root.google.bigtable.admin.v2.RestoreInfo(); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "RESTORE_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "BACKUP": + case 1: + message.sourceType = 1; + break; + } + if (object.backupInfo != null) { + if (typeof object.backupInfo !== "object") + throw TypeError(".google.bigtable.admin.v2.RestoreInfo.backupInfo: object expected"); + message.backupInfo = $root.google.bigtable.admin.v2.BackupInfo.fromObject(object.backupInfo); + } + return message; + }; + + /** + * Creates a plain object from a RestoreInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {google.bigtable.admin.v2.RestoreInfo} message RestoreInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sourceType = options.enums === String ? "RESTORE_SOURCE_TYPE_UNSPECIFIED" : 0; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.bigtable.admin.v2.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.bigtable.admin.v2.RestoreSourceType[message.sourceType] : message.sourceType; + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + object.backupInfo = $root.google.bigtable.admin.v2.BackupInfo.toObject(message.backupInfo, options); + if (options.oneofs) + object.sourceInfo = "backupInfo"; + } + return object; + }; + + /** + * Converts this RestoreInfo to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.RestoreInfo + * @instance + * @returns {Object.} JSON object + */ + RestoreInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreInfo + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.RestoreInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.RestoreInfo"; + }; + + return RestoreInfo; + })(); + + v2.ChangeStreamConfig = (function() { + + /** + * Properties of a ChangeStreamConfig. + * @memberof google.bigtable.admin.v2 + * @interface IChangeStreamConfig + * @property {google.protobuf.IDuration|null} [retentionPeriod] ChangeStreamConfig retentionPeriod + */ + + /** + * Constructs a new ChangeStreamConfig. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ChangeStreamConfig. + * @implements IChangeStreamConfig + * @constructor + * @param {google.bigtable.admin.v2.IChangeStreamConfig=} [properties] Properties to set + */ + function ChangeStreamConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChangeStreamConfig retentionPeriod. + * @member {google.protobuf.IDuration|null|undefined} retentionPeriod + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @instance + */ + ChangeStreamConfig.prototype.retentionPeriod = null; + + /** + * Creates a new ChangeStreamConfig instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {google.bigtable.admin.v2.IChangeStreamConfig=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ChangeStreamConfig} ChangeStreamConfig instance + */ + ChangeStreamConfig.create = function create(properties) { + return new ChangeStreamConfig(properties); + }; + + /** + * Encodes the specified ChangeStreamConfig message. Does not implicitly {@link google.bigtable.admin.v2.ChangeStreamConfig.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {google.bigtable.admin.v2.IChangeStreamConfig} message ChangeStreamConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeStreamConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) + $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChangeStreamConfig message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ChangeStreamConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {google.bigtable.admin.v2.IChangeStreamConfig} message ChangeStreamConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeStreamConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChangeStreamConfig message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ChangeStreamConfig} ChangeStreamConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeStreamConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ChangeStreamConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChangeStreamConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ChangeStreamConfig} ChangeStreamConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeStreamConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChangeStreamConfig message. + * @function verify + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChangeStreamConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); + if (error) + return "retentionPeriod." + error; + } + return null; + }; + + /** + * Creates a ChangeStreamConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ChangeStreamConfig} ChangeStreamConfig + */ + ChangeStreamConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ChangeStreamConfig) + return object; + var message = new $root.google.bigtable.admin.v2.ChangeStreamConfig(); + if (object.retentionPeriod != null) { + if (typeof object.retentionPeriod !== "object") + throw TypeError(".google.bigtable.admin.v2.ChangeStreamConfig.retentionPeriod: object expected"); + message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); + } + return message; + }; + + /** + * Creates a plain object from a ChangeStreamConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {google.bigtable.admin.v2.ChangeStreamConfig} message ChangeStreamConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChangeStreamConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.retentionPeriod = null; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) + object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); + return object; + }; + + /** + * Converts this ChangeStreamConfig to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @instance + * @returns {Object.} JSON object + */ + ChangeStreamConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChangeStreamConfig + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ChangeStreamConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChangeStreamConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ChangeStreamConfig"; + }; + + return ChangeStreamConfig; + })(); + + v2.Table = (function() { + + /** + * Properties of a Table. + * @memberof google.bigtable.admin.v2 + * @interface ITable + * @property {string|null} [name] Table name + * @property {Object.|null} [clusterStates] Table clusterStates + * @property {Object.|null} [columnFamilies] Table columnFamilies + * @property {google.bigtable.admin.v2.Table.TimestampGranularity|null} [granularity] Table granularity + * @property {google.bigtable.admin.v2.IRestoreInfo|null} [restoreInfo] Table restoreInfo + * @property {google.bigtable.admin.v2.IChangeStreamConfig|null} [changeStreamConfig] Table changeStreamConfig + * @property {boolean|null} [deletionProtection] Table deletionProtection + * @property {google.bigtable.admin.v2.Table.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Table automatedBackupPolicy + * @property {google.bigtable.admin.v2.Type.IStruct|null} [rowKeySchema] Table rowKeySchema + */ + + /** + * Constructs a new Table. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a Table. + * @implements ITable + * @constructor + * @param {google.bigtable.admin.v2.ITable=} [properties] Properties to set + */ + function Table(properties) { + this.clusterStates = {}; + this.columnFamilies = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Table name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.name = ""; + + /** + * Table clusterStates. + * @member {Object.} clusterStates + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.clusterStates = $util.emptyObject; + + /** + * Table columnFamilies. + * @member {Object.} columnFamilies + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.columnFamilies = $util.emptyObject; + + /** + * Table granularity. + * @member {google.bigtable.admin.v2.Table.TimestampGranularity} granularity + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.granularity = 0; + + /** + * Table restoreInfo. + * @member {google.bigtable.admin.v2.IRestoreInfo|null|undefined} restoreInfo + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.restoreInfo = null; + + /** + * Table changeStreamConfig. + * @member {google.bigtable.admin.v2.IChangeStreamConfig|null|undefined} changeStreamConfig + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.changeStreamConfig = null; + + /** + * Table deletionProtection. + * @member {boolean} deletionProtection + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.deletionProtection = false; + + /** + * Table automatedBackupPolicy. + * @member {google.bigtable.admin.v2.Table.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.automatedBackupPolicy = null; + + /** + * Table rowKeySchema. + * @member {google.bigtable.admin.v2.Type.IStruct|null|undefined} rowKeySchema + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.rowKeySchema = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Table automatedBackupConfig. + * @member {"automatedBackupPolicy"|undefined} automatedBackupConfig + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Object.defineProperty(Table.prototype, "automatedBackupConfig", { + get: $util.oneOfGetter($oneOfFields = ["automatedBackupPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Table instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {google.bigtable.admin.v2.ITable=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Table} Table instance + */ + Table.create = function create(properties) { + return new Table(properties); + }; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.bigtable.admin.v2.Table.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {google.bigtable.admin.v2.ITable} message Table message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Table.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.clusterStates != null && Object.hasOwnProperty.call(message, "clusterStates")) + for (var keys = Object.keys(message.clusterStates), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.admin.v2.Table.ClusterState.encode(message.clusterStates[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.columnFamilies != null && Object.hasOwnProperty.call(message, "columnFamilies")) + for (var keys = Object.keys(message.columnFamilies), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.admin.v2.ColumnFamily.encode(message.columnFamilies[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.granularity != null && Object.hasOwnProperty.call(message, "granularity")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.granularity); + if (message.restoreInfo != null && Object.hasOwnProperty.call(message, "restoreInfo")) + $root.google.bigtable.admin.v2.RestoreInfo.encode(message.restoreInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.changeStreamConfig != null && Object.hasOwnProperty.call(message, "changeStreamConfig")) + $root.google.bigtable.admin.v2.ChangeStreamConfig.encode(message.changeStreamConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.deletionProtection); + if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) + $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.rowKeySchema != null && Object.hasOwnProperty.call(message, "rowKeySchema")) + $root.google.bigtable.admin.v2.Type.Struct.encode(message.rowKeySchema, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Table.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {google.bigtable.admin.v2.ITable} message Table message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Table.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Table message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Table} Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Table.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Table(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.clusterStates === $util.emptyObject) + message.clusterStates = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.admin.v2.Table.ClusterState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.clusterStates[key] = value; + break; + } + case 3: { + if (message.columnFamilies === $util.emptyObject) + message.columnFamilies = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.admin.v2.ColumnFamily.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.columnFamilies[key] = value; + break; + } + case 4: { + message.granularity = reader.int32(); + break; + } + case 6: { + message.restoreInfo = $root.google.bigtable.admin.v2.RestoreInfo.decode(reader, reader.uint32()); + break; + } + case 8: { + message.changeStreamConfig = $root.google.bigtable.admin.v2.ChangeStreamConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.deletionProtection = reader.bool(); + break; + } + case 13: { + message.automatedBackupPolicy = $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.decode(reader, reader.uint32()); + break; + } + case 15: { + message.rowKeySchema = $root.google.bigtable.admin.v2.Type.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Table message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Table} Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Table.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Table message. + * @function verify + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Table.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.clusterStates != null && message.hasOwnProperty("clusterStates")) { + if (!$util.isObject(message.clusterStates)) + return "clusterStates: object expected"; + var key = Object.keys(message.clusterStates); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.admin.v2.Table.ClusterState.verify(message.clusterStates[key[i]]); + if (error) + return "clusterStates." + error; + } + } + if (message.columnFamilies != null && message.hasOwnProperty("columnFamilies")) { + if (!$util.isObject(message.columnFamilies)) + return "columnFamilies: object expected"; + var key = Object.keys(message.columnFamilies); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.admin.v2.ColumnFamily.verify(message.columnFamilies[key[i]]); + if (error) + return "columnFamilies." + error; + } + } + if (message.granularity != null && message.hasOwnProperty("granularity")) + switch (message.granularity) { + default: + return "granularity: enum value expected"; + case 0: + case 1: + break; + } + if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) { + var error = $root.google.bigtable.admin.v2.RestoreInfo.verify(message.restoreInfo); + if (error) + return "restoreInfo." + error; + } + if (message.changeStreamConfig != null && message.hasOwnProperty("changeStreamConfig")) { + var error = $root.google.bigtable.admin.v2.ChangeStreamConfig.verify(message.changeStreamConfig); + if (error) + return "changeStreamConfig." + error; + } + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { + properties.automatedBackupConfig = 1; + { + var error = $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); + if (error) + return "automatedBackupPolicy." + error; + } + } + if (message.rowKeySchema != null && message.hasOwnProperty("rowKeySchema")) { + var error = $root.google.bigtable.admin.v2.Type.Struct.verify(message.rowKeySchema); + if (error) + return "rowKeySchema." + error; + } + return null; + }; + + /** + * Creates a Table message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Table} Table + */ + Table.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Table) + return object; + var message = new $root.google.bigtable.admin.v2.Table(); + if (object.name != null) + message.name = String(object.name); + if (object.clusterStates) { + if (typeof object.clusterStates !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.clusterStates: object expected"); + message.clusterStates = {}; + for (var keys = Object.keys(object.clusterStates), i = 0; i < keys.length; ++i) { + if (typeof object.clusterStates[keys[i]] !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.clusterStates: object expected"); + message.clusterStates[keys[i]] = $root.google.bigtable.admin.v2.Table.ClusterState.fromObject(object.clusterStates[keys[i]]); + } + } + if (object.columnFamilies) { + if (typeof object.columnFamilies !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.columnFamilies: object expected"); + message.columnFamilies = {}; + for (var keys = Object.keys(object.columnFamilies), i = 0; i < keys.length; ++i) { + if (typeof object.columnFamilies[keys[i]] !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.columnFamilies: object expected"); + message.columnFamilies[keys[i]] = $root.google.bigtable.admin.v2.ColumnFamily.fromObject(object.columnFamilies[keys[i]]); + } + } + switch (object.granularity) { + default: + if (typeof object.granularity === "number") { + message.granularity = object.granularity; + break; + } + break; + case "TIMESTAMP_GRANULARITY_UNSPECIFIED": + case 0: + message.granularity = 0; + break; + case "MILLIS": + case 1: + message.granularity = 1; + break; + } + if (object.restoreInfo != null) { + if (typeof object.restoreInfo !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.restoreInfo: object expected"); + message.restoreInfo = $root.google.bigtable.admin.v2.RestoreInfo.fromObject(object.restoreInfo); + } + if (object.changeStreamConfig != null) { + if (typeof object.changeStreamConfig !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.changeStreamConfig: object expected"); + message.changeStreamConfig = $root.google.bigtable.admin.v2.ChangeStreamConfig.fromObject(object.changeStreamConfig); + } + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + if (object.automatedBackupPolicy != null) { + if (typeof object.automatedBackupPolicy !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.automatedBackupPolicy: object expected"); + message.automatedBackupPolicy = $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); + } + if (object.rowKeySchema != null) { + if (typeof object.rowKeySchema !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.rowKeySchema: object expected"); + message.rowKeySchema = $root.google.bigtable.admin.v2.Type.Struct.fromObject(object.rowKeySchema); + } + return message; + }; + + /** + * Creates a plain object from a Table message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {google.bigtable.admin.v2.Table} message Table + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Table.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.clusterStates = {}; + object.columnFamilies = {}; + } + if (options.defaults) { + object.name = ""; + object.granularity = options.enums === String ? "TIMESTAMP_GRANULARITY_UNSPECIFIED" : 0; + object.restoreInfo = null; + object.changeStreamConfig = null; + object.deletionProtection = false; + object.rowKeySchema = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.clusterStates && (keys2 = Object.keys(message.clusterStates)).length) { + object.clusterStates = {}; + for (var j = 0; j < keys2.length; ++j) + object.clusterStates[keys2[j]] = $root.google.bigtable.admin.v2.Table.ClusterState.toObject(message.clusterStates[keys2[j]], options); + } + if (message.columnFamilies && (keys2 = Object.keys(message.columnFamilies)).length) { + object.columnFamilies = {}; + for (var j = 0; j < keys2.length; ++j) + object.columnFamilies[keys2[j]] = $root.google.bigtable.admin.v2.ColumnFamily.toObject(message.columnFamilies[keys2[j]], options); + } + if (message.granularity != null && message.hasOwnProperty("granularity")) + object.granularity = options.enums === String ? $root.google.bigtable.admin.v2.Table.TimestampGranularity[message.granularity] === undefined ? message.granularity : $root.google.bigtable.admin.v2.Table.TimestampGranularity[message.granularity] : message.granularity; + if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) + object.restoreInfo = $root.google.bigtable.admin.v2.RestoreInfo.toObject(message.restoreInfo, options); + if (message.changeStreamConfig != null && message.hasOwnProperty("changeStreamConfig")) + object.changeStreamConfig = $root.google.bigtable.admin.v2.ChangeStreamConfig.toObject(message.changeStreamConfig, options); + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + object.deletionProtection = message.deletionProtection; + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { + object.automatedBackupPolicy = $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); + if (options.oneofs) + object.automatedBackupConfig = "automatedBackupPolicy"; + } + if (message.rowKeySchema != null && message.hasOwnProperty("rowKeySchema")) + object.rowKeySchema = $root.google.bigtable.admin.v2.Type.Struct.toObject(message.rowKeySchema, options); + return object; + }; + + /** + * Converts this Table to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Table + * @instance + * @returns {Object.} JSON object + */ + Table.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Table + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Table + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Table.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Table"; + }; + + Table.ClusterState = (function() { + + /** + * Properties of a ClusterState. + * @memberof google.bigtable.admin.v2.Table + * @interface IClusterState + * @property {google.bigtable.admin.v2.Table.ClusterState.ReplicationState|null} [replicationState] ClusterState replicationState + * @property {Array.|null} [encryptionInfo] ClusterState encryptionInfo + */ + + /** + * Constructs a new ClusterState. + * @memberof google.bigtable.admin.v2.Table + * @classdesc Represents a ClusterState. + * @implements IClusterState + * @constructor + * @param {google.bigtable.admin.v2.Table.IClusterState=} [properties] Properties to set + */ + function ClusterState(properties) { + this.encryptionInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterState replicationState. + * @member {google.bigtable.admin.v2.Table.ClusterState.ReplicationState} replicationState + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @instance + */ + ClusterState.prototype.replicationState = 0; + + /** + * ClusterState encryptionInfo. + * @member {Array.} encryptionInfo + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @instance + */ + ClusterState.prototype.encryptionInfo = $util.emptyArray; + + /** + * Creates a new ClusterState instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {google.bigtable.admin.v2.Table.IClusterState=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Table.ClusterState} ClusterState instance + */ + ClusterState.create = function create(properties) { + return new ClusterState(properties); + }; + + /** + * Encodes the specified ClusterState message. Does not implicitly {@link google.bigtable.admin.v2.Table.ClusterState.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {google.bigtable.admin.v2.Table.IClusterState} message ClusterState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicationState != null && Object.hasOwnProperty.call(message, "replicationState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.replicationState); + if (message.encryptionInfo != null && message.encryptionInfo.length) + for (var i = 0; i < message.encryptionInfo.length; ++i) + $root.google.bigtable.admin.v2.EncryptionInfo.encode(message.encryptionInfo[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterState message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Table.ClusterState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {google.bigtable.admin.v2.Table.IClusterState} message ClusterState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterState message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Table.ClusterState} ClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterState.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Table.ClusterState(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.replicationState = reader.int32(); + break; + } + case 2: { + if (!(message.encryptionInfo && message.encryptionInfo.length)) + message.encryptionInfo = []; + message.encryptionInfo.push($root.google.bigtable.admin.v2.EncryptionInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Table.ClusterState} ClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterState message. + * @function verify + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replicationState != null && message.hasOwnProperty("replicationState")) + switch (message.replicationState) { + default: + return "replicationState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + if (!Array.isArray(message.encryptionInfo)) + return "encryptionInfo: array expected"; + for (var i = 0; i < message.encryptionInfo.length; ++i) { + var error = $root.google.bigtable.admin.v2.EncryptionInfo.verify(message.encryptionInfo[i]); + if (error) + return "encryptionInfo." + error; + } + } + return null; + }; + + /** + * Creates a ClusterState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Table.ClusterState} ClusterState + */ + ClusterState.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Table.ClusterState) + return object; + var message = new $root.google.bigtable.admin.v2.Table.ClusterState(); + switch (object.replicationState) { + default: + if (typeof object.replicationState === "number") { + message.replicationState = object.replicationState; + break; + } + break; + case "STATE_NOT_KNOWN": + case 0: + message.replicationState = 0; + break; + case "INITIALIZING": + case 1: + message.replicationState = 1; + break; + case "PLANNED_MAINTENANCE": + case 2: + message.replicationState = 2; + break; + case "UNPLANNED_MAINTENANCE": + case 3: + message.replicationState = 3; + break; + case "READY": + case 4: + message.replicationState = 4; + break; + case "READY_OPTIMIZING": + case 5: + message.replicationState = 5; + break; + } + if (object.encryptionInfo) { + if (!Array.isArray(object.encryptionInfo)) + throw TypeError(".google.bigtable.admin.v2.Table.ClusterState.encryptionInfo: array expected"); + message.encryptionInfo = []; + for (var i = 0; i < object.encryptionInfo.length; ++i) { + if (typeof object.encryptionInfo[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.ClusterState.encryptionInfo: object expected"); + message.encryptionInfo[i] = $root.google.bigtable.admin.v2.EncryptionInfo.fromObject(object.encryptionInfo[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClusterState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {google.bigtable.admin.v2.Table.ClusterState} message ClusterState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.encryptionInfo = []; + if (options.defaults) + object.replicationState = options.enums === String ? "STATE_NOT_KNOWN" : 0; + if (message.replicationState != null && message.hasOwnProperty("replicationState")) + object.replicationState = options.enums === String ? $root.google.bigtable.admin.v2.Table.ClusterState.ReplicationState[message.replicationState] === undefined ? message.replicationState : $root.google.bigtable.admin.v2.Table.ClusterState.ReplicationState[message.replicationState] : message.replicationState; + if (message.encryptionInfo && message.encryptionInfo.length) { + object.encryptionInfo = []; + for (var j = 0; j < message.encryptionInfo.length; ++j) + object.encryptionInfo[j] = $root.google.bigtable.admin.v2.EncryptionInfo.toObject(message.encryptionInfo[j], options); + } + return object; + }; + + /** + * Converts this ClusterState to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @instance + * @returns {Object.} JSON object + */ + ClusterState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterState + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Table.ClusterState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Table.ClusterState"; + }; + + /** + * ReplicationState enum. + * @name google.bigtable.admin.v2.Table.ClusterState.ReplicationState + * @enum {number} + * @property {number} STATE_NOT_KNOWN=0 STATE_NOT_KNOWN value + * @property {number} INITIALIZING=1 INITIALIZING value + * @property {number} PLANNED_MAINTENANCE=2 PLANNED_MAINTENANCE value + * @property {number} UNPLANNED_MAINTENANCE=3 UNPLANNED_MAINTENANCE value + * @property {number} READY=4 READY value + * @property {number} READY_OPTIMIZING=5 READY_OPTIMIZING value + */ + ClusterState.ReplicationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_NOT_KNOWN"] = 0; + values[valuesById[1] = "INITIALIZING"] = 1; + values[valuesById[2] = "PLANNED_MAINTENANCE"] = 2; + values[valuesById[3] = "UNPLANNED_MAINTENANCE"] = 3; + values[valuesById[4] = "READY"] = 4; + values[valuesById[5] = "READY_OPTIMIZING"] = 5; + return values; + })(); + + return ClusterState; + })(); + + /** + * TimestampGranularity enum. + * @name google.bigtable.admin.v2.Table.TimestampGranularity + * @enum {number} + * @property {number} TIMESTAMP_GRANULARITY_UNSPECIFIED=0 TIMESTAMP_GRANULARITY_UNSPECIFIED value + * @property {number} MILLIS=1 MILLIS value + */ + Table.TimestampGranularity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIMESTAMP_GRANULARITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "MILLIS"] = 1; + return values; + })(); + + /** + * View enum. + * @name google.bigtable.admin.v2.Table.View + * @enum {number} + * @property {number} VIEW_UNSPECIFIED=0 VIEW_UNSPECIFIED value + * @property {number} NAME_ONLY=1 NAME_ONLY value + * @property {number} SCHEMA_VIEW=2 SCHEMA_VIEW value + * @property {number} REPLICATION_VIEW=3 REPLICATION_VIEW value + * @property {number} ENCRYPTION_VIEW=5 ENCRYPTION_VIEW value + * @property {number} FULL=4 FULL value + */ + Table.View = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "NAME_ONLY"] = 1; + values[valuesById[2] = "SCHEMA_VIEW"] = 2; + values[valuesById[3] = "REPLICATION_VIEW"] = 3; + values[valuesById[5] = "ENCRYPTION_VIEW"] = 5; + values[valuesById[4] = "FULL"] = 4; + return values; + })(); + + Table.AutomatedBackupPolicy = (function() { + + /** + * Properties of an AutomatedBackupPolicy. + * @memberof google.bigtable.admin.v2.Table + * @interface IAutomatedBackupPolicy + * @property {google.protobuf.IDuration|null} [retentionPeriod] AutomatedBackupPolicy retentionPeriod + * @property {google.protobuf.IDuration|null} [frequency] AutomatedBackupPolicy frequency + */ + + /** + * Constructs a new AutomatedBackupPolicy. + * @memberof google.bigtable.admin.v2.Table + * @classdesc Represents an AutomatedBackupPolicy. + * @implements IAutomatedBackupPolicy + * @constructor + * @param {google.bigtable.admin.v2.Table.IAutomatedBackupPolicy=} [properties] Properties to set + */ + function AutomatedBackupPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutomatedBackupPolicy retentionPeriod. + * @member {google.protobuf.IDuration|null|undefined} retentionPeriod + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.retentionPeriod = null; + + /** + * AutomatedBackupPolicy frequency. + * @member {google.protobuf.IDuration|null|undefined} frequency + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.frequency = null; + + /** + * Creates a new AutomatedBackupPolicy instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {google.bigtable.admin.v2.Table.IAutomatedBackupPolicy=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Table.AutomatedBackupPolicy} AutomatedBackupPolicy instance + */ + AutomatedBackupPolicy.create = function create(properties) { + return new AutomatedBackupPolicy(properties); + }; + + /** + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.bigtable.admin.v2.Table.AutomatedBackupPolicy.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {google.bigtable.admin.v2.Table.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) + $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.frequency != null && Object.hasOwnProperty.call(message, "frequency")) + $root.google.protobuf.Duration.encode(message.frequency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Table.AutomatedBackupPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {google.bigtable.admin.v2.Table.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Table.AutomatedBackupPolicy} AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedBackupPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.frequency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Table.AutomatedBackupPolicy} AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutomatedBackupPolicy message. + * @function verify + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomatedBackupPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); + if (error) + return "retentionPeriod." + error; + } + if (message.frequency != null && message.hasOwnProperty("frequency")) { + var error = $root.google.protobuf.Duration.verify(message.frequency); + if (error) + return "frequency." + error; + } + return null; + }; + + /** + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Table.AutomatedBackupPolicy} AutomatedBackupPolicy + */ + AutomatedBackupPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) + return object; + var message = new $root.google.bigtable.admin.v2.Table.AutomatedBackupPolicy(); + if (object.retentionPeriod != null) { + if (typeof object.retentionPeriod !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.AutomatedBackupPolicy.retentionPeriod: object expected"); + message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); + } + if (object.frequency != null) { + if (typeof object.frequency !== "object") + throw TypeError(".google.bigtable.admin.v2.Table.AutomatedBackupPolicy.frequency: object expected"); + message.frequency = $root.google.protobuf.Duration.fromObject(object.frequency); + } + return message; + }; + + /** + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {google.bigtable.admin.v2.Table.AutomatedBackupPolicy} message AutomatedBackupPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomatedBackupPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.retentionPeriod = null; + object.frequency = null; + } + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) + object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); + if (message.frequency != null && message.hasOwnProperty("frequency")) + object.frequency = $root.google.protobuf.Duration.toObject(message.frequency, options); + return object; + }; + + /** + * Converts this AutomatedBackupPolicy to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @instance + * @returns {Object.} JSON object + */ + AutomatedBackupPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutomatedBackupPolicy + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Table.AutomatedBackupPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Table.AutomatedBackupPolicy"; + }; + + return AutomatedBackupPolicy; + })(); + + return Table; + })(); + + v2.AuthorizedView = (function() { + + /** + * Properties of an AuthorizedView. + * @memberof google.bigtable.admin.v2 + * @interface IAuthorizedView + * @property {string|null} [name] AuthorizedView name + * @property {google.bigtable.admin.v2.AuthorizedView.ISubsetView|null} [subsetView] AuthorizedView subsetView + * @property {string|null} [etag] AuthorizedView etag + * @property {boolean|null} [deletionProtection] AuthorizedView deletionProtection + */ + + /** + * Constructs a new AuthorizedView. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an AuthorizedView. + * @implements IAuthorizedView + * @constructor + * @param {google.bigtable.admin.v2.IAuthorizedView=} [properties] Properties to set + */ + function AuthorizedView(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthorizedView name. + * @member {string} name + * @memberof google.bigtable.admin.v2.AuthorizedView + * @instance + */ + AuthorizedView.prototype.name = ""; + + /** + * AuthorizedView subsetView. + * @member {google.bigtable.admin.v2.AuthorizedView.ISubsetView|null|undefined} subsetView + * @memberof google.bigtable.admin.v2.AuthorizedView + * @instance + */ + AuthorizedView.prototype.subsetView = null; + + /** + * AuthorizedView etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.AuthorizedView + * @instance + */ + AuthorizedView.prototype.etag = ""; + + /** + * AuthorizedView deletionProtection. + * @member {boolean} deletionProtection + * @memberof google.bigtable.admin.v2.AuthorizedView + * @instance + */ + AuthorizedView.prototype.deletionProtection = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AuthorizedView authorizedView. + * @member {"subsetView"|undefined} authorizedView + * @memberof google.bigtable.admin.v2.AuthorizedView + * @instance + */ + Object.defineProperty(AuthorizedView.prototype, "authorizedView", { + get: $util.oneOfGetter($oneOfFields = ["subsetView"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AuthorizedView instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {google.bigtable.admin.v2.IAuthorizedView=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AuthorizedView} AuthorizedView instance + */ + AuthorizedView.create = function create(properties) { + return new AuthorizedView(properties); + }; + + /** + * Encodes the specified AuthorizedView message. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {google.bigtable.admin.v2.IAuthorizedView} message AuthorizedView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedView.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.subsetView != null && Object.hasOwnProperty.call(message, "subsetView")) + $root.google.bigtable.admin.v2.AuthorizedView.SubsetView.encode(message.subsetView, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.deletionProtection); + return writer; + }; + + /** + * Encodes the specified AuthorizedView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {google.bigtable.admin.v2.IAuthorizedView} message AuthorizedView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizedView message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AuthorizedView} AuthorizedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedView.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AuthorizedView(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.subsetView = $root.google.bigtable.admin.v2.AuthorizedView.SubsetView.decode(reader, reader.uint32()); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.deletionProtection = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizedView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AuthorizedView} AuthorizedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizedView message. + * @function verify + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizedView.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.subsetView != null && message.hasOwnProperty("subsetView")) { + properties.authorizedView = 1; + { + var error = $root.google.bigtable.admin.v2.AuthorizedView.SubsetView.verify(message.subsetView); + if (error) + return "subsetView." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + return null; + }; + + /** + * Creates an AuthorizedView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AuthorizedView} AuthorizedView + */ + AuthorizedView.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AuthorizedView) + return object; + var message = new $root.google.bigtable.admin.v2.AuthorizedView(); + if (object.name != null) + message.name = String(object.name); + if (object.subsetView != null) { + if (typeof object.subsetView !== "object") + throw TypeError(".google.bigtable.admin.v2.AuthorizedView.subsetView: object expected"); + message.subsetView = $root.google.bigtable.admin.v2.AuthorizedView.SubsetView.fromObject(object.subsetView); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + return message; + }; + + /** + * Creates a plain object from an AuthorizedView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {google.bigtable.admin.v2.AuthorizedView} message AuthorizedView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizedView.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + object.deletionProtection = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.subsetView != null && message.hasOwnProperty("subsetView")) { + object.subsetView = $root.google.bigtable.admin.v2.AuthorizedView.SubsetView.toObject(message.subsetView, options); + if (options.oneofs) + object.authorizedView = "subsetView"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) + object.deletionProtection = message.deletionProtection; + return object; + }; + + /** + * Converts this AuthorizedView to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AuthorizedView + * @instance + * @returns {Object.} JSON object + */ + AuthorizedView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizedView + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AuthorizedView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizedView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AuthorizedView"; + }; + + AuthorizedView.FamilySubsets = (function() { + + /** + * Properties of a FamilySubsets. + * @memberof google.bigtable.admin.v2.AuthorizedView + * @interface IFamilySubsets + * @property {Array.|null} [qualifiers] FamilySubsets qualifiers + * @property {Array.|null} [qualifierPrefixes] FamilySubsets qualifierPrefixes + */ + + /** + * Constructs a new FamilySubsets. + * @memberof google.bigtable.admin.v2.AuthorizedView + * @classdesc Represents a FamilySubsets. + * @implements IFamilySubsets + * @constructor + * @param {google.bigtable.admin.v2.AuthorizedView.IFamilySubsets=} [properties] Properties to set + */ + function FamilySubsets(properties) { + this.qualifiers = []; + this.qualifierPrefixes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FamilySubsets qualifiers. + * @member {Array.} qualifiers + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @instance + */ + FamilySubsets.prototype.qualifiers = $util.emptyArray; + + /** + * FamilySubsets qualifierPrefixes. + * @member {Array.} qualifierPrefixes + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @instance + */ + FamilySubsets.prototype.qualifierPrefixes = $util.emptyArray; + + /** + * Creates a new FamilySubsets instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.IFamilySubsets=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AuthorizedView.FamilySubsets} FamilySubsets instance + */ + FamilySubsets.create = function create(properties) { + return new FamilySubsets(properties); + }; + + /** + * Encodes the specified FamilySubsets message. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.FamilySubsets.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.IFamilySubsets} message FamilySubsets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FamilySubsets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.qualifiers != null && message.qualifiers.length) + for (var i = 0; i < message.qualifiers.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.qualifiers[i]); + if (message.qualifierPrefixes != null && message.qualifierPrefixes.length) + for (var i = 0; i < message.qualifierPrefixes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.qualifierPrefixes[i]); + return writer; + }; + + /** + * Encodes the specified FamilySubsets message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.FamilySubsets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.IFamilySubsets} message FamilySubsets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FamilySubsets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FamilySubsets message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AuthorizedView.FamilySubsets} FamilySubsets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FamilySubsets.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.qualifiers && message.qualifiers.length)) + message.qualifiers = []; + message.qualifiers.push(reader.bytes()); + break; + } + case 2: { + if (!(message.qualifierPrefixes && message.qualifierPrefixes.length)) + message.qualifierPrefixes = []; + message.qualifierPrefixes.push(reader.bytes()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FamilySubsets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AuthorizedView.FamilySubsets} FamilySubsets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FamilySubsets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FamilySubsets message. + * @function verify + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FamilySubsets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.qualifiers != null && message.hasOwnProperty("qualifiers")) { + if (!Array.isArray(message.qualifiers)) + return "qualifiers: array expected"; + for (var i = 0; i < message.qualifiers.length; ++i) + if (!(message.qualifiers[i] && typeof message.qualifiers[i].length === "number" || $util.isString(message.qualifiers[i]))) + return "qualifiers: buffer[] expected"; + } + if (message.qualifierPrefixes != null && message.hasOwnProperty("qualifierPrefixes")) { + if (!Array.isArray(message.qualifierPrefixes)) + return "qualifierPrefixes: array expected"; + for (var i = 0; i < message.qualifierPrefixes.length; ++i) + if (!(message.qualifierPrefixes[i] && typeof message.qualifierPrefixes[i].length === "number" || $util.isString(message.qualifierPrefixes[i]))) + return "qualifierPrefixes: buffer[] expected"; + } + return null; + }; + + /** + * Creates a FamilySubsets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AuthorizedView.FamilySubsets} FamilySubsets + */ + FamilySubsets.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets) + return object; + var message = new $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets(); + if (object.qualifiers) { + if (!Array.isArray(object.qualifiers)) + throw TypeError(".google.bigtable.admin.v2.AuthorizedView.FamilySubsets.qualifiers: array expected"); + message.qualifiers = []; + for (var i = 0; i < object.qualifiers.length; ++i) + if (typeof object.qualifiers[i] === "string") + $util.base64.decode(object.qualifiers[i], message.qualifiers[i] = $util.newBuffer($util.base64.length(object.qualifiers[i])), 0); + else if (object.qualifiers[i].length >= 0) + message.qualifiers[i] = object.qualifiers[i]; + } + if (object.qualifierPrefixes) { + if (!Array.isArray(object.qualifierPrefixes)) + throw TypeError(".google.bigtable.admin.v2.AuthorizedView.FamilySubsets.qualifierPrefixes: array expected"); + message.qualifierPrefixes = []; + for (var i = 0; i < object.qualifierPrefixes.length; ++i) + if (typeof object.qualifierPrefixes[i] === "string") + $util.base64.decode(object.qualifierPrefixes[i], message.qualifierPrefixes[i] = $util.newBuffer($util.base64.length(object.qualifierPrefixes[i])), 0); + else if (object.qualifierPrefixes[i].length >= 0) + message.qualifierPrefixes[i] = object.qualifierPrefixes[i]; + } + return message; + }; + + /** + * Creates a plain object from a FamilySubsets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.FamilySubsets} message FamilySubsets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FamilySubsets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.qualifiers = []; + object.qualifierPrefixes = []; + } + if (message.qualifiers && message.qualifiers.length) { + object.qualifiers = []; + for (var j = 0; j < message.qualifiers.length; ++j) + object.qualifiers[j] = options.bytes === String ? $util.base64.encode(message.qualifiers[j], 0, message.qualifiers[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.qualifiers[j]) : message.qualifiers[j]; + } + if (message.qualifierPrefixes && message.qualifierPrefixes.length) { + object.qualifierPrefixes = []; + for (var j = 0; j < message.qualifierPrefixes.length; ++j) + object.qualifierPrefixes[j] = options.bytes === String ? $util.base64.encode(message.qualifierPrefixes[j], 0, message.qualifierPrefixes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.qualifierPrefixes[j]) : message.qualifierPrefixes[j]; + } + return object; + }; + + /** + * Converts this FamilySubsets to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @instance + * @returns {Object.} JSON object + */ + FamilySubsets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FamilySubsets + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AuthorizedView.FamilySubsets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FamilySubsets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AuthorizedView.FamilySubsets"; + }; + + return FamilySubsets; + })(); + + AuthorizedView.SubsetView = (function() { + + /** + * Properties of a SubsetView. + * @memberof google.bigtable.admin.v2.AuthorizedView + * @interface ISubsetView + * @property {Array.|null} [rowPrefixes] SubsetView rowPrefixes + * @property {Object.|null} [familySubsets] SubsetView familySubsets + */ + + /** + * Constructs a new SubsetView. + * @memberof google.bigtable.admin.v2.AuthorizedView + * @classdesc Represents a SubsetView. + * @implements ISubsetView + * @constructor + * @param {google.bigtable.admin.v2.AuthorizedView.ISubsetView=} [properties] Properties to set + */ + function SubsetView(properties) { + this.rowPrefixes = []; + this.familySubsets = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubsetView rowPrefixes. + * @member {Array.} rowPrefixes + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @instance + */ + SubsetView.prototype.rowPrefixes = $util.emptyArray; + + /** + * SubsetView familySubsets. + * @member {Object.} familySubsets + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @instance + */ + SubsetView.prototype.familySubsets = $util.emptyObject; + + /** + * Creates a new SubsetView instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.ISubsetView=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AuthorizedView.SubsetView} SubsetView instance + */ + SubsetView.create = function create(properties) { + return new SubsetView(properties); + }; + + /** + * Encodes the specified SubsetView message. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.SubsetView.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.ISubsetView} message SubsetView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubsetView.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowPrefixes != null && message.rowPrefixes.length) + for (var i = 0; i < message.rowPrefixes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rowPrefixes[i]); + if (message.familySubsets != null && Object.hasOwnProperty.call(message, "familySubsets")) + for (var keys = Object.keys(message.familySubsets), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.encode(message.familySubsets[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SubsetView message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AuthorizedView.SubsetView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.ISubsetView} message SubsetView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubsetView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubsetView message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AuthorizedView.SubsetView} SubsetView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubsetView.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AuthorizedView.SubsetView(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rowPrefixes && message.rowPrefixes.length)) + message.rowPrefixes = []; + message.rowPrefixes.push(reader.bytes()); + break; + } + case 2: { + if (message.familySubsets === $util.emptyObject) + message.familySubsets = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.familySubsets[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubsetView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AuthorizedView.SubsetView} SubsetView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubsetView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubsetView message. + * @function verify + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubsetView.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowPrefixes != null && message.hasOwnProperty("rowPrefixes")) { + if (!Array.isArray(message.rowPrefixes)) + return "rowPrefixes: array expected"; + for (var i = 0; i < message.rowPrefixes.length; ++i) + if (!(message.rowPrefixes[i] && typeof message.rowPrefixes[i].length === "number" || $util.isString(message.rowPrefixes[i]))) + return "rowPrefixes: buffer[] expected"; + } + if (message.familySubsets != null && message.hasOwnProperty("familySubsets")) { + if (!$util.isObject(message.familySubsets)) + return "familySubsets: object expected"; + var key = Object.keys(message.familySubsets); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.verify(message.familySubsets[key[i]]); + if (error) + return "familySubsets." + error; + } + } + return null; + }; + + /** + * Creates a SubsetView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AuthorizedView.SubsetView} SubsetView + */ + SubsetView.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AuthorizedView.SubsetView) + return object; + var message = new $root.google.bigtable.admin.v2.AuthorizedView.SubsetView(); + if (object.rowPrefixes) { + if (!Array.isArray(object.rowPrefixes)) + throw TypeError(".google.bigtable.admin.v2.AuthorizedView.SubsetView.rowPrefixes: array expected"); + message.rowPrefixes = []; + for (var i = 0; i < object.rowPrefixes.length; ++i) + if (typeof object.rowPrefixes[i] === "string") + $util.base64.decode(object.rowPrefixes[i], message.rowPrefixes[i] = $util.newBuffer($util.base64.length(object.rowPrefixes[i])), 0); + else if (object.rowPrefixes[i].length >= 0) + message.rowPrefixes[i] = object.rowPrefixes[i]; + } + if (object.familySubsets) { + if (typeof object.familySubsets !== "object") + throw TypeError(".google.bigtable.admin.v2.AuthorizedView.SubsetView.familySubsets: object expected"); + message.familySubsets = {}; + for (var keys = Object.keys(object.familySubsets), i = 0; i < keys.length; ++i) { + if (typeof object.familySubsets[keys[i]] !== "object") + throw TypeError(".google.bigtable.admin.v2.AuthorizedView.SubsetView.familySubsets: object expected"); + message.familySubsets[keys[i]] = $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.fromObject(object.familySubsets[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a SubsetView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {google.bigtable.admin.v2.AuthorizedView.SubsetView} message SubsetView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubsetView.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rowPrefixes = []; + if (options.objects || options.defaults) + object.familySubsets = {}; + if (message.rowPrefixes && message.rowPrefixes.length) { + object.rowPrefixes = []; + for (var j = 0; j < message.rowPrefixes.length; ++j) + object.rowPrefixes[j] = options.bytes === String ? $util.base64.encode(message.rowPrefixes[j], 0, message.rowPrefixes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.rowPrefixes[j]) : message.rowPrefixes[j]; + } + var keys2; + if (message.familySubsets && (keys2 = Object.keys(message.familySubsets)).length) { + object.familySubsets = {}; + for (var j = 0; j < keys2.length; ++j) + object.familySubsets[keys2[j]] = $root.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.toObject(message.familySubsets[keys2[j]], options); + } + return object; + }; + + /** + * Converts this SubsetView to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @instance + * @returns {Object.} JSON object + */ + SubsetView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubsetView + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AuthorizedView.SubsetView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubsetView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AuthorizedView.SubsetView"; + }; + + return SubsetView; + })(); + + /** + * ResponseView enum. + * @name google.bigtable.admin.v2.AuthorizedView.ResponseView + * @enum {number} + * @property {number} RESPONSE_VIEW_UNSPECIFIED=0 RESPONSE_VIEW_UNSPECIFIED value + * @property {number} NAME_ONLY=1 NAME_ONLY value + * @property {number} BASIC=2 BASIC value + * @property {number} FULL=3 FULL value + */ + AuthorizedView.ResponseView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESPONSE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "NAME_ONLY"] = 1; + values[valuesById[2] = "BASIC"] = 2; + values[valuesById[3] = "FULL"] = 3; + return values; + })(); + + return AuthorizedView; + })(); + + v2.ColumnFamily = (function() { + + /** + * Properties of a ColumnFamily. + * @memberof google.bigtable.admin.v2 + * @interface IColumnFamily + * @property {google.bigtable.admin.v2.IGcRule|null} [gcRule] ColumnFamily gcRule + * @property {google.bigtable.admin.v2.IType|null} [valueType] ColumnFamily valueType + */ + + /** + * Constructs a new ColumnFamily. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ColumnFamily. + * @implements IColumnFamily + * @constructor + * @param {google.bigtable.admin.v2.IColumnFamily=} [properties] Properties to set + */ + function ColumnFamily(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnFamily gcRule. + * @member {google.bigtable.admin.v2.IGcRule|null|undefined} gcRule + * @memberof google.bigtable.admin.v2.ColumnFamily + * @instance + */ + ColumnFamily.prototype.gcRule = null; + + /** + * ColumnFamily valueType. + * @member {google.bigtable.admin.v2.IType|null|undefined} valueType + * @memberof google.bigtable.admin.v2.ColumnFamily + * @instance + */ + ColumnFamily.prototype.valueType = null; + + /** + * Creates a new ColumnFamily instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {google.bigtable.admin.v2.IColumnFamily=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ColumnFamily} ColumnFamily instance + */ + ColumnFamily.create = function create(properties) { + return new ColumnFamily(properties); + }; + + /** + * Encodes the specified ColumnFamily message. Does not implicitly {@link google.bigtable.admin.v2.ColumnFamily.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {google.bigtable.admin.v2.IColumnFamily} message ColumnFamily message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnFamily.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcRule != null && Object.hasOwnProperty.call(message, "gcRule")) + $root.google.bigtable.admin.v2.GcRule.encode(message.gcRule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + $root.google.bigtable.admin.v2.Type.encode(message.valueType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ColumnFamily message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ColumnFamily.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {google.bigtable.admin.v2.IColumnFamily} message ColumnFamily message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnFamily.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnFamily message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ColumnFamily} ColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnFamily.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ColumnFamily(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcRule = $root.google.bigtable.admin.v2.GcRule.decode(reader, reader.uint32()); + break; + } + case 3: { + message.valueType = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnFamily message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ColumnFamily} ColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnFamily.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnFamily message. + * @function verify + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnFamily.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcRule != null && message.hasOwnProperty("gcRule")) { + var error = $root.google.bigtable.admin.v2.GcRule.verify(message.gcRule); + if (error) + return "gcRule." + error; + } + if (message.valueType != null && message.hasOwnProperty("valueType")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.valueType); + if (error) + return "valueType." + error; + } + return null; + }; + + /** + * Creates a ColumnFamily message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ColumnFamily} ColumnFamily + */ + ColumnFamily.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ColumnFamily) + return object; + var message = new $root.google.bigtable.admin.v2.ColumnFamily(); + if (object.gcRule != null) { + if (typeof object.gcRule !== "object") + throw TypeError(".google.bigtable.admin.v2.ColumnFamily.gcRule: object expected"); + message.gcRule = $root.google.bigtable.admin.v2.GcRule.fromObject(object.gcRule); + } + if (object.valueType != null) { + if (typeof object.valueType !== "object") + throw TypeError(".google.bigtable.admin.v2.ColumnFamily.valueType: object expected"); + message.valueType = $root.google.bigtable.admin.v2.Type.fromObject(object.valueType); + } + return message; + }; + + /** + * Creates a plain object from a ColumnFamily message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {google.bigtable.admin.v2.ColumnFamily} message ColumnFamily + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnFamily.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcRule = null; + object.valueType = null; + } + if (message.gcRule != null && message.hasOwnProperty("gcRule")) + object.gcRule = $root.google.bigtable.admin.v2.GcRule.toObject(message.gcRule, options); + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = $root.google.bigtable.admin.v2.Type.toObject(message.valueType, options); + return object; + }; + + /** + * Converts this ColumnFamily to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ColumnFamily + * @instance + * @returns {Object.} JSON object + */ + ColumnFamily.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnFamily + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ColumnFamily + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnFamily.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ColumnFamily"; + }; + + return ColumnFamily; + })(); + + v2.GcRule = (function() { + + /** + * Properties of a GcRule. + * @memberof google.bigtable.admin.v2 + * @interface IGcRule + * @property {number|null} [maxNumVersions] GcRule maxNumVersions + * @property {google.protobuf.IDuration|null} [maxAge] GcRule maxAge + * @property {google.bigtable.admin.v2.GcRule.IIntersection|null} [intersection] GcRule intersection + * @property {google.bigtable.admin.v2.GcRule.IUnion|null} [union] GcRule union + */ + + /** + * Constructs a new GcRule. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a GcRule. + * @implements IGcRule + * @constructor + * @param {google.bigtable.admin.v2.IGcRule=} [properties] Properties to set + */ + function GcRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcRule maxNumVersions. + * @member {number|null|undefined} maxNumVersions + * @memberof google.bigtable.admin.v2.GcRule + * @instance + */ + GcRule.prototype.maxNumVersions = null; + + /** + * GcRule maxAge. + * @member {google.protobuf.IDuration|null|undefined} maxAge + * @memberof google.bigtable.admin.v2.GcRule + * @instance + */ + GcRule.prototype.maxAge = null; + + /** + * GcRule intersection. + * @member {google.bigtable.admin.v2.GcRule.IIntersection|null|undefined} intersection + * @memberof google.bigtable.admin.v2.GcRule + * @instance + */ + GcRule.prototype.intersection = null; + + /** + * GcRule union. + * @member {google.bigtable.admin.v2.GcRule.IUnion|null|undefined} union + * @memberof google.bigtable.admin.v2.GcRule + * @instance + */ + GcRule.prototype.union = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GcRule rule. + * @member {"maxNumVersions"|"maxAge"|"intersection"|"union"|undefined} rule + * @memberof google.bigtable.admin.v2.GcRule + * @instance + */ + Object.defineProperty(GcRule.prototype, "rule", { + get: $util.oneOfGetter($oneOfFields = ["maxNumVersions", "maxAge", "intersection", "union"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GcRule instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {google.bigtable.admin.v2.IGcRule=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GcRule} GcRule instance + */ + GcRule.create = function create(properties) { + return new GcRule(properties); + }; + + /** + * Encodes the specified GcRule message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {google.bigtable.admin.v2.IGcRule} message GcRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxNumVersions != null && Object.hasOwnProperty.call(message, "maxNumVersions")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxNumVersions); + if (message.maxAge != null && Object.hasOwnProperty.call(message, "maxAge")) + $root.google.protobuf.Duration.encode(message.maxAge, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.intersection != null && Object.hasOwnProperty.call(message, "intersection")) + $root.google.bigtable.admin.v2.GcRule.Intersection.encode(message.intersection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.union != null && Object.hasOwnProperty.call(message, "union")) + $root.google.bigtable.admin.v2.GcRule.Union.encode(message.union, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GcRule message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {google.bigtable.admin.v2.IGcRule} message GcRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcRule message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GcRule} GcRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GcRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.maxNumVersions = reader.int32(); + break; + } + case 2: { + message.maxAge = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.intersection = $root.google.bigtable.admin.v2.GcRule.Intersection.decode(reader, reader.uint32()); + break; + } + case 4: { + message.union = $root.google.bigtable.admin.v2.GcRule.Union.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GcRule} GcRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcRule message. + * @function verify + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.maxNumVersions != null && message.hasOwnProperty("maxNumVersions")) { + properties.rule = 1; + if (!$util.isInteger(message.maxNumVersions)) + return "maxNumVersions: integer expected"; + } + if (message.maxAge != null && message.hasOwnProperty("maxAge")) { + if (properties.rule === 1) + return "rule: multiple values"; + properties.rule = 1; + { + var error = $root.google.protobuf.Duration.verify(message.maxAge); + if (error) + return "maxAge." + error; + } + } + if (message.intersection != null && message.hasOwnProperty("intersection")) { + if (properties.rule === 1) + return "rule: multiple values"; + properties.rule = 1; + { + var error = $root.google.bigtable.admin.v2.GcRule.Intersection.verify(message.intersection); + if (error) + return "intersection." + error; + } + } + if (message.union != null && message.hasOwnProperty("union")) { + if (properties.rule === 1) + return "rule: multiple values"; + properties.rule = 1; + { + var error = $root.google.bigtable.admin.v2.GcRule.Union.verify(message.union); + if (error) + return "union." + error; + } + } + return null; + }; + + /** + * Creates a GcRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GcRule} GcRule + */ + GcRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GcRule) + return object; + var message = new $root.google.bigtable.admin.v2.GcRule(); + if (object.maxNumVersions != null) + message.maxNumVersions = object.maxNumVersions | 0; + if (object.maxAge != null) { + if (typeof object.maxAge !== "object") + throw TypeError(".google.bigtable.admin.v2.GcRule.maxAge: object expected"); + message.maxAge = $root.google.protobuf.Duration.fromObject(object.maxAge); + } + if (object.intersection != null) { + if (typeof object.intersection !== "object") + throw TypeError(".google.bigtable.admin.v2.GcRule.intersection: object expected"); + message.intersection = $root.google.bigtable.admin.v2.GcRule.Intersection.fromObject(object.intersection); + } + if (object.union != null) { + if (typeof object.union !== "object") + throw TypeError(".google.bigtable.admin.v2.GcRule.union: object expected"); + message.union = $root.google.bigtable.admin.v2.GcRule.Union.fromObject(object.union); + } + return message; + }; + + /** + * Creates a plain object from a GcRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {google.bigtable.admin.v2.GcRule} message GcRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.maxNumVersions != null && message.hasOwnProperty("maxNumVersions")) { + object.maxNumVersions = message.maxNumVersions; + if (options.oneofs) + object.rule = "maxNumVersions"; + } + if (message.maxAge != null && message.hasOwnProperty("maxAge")) { + object.maxAge = $root.google.protobuf.Duration.toObject(message.maxAge, options); + if (options.oneofs) + object.rule = "maxAge"; + } + if (message.intersection != null && message.hasOwnProperty("intersection")) { + object.intersection = $root.google.bigtable.admin.v2.GcRule.Intersection.toObject(message.intersection, options); + if (options.oneofs) + object.rule = "intersection"; + } + if (message.union != null && message.hasOwnProperty("union")) { + object.union = $root.google.bigtable.admin.v2.GcRule.Union.toObject(message.union, options); + if (options.oneofs) + object.rule = "union"; + } + return object; + }; + + /** + * Converts this GcRule to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GcRule + * @instance + * @returns {Object.} JSON object + */ + GcRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcRule + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GcRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GcRule"; + }; + + GcRule.Intersection = (function() { + + /** + * Properties of an Intersection. + * @memberof google.bigtable.admin.v2.GcRule + * @interface IIntersection + * @property {Array.|null} [rules] Intersection rules + */ + + /** + * Constructs a new Intersection. + * @memberof google.bigtable.admin.v2.GcRule + * @classdesc Represents an Intersection. + * @implements IIntersection + * @constructor + * @param {google.bigtable.admin.v2.GcRule.IIntersection=} [properties] Properties to set + */ + function Intersection(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]]; + } + + /** + * Intersection rules. + * @member {Array.} rules + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @instance + */ + Intersection.prototype.rules = $util.emptyArray; + + /** + * Creates a new Intersection instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {google.bigtable.admin.v2.GcRule.IIntersection=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GcRule.Intersection} Intersection instance + */ + Intersection.create = function create(properties) { + return new Intersection(properties); + }; + + /** + * Encodes the specified Intersection message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Intersection.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {google.bigtable.admin.v2.GcRule.IIntersection} message Intersection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intersection.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.bigtable.admin.v2.GcRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Intersection message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Intersection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {google.bigtable.admin.v2.GcRule.IIntersection} message Intersection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intersection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Intersection message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GcRule.Intersection} Intersection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intersection.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GcRule.Intersection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.bigtable.admin.v2.GcRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Intersection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GcRule.Intersection} Intersection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intersection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Intersection message. + * @function verify + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Intersection.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.bigtable.admin.v2.GcRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates an Intersection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GcRule.Intersection} Intersection + */ + Intersection.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GcRule.Intersection) + return object; + var message = new $root.google.bigtable.admin.v2.GcRule.Intersection(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.bigtable.admin.v2.GcRule.Intersection.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.GcRule.Intersection.rules: object expected"); + message.rules[i] = $root.google.bigtable.admin.v2.GcRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Intersection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {google.bigtable.admin.v2.GcRule.Intersection} message Intersection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Intersection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.bigtable.admin.v2.GcRule.toObject(message.rules[j], options); + } + return object; + }; + + /** + * Converts this Intersection to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @instance + * @returns {Object.} JSON object + */ + Intersection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Intersection + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Intersection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GcRule.Intersection"; + }; + + return Intersection; + })(); + + GcRule.Union = (function() { + + /** + * Properties of an Union. + * @memberof google.bigtable.admin.v2.GcRule + * @interface IUnion + * @property {Array.|null} [rules] Union rules + */ + + /** + * Constructs a new Union. + * @memberof google.bigtable.admin.v2.GcRule + * @classdesc Represents an Union. + * @implements IUnion + * @constructor + * @param {google.bigtable.admin.v2.GcRule.IUnion=} [properties] Properties to set + */ + function Union(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]]; + } + + /** + * Union rules. + * @member {Array.} rules + * @memberof google.bigtable.admin.v2.GcRule.Union + * @instance + */ + Union.prototype.rules = $util.emptyArray; + + /** + * Creates a new Union instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {google.bigtable.admin.v2.GcRule.IUnion=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GcRule.Union} Union instance + */ + Union.create = function create(properties) { + return new Union(properties); + }; + + /** + * Encodes the specified Union message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Union.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {google.bigtable.admin.v2.GcRule.IUnion} message Union message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Union.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.bigtable.admin.v2.GcRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Union message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.Union.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {google.bigtable.admin.v2.GcRule.IUnion} message Union message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Union.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Union message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.GcRule.Union} Union + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Union.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.GcRule.Union(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.bigtable.admin.v2.GcRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Union message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.GcRule.Union} Union + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Union.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Union message. + * @function verify + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Union.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.bigtable.admin.v2.GcRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates an Union message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.GcRule.Union} Union + */ + Union.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GcRule.Union) + return object; + var message = new $root.google.bigtable.admin.v2.GcRule.Union(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.bigtable.admin.v2.GcRule.Union.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.GcRule.Union.rules: object expected"); + message.rules[i] = $root.google.bigtable.admin.v2.GcRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Union message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {google.bigtable.admin.v2.GcRule.Union} message Union + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Union.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.bigtable.admin.v2.GcRule.toObject(message.rules[j], options); + } + return object; + }; + + /** + * Converts this Union to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.GcRule.Union + * @instance + * @returns {Object.} JSON object + */ + Union.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Union + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.GcRule.Union + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Union.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.GcRule.Union"; + }; + + return Union; + })(); + + return GcRule; + })(); + + v2.EncryptionInfo = (function() { + + /** + * Properties of an EncryptionInfo. + * @memberof google.bigtable.admin.v2 + * @interface IEncryptionInfo + * @property {google.bigtable.admin.v2.EncryptionInfo.EncryptionType|null} [encryptionType] EncryptionInfo encryptionType + * @property {google.rpc.IStatus|null} [encryptionStatus] EncryptionInfo encryptionStatus + * @property {string|null} [kmsKeyVersion] EncryptionInfo kmsKeyVersion + */ + + /** + * Constructs a new EncryptionInfo. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents an EncryptionInfo. + * @implements IEncryptionInfo + * @constructor + * @param {google.bigtable.admin.v2.IEncryptionInfo=} [properties] Properties to set + */ + function EncryptionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionInfo encryptionType. + * @member {google.bigtable.admin.v2.EncryptionInfo.EncryptionType} encryptionType + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionType = 0; + + /** + * EncryptionInfo encryptionStatus. + * @member {google.rpc.IStatus|null|undefined} encryptionStatus + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionStatus = null; + + /** + * EncryptionInfo kmsKeyVersion. + * @member {string} kmsKeyVersion + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.kmsKeyVersion = ""; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {google.bigtable.admin.v2.IEncryptionInfo=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.EncryptionInfo} EncryptionInfo instance + */ + EncryptionInfo.create = function create(properties) { + return new EncryptionInfo(properties); + }; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.bigtable.admin.v2.EncryptionInfo.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {google.bigtable.admin.v2.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersion); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encryptionType); + if (message.encryptionStatus != null && Object.hasOwnProperty.call(message, "encryptionStatus")) + $root.google.rpc.Status.encode(message.encryptionStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.EncryptionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {google.bigtable.admin.v2.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.EncryptionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.encryptionType = reader.int32(); + break; + } + case 4: { + message.encryptionStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.kmsKeyVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionInfo message. + * @function verify + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) { + var error = $root.google.rpc.Status.verify(message.encryptionStatus); + if (error) + return "encryptionStatus." + error; + } + if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) + if (!$util.isString(message.kmsKeyVersion)) + return "kmsKeyVersion: string expected"; + return null; + }; + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.EncryptionInfo} EncryptionInfo + */ + EncryptionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.EncryptionInfo) + return object; + var message = new $root.google.bigtable.admin.v2.EncryptionInfo(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "ENCRYPTION_TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + } + if (object.encryptionStatus != null) { + if (typeof object.encryptionStatus !== "object") + throw TypeError(".google.bigtable.admin.v2.EncryptionInfo.encryptionStatus: object expected"); + message.encryptionStatus = $root.google.rpc.Status.fromObject(object.encryptionStatus); + } + if (object.kmsKeyVersion != null) + message.kmsKeyVersion = String(object.kmsKeyVersion); + return message; + }; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {google.bigtable.admin.v2.EncryptionInfo} message EncryptionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kmsKeyVersion = ""; + object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; + object.encryptionStatus = null; + } + if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) + object.kmsKeyVersion = message.kmsKeyVersion; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.bigtable.admin.v2.EncryptionInfo.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.bigtable.admin.v2.EncryptionInfo.EncryptionType[message.encryptionType] : message.encryptionType; + if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) + object.encryptionStatus = $root.google.rpc.Status.toObject(message.encryptionStatus, options); + return object; + }; + + /** + * Converts this EncryptionInfo to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @instance + * @returns {Object.} JSON object + */ + EncryptionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionInfo + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.EncryptionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.EncryptionInfo"; + }; + + /** + * EncryptionType enum. + * @name google.bigtable.admin.v2.EncryptionInfo.EncryptionType + * @enum {number} + * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value + */ + EncryptionInfo.EncryptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; + values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; + return values; + })(); + + return EncryptionInfo; + })(); + + v2.Snapshot = (function() { + + /** + * Properties of a Snapshot. + * @memberof google.bigtable.admin.v2 + * @interface ISnapshot + * @property {string|null} [name] Snapshot name + * @property {google.bigtable.admin.v2.ITable|null} [sourceTable] Snapshot sourceTable + * @property {number|Long|null} [dataSizeBytes] Snapshot dataSizeBytes + * @property {google.protobuf.ITimestamp|null} [createTime] Snapshot createTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Snapshot deleteTime + * @property {google.bigtable.admin.v2.Snapshot.State|null} [state] Snapshot state + * @property {string|null} [description] Snapshot description + */ + + /** + * Constructs a new Snapshot. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a Snapshot. + * @implements ISnapshot + * @constructor + * @param {google.bigtable.admin.v2.ISnapshot=} [properties] Properties to set + */ + function Snapshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Snapshot name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.name = ""; + + /** + * Snapshot sourceTable. + * @member {google.bigtable.admin.v2.ITable|null|undefined} sourceTable + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.sourceTable = null; + + /** + * Snapshot dataSizeBytes. + * @member {number|Long} dataSizeBytes + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.dataSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Snapshot createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.createTime = null; + + /** + * Snapshot deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.deleteTime = null; + + /** + * Snapshot state. + * @member {google.bigtable.admin.v2.Snapshot.State} state + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.state = 0; + + /** + * Snapshot description. + * @member {string} description + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + */ + Snapshot.prototype.description = ""; + + /** + * Creates a new Snapshot instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {google.bigtable.admin.v2.ISnapshot=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Snapshot} Snapshot instance + */ + Snapshot.create = function create(properties) { + return new Snapshot(properties); + }; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.bigtable.admin.v2.Snapshot.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {google.bigtable.admin.v2.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + $root.google.bigtable.admin.v2.Table.encode(message.sourceTable, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dataSizeBytes != null && Object.hasOwnProperty.call(message, "dataSizeBytes")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.dataSizeBytes); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + return writer; + }; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Snapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {google.bigtable.admin.v2.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Snapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceTable = $root.google.bigtable.admin.v2.Table.decode(reader, reader.uint32()); + break; + } + case 3: { + message.dataSizeBytes = reader.int64(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Snapshot message. + * @function verify + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Snapshot.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.sourceTable != null && message.hasOwnProperty("sourceTable")) { + var error = $root.google.bigtable.admin.v2.Table.verify(message.sourceTable); + if (error) + return "sourceTable." + error; + } + if (message.dataSizeBytes != null && message.hasOwnProperty("dataSizeBytes")) + if (!$util.isInteger(message.dataSizeBytes) && !(message.dataSizeBytes && $util.isInteger(message.dataSizeBytes.low) && $util.isInteger(message.dataSizeBytes.high))) + return "dataSizeBytes: integer|Long expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Snapshot} Snapshot + */ + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Snapshot) + return object; + var message = new $root.google.bigtable.admin.v2.Snapshot(); + if (object.name != null) + message.name = String(object.name); + if (object.sourceTable != null) { + if (typeof object.sourceTable !== "object") + throw TypeError(".google.bigtable.admin.v2.Snapshot.sourceTable: object expected"); + message.sourceTable = $root.google.bigtable.admin.v2.Table.fromObject(object.sourceTable); + } + if (object.dataSizeBytes != null) + if ($util.Long) + (message.dataSizeBytes = $util.Long.fromValue(object.dataSizeBytes)).unsigned = false; + else if (typeof object.dataSizeBytes === "string") + message.dataSizeBytes = parseInt(object.dataSizeBytes, 10); + else if (typeof object.dataSizeBytes === "number") + message.dataSizeBytes = object.dataSizeBytes; + else if (typeof object.dataSizeBytes === "object") + message.dataSizeBytes = new $util.LongBits(object.dataSizeBytes.low >>> 0, object.dataSizeBytes.high >>> 0).toNumber(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Snapshot.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Snapshot.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_NOT_KNOWN": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {google.bigtable.admin.v2.Snapshot} message Snapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Snapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceTable = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.dataSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.dataSizeBytes = options.longs === String ? "0" : 0; + object.createTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_NOT_KNOWN" : 0; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) + object.sourceTable = $root.google.bigtable.admin.v2.Table.toObject(message.sourceTable, options); + if (message.dataSizeBytes != null && message.hasOwnProperty("dataSizeBytes")) + if (typeof message.dataSizeBytes === "number") + object.dataSizeBytes = options.longs === String ? String(message.dataSizeBytes) : message.dataSizeBytes; + else + object.dataSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.dataSizeBytes) : options.longs === Number ? new $util.LongBits(message.dataSizeBytes.low >>> 0, message.dataSizeBytes.high >>> 0).toNumber() : message.dataSizeBytes; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.bigtable.admin.v2.Snapshot.State[message.state] === undefined ? message.state : $root.google.bigtable.admin.v2.Snapshot.State[message.state] : message.state; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Snapshot to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Snapshot + * @instance + * @returns {Object.} JSON object + */ + Snapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Snapshot + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Snapshot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Snapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Snapshot"; + }; + + /** + * State enum. + * @name google.bigtable.admin.v2.Snapshot.State + * @enum {number} + * @property {number} STATE_NOT_KNOWN=0 STATE_NOT_KNOWN value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + */ + Snapshot.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_NOT_KNOWN"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + return values; + })(); + + return Snapshot; + })(); + + v2.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.bigtable.admin.v2 + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [sourceTable] Backup sourceTable + * @property {string|null} [sourceBackup] Backup sourceBackup + * @property {google.protobuf.ITimestamp|null} [expireTime] Backup expireTime + * @property {google.protobuf.ITimestamp|null} [startTime] Backup startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Backup endTime + * @property {number|Long|null} [sizeBytes] Backup sizeBytes + * @property {google.bigtable.admin.v2.Backup.State|null} [state] Backup state + * @property {google.bigtable.admin.v2.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo + * @property {google.bigtable.admin.v2.Backup.BackupType|null} [backupType] Backup backupType + * @property {google.protobuf.ITimestamp|null} [hotToStandardTime] Backup hotToStandardTime + */ + + /** + * Constructs a new Backup. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.bigtable.admin.v2.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup sourceTable. + * @member {string} sourceTable + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.sourceTable = ""; + + /** + * Backup sourceBackup. + * @member {string} sourceBackup + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.sourceBackup = ""; + + /** + * Backup expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.expireTime = null; + + /** + * Backup startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.startTime = null; + + /** + * Backup endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.endTime = null; + + /** + * Backup sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup state. + * @member {google.bigtable.admin.v2.Backup.State} state + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup encryptionInfo. + * @member {google.bigtable.admin.v2.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.encryptionInfo = null; + + /** + * Backup backupType. + * @member {google.bigtable.admin.v2.Backup.BackupType} backupType + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.backupType = 0; + + /** + * Backup hotToStandardTime. + * @member {google.protobuf.ITimestamp|null|undefined} hotToStandardTime + * @memberof google.bigtable.admin.v2.Backup + * @instance + */ + Backup.prototype.hotToStandardTime = null; + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {google.bigtable.admin.v2.IBackup=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.bigtable.admin.v2.Backup.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {google.bigtable.admin.v2.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceTable); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.sizeBytes); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.bigtable.admin.v2.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.sourceBackup); + if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.backupType); + if (message.hotToStandardTime != null && Object.hasOwnProperty.call(message, "hotToStandardTime")) + $root.google.protobuf.Timestamp.encode(message.hotToStandardTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {google.bigtable.admin.v2.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Backup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceTable = reader.string(); + break; + } + case 10: { + message.sourceBackup = reader.string(); + break; + } + case 3: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.sizeBytes = reader.int64(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 9: { + message.encryptionInfo = $root.google.bigtable.admin.v2.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 11: { + message.backupType = reader.int32(); + break; + } + case 12: { + message.hotToStandardTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.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.sourceTable != null && message.hasOwnProperty("sourceTable")) + if (!$util.isString(message.sourceTable)) + return "sourceTable: string expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: 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.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.bigtable.admin.v2.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.backupType != null && message.hasOwnProperty("backupType")) + switch (message.backupType) { + default: + return "backupType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.hotToStandardTime != null && message.hasOwnProperty("hotToStandardTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.hotToStandardTime); + if (error) + return "hotToStandardTime." + error; + } + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Backup) + return object; + var message = new $root.google.bigtable.admin.v2.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.sourceTable != null) + message.sourceTable = String(object.sourceTable); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Backup.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Backup.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Backup.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.bigtable.admin.v2.Backup.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.bigtable.admin.v2.EncryptionInfo.fromObject(object.encryptionInfo); + } + switch (object.backupType) { + default: + if (typeof object.backupType === "number") { + message.backupType = object.backupType; + break; + } + break; + case "BACKUP_TYPE_UNSPECIFIED": + case 0: + message.backupType = 0; + break; + case "STANDARD": + case 1: + message.backupType = 1; + break; + case "HOT": + case 2: + message.backupType = 2; + break; + } + if (object.hotToStandardTime != null) { + if (typeof object.hotToStandardTime !== "object") + throw TypeError(".google.bigtable.admin.v2.Backup.hotToStandardTime: object expected"); + message.hotToStandardTime = $root.google.protobuf.Timestamp.fromObject(object.hotToStandardTime); + } + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {google.bigtable.admin.v2.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceTable = ""; + object.expireTime = null; + object.startTime = null; + object.endTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.encryptionInfo = null; + object.sourceBackup = ""; + object.backupType = options.enums === String ? "BACKUP_TYPE_UNSPECIFIED" : 0; + object.hotToStandardTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) + object.sourceTable = message.sourceTable; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.bigtable.admin.v2.Backup.State[message.state] === undefined ? message.state : $root.google.bigtable.admin.v2.Backup.State[message.state] : message.state; + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.bigtable.admin.v2.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + object.sourceBackup = message.sourceBackup; + if (message.backupType != null && message.hasOwnProperty("backupType")) + object.backupType = options.enums === String ? $root.google.bigtable.admin.v2.Backup.BackupType[message.backupType] === undefined ? message.backupType : $root.google.bigtable.admin.v2.Backup.BackupType[message.backupType] : message.backupType; + if (message.hotToStandardTime != null && message.hasOwnProperty("hotToStandardTime")) + object.hotToStandardTime = $root.google.protobuf.Timestamp.toObject(message.hotToStandardTime, options); + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Backup"; + }; + + /** + * State enum. + * @name google.bigtable.admin.v2.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + return values; + })(); + + /** + * BackupType enum. + * @name google.bigtable.admin.v2.Backup.BackupType + * @enum {number} + * @property {number} BACKUP_TYPE_UNSPECIFIED=0 BACKUP_TYPE_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} HOT=2 HOT value + */ + Backup.BackupType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "HOT"] = 2; + return values; + })(); + + return Backup; + })(); + + v2.BackupInfo = (function() { + + /** + * Properties of a BackupInfo. + * @memberof google.bigtable.admin.v2 + * @interface IBackupInfo + * @property {string|null} [backup] BackupInfo backup + * @property {google.protobuf.ITimestamp|null} [startTime] BackupInfo startTime + * @property {google.protobuf.ITimestamp|null} [endTime] BackupInfo endTime + * @property {string|null} [sourceTable] BackupInfo sourceTable + * @property {string|null} [sourceBackup] BackupInfo sourceBackup + */ + + /** + * Constructs a new BackupInfo. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a BackupInfo. + * @implements IBackupInfo + * @constructor + * @param {google.bigtable.admin.v2.IBackupInfo=} [properties] Properties to set + */ + function BackupInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupInfo backup. + * @member {string} backup + * @memberof google.bigtable.admin.v2.BackupInfo + * @instance + */ + BackupInfo.prototype.backup = ""; + + /** + * BackupInfo startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.admin.v2.BackupInfo + * @instance + */ + BackupInfo.prototype.startTime = null; + + /** + * BackupInfo endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.admin.v2.BackupInfo + * @instance + */ + BackupInfo.prototype.endTime = null; + + /** + * BackupInfo sourceTable. + * @member {string} sourceTable + * @memberof google.bigtable.admin.v2.BackupInfo + * @instance + */ + BackupInfo.prototype.sourceTable = ""; + + /** + * BackupInfo sourceBackup. + * @member {string} sourceBackup + * @memberof google.bigtable.admin.v2.BackupInfo + * @instance + */ + BackupInfo.prototype.sourceBackup = ""; + + /** + * Creates a new BackupInfo instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {google.bigtable.admin.v2.IBackupInfo=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.BackupInfo} BackupInfo instance + */ + BackupInfo.create = function create(properties) { + return new BackupInfo(properties); + }; + + /** + * Encodes the specified BackupInfo message. Does not implicitly {@link google.bigtable.admin.v2.BackupInfo.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {google.bigtable.admin.v2.IBackupInfo} message BackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backup); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceTable); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.sourceBackup); + return writer; + }; + + /** + * Encodes the specified BackupInfo message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.BackupInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {google.bigtable.admin.v2.IBackupInfo} message BackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupInfo message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.BackupInfo} BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.BackupInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backup = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.sourceTable = reader.string(); + break; + } + case 10: { + message.sourceBackup = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.BackupInfo} BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupInfo message. + * @function verify + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backup != null && message.hasOwnProperty("backup")) + if (!$util.isString(message.backup)) + return "backup: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) + if (!$util.isString(message.sourceTable)) + return "sourceTable: string expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + return null; + }; + + /** + * Creates a BackupInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.BackupInfo} BackupInfo + */ + BackupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.BackupInfo) + return object; + var message = new $root.google.bigtable.admin.v2.BackupInfo(); + if (object.backup != null) + message.backup = String(object.backup); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.admin.v2.BackupInfo.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.admin.v2.BackupInfo.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.sourceTable != null) + message.sourceTable = String(object.sourceTable); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + return message; + }; + + /** + * Creates a plain object from a BackupInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {google.bigtable.admin.v2.BackupInfo} message BackupInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backup = ""; + object.startTime = null; + object.endTime = null; + object.sourceTable = ""; + object.sourceBackup = ""; + } + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = message.backup; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) + object.sourceTable = message.sourceTable; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + object.sourceBackup = message.sourceBackup; + return object; + }; + + /** + * Converts this BackupInfo to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.BackupInfo + * @instance + * @returns {Object.} JSON object + */ + BackupInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupInfo + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.BackupInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.BackupInfo"; + }; + + return BackupInfo; + })(); + + /** + * RestoreSourceType enum. + * @name google.bigtable.admin.v2.RestoreSourceType + * @enum {number} + * @property {number} RESTORE_SOURCE_TYPE_UNSPECIFIED=0 RESTORE_SOURCE_TYPE_UNSPECIFIED value + * @property {number} BACKUP=1 BACKUP value + */ + v2.RestoreSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTORE_SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKUP"] = 1; + return values; + })(); + + v2.ProtoSchema = (function() { + + /** + * Properties of a ProtoSchema. + * @memberof google.bigtable.admin.v2 + * @interface IProtoSchema + * @property {Uint8Array|null} [protoDescriptors] ProtoSchema protoDescriptors + */ + + /** + * Constructs a new ProtoSchema. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a ProtoSchema. + * @implements IProtoSchema + * @constructor + * @param {google.bigtable.admin.v2.IProtoSchema=} [properties] Properties to set + */ + function ProtoSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtoSchema protoDescriptors. + * @member {Uint8Array} protoDescriptors + * @memberof google.bigtable.admin.v2.ProtoSchema + * @instance + */ + ProtoSchema.prototype.protoDescriptors = $util.newBuffer([]); + + /** + * Creates a new ProtoSchema instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {google.bigtable.admin.v2.IProtoSchema=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ProtoSchema} ProtoSchema instance + */ + ProtoSchema.create = function create(properties) { + return new ProtoSchema(properties); + }; + + /** + * Encodes the specified ProtoSchema message. Does not implicitly {@link google.bigtable.admin.v2.ProtoSchema.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {google.bigtable.admin.v2.IProtoSchema} message ProtoSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.protoDescriptors); + return writer; + }; + + /** + * Encodes the specified ProtoSchema message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ProtoSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {google.bigtable.admin.v2.IProtoSchema} message ProtoSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.ProtoSchema} ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoSchema.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.ProtoSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.protoDescriptors = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.ProtoSchema} ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoSchema message. + * @function verify + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) + return "protoDescriptors: buffer expected"; + return null; + }; + + /** + * Creates a ProtoSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.ProtoSchema} ProtoSchema + */ + ProtoSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ProtoSchema) + return object; + var message = new $root.google.bigtable.admin.v2.ProtoSchema(); + if (object.protoDescriptors != null) + if (typeof object.protoDescriptors === "string") + $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); + else if (object.protoDescriptors.length >= 0) + message.protoDescriptors = object.protoDescriptors; + return message; + }; + + /** + * Creates a plain object from a ProtoSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {google.bigtable.admin.v2.ProtoSchema} message ProtoSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.protoDescriptors = ""; + else { + object.protoDescriptors = []; + if (options.bytes !== Array) + object.protoDescriptors = $util.newBuffer(object.protoDescriptors); + } + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; + return object; + }; + + /** + * Converts this ProtoSchema to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ProtoSchema + * @instance + * @returns {Object.} JSON object + */ + ProtoSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProtoSchema + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.ProtoSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.ProtoSchema"; + }; + + return ProtoSchema; + })(); + + v2.SchemaBundle = (function() { + + /** + * Properties of a SchemaBundle. + * @memberof google.bigtable.admin.v2 + * @interface ISchemaBundle + * @property {string|null} [name] SchemaBundle name + * @property {google.bigtable.admin.v2.IProtoSchema|null} [protoSchema] SchemaBundle protoSchema + * @property {string|null} [etag] SchemaBundle etag + */ + + /** + * Constructs a new SchemaBundle. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a SchemaBundle. + * @implements ISchemaBundle + * @constructor + * @param {google.bigtable.admin.v2.ISchemaBundle=} [properties] Properties to set + */ + function SchemaBundle(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SchemaBundle name. + * @member {string} name + * @memberof google.bigtable.admin.v2.SchemaBundle + * @instance + */ + SchemaBundle.prototype.name = ""; + + /** + * SchemaBundle protoSchema. + * @member {google.bigtable.admin.v2.IProtoSchema|null|undefined} protoSchema + * @memberof google.bigtable.admin.v2.SchemaBundle + * @instance + */ + SchemaBundle.prototype.protoSchema = null; + + /** + * SchemaBundle etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.SchemaBundle + * @instance + */ + SchemaBundle.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SchemaBundle type. + * @member {"protoSchema"|undefined} type + * @memberof google.bigtable.admin.v2.SchemaBundle + * @instance + */ + Object.defineProperty(SchemaBundle.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["protoSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SchemaBundle instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {google.bigtable.admin.v2.ISchemaBundle=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.SchemaBundle} SchemaBundle instance + */ + SchemaBundle.create = function create(properties) { + return new SchemaBundle(properties); + }; + + /** + * Encodes the specified SchemaBundle message. Does not implicitly {@link google.bigtable.admin.v2.SchemaBundle.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {google.bigtable.admin.v2.ISchemaBundle} message SchemaBundle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaBundle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.protoSchema != null && Object.hasOwnProperty.call(message, "protoSchema")) + $root.google.bigtable.admin.v2.ProtoSchema.encode(message.protoSchema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified SchemaBundle message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SchemaBundle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {google.bigtable.admin.v2.ISchemaBundle} message SchemaBundle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaBundle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchemaBundle message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.SchemaBundle} SchemaBundle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaBundle.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.SchemaBundle(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.protoSchema = $root.google.bigtable.admin.v2.ProtoSchema.decode(reader, reader.uint32()); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchemaBundle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.SchemaBundle} SchemaBundle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaBundle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchemaBundle message. + * @function verify + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchemaBundle.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.protoSchema != null && message.hasOwnProperty("protoSchema")) { + properties.type = 1; + { + var error = $root.google.bigtable.admin.v2.ProtoSchema.verify(message.protoSchema); + if (error) + return "protoSchema." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a SchemaBundle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.SchemaBundle} SchemaBundle + */ + SchemaBundle.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.SchemaBundle) + return object; + var message = new $root.google.bigtable.admin.v2.SchemaBundle(); + if (object.name != null) + message.name = String(object.name); + if (object.protoSchema != null) { + if (typeof object.protoSchema !== "object") + throw TypeError(".google.bigtable.admin.v2.SchemaBundle.protoSchema: object expected"); + message.protoSchema = $root.google.bigtable.admin.v2.ProtoSchema.fromObject(object.protoSchema); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a SchemaBundle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {google.bigtable.admin.v2.SchemaBundle} message SchemaBundle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchemaBundle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.protoSchema != null && message.hasOwnProperty("protoSchema")) { + object.protoSchema = $root.google.bigtable.admin.v2.ProtoSchema.toObject(message.protoSchema, options); + if (options.oneofs) + object.type = "protoSchema"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this SchemaBundle to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.SchemaBundle + * @instance + * @returns {Object.} JSON object + */ + SchemaBundle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchemaBundle + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.SchemaBundle + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchemaBundle.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.SchemaBundle"; + }; + + return SchemaBundle; + })(); + + v2.Type = (function() { + + /** + * Properties of a Type. + * @memberof google.bigtable.admin.v2 + * @interface IType + * @property {google.bigtable.admin.v2.Type.IBytes|null} [bytesType] Type bytesType + * @property {google.bigtable.admin.v2.Type.IString|null} [stringType] Type stringType + * @property {google.bigtable.admin.v2.Type.IInt64|null} [int64Type] Type int64Type + * @property {google.bigtable.admin.v2.Type.IFloat32|null} [float32Type] Type float32Type + * @property {google.bigtable.admin.v2.Type.IFloat64|null} [float64Type] Type float64Type + * @property {google.bigtable.admin.v2.Type.IBool|null} [boolType] Type boolType + * @property {google.bigtable.admin.v2.Type.ITimestamp|null} [timestampType] Type timestampType + * @property {google.bigtable.admin.v2.Type.IDate|null} [dateType] Type dateType + * @property {google.bigtable.admin.v2.Type.IAggregate|null} [aggregateType] Type aggregateType + * @property {google.bigtable.admin.v2.Type.IStruct|null} [structType] Type structType + * @property {google.bigtable.admin.v2.Type.IArray|null} [arrayType] Type arrayType + * @property {google.bigtable.admin.v2.Type.IMap|null} [mapType] Type mapType + * @property {google.bigtable.admin.v2.Type.IProto|null} [protoType] Type protoType + * @property {google.bigtable.admin.v2.Type.IEnum|null} [enumType] Type enumType + */ + + /** + * Constructs a new Type. + * @memberof google.bigtable.admin.v2 + * @classdesc Represents a Type. + * @implements IType + * @constructor + * @param {google.bigtable.admin.v2.IType=} [properties] Properties to set + */ + function Type(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Type bytesType. + * @member {google.bigtable.admin.v2.Type.IBytes|null|undefined} bytesType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.bytesType = null; + + /** + * Type stringType. + * @member {google.bigtable.admin.v2.Type.IString|null|undefined} stringType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.stringType = null; + + /** + * Type int64Type. + * @member {google.bigtable.admin.v2.Type.IInt64|null|undefined} int64Type + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.int64Type = null; + + /** + * Type float32Type. + * @member {google.bigtable.admin.v2.Type.IFloat32|null|undefined} float32Type + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.float32Type = null; + + /** + * Type float64Type. + * @member {google.bigtable.admin.v2.Type.IFloat64|null|undefined} float64Type + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.float64Type = null; + + /** + * Type boolType. + * @member {google.bigtable.admin.v2.Type.IBool|null|undefined} boolType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.boolType = null; + + /** + * Type timestampType. + * @member {google.bigtable.admin.v2.Type.ITimestamp|null|undefined} timestampType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.timestampType = null; + + /** + * Type dateType. + * @member {google.bigtable.admin.v2.Type.IDate|null|undefined} dateType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.dateType = null; + + /** + * Type aggregateType. + * @member {google.bigtable.admin.v2.Type.IAggregate|null|undefined} aggregateType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.aggregateType = null; + + /** + * Type structType. + * @member {google.bigtable.admin.v2.Type.IStruct|null|undefined} structType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.structType = null; + + /** + * Type arrayType. + * @member {google.bigtable.admin.v2.Type.IArray|null|undefined} arrayType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.arrayType = null; + + /** + * Type mapType. + * @member {google.bigtable.admin.v2.Type.IMap|null|undefined} mapType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.mapType = null; + + /** + * Type protoType. + * @member {google.bigtable.admin.v2.Type.IProto|null|undefined} protoType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.protoType = null; + + /** + * Type enumType. + * @member {google.bigtable.admin.v2.Type.IEnum|null|undefined} enumType + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Type.prototype.enumType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Type kind. + * @member {"bytesType"|"stringType"|"int64Type"|"float32Type"|"float64Type"|"boolType"|"timestampType"|"dateType"|"aggregateType"|"structType"|"arrayType"|"mapType"|"protoType"|"enumType"|undefined} kind + * @memberof google.bigtable.admin.v2.Type + * @instance + */ + Object.defineProperty(Type.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["bytesType", "stringType", "int64Type", "float32Type", "float64Type", "boolType", "timestampType", "dateType", "aggregateType", "structType", "arrayType", "mapType", "protoType", "enumType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Type instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {google.bigtable.admin.v2.IType=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type} Type instance + */ + Type.create = function create(properties) { + return new Type(properties); + }; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.bigtable.admin.v2.Type.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {google.bigtable.admin.v2.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesType != null && Object.hasOwnProperty.call(message, "bytesType")) + $root.google.bigtable.admin.v2.Type.Bytes.encode(message.bytesType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stringType != null && Object.hasOwnProperty.call(message, "stringType")) + $root.google.bigtable.admin.v2.Type.String.encode(message.stringType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.arrayType != null && Object.hasOwnProperty.call(message, "arrayType")) + $root.google.bigtable.admin.v2.Type.Array.encode(message.arrayType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mapType != null && Object.hasOwnProperty.call(message, "mapType")) + $root.google.bigtable.admin.v2.Type.Map.encode(message.mapType, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.int64Type != null && Object.hasOwnProperty.call(message, "int64Type")) + $root.google.bigtable.admin.v2.Type.Int64.encode(message.int64Type, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.aggregateType != null && Object.hasOwnProperty.call(message, "aggregateType")) + $root.google.bigtable.admin.v2.Type.Aggregate.encode(message.aggregateType, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) + $root.google.bigtable.admin.v2.Type.Struct.encode(message.structType, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.boolType != null && Object.hasOwnProperty.call(message, "boolType")) + $root.google.bigtable.admin.v2.Type.Bool.encode(message.boolType, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.float64Type != null && Object.hasOwnProperty.call(message, "float64Type")) + $root.google.bigtable.admin.v2.Type.Float64.encode(message.float64Type, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.timestampType != null && Object.hasOwnProperty.call(message, "timestampType")) + $root.google.bigtable.admin.v2.Type.Timestamp.encode(message.timestampType, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.dateType != null && Object.hasOwnProperty.call(message, "dateType")) + $root.google.bigtable.admin.v2.Type.Date.encode(message.dateType, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.float32Type != null && Object.hasOwnProperty.call(message, "float32Type")) + $root.google.bigtable.admin.v2.Type.Float32.encode(message.float32Type, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.protoType != null && Object.hasOwnProperty.call(message, "protoType")) + $root.google.bigtable.admin.v2.Type.Proto.encode(message.protoType, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + $root.google.bigtable.admin.v2.Type.Enum.encode(message.enumType, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {google.bigtable.admin.v2.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Type message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bytesType = $root.google.bigtable.admin.v2.Type.Bytes.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stringType = $root.google.bigtable.admin.v2.Type.String.decode(reader, reader.uint32()); + break; + } + case 5: { + message.int64Type = $root.google.bigtable.admin.v2.Type.Int64.decode(reader, reader.uint32()); + break; + } + case 12: { + message.float32Type = $root.google.bigtable.admin.v2.Type.Float32.decode(reader, reader.uint32()); + break; + } + case 9: { + message.float64Type = $root.google.bigtable.admin.v2.Type.Float64.decode(reader, reader.uint32()); + break; + } + case 8: { + message.boolType = $root.google.bigtable.admin.v2.Type.Bool.decode(reader, reader.uint32()); + break; + } + case 10: { + message.timestampType = $root.google.bigtable.admin.v2.Type.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.dateType = $root.google.bigtable.admin.v2.Type.Date.decode(reader, reader.uint32()); + break; + } + case 6: { + message.aggregateType = $root.google.bigtable.admin.v2.Type.Aggregate.decode(reader, reader.uint32()); + break; + } + case 7: { + message.structType = $root.google.bigtable.admin.v2.Type.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.arrayType = $root.google.bigtable.admin.v2.Type.Array.decode(reader, reader.uint32()); + break; + } + case 4: { + message.mapType = $root.google.bigtable.admin.v2.Type.Map.decode(reader, reader.uint32()); + break; + } + case 13: { + message.protoType = $root.google.bigtable.admin.v2.Type.Proto.decode(reader, reader.uint32()); + break; + } + case 14: { + message.enumType = $root.google.bigtable.admin.v2.Type.Enum.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Type message. + * @function verify + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Type.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) { + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Bytes.verify(message.bytesType); + if (error) + return "bytesType." + error; + } + } + if (message.stringType != null && message.hasOwnProperty("stringType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.String.verify(message.stringType); + if (error) + return "stringType." + error; + } + } + if (message.int64Type != null && message.hasOwnProperty("int64Type")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Int64.verify(message.int64Type); + if (error) + return "int64Type." + error; + } + } + if (message.float32Type != null && message.hasOwnProperty("float32Type")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Float32.verify(message.float32Type); + if (error) + return "float32Type." + error; + } + } + if (message.float64Type != null && message.hasOwnProperty("float64Type")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Float64.verify(message.float64Type); + if (error) + return "float64Type." + error; + } + } + if (message.boolType != null && message.hasOwnProperty("boolType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Bool.verify(message.boolType); + if (error) + return "boolType." + error; + } + } + if (message.timestampType != null && message.hasOwnProperty("timestampType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Timestamp.verify(message.timestampType); + if (error) + return "timestampType." + error; + } + } + if (message.dateType != null && message.hasOwnProperty("dateType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Date.verify(message.dateType); + if (error) + return "dateType." + error; + } + } + if (message.aggregateType != null && message.hasOwnProperty("aggregateType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Aggregate.verify(message.aggregateType); + if (error) + return "aggregateType." + error; + } + } + if (message.structType != null && message.hasOwnProperty("structType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Struct.verify(message.structType); + if (error) + return "structType." + error; + } + } + if (message.arrayType != null && message.hasOwnProperty("arrayType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Array.verify(message.arrayType); + if (error) + return "arrayType." + error; + } + } + if (message.mapType != null && message.hasOwnProperty("mapType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Map.verify(message.mapType); + if (error) + return "mapType." + error; + } + } + if (message.protoType != null && message.hasOwnProperty("protoType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Proto.verify(message.protoType); + if (error) + return "protoType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Enum.verify(message.enumType); + if (error) + return "enumType." + error; + } + } + return null; + }; + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type} Type + */ + Type.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type) + return object; + var message = new $root.google.bigtable.admin.v2.Type(); + if (object.bytesType != null) { + if (typeof object.bytesType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.bytesType: object expected"); + message.bytesType = $root.google.bigtable.admin.v2.Type.Bytes.fromObject(object.bytesType); + } + if (object.stringType != null) { + if (typeof object.stringType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.stringType: object expected"); + message.stringType = $root.google.bigtable.admin.v2.Type.String.fromObject(object.stringType); + } + if (object.int64Type != null) { + if (typeof object.int64Type !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.int64Type: object expected"); + message.int64Type = $root.google.bigtable.admin.v2.Type.Int64.fromObject(object.int64Type); + } + if (object.float32Type != null) { + if (typeof object.float32Type !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.float32Type: object expected"); + message.float32Type = $root.google.bigtable.admin.v2.Type.Float32.fromObject(object.float32Type); + } + if (object.float64Type != null) { + if (typeof object.float64Type !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.float64Type: object expected"); + message.float64Type = $root.google.bigtable.admin.v2.Type.Float64.fromObject(object.float64Type); + } + if (object.boolType != null) { + if (typeof object.boolType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.boolType: object expected"); + message.boolType = $root.google.bigtable.admin.v2.Type.Bool.fromObject(object.boolType); + } + if (object.timestampType != null) { + if (typeof object.timestampType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.timestampType: object expected"); + message.timestampType = $root.google.bigtable.admin.v2.Type.Timestamp.fromObject(object.timestampType); + } + if (object.dateType != null) { + if (typeof object.dateType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.dateType: object expected"); + message.dateType = $root.google.bigtable.admin.v2.Type.Date.fromObject(object.dateType); + } + if (object.aggregateType != null) { + if (typeof object.aggregateType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.aggregateType: object expected"); + message.aggregateType = $root.google.bigtable.admin.v2.Type.Aggregate.fromObject(object.aggregateType); + } + if (object.structType != null) { + if (typeof object.structType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.structType: object expected"); + message.structType = $root.google.bigtable.admin.v2.Type.Struct.fromObject(object.structType); + } + if (object.arrayType != null) { + if (typeof object.arrayType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.arrayType: object expected"); + message.arrayType = $root.google.bigtable.admin.v2.Type.Array.fromObject(object.arrayType); + } + if (object.mapType != null) { + if (typeof object.mapType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.mapType: object expected"); + message.mapType = $root.google.bigtable.admin.v2.Type.Map.fromObject(object.mapType); + } + if (object.protoType != null) { + if (typeof object.protoType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.protoType: object expected"); + message.protoType = $root.google.bigtable.admin.v2.Type.Proto.fromObject(object.protoType); + } + if (object.enumType != null) { + if (typeof object.enumType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.enumType: object expected"); + message.enumType = $root.google.bigtable.admin.v2.Type.Enum.fromObject(object.enumType); + } + return message; + }; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {google.bigtable.admin.v2.Type} message Type + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Type.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) { + object.bytesType = $root.google.bigtable.admin.v2.Type.Bytes.toObject(message.bytesType, options); + if (options.oneofs) + object.kind = "bytesType"; + } + if (message.stringType != null && message.hasOwnProperty("stringType")) { + object.stringType = $root.google.bigtable.admin.v2.Type.String.toObject(message.stringType, options); + if (options.oneofs) + object.kind = "stringType"; + } + if (message.arrayType != null && message.hasOwnProperty("arrayType")) { + object.arrayType = $root.google.bigtable.admin.v2.Type.Array.toObject(message.arrayType, options); + if (options.oneofs) + object.kind = "arrayType"; + } + if (message.mapType != null && message.hasOwnProperty("mapType")) { + object.mapType = $root.google.bigtable.admin.v2.Type.Map.toObject(message.mapType, options); + if (options.oneofs) + object.kind = "mapType"; + } + if (message.int64Type != null && message.hasOwnProperty("int64Type")) { + object.int64Type = $root.google.bigtable.admin.v2.Type.Int64.toObject(message.int64Type, options); + if (options.oneofs) + object.kind = "int64Type"; + } + if (message.aggregateType != null && message.hasOwnProperty("aggregateType")) { + object.aggregateType = $root.google.bigtable.admin.v2.Type.Aggregate.toObject(message.aggregateType, options); + if (options.oneofs) + object.kind = "aggregateType"; + } + if (message.structType != null && message.hasOwnProperty("structType")) { + object.structType = $root.google.bigtable.admin.v2.Type.Struct.toObject(message.structType, options); + if (options.oneofs) + object.kind = "structType"; + } + if (message.boolType != null && message.hasOwnProperty("boolType")) { + object.boolType = $root.google.bigtable.admin.v2.Type.Bool.toObject(message.boolType, options); + if (options.oneofs) + object.kind = "boolType"; + } + if (message.float64Type != null && message.hasOwnProperty("float64Type")) { + object.float64Type = $root.google.bigtable.admin.v2.Type.Float64.toObject(message.float64Type, options); + if (options.oneofs) + object.kind = "float64Type"; + } + if (message.timestampType != null && message.hasOwnProperty("timestampType")) { + object.timestampType = $root.google.bigtable.admin.v2.Type.Timestamp.toObject(message.timestampType, options); + if (options.oneofs) + object.kind = "timestampType"; + } + if (message.dateType != null && message.hasOwnProperty("dateType")) { + object.dateType = $root.google.bigtable.admin.v2.Type.Date.toObject(message.dateType, options); + if (options.oneofs) + object.kind = "dateType"; + } + if (message.float32Type != null && message.hasOwnProperty("float32Type")) { + object.float32Type = $root.google.bigtable.admin.v2.Type.Float32.toObject(message.float32Type, options); + if (options.oneofs) + object.kind = "float32Type"; + } + if (message.protoType != null && message.hasOwnProperty("protoType")) { + object.protoType = $root.google.bigtable.admin.v2.Type.Proto.toObject(message.protoType, options); + if (options.oneofs) + object.kind = "protoType"; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + object.enumType = $root.google.bigtable.admin.v2.Type.Enum.toObject(message.enumType, options); + if (options.oneofs) + object.kind = "enumType"; + } + return object; + }; + + /** + * Converts this Type to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type + * @instance + * @returns {Object.} JSON object + */ + Type.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Type + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Type.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type"; + }; + + Type.Bytes = (function() { + + /** + * Properties of a Bytes. + * @memberof google.bigtable.admin.v2.Type + * @interface IBytes + * @property {google.bigtable.admin.v2.Type.Bytes.IEncoding|null} [encoding] Bytes encoding + */ + + /** + * Constructs a new Bytes. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Bytes. + * @implements IBytes + * @constructor + * @param {google.bigtable.admin.v2.Type.IBytes=} [properties] Properties to set + */ + function Bytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bytes encoding. + * @member {google.bigtable.admin.v2.Type.Bytes.IEncoding|null|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Bytes + * @instance + */ + Bytes.prototype.encoding = null; + + /** + * Creates a new Bytes instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {google.bigtable.admin.v2.Type.IBytes=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Bytes} Bytes instance + */ + Bytes.create = function create(properties) { + return new Bytes(properties); + }; + + /** + * Encodes the specified Bytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {google.bigtable.admin.v2.Type.IBytes} message Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.admin.v2.Type.Bytes.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Bytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {google.bigtable.admin.v2.Type.IBytes} message Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Bytes} Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Bytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Bytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Bytes} Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bytes message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a Bytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Bytes} Bytes + */ + Bytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Bytes) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Bytes(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Bytes.encoding: object expected"); + message.encoding = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a Bytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {google.bigtable.admin.v2.Type.Bytes} message Bytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Bytes to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Bytes + * @instance + * @returns {Object.} JSON object + */ + Bytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bytes + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Bytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Bytes"; + }; + + Bytes.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.admin.v2.Type.Bytes + * @interface IEncoding + * @property {google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw|null} [raw] Encoding raw + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.admin.v2.Type.Bytes + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.admin.v2.Type.Bytes.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding raw. + * @member {google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw|null|undefined} raw + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @instance + */ + Encoding.prototype.raw = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"raw"|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["raw"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.raw != null && Object.hasOwnProperty.call(message, "raw")) + $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.encode(message.raw, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Bytes.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.raw = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.raw != null && message.hasOwnProperty("raw")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.verify(message.raw); + if (error) + return "raw." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Bytes.Encoding) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Bytes.Encoding(); + if (object.raw != null) { + if (typeof object.raw !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Bytes.Encoding.raw: object expected"); + message.raw = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.fromObject(object.raw); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.raw != null && message.hasOwnProperty("raw")) { + object.raw = $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.toObject(message.raw, options); + if (options.oneofs) + object.encoding = "raw"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Bytes.Encoding"; + }; + + Encoding.Raw = (function() { + + /** + * Properties of a Raw. + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @interface IRaw + */ + + /** + * Constructs a new Raw. + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding + * @classdesc Represents a Raw. + * @implements IRaw + * @constructor + * @param {google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw=} [properties] Properties to set + */ + function Raw(properties) { + if (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 Raw instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} Raw instance + */ + Raw.create = function create(properties) { + return new Raw(properties); + }; + + /** + * Encodes the specified Raw message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw} message Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Raw.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Raw message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.Encoding.IRaw} message Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Raw.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Raw message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Raw.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Raw message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Raw.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Raw message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Raw.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Raw message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} Raw + */ + Raw.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) + return object; + return new $root.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw(); + }; + + /** + * Creates a plain object from a Raw message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} message Raw + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Raw.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Raw to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @instance + * @returns {Object.} JSON object + */ + Raw.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Raw + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Bytes.Encoding.Raw + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Raw.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Bytes.Encoding.Raw"; + }; + + return Raw; + })(); + + return Encoding; + })(); + + return Bytes; + })(); + + Type.String = (function() { + + /** + * Properties of a String. + * @memberof google.bigtable.admin.v2.Type + * @interface IString + * @property {google.bigtable.admin.v2.Type.String.IEncoding|null} [encoding] String encoding + */ + + /** + * Constructs a new String. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a String. + * @implements IString + * @constructor + * @param {google.bigtable.admin.v2.Type.IString=} [properties] Properties to set + */ + function String(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * String encoding. + * @member {google.bigtable.admin.v2.Type.String.IEncoding|null|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.String + * @instance + */ + String.prototype.encoding = null; + + /** + * Creates a new String instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {google.bigtable.admin.v2.Type.IString=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.String} String instance + */ + String.create = function create(properties) { + return new String(properties); + }; + + /** + * Encodes the specified String message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {google.bigtable.admin.v2.Type.IString} message String message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + String.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.admin.v2.Type.String.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified String message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {google.bigtable.admin.v2.Type.IString} message String message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + String.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a String message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.String} String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + String.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.String(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.admin.v2.Type.String.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a String message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.String} String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + String.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a String message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + String.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.admin.v2.Type.String.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a String message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.String} String + */ + String.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.String) + return object; + var message = new $root.google.bigtable.admin.v2.Type.String(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.String.encoding: object expected"); + message.encoding = $root.google.bigtable.admin.v2.Type.String.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a String message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {google.bigtable.admin.v2.Type.String} message String + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + String.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.admin.v2.Type.String.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this String to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.String + * @instance + * @returns {Object.} JSON object + */ + String.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for String + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.String + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + String.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.String"; + }; + + String.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.admin.v2.Type.String + * @interface IEncoding + * @property {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw|null} [utf8Raw] Encoding utf8Raw + * @property {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes|null} [utf8Bytes] Encoding utf8Bytes + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.admin.v2.Type.String + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.admin.v2.Type.String.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding utf8Raw. + * @member {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw|null|undefined} utf8Raw + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @instance + */ + Encoding.prototype.utf8Raw = null; + + /** + * Encoding utf8Bytes. + * @member {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes|null|undefined} utf8Bytes + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @instance + */ + Encoding.prototype.utf8Bytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"utf8Raw"|"utf8Bytes"|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["utf8Raw", "utf8Bytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.String.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.String.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.String.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.utf8Raw != null && Object.hasOwnProperty.call(message, "utf8Raw")) + $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.encode(message.utf8Raw, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.utf8Bytes != null && Object.hasOwnProperty.call(message, "utf8Bytes")) + $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.encode(message.utf8Bytes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.String.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.String.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.String.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.utf8Raw = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.decode(reader, reader.uint32()); + break; + } + case 2: { + message.utf8Bytes = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.String.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.utf8Raw != null && message.hasOwnProperty("utf8Raw")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.verify(message.utf8Raw); + if (error) + return "utf8Raw." + error; + } + } + if (message.utf8Bytes != null && message.hasOwnProperty("utf8Bytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.verify(message.utf8Bytes); + if (error) + return "utf8Bytes." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.String.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.String.Encoding) + return object; + var message = new $root.google.bigtable.admin.v2.Type.String.Encoding(); + if (object.utf8Raw != null) { + if (typeof object.utf8Raw !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.String.Encoding.utf8Raw: object expected"); + message.utf8Raw = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.fromObject(object.utf8Raw); + } + if (object.utf8Bytes != null) { + if (typeof object.utf8Bytes !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.String.Encoding.utf8Bytes: object expected"); + message.utf8Bytes = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.fromObject(object.utf8Bytes); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.utf8Raw != null && message.hasOwnProperty("utf8Raw")) { + object.utf8Raw = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.toObject(message.utf8Raw, options); + if (options.oneofs) + object.encoding = "utf8Raw"; + } + if (message.utf8Bytes != null && message.hasOwnProperty("utf8Bytes")) { + object.utf8Bytes = $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.toObject(message.utf8Bytes, options); + if (options.oneofs) + object.encoding = "utf8Bytes"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.String.Encoding"; + }; + + Encoding.Utf8Raw = (function() { + + /** + * Properties of an Utf8Raw. + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @interface IUtf8Raw + */ + + /** + * Constructs a new Utf8Raw. + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @classdesc Represents an Utf8Raw. + * @implements IUtf8Raw + * @constructor + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw=} [properties] Properties to set + */ + function Utf8Raw(properties) { + if (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 Utf8Raw instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw} Utf8Raw instance + */ + Utf8Raw.create = function create(properties) { + return new Utf8Raw(properties); + }; + + /** + * Encodes the specified Utf8Raw message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw} message Utf8Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Raw.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Utf8Raw message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Raw} message Utf8Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Raw.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw} Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Raw.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw} Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Raw.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Utf8Raw message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Utf8Raw.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Utf8Raw message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw} Utf8Raw + */ + Utf8Raw.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) + return object; + return new $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw(); + }; + + /** + * Creates a plain object from an Utf8Raw message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw} message Utf8Raw + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Utf8Raw.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Utf8Raw to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @instance + * @returns {Object.} JSON object + */ + Utf8Raw.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Utf8Raw + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Utf8Raw.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw"; + }; + + return Utf8Raw; + })(); + + Encoding.Utf8Bytes = (function() { + + /** + * Properties of an Utf8Bytes. + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @interface IUtf8Bytes + */ + + /** + * Constructs a new Utf8Bytes. + * @memberof google.bigtable.admin.v2.Type.String.Encoding + * @classdesc Represents an Utf8Bytes. + * @implements IUtf8Bytes + * @constructor + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes=} [properties] Properties to set + */ + function Utf8Bytes(properties) { + if (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 Utf8Bytes instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes instance + */ + Utf8Bytes.create = function create(properties) { + return new Utf8Bytes(properties); + }; + + /** + * Encodes the specified Utf8Bytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes} message Utf8Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Bytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Utf8Bytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.IUtf8Bytes} message Utf8Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Bytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Bytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Bytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Utf8Bytes message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Utf8Bytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Utf8Bytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes + */ + Utf8Bytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) + return object; + return new $root.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes(); + }; + + /** + * Creates a plain object from an Utf8Bytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes} message Utf8Bytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Utf8Bytes.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Utf8Bytes to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @instance + * @returns {Object.} JSON object + */ + Utf8Bytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Utf8Bytes + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Utf8Bytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes"; + }; + + return Utf8Bytes; + })(); + + return Encoding; + })(); + + return String; + })(); + + Type.Int64 = (function() { + + /** + * Properties of an Int64. + * @memberof google.bigtable.admin.v2.Type + * @interface IInt64 + * @property {google.bigtable.admin.v2.Type.Int64.IEncoding|null} [encoding] Int64 encoding + */ + + /** + * Constructs a new Int64. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents an Int64. + * @implements IInt64 + * @constructor + * @param {google.bigtable.admin.v2.Type.IInt64=} [properties] Properties to set + */ + function Int64(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64 encoding. + * @member {google.bigtable.admin.v2.Type.Int64.IEncoding|null|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Int64 + * @instance + */ + Int64.prototype.encoding = null; + + /** + * Creates a new Int64 instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {google.bigtable.admin.v2.Type.IInt64=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Int64} Int64 instance + */ + Int64.create = function create(properties) { + return new Int64(properties); + }; + + /** + * Encodes the specified Int64 message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {google.bigtable.admin.v2.Type.IInt64} message Int64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.admin.v2.Type.Int64.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Int64 message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {google.bigtable.admin.v2.Type.IInt64} message Int64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64 message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Int64} Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Int64(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.admin.v2.Type.Int64.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Int64} Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64 message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.admin.v2.Type.Int64.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates an Int64 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Int64} Int64 + */ + Int64.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Int64) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Int64(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Int64.encoding: object expected"); + message.encoding = $root.google.bigtable.admin.v2.Type.Int64.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from an Int64 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {google.bigtable.admin.v2.Type.Int64} message Int64 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.admin.v2.Type.Int64.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Int64 to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Int64 + * @instance + * @returns {Object.} JSON object + */ + Int64.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64 + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Int64 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Int64"; + }; + + Int64.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.admin.v2.Type.Int64 + * @interface IEncoding + * @property {google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes|null} [bigEndianBytes] Encoding bigEndianBytes + * @property {google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes|null} [orderedCodeBytes] Encoding orderedCodeBytes + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.admin.v2.Type.Int64 + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.admin.v2.Type.Int64.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding bigEndianBytes. + * @member {google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes|null|undefined} bigEndianBytes + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @instance + */ + Encoding.prototype.bigEndianBytes = null; + + /** + * Encoding orderedCodeBytes. + * @member {google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes|null|undefined} orderedCodeBytes + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @instance + */ + Encoding.prototype.orderedCodeBytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"bigEndianBytes"|"orderedCodeBytes"|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["bigEndianBytes", "orderedCodeBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Int64.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Int64.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigEndianBytes != null && Object.hasOwnProperty.call(message, "bigEndianBytes")) + $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.encode(message.bigEndianBytes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.orderedCodeBytes != null && Object.hasOwnProperty.call(message, "orderedCodeBytes")) + $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.encode(message.orderedCodeBytes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Int64.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Int64.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bigEndianBytes = $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.decode(reader, reader.uint32()); + break; + } + case 2: { + message.orderedCodeBytes = $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bigEndianBytes != null && message.hasOwnProperty("bigEndianBytes")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.verify(message.bigEndianBytes); + if (error) + return "bigEndianBytes." + error; + } + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.verify(message.orderedCodeBytes); + if (error) + return "orderedCodeBytes." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Int64.Encoding) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Int64.Encoding(); + if (object.bigEndianBytes != null) { + if (typeof object.bigEndianBytes !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Int64.Encoding.bigEndianBytes: object expected"); + message.bigEndianBytes = $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.fromObject(object.bigEndianBytes); + } + if (object.orderedCodeBytes != null) { + if (typeof object.orderedCodeBytes !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Int64.Encoding.orderedCodeBytes: object expected"); + message.orderedCodeBytes = $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.fromObject(object.orderedCodeBytes); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bigEndianBytes != null && message.hasOwnProperty("bigEndianBytes")) { + object.bigEndianBytes = $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.toObject(message.bigEndianBytes, options); + if (options.oneofs) + object.encoding = "bigEndianBytes"; + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + object.orderedCodeBytes = $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.toObject(message.orderedCodeBytes, options); + if (options.oneofs) + object.encoding = "orderedCodeBytes"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Int64.Encoding"; + }; + + Encoding.BigEndianBytes = (function() { + + /** + * Properties of a BigEndianBytes. + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @interface IBigEndianBytes + * @property {google.bigtable.admin.v2.Type.IBytes|null} [bytesType] BigEndianBytes bytesType + */ + + /** + * Constructs a new BigEndianBytes. + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @classdesc Represents a BigEndianBytes. + * @implements IBigEndianBytes + * @constructor + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes=} [properties] Properties to set + */ + function BigEndianBytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigEndianBytes bytesType. + * @member {google.bigtable.admin.v2.Type.IBytes|null|undefined} bytesType + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @instance + */ + BigEndianBytes.prototype.bytesType = null; + + /** + * Creates a new BigEndianBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes instance + */ + BigEndianBytes.create = function create(properties) { + return new BigEndianBytes(properties); + }; + + /** + * Encodes the specified BigEndianBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes} message BigEndianBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigEndianBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesType != null && Object.hasOwnProperty.call(message, "bytesType")) + $root.google.bigtable.admin.v2.Type.Bytes.encode(message.bytesType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BigEndianBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IBigEndianBytes} message BigEndianBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigEndianBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigEndianBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bytesType = $root.google.bigtable.admin.v2.Type.Bytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigEndianBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigEndianBytes message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigEndianBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) { + var error = $root.google.bigtable.admin.v2.Type.Bytes.verify(message.bytesType); + if (error) + return "bytesType." + error; + } + return null; + }; + + /** + * Creates a BigEndianBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes + */ + BigEndianBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes(); + if (object.bytesType != null) { + if (typeof object.bytesType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.bytesType: object expected"); + message.bytesType = $root.google.bigtable.admin.v2.Type.Bytes.fromObject(object.bytesType); + } + return message; + }; + + /** + * Creates a plain object from a BigEndianBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes} message BigEndianBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigEndianBytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.bytesType = null; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) + object.bytesType = $root.google.bigtable.admin.v2.Type.Bytes.toObject(message.bytesType, options); + return object; + }; + + /** + * Converts this BigEndianBytes to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @instance + * @returns {Object.} JSON object + */ + BigEndianBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigEndianBytes + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigEndianBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes"; + }; + + return BigEndianBytes; + })(); + + Encoding.OrderedCodeBytes = (function() { + + /** + * Properties of an OrderedCodeBytes. + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @interface IOrderedCodeBytes + */ + + /** + * Constructs a new OrderedCodeBytes. + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding + * @classdesc Represents an OrderedCodeBytes. + * @implements IOrderedCodeBytes + * @constructor + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes=} [properties] Properties to set + */ + function OrderedCodeBytes(properties) { + if (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 OrderedCodeBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes instance + */ + OrderedCodeBytes.create = function create(properties) { + return new OrderedCodeBytes(properties); + }; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrderedCodeBytes message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrderedCodeBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes + */ + OrderedCodeBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) + return object; + return new $root.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes(); + }; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes} message OrderedCodeBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrderedCodeBytes.toObject = function toObject() { + return {}; + }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @instance + * @returns {Object.} JSON object + */ + OrderedCodeBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrderedCodeBytes + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrderedCodeBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes"; + }; + + return OrderedCodeBytes; + })(); + + return Encoding; + })(); + + return Int64; + })(); + + Type.Bool = (function() { + + /** + * Properties of a Bool. + * @memberof google.bigtable.admin.v2.Type + * @interface IBool + */ + + /** + * Constructs a new Bool. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Bool. + * @implements IBool + * @constructor + * @param {google.bigtable.admin.v2.Type.IBool=} [properties] Properties to set + */ + function Bool(properties) { + if (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 Bool instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {google.bigtable.admin.v2.Type.IBool=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Bool} Bool instance + */ + Bool.create = function create(properties) { + return new Bool(properties); + }; + + /** + * Encodes the specified Bool message. Does not implicitly {@link google.bigtable.admin.v2.Type.Bool.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {google.bigtable.admin.v2.Type.IBool} message Bool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Bool message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Bool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {google.bigtable.admin.v2.Type.IBool} message Bool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bool message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Bool} Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Bool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Bool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Bool} Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bool message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Bool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Bool} Bool + */ + Bool.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Bool) + return object; + return new $root.google.bigtable.admin.v2.Type.Bool(); + }; + + /** + * Creates a plain object from a Bool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {google.bigtable.admin.v2.Type.Bool} message Bool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bool.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Bool to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Bool + * @instance + * @returns {Object.} JSON object + */ + Bool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bool + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Bool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Bool"; + }; + + return Bool; + })(); + + Type.Float32 = (function() { + + /** + * Properties of a Float32. + * @memberof google.bigtable.admin.v2.Type + * @interface IFloat32 + */ + + /** + * Constructs a new Float32. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Float32. + * @implements IFloat32 + * @constructor + * @param {google.bigtable.admin.v2.Type.IFloat32=} [properties] Properties to set + */ + function Float32(properties) { + if (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 Float32 instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {google.bigtable.admin.v2.Type.IFloat32=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Float32} Float32 instance + */ + Float32.create = function create(properties) { + return new Float32(properties); + }; + + /** + * Encodes the specified Float32 message. Does not implicitly {@link google.bigtable.admin.v2.Type.Float32.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {google.bigtable.admin.v2.Type.IFloat32} message Float32 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float32.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Float32 message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Float32.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {google.bigtable.admin.v2.Type.IFloat32} message Float32 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float32.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Float32 message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Float32} Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float32.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Float32(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Float32 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Float32} Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float32.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Float32 message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Float32.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Float32 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Float32} Float32 + */ + Float32.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Float32) + return object; + return new $root.google.bigtable.admin.v2.Type.Float32(); + }; + + /** + * Creates a plain object from a Float32 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {google.bigtable.admin.v2.Type.Float32} message Float32 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Float32.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Float32 to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Float32 + * @instance + * @returns {Object.} JSON object + */ + Float32.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Float32 + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Float32 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Float32.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Float32"; + }; + + return Float32; + })(); + + Type.Float64 = (function() { + + /** + * Properties of a Float64. + * @memberof google.bigtable.admin.v2.Type + * @interface IFloat64 + */ + + /** + * Constructs a new Float64. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Float64. + * @implements IFloat64 + * @constructor + * @param {google.bigtable.admin.v2.Type.IFloat64=} [properties] Properties to set + */ + function Float64(properties) { + if (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 Float64 instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {google.bigtable.admin.v2.Type.IFloat64=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Float64} Float64 instance + */ + Float64.create = function create(properties) { + return new Float64(properties); + }; + + /** + * Encodes the specified Float64 message. Does not implicitly {@link google.bigtable.admin.v2.Type.Float64.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {google.bigtable.admin.v2.Type.IFloat64} message Float64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float64.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Float64 message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Float64.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {google.bigtable.admin.v2.Type.IFloat64} message Float64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float64.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Float64 message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Float64} Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float64.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Float64(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Float64 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Float64} Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float64.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Float64 message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Float64.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Float64 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Float64} Float64 + */ + Float64.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Float64) + return object; + return new $root.google.bigtable.admin.v2.Type.Float64(); + }; + + /** + * Creates a plain object from a Float64 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {google.bigtable.admin.v2.Type.Float64} message Float64 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Float64.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Float64 to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Float64 + * @instance + * @returns {Object.} JSON object + */ + Float64.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Float64 + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Float64 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Float64.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Float64"; + }; + + return Float64; + })(); + + Type.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.bigtable.admin.v2.Type + * @interface ITimestamp + * @property {google.bigtable.admin.v2.Type.Timestamp.IEncoding|null} [encoding] Timestamp encoding + */ + + /** + * Constructs a new Timestamp. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.bigtable.admin.v2.Type.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 encoding. + * @member {google.bigtable.admin.v2.Type.Timestamp.IEncoding|null|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @instance + */ + Timestamp.prototype.encoding = null; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @static + * @param {google.bigtable.admin.v2.Type.ITimestamp=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.bigtable.admin.v2.Type.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @static + * @param {google.bigtable.admin.v2.Type.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.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.admin.v2.Type.Timestamp.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @static + * @param {google.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.admin.v2.Type.Timestamp.Encoding.decode(reader, reader.uint32()); + 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.bigtable.admin.v2.Type.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.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.bigtable.admin.v2.Type.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.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.admin.v2.Type.Timestamp.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Timestamp) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Timestamp(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Timestamp.encoding: object expected"); + message.encoding = $root.google.bigtable.admin.v2.Type.Timestamp.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @static + * @param {google.bigtable.admin.v2.Type.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) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.admin.v2.Type.Timestamp.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Timestamp"; + }; + + Timestamp.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @interface IEncoding + * @property {google.bigtable.admin.v2.Type.Int64.IEncoding|null} [unixMicrosInt64] Encoding unixMicrosInt64 + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.admin.v2.Type.Timestamp + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.admin.v2.Type.Timestamp.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding unixMicrosInt64. + * @member {google.bigtable.admin.v2.Type.Int64.IEncoding|null|undefined} unixMicrosInt64 + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @instance + */ + Encoding.prototype.unixMicrosInt64 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"unixMicrosInt64"|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["unixMicrosInt64"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Timestamp.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Timestamp.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Timestamp.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unixMicrosInt64 != null && Object.hasOwnProperty.call(message, "unixMicrosInt64")) + $root.google.bigtable.admin.v2.Type.Int64.Encoding.encode(message.unixMicrosInt64, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Timestamp.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Timestamp.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Timestamp.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.unixMicrosInt64 = $root.google.bigtable.admin.v2.Type.Int64.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Timestamp.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.unixMicrosInt64 != null && message.hasOwnProperty("unixMicrosInt64")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Int64.Encoding.verify(message.unixMicrosInt64); + if (error) + return "unixMicrosInt64." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Timestamp.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Timestamp.Encoding) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Timestamp.Encoding(); + if (object.unixMicrosInt64 != null) { + if (typeof object.unixMicrosInt64 !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Timestamp.Encoding.unixMicrosInt64: object expected"); + message.unixMicrosInt64 = $root.google.bigtable.admin.v2.Type.Int64.Encoding.fromObject(object.unixMicrosInt64); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Timestamp.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.unixMicrosInt64 != null && message.hasOwnProperty("unixMicrosInt64")) { + object.unixMicrosInt64 = $root.google.bigtable.admin.v2.Type.Int64.Encoding.toObject(message.unixMicrosInt64, options); + if (options.oneofs) + object.encoding = "unixMicrosInt64"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Timestamp.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Timestamp.Encoding"; + }; + + return Encoding; + })(); + + return Timestamp; + })(); + + Type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.bigtable.admin.v2.Type + * @interface IDate + */ + + /** + * Constructs a new Date. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.bigtable.admin.v2.Type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {google.bigtable.admin.v2.Type.IDate=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.bigtable.admin.v2.Type.Date.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {google.bigtable.admin.v2.Type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {google.bigtable.admin.v2.Type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Date) + return object; + return new $root.google.bigtable.admin.v2.Type.Date(); + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {google.bigtable.admin.v2.Type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Date"; + }; + + return Date; + })(); + + Type.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.bigtable.admin.v2.Type + * @interface IStruct + * @property {Array.|null} [fields] Struct fields + * @property {google.bigtable.admin.v2.Type.Struct.IEncoding|null} [encoding] Struct encoding + */ + + /** + * Constructs a new Struct. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.bigtable.admin.v2.Type.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Array.} fields + * @memberof google.bigtable.admin.v2.Type.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyArray; + + /** + * Struct encoding. + * @member {google.bigtable.admin.v2.Type.Struct.IEncoding|null|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Struct + * @instance + */ + Struct.prototype.encoding = null; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {google.bigtable.admin.v2.Type.IStruct=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {google.bigtable.admin.v2.Type.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.bigtable.admin.v2.Type.Struct.Field.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.admin.v2.Type.Struct.Encoding.encode(message.encoding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {google.bigtable.admin.v2.Type.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Struct(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.bigtable.admin.v2.Type.Struct.Field.decode(reader, reader.uint32())); + break; + } + case 2: { + message.encoding = $root.google.bigtable.admin.v2.Type.Struct.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.bigtable.admin.v2.Type.Struct.Field.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.admin.v2.Type.Struct.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Struct) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Struct(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.bigtable.admin.v2.Type.Struct.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Struct.fields: object expected"); + message.fields[i] = $root.google.bigtable.admin.v2.Type.Struct.Field.fromObject(object.fields[i]); + } + } + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Struct.encoding: object expected"); + message.encoding = $root.google.bigtable.admin.v2.Type.Struct.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {google.bigtable.admin.v2.Type.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) + object.encoding = null; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.bigtable.admin.v2.Type.Struct.Field.toObject(message.fields[j], options); + } + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.admin.v2.Type.Struct.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Struct"; + }; + + Struct.Field = (function() { + + /** + * Properties of a Field. + * @memberof google.bigtable.admin.v2.Type.Struct + * @interface IField + * @property {string|null} [fieldName] Field fieldName + * @property {google.bigtable.admin.v2.IType|null} [type] Field type + */ + + /** + * Constructs a new Field. + * @memberof google.bigtable.admin.v2.Type.Struct + * @classdesc Represents a Field. + * @implements IField + * @constructor + * @param {google.bigtable.admin.v2.Type.Struct.IField=} [properties] Properties to set + */ + function Field(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Field fieldName. + * @member {string} fieldName + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @instance + */ + Field.prototype.fieldName = ""; + + /** + * Field type. + * @member {google.bigtable.admin.v2.IType|null|undefined} type + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @instance + */ + Field.prototype.type = null; + + /** + * Creates a new Field instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {google.bigtable.admin.v2.Type.Struct.IField=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Struct.Field} Field instance + */ + Field.create = function create(properties) { + return new Field(properties); + }; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Field.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {google.bigtable.admin.v2.Type.Struct.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.bigtable.admin.v2.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Field.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {google.bigtable.admin.v2.Type.Struct.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Field message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Struct.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Struct.Field(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 2: { + message.type = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Struct.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Field message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Field.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.type); + if (error) + return "type." + error; + } + return null; + }; + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Struct.Field} Field + */ + Field.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Struct.Field) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Struct.Field(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Struct.Field.type: object expected"); + message.type = $root.google.bigtable.admin.v2.Type.fromObject(object.type); + } + return message; + }; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Field} message Field + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Field.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldName = ""; + object.type = null; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.bigtable.admin.v2.Type.toObject(message.type, options); + return object; + }; + + /** + * Converts this Field to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @instance + * @returns {Object.} JSON object + */ + Field.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Field + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Struct.Field + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Struct.Field"; + }; + + return Field; + })(); + + Struct.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.admin.v2.Type.Struct + * @interface IEncoding + * @property {google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton|null} [singleton] Encoding singleton + * @property {google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes|null} [delimitedBytes] Encoding delimitedBytes + * @property {google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes|null} [orderedCodeBytes] Encoding orderedCodeBytes + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.admin.v2.Type.Struct + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.admin.v2.Type.Struct.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding singleton. + * @member {google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton|null|undefined} singleton + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @instance + */ + Encoding.prototype.singleton = null; + + /** + * Encoding delimitedBytes. + * @member {google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes|null|undefined} delimitedBytes + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @instance + */ + Encoding.prototype.delimitedBytes = null; + + /** + * Encoding orderedCodeBytes. + * @member {google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes|null|undefined} orderedCodeBytes + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @instance + */ + Encoding.prototype.orderedCodeBytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"singleton"|"delimitedBytes"|"orderedCodeBytes"|undefined} encoding + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["singleton", "delimitedBytes", "orderedCodeBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Struct.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Struct.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.singleton != null && Object.hasOwnProperty.call(message, "singleton")) + $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.encode(message.singleton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.delimitedBytes != null && Object.hasOwnProperty.call(message, "delimitedBytes")) + $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.encode(message.delimitedBytes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.orderedCodeBytes != null && Object.hasOwnProperty.call(message, "orderedCodeBytes")) + $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.encode(message.orderedCodeBytes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Struct.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Struct.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.singleton = $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.decode(reader, reader.uint32()); + break; + } + case 2: { + message.delimitedBytes = $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.decode(reader, reader.uint32()); + break; + } + case 3: { + message.orderedCodeBytes = $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.singleton != null && message.hasOwnProperty("singleton")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.verify(message.singleton); + if (error) + return "singleton." + error; + } + } + if (message.delimitedBytes != null && message.hasOwnProperty("delimitedBytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.verify(message.delimitedBytes); + if (error) + return "delimitedBytes." + error; + } + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.verify(message.orderedCodeBytes); + if (error) + return "orderedCodeBytes." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Struct.Encoding) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Struct.Encoding(); + if (object.singleton != null) { + if (typeof object.singleton !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Struct.Encoding.singleton: object expected"); + message.singleton = $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.fromObject(object.singleton); + } + if (object.delimitedBytes != null) { + if (typeof object.delimitedBytes !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Struct.Encoding.delimitedBytes: object expected"); + message.delimitedBytes = $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.fromObject(object.delimitedBytes); + } + if (object.orderedCodeBytes != null) { + if (typeof object.orderedCodeBytes !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Struct.Encoding.orderedCodeBytes: object expected"); + message.orderedCodeBytes = $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.fromObject(object.orderedCodeBytes); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.singleton != null && message.hasOwnProperty("singleton")) { + object.singleton = $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.toObject(message.singleton, options); + if (options.oneofs) + object.encoding = "singleton"; + } + if (message.delimitedBytes != null && message.hasOwnProperty("delimitedBytes")) { + object.delimitedBytes = $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.toObject(message.delimitedBytes, options); + if (options.oneofs) + object.encoding = "delimitedBytes"; + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + object.orderedCodeBytes = $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.toObject(message.orderedCodeBytes, options); + if (options.oneofs) + object.encoding = "orderedCodeBytes"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Struct.Encoding"; + }; + + Encoding.Singleton = (function() { + + /** + * Properties of a Singleton. + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @interface ISingleton + */ + + /** + * Constructs a new Singleton. + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @classdesc Represents a Singleton. + * @implements ISingleton + * @constructor + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton=} [properties] Properties to set + */ + function Singleton(properties) { + if (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 Singleton instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.Singleton} Singleton instance + */ + Singleton.create = function create(properties) { + return new Singleton(properties); + }; + + /** + * Encodes the specified Singleton message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton} message Singleton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Singleton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Singleton message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.ISingleton} message Singleton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Singleton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Singleton message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.Singleton} Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Singleton.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Singleton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.Singleton} Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Singleton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Singleton message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Singleton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Singleton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.Singleton} Singleton + */ + Singleton.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) + return object; + return new $root.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton(); + }; + + /** + * Creates a plain object from a Singleton message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.Singleton} message Singleton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Singleton.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Singleton to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @instance + * @returns {Object.} JSON object + */ + Singleton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Singleton + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Singleton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Struct.Encoding.Singleton"; + }; + + return Singleton; + })(); + + Encoding.DelimitedBytes = (function() { + + /** + * Properties of a DelimitedBytes. + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @interface IDelimitedBytes + * @property {Uint8Array|null} [delimiter] DelimitedBytes delimiter + */ + + /** + * Constructs a new DelimitedBytes. + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @classdesc Represents a DelimitedBytes. + * @implements IDelimitedBytes + * @constructor + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes=} [properties] Properties to set + */ + function DelimitedBytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DelimitedBytes delimiter. + * @member {Uint8Array} delimiter + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @instance + */ + DelimitedBytes.prototype.delimiter = $util.newBuffer([]); + + /** + * Creates a new DelimitedBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes instance + */ + DelimitedBytes.create = function create(properties) { + return new DelimitedBytes(properties); + }; + + /** + * Encodes the specified DelimitedBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes} message DelimitedBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelimitedBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.delimiter); + return writer; + }; + + /** + * Encodes the specified DelimitedBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IDelimitedBytes} message DelimitedBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelimitedBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelimitedBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.delimiter = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelimitedBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DelimitedBytes message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DelimitedBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + if (!(message.delimiter && typeof message.delimiter.length === "number" || $util.isString(message.delimiter))) + return "delimiter: buffer expected"; + return null; + }; + + /** + * Creates a DelimitedBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes + */ + DelimitedBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes(); + if (object.delimiter != null) + if (typeof object.delimiter === "string") + $util.base64.decode(object.delimiter, message.delimiter = $util.newBuffer($util.base64.length(object.delimiter)), 0); + else if (object.delimiter.length >= 0) + message.delimiter = object.delimiter; + return message; + }; + + /** + * Creates a plain object from a DelimitedBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes} message DelimitedBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DelimitedBytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.delimiter = ""; + else { + object.delimiter = []; + if (options.bytes !== Array) + object.delimiter = $util.newBuffer(object.delimiter); + } + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + object.delimiter = options.bytes === String ? $util.base64.encode(message.delimiter, 0, message.delimiter.length) : options.bytes === Array ? Array.prototype.slice.call(message.delimiter) : message.delimiter; + return object; + }; + + /** + * Converts this DelimitedBytes to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @instance + * @returns {Object.} JSON object + */ + DelimitedBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DelimitedBytes + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DelimitedBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes"; + }; + + return DelimitedBytes; + })(); + + Encoding.OrderedCodeBytes = (function() { + + /** + * Properties of an OrderedCodeBytes. + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @interface IOrderedCodeBytes + */ + + /** + * Constructs a new OrderedCodeBytes. + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding + * @classdesc Represents an OrderedCodeBytes. + * @implements IOrderedCodeBytes + * @constructor + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes=} [properties] Properties to set + */ + function OrderedCodeBytes(properties) { + if (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 OrderedCodeBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes instance + */ + OrderedCodeBytes.create = function create(properties) { + return new OrderedCodeBytes(properties); + }; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrderedCodeBytes message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrderedCodeBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes + */ + OrderedCodeBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) + return object; + return new $root.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes(); + }; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes} message OrderedCodeBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrderedCodeBytes.toObject = function toObject() { + return {}; + }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @instance + * @returns {Object.} JSON object + */ + OrderedCodeBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrderedCodeBytes + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrderedCodeBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes"; + }; + + return OrderedCodeBytes; + })(); + + return Encoding; + })(); + + return Struct; + })(); + + Type.Proto = (function() { + + /** + * Properties of a Proto. + * @memberof google.bigtable.admin.v2.Type + * @interface IProto + * @property {string|null} [schemaBundleId] Proto schemaBundleId + * @property {string|null} [messageName] Proto messageName + */ + + /** + * Constructs a new Proto. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Proto. + * @implements IProto + * @constructor + * @param {google.bigtable.admin.v2.Type.IProto=} [properties] Properties to set + */ + function Proto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proto schemaBundleId. + * @member {string} schemaBundleId + * @memberof google.bigtable.admin.v2.Type.Proto + * @instance + */ + Proto.prototype.schemaBundleId = ""; + + /** + * Proto messageName. + * @member {string} messageName + * @memberof google.bigtable.admin.v2.Type.Proto + * @instance + */ + Proto.prototype.messageName = ""; + + /** + * Creates a new Proto instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {google.bigtable.admin.v2.Type.IProto=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Proto} Proto instance + */ + Proto.create = function create(properties) { + return new Proto(properties); + }; + + /** + * Encodes the specified Proto message. Does not implicitly {@link google.bigtable.admin.v2.Type.Proto.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {google.bigtable.admin.v2.Type.IProto} message Proto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schemaBundleId); + if (message.messageName != null && Object.hasOwnProperty.call(message, "messageName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.messageName); + return writer; + }; + + /** + * Encodes the specified Proto message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Proto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {google.bigtable.admin.v2.Type.IProto} message Proto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proto message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Proto} Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Proto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schemaBundleId = reader.string(); + break; + } + case 2: { + message.messageName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Proto} Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proto message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + if (!$util.isString(message.schemaBundleId)) + return "schemaBundleId: string expected"; + if (message.messageName != null && message.hasOwnProperty("messageName")) + if (!$util.isString(message.messageName)) + return "messageName: string expected"; + return null; + }; + + /** + * Creates a Proto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Proto} Proto + */ + Proto.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Proto) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Proto(); + if (object.schemaBundleId != null) + message.schemaBundleId = String(object.schemaBundleId); + if (object.messageName != null) + message.messageName = String(object.messageName); + return message; + }; + + /** + * Creates a plain object from a Proto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {google.bigtable.admin.v2.Type.Proto} message Proto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schemaBundleId = ""; + object.messageName = ""; + } + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + object.schemaBundleId = message.schemaBundleId; + if (message.messageName != null && message.hasOwnProperty("messageName")) + object.messageName = message.messageName; + return object; + }; + + /** + * Converts this Proto to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Proto + * @instance + * @returns {Object.} JSON object + */ + Proto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Proto + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Proto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Proto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Proto"; + }; + + return Proto; + })(); + + Type.Enum = (function() { + + /** + * Properties of an Enum. + * @memberof google.bigtable.admin.v2.Type + * @interface IEnum + * @property {string|null} [schemaBundleId] Enum schemaBundleId + * @property {string|null} [enumName] Enum enumName + */ + + /** + * Constructs a new Enum. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents an Enum. + * @implements IEnum + * @constructor + * @param {google.bigtable.admin.v2.Type.IEnum=} [properties] Properties to set + */ + function Enum(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Enum schemaBundleId. + * @member {string} schemaBundleId + * @memberof google.bigtable.admin.v2.Type.Enum + * @instance + */ + Enum.prototype.schemaBundleId = ""; + + /** + * Enum enumName. + * @member {string} enumName + * @memberof google.bigtable.admin.v2.Type.Enum + * @instance + */ + Enum.prototype.enumName = ""; + + /** + * Creates a new Enum instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {google.bigtable.admin.v2.Type.IEnum=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Enum} Enum instance + */ + Enum.create = function create(properties) { + return new Enum(properties); + }; + + /** + * Encodes the specified Enum message. Does not implicitly {@link google.bigtable.admin.v2.Type.Enum.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {google.bigtable.admin.v2.Type.IEnum} message Enum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Enum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schemaBundleId); + if (message.enumName != null && Object.hasOwnProperty.call(message, "enumName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.enumName); + return writer; + }; + + /** + * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Enum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {google.bigtable.admin.v2.Type.IEnum} message Enum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Enum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Enum message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Enum} Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Enum.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Enum(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schemaBundleId = reader.string(); + break; + } + case 2: { + message.enumName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Enum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Enum} Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Enum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Enum message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Enum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + if (!$util.isString(message.schemaBundleId)) + return "schemaBundleId: string expected"; + if (message.enumName != null && message.hasOwnProperty("enumName")) + if (!$util.isString(message.enumName)) + return "enumName: string expected"; + return null; + }; + + /** + * Creates an Enum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Enum} Enum + */ + Enum.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Enum) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Enum(); + if (object.schemaBundleId != null) + message.schemaBundleId = String(object.schemaBundleId); + if (object.enumName != null) + message.enumName = String(object.enumName); + return message; + }; + + /** + * Creates a plain object from an Enum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {google.bigtable.admin.v2.Type.Enum} message Enum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Enum.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schemaBundleId = ""; + object.enumName = ""; + } + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + object.schemaBundleId = message.schemaBundleId; + if (message.enumName != null && message.hasOwnProperty("enumName")) + object.enumName = message.enumName; + return object; + }; + + /** + * Converts this Enum to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Enum + * @instance + * @returns {Object.} JSON object + */ + Enum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Enum + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Enum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Enum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Enum"; + }; + + return Enum; + })(); + + Type.Array = (function() { + + /** + * Properties of an Array. + * @memberof google.bigtable.admin.v2.Type + * @interface IArray + * @property {google.bigtable.admin.v2.IType|null} [elementType] Array elementType + */ + + /** + * Constructs a new Array. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents an Array. + * @implements IArray + * @constructor + * @param {google.bigtable.admin.v2.Type.IArray=} [properties] Properties to set + */ + function Array(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Array elementType. + * @member {google.bigtable.admin.v2.IType|null|undefined} elementType + * @memberof google.bigtable.admin.v2.Type.Array + * @instance + */ + Array.prototype.elementType = null; + + /** + * Creates a new Array instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {google.bigtable.admin.v2.Type.IArray=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Array} Array instance + */ + Array.create = function create(properties) { + return new Array(properties); + }; + + /** + * Encodes the specified Array message. Does not implicitly {@link google.bigtable.admin.v2.Type.Array.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {google.bigtable.admin.v2.Type.IArray} message Array message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Array.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.elementType != null && Object.hasOwnProperty.call(message, "elementType")) + $root.google.bigtable.admin.v2.Type.encode(message.elementType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Array message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Array.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {google.bigtable.admin.v2.Type.IArray} message Array message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Array.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Array message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Array} Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Array.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Array(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.elementType = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Array message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Array} Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Array.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Array message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Array.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.elementType != null && message.hasOwnProperty("elementType")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.elementType); + if (error) + return "elementType." + error; + } + return null; + }; + + /** + * Creates an Array message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Array} Array + */ + Array.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Array) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Array(); + if (object.elementType != null) { + if (typeof object.elementType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Array.elementType: object expected"); + message.elementType = $root.google.bigtable.admin.v2.Type.fromObject(object.elementType); + } + return message; + }; + + /** + * Creates a plain object from an Array message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {google.bigtable.admin.v2.Type.Array} message Array + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Array.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.elementType = null; + if (message.elementType != null && message.hasOwnProperty("elementType")) + object.elementType = $root.google.bigtable.admin.v2.Type.toObject(message.elementType, options); + return object; + }; + + /** + * Converts this Array to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Array + * @instance + * @returns {Object.} JSON object + */ + Array.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Array + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Array + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Array.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Array"; + }; + + return Array; + })(); + + Type.Map = (function() { + + /** + * Properties of a Map. + * @memberof google.bigtable.admin.v2.Type + * @interface IMap + * @property {google.bigtable.admin.v2.IType|null} [keyType] Map keyType + * @property {google.bigtable.admin.v2.IType|null} [valueType] Map valueType + */ + + /** + * Constructs a new Map. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents a Map. + * @implements IMap + * @constructor + * @param {google.bigtable.admin.v2.Type.IMap=} [properties] Properties to set + */ + function Map(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Map keyType. + * @member {google.bigtable.admin.v2.IType|null|undefined} keyType + * @memberof google.bigtable.admin.v2.Type.Map + * @instance + */ + Map.prototype.keyType = null; + + /** + * Map valueType. + * @member {google.bigtable.admin.v2.IType|null|undefined} valueType + * @memberof google.bigtable.admin.v2.Type.Map + * @instance + */ + Map.prototype.valueType = null; + + /** + * Creates a new Map instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {google.bigtable.admin.v2.Type.IMap=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Map} Map instance + */ + Map.create = function create(properties) { + return new Map(properties); + }; + + /** + * Encodes the specified Map message. Does not implicitly {@link google.bigtable.admin.v2.Type.Map.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {google.bigtable.admin.v2.Type.IMap} message Map message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Map.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyType != null && Object.hasOwnProperty.call(message, "keyType")) + $root.google.bigtable.admin.v2.Type.encode(message.keyType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + $root.google.bigtable.admin.v2.Type.encode(message.valueType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Map message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Map.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {google.bigtable.admin.v2.Type.IMap} message Map message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Map.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Map message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Map} Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Map.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Map(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyType = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + case 2: { + message.valueType = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Map message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Map} Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Map.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Map message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Map.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyType != null && message.hasOwnProperty("keyType")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.keyType); + if (error) + return "keyType." + error; + } + if (message.valueType != null && message.hasOwnProperty("valueType")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.valueType); + if (error) + return "valueType." + error; + } + return null; + }; + + /** + * Creates a Map message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Map} Map + */ + Map.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Map) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Map(); + if (object.keyType != null) { + if (typeof object.keyType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Map.keyType: object expected"); + message.keyType = $root.google.bigtable.admin.v2.Type.fromObject(object.keyType); + } + if (object.valueType != null) { + if (typeof object.valueType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Map.valueType: object expected"); + message.valueType = $root.google.bigtable.admin.v2.Type.fromObject(object.valueType); + } + return message; + }; + + /** + * Creates a plain object from a Map message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {google.bigtable.admin.v2.Type.Map} message Map + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Map.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyType = null; + object.valueType = null; + } + if (message.keyType != null && message.hasOwnProperty("keyType")) + object.keyType = $root.google.bigtable.admin.v2.Type.toObject(message.keyType, options); + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = $root.google.bigtable.admin.v2.Type.toObject(message.valueType, options); + return object; + }; + + /** + * Converts this Map to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Map + * @instance + * @returns {Object.} JSON object + */ + Map.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Map + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Map + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Map.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Map"; + }; + + return Map; + })(); + + Type.Aggregate = (function() { + + /** + * Properties of an Aggregate. + * @memberof google.bigtable.admin.v2.Type + * @interface IAggregate + * @property {google.bigtable.admin.v2.IType|null} [inputType] Aggregate inputType + * @property {google.bigtable.admin.v2.IType|null} [stateType] Aggregate stateType + * @property {google.bigtable.admin.v2.Type.Aggregate.ISum|null} [sum] Aggregate sum + * @property {google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null} [hllppUniqueCount] Aggregate hllppUniqueCount + * @property {google.bigtable.admin.v2.Type.Aggregate.IMax|null} [max] Aggregate max + * @property {google.bigtable.admin.v2.Type.Aggregate.IMin|null} [min] Aggregate min + */ + + /** + * Constructs a new Aggregate. + * @memberof google.bigtable.admin.v2.Type + * @classdesc Represents an Aggregate. + * @implements IAggregate + * @constructor + * @param {google.bigtable.admin.v2.Type.IAggregate=} [properties] Properties to set + */ + function Aggregate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Aggregate inputType. + * @member {google.bigtable.admin.v2.IType|null|undefined} inputType + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.inputType = null; + + /** + * Aggregate stateType. + * @member {google.bigtable.admin.v2.IType|null|undefined} stateType + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.stateType = null; + + /** + * Aggregate sum. + * @member {google.bigtable.admin.v2.Type.Aggregate.ISum|null|undefined} sum + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.sum = null; + + /** + * Aggregate hllppUniqueCount. + * @member {google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null|undefined} hllppUniqueCount + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.hllppUniqueCount = null; + + /** + * Aggregate max. + * @member {google.bigtable.admin.v2.Type.Aggregate.IMax|null|undefined} max + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.max = null; + + /** + * Aggregate min. + * @member {google.bigtable.admin.v2.Type.Aggregate.IMin|null|undefined} min + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.min = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Aggregate aggregator. + * @member {"sum"|"hllppUniqueCount"|"max"|"min"|undefined} aggregator + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + */ + Object.defineProperty(Aggregate.prototype, "aggregator", { + get: $util.oneOfGetter($oneOfFields = ["sum", "hllppUniqueCount", "max", "min"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Aggregate instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {google.bigtable.admin.v2.Type.IAggregate=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Aggregate} Aggregate instance + */ + Aggregate.create = function create(properties) { + return new Aggregate(properties); + }; + + /** + * Encodes the specified Aggregate message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {google.bigtable.admin.v2.Type.IAggregate} message Aggregate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + $root.google.bigtable.admin.v2.Type.encode(message.inputType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateType != null && Object.hasOwnProperty.call(message, "stateType")) + $root.google.bigtable.admin.v2.Type.encode(message.stateType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + $root.google.bigtable.admin.v2.Type.Aggregate.Sum.encode(message.sum, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hllppUniqueCount != null && Object.hasOwnProperty.call(message, "hllppUniqueCount")) + $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.encode(message.hllppUniqueCount, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + $root.google.bigtable.admin.v2.Type.Aggregate.Max.encode(message.max, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + $root.google.bigtable.admin.v2.Type.Aggregate.Min.encode(message.min, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Aggregate message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {google.bigtable.admin.v2.Type.IAggregate} message Aggregate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Aggregate message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Aggregate} Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Aggregate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputType = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stateType = $root.google.bigtable.admin.v2.Type.decode(reader, reader.uint32()); + break; + } + case 4: { + message.sum = $root.google.bigtable.admin.v2.Type.Aggregate.Sum.decode(reader, reader.uint32()); + break; + } + case 5: { + message.hllppUniqueCount = $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.decode(reader, reader.uint32()); + break; + } + case 6: { + message.max = $root.google.bigtable.admin.v2.Type.Aggregate.Max.decode(reader, reader.uint32()); + break; + } + case 7: { + message.min = $root.google.bigtable.admin.v2.Type.Aggregate.Min.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Aggregate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Aggregate} Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Aggregate message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Aggregate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inputType != null && message.hasOwnProperty("inputType")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.inputType); + if (error) + return "inputType." + error; + } + if (message.stateType != null && message.hasOwnProperty("stateType")) { + var error = $root.google.bigtable.admin.v2.Type.verify(message.stateType); + if (error) + return "stateType." + error; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + properties.aggregator = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Aggregate.Sum.verify(message.sum); + if (error) + return "sum." + error; + } + } + if (message.hllppUniqueCount != null && message.hasOwnProperty("hllppUniqueCount")) { + if (properties.aggregator === 1) + return "aggregator: multiple values"; + properties.aggregator = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify(message.hllppUniqueCount); + if (error) + return "hllppUniqueCount." + error; + } + } + if (message.max != null && message.hasOwnProperty("max")) { + if (properties.aggregator === 1) + return "aggregator: multiple values"; + properties.aggregator = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Aggregate.Max.verify(message.max); + if (error) + return "max." + error; + } + } + if (message.min != null && message.hasOwnProperty("min")) { + if (properties.aggregator === 1) + return "aggregator: multiple values"; + properties.aggregator = 1; + { + var error = $root.google.bigtable.admin.v2.Type.Aggregate.Min.verify(message.min); + if (error) + return "min." + error; + } + } + return null; + }; + + /** + * Creates an Aggregate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Aggregate} Aggregate + */ + Aggregate.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Aggregate) + return object; + var message = new $root.google.bigtable.admin.v2.Type.Aggregate(); + if (object.inputType != null) { + if (typeof object.inputType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Aggregate.inputType: object expected"); + message.inputType = $root.google.bigtable.admin.v2.Type.fromObject(object.inputType); + } + if (object.stateType != null) { + if (typeof object.stateType !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Aggregate.stateType: object expected"); + message.stateType = $root.google.bigtable.admin.v2.Type.fromObject(object.stateType); + } + if (object.sum != null) { + if (typeof object.sum !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Aggregate.sum: object expected"); + message.sum = $root.google.bigtable.admin.v2.Type.Aggregate.Sum.fromObject(object.sum); + } + if (object.hllppUniqueCount != null) { + if (typeof object.hllppUniqueCount !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Aggregate.hllppUniqueCount: object expected"); + message.hllppUniqueCount = $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.fromObject(object.hllppUniqueCount); + } + if (object.max != null) { + if (typeof object.max !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Aggregate.max: object expected"); + message.max = $root.google.bigtable.admin.v2.Type.Aggregate.Max.fromObject(object.max); + } + if (object.min != null) { + if (typeof object.min !== "object") + throw TypeError(".google.bigtable.admin.v2.Type.Aggregate.min: object expected"); + message.min = $root.google.bigtable.admin.v2.Type.Aggregate.Min.fromObject(object.min); + } + return message; + }; + + /** + * Creates a plain object from an Aggregate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate} message Aggregate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Aggregate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputType = null; + object.stateType = null; + } + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = $root.google.bigtable.admin.v2.Type.toObject(message.inputType, options); + if (message.stateType != null && message.hasOwnProperty("stateType")) + object.stateType = $root.google.bigtable.admin.v2.Type.toObject(message.stateType, options); + if (message.sum != null && message.hasOwnProperty("sum")) { + object.sum = $root.google.bigtable.admin.v2.Type.Aggregate.Sum.toObject(message.sum, options); + if (options.oneofs) + object.aggregator = "sum"; + } + if (message.hllppUniqueCount != null && message.hasOwnProperty("hllppUniqueCount")) { + object.hllppUniqueCount = $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.toObject(message.hllppUniqueCount, options); + if (options.oneofs) + object.aggregator = "hllppUniqueCount"; + } + if (message.max != null && message.hasOwnProperty("max")) { + object.max = $root.google.bigtable.admin.v2.Type.Aggregate.Max.toObject(message.max, options); + if (options.oneofs) + object.aggregator = "max"; + } + if (message.min != null && message.hasOwnProperty("min")) { + object.min = $root.google.bigtable.admin.v2.Type.Aggregate.Min.toObject(message.min, options); + if (options.oneofs) + object.aggregator = "min"; + } + return object; + }; + + /** + * Converts this Aggregate to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @instance + * @returns {Object.} JSON object + */ + Aggregate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Aggregate + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Aggregate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Aggregate"; + }; + + Aggregate.Sum = (function() { + + /** + * Properties of a Sum. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @interface ISum + */ + + /** + * Constructs a new Sum. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @classdesc Represents a Sum. + * @implements ISum + * @constructor + * @param {google.bigtable.admin.v2.Type.Aggregate.ISum=} [properties] Properties to set + */ + function Sum(properties) { + if (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 Sum instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.ISum=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Aggregate.Sum} Sum instance + */ + Sum.create = function create(properties) { + return new Sum(properties); + }; + + /** + * Encodes the specified Sum message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Sum.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Sum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sum message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Aggregate.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Aggregate.Sum(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Aggregate.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sum message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Aggregate.Sum} Sum + */ + Sum.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Aggregate.Sum) + return object; + return new $root.google.bigtable.admin.v2.Type.Aggregate.Sum(); + }; + + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.Sum} message Sum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sum.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Sum to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @instance + * @returns {Object.} JSON object + */ + Sum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Sum + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Aggregate.Sum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Aggregate.Sum"; + }; + + return Sum; + })(); + + Aggregate.Max = (function() { + + /** + * Properties of a Max. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @interface IMax + */ + + /** + * Constructs a new Max. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @classdesc Represents a Max. + * @implements IMax + * @constructor + * @param {google.bigtable.admin.v2.Type.Aggregate.IMax=} [properties] Properties to set + */ + function Max(properties) { + if (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 Max instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IMax=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Aggregate.Max} Max instance + */ + Max.create = function create(properties) { + return new Max(properties); + }; + + /** + * Encodes the specified Max message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Max.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IMax} message Max message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Max.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Max message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Max.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IMax} message Max message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Max.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Max message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Aggregate.Max} Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Max.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Aggregate.Max(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Max message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Aggregate.Max} Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Max.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Max message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Max.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Max message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Aggregate.Max} Max + */ + Max.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Aggregate.Max) + return object; + return new $root.google.bigtable.admin.v2.Type.Aggregate.Max(); + }; + + /** + * Creates a plain object from a Max message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.Max} message Max + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Max.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Max to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @instance + * @returns {Object.} JSON object + */ + Max.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Max + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Aggregate.Max + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Max.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Aggregate.Max"; + }; + + return Max; + })(); + + Aggregate.Min = (function() { + + /** + * Properties of a Min. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @interface IMin + */ + + /** + * Constructs a new Min. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @classdesc Represents a Min. + * @implements IMin + * @constructor + * @param {google.bigtable.admin.v2.Type.Aggregate.IMin=} [properties] Properties to set + */ + function Min(properties) { + if (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 Min instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IMin=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Aggregate.Min} Min instance + */ + Min.create = function create(properties) { + return new Min(properties); + }; + + /** + * Encodes the specified Min message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Min.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IMin} message Min message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Min.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Min message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.Min.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IMin} message Min message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Min.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Min message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Aggregate.Min} Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Min.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Aggregate.Min(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Min message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Aggregate.Min} Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Min.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Min message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Min.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Min message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Aggregate.Min} Min + */ + Min.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Aggregate.Min) + return object; + return new $root.google.bigtable.admin.v2.Type.Aggregate.Min(); + }; + + /** + * Creates a plain object from a Min message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.Min} message Min + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Min.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Min to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @instance + * @returns {Object.} JSON object + */ + Min.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Min + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Aggregate.Min + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Min.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Aggregate.Min"; + }; + + return Min; + })(); + + Aggregate.HyperLogLogPlusPlusUniqueCount = (function() { + + /** + * Properties of a HyperLogLogPlusPlusUniqueCount. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @interface IHyperLogLogPlusPlusUniqueCount + */ + + /** + * Constructs a new HyperLogLogPlusPlusUniqueCount. + * @memberof google.bigtable.admin.v2.Type.Aggregate + * @classdesc Represents a HyperLogLogPlusPlusUniqueCount. + * @implements IHyperLogLogPlusPlusUniqueCount + * @constructor + * @param {google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount=} [properties] Properties to set + */ + function HyperLogLogPlusPlusUniqueCount(properties) { + if (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 HyperLogLogPlusPlusUniqueCount instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount instance + */ + HyperLogLogPlusPlusUniqueCount.create = function create(properties) { + return new HyperLogLogPlusPlusUniqueCount(properties); + }; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount} message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HyperLogLogPlusPlusUniqueCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount} message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HyperLogLogPlusPlusUniqueCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HyperLogLogPlusPlusUniqueCount.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HyperLogLogPlusPlusUniqueCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HyperLogLogPlusPlusUniqueCount message. + * @function verify + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HyperLogLogPlusPlusUniqueCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a HyperLogLogPlusPlusUniqueCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount + */ + HyperLogLogPlusPlusUniqueCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + return object; + return new $root.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount(); + }; + + /** + * Creates a plain object from a HyperLogLogPlusPlusUniqueCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} message HyperLogLogPlusPlusUniqueCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HyperLogLogPlusPlusUniqueCount.toObject = function toObject() { + return {}; + }; + + /** + * Converts this HyperLogLogPlusPlusUniqueCount to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @instance + * @returns {Object.} JSON object + */ + HyperLogLogPlusPlusUniqueCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HyperLogLogPlusPlusUniqueCount + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HyperLogLogPlusPlusUniqueCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount"; + }; + + return HyperLogLogPlusPlusUniqueCount; + })(); + + return Aggregate; + })(); + + return Type; + })(); + + return v2; + })(); + + return admin; + })(); + + bigtable.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.bigtable + * @namespace + */ + var v2 = {}; + + v2.Bigtable = (function() { + + /** + * Constructs a new Bigtable service. + * @memberof google.bigtable.v2 + * @classdesc Represents a Bigtable + * @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 Bigtable(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Bigtable.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Bigtable; + + /** + * Creates new Bigtable service using the specified rpc implementation. + * @function create + * @memberof google.bigtable.v2.Bigtable + * @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 {Bigtable} RPC service. Useful where requests and/or responses are streamed. + */ + Bigtable.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|readRows}. + * @memberof google.bigtable.v2.Bigtable + * @typedef ReadRowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.ReadRowsResponse} [response] ReadRowsResponse + */ + + /** + * Calls ReadRows. + * @function readRows + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IReadRowsRequest} request ReadRowsRequest message or plain object + * @param {google.bigtable.v2.Bigtable.ReadRowsCallback} callback Node-style callback called with the error, if any, and ReadRowsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.readRows = function readRows(request, callback) { + return this.rpcCall(readRows, $root.google.bigtable.v2.ReadRowsRequest, $root.google.bigtable.v2.ReadRowsResponse, request, callback); + }, "name", { value: "ReadRows" }); + + /** + * Calls ReadRows. + * @function readRows + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IReadRowsRequest} request ReadRowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|sampleRowKeys}. + * @memberof google.bigtable.v2.Bigtable + * @typedef SampleRowKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.SampleRowKeysResponse} [response] SampleRowKeysResponse + */ + + /** + * Calls SampleRowKeys. + * @function sampleRowKeys + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.ISampleRowKeysRequest} request SampleRowKeysRequest message or plain object + * @param {google.bigtable.v2.Bigtable.SampleRowKeysCallback} callback Node-style callback called with the error, if any, and SampleRowKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.sampleRowKeys = function sampleRowKeys(request, callback) { + return this.rpcCall(sampleRowKeys, $root.google.bigtable.v2.SampleRowKeysRequest, $root.google.bigtable.v2.SampleRowKeysResponse, request, callback); + }, "name", { value: "SampleRowKeys" }); + + /** + * Calls SampleRowKeys. + * @function sampleRowKeys + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.ISampleRowKeysRequest} request SampleRowKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|mutateRow}. + * @memberof google.bigtable.v2.Bigtable + * @typedef MutateRowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.MutateRowResponse} [response] MutateRowResponse + */ + + /** + * Calls MutateRow. + * @function mutateRow + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IMutateRowRequest} request MutateRowRequest message or plain object + * @param {google.bigtable.v2.Bigtable.MutateRowCallback} callback Node-style callback called with the error, if any, and MutateRowResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.mutateRow = function mutateRow(request, callback) { + return this.rpcCall(mutateRow, $root.google.bigtable.v2.MutateRowRequest, $root.google.bigtable.v2.MutateRowResponse, request, callback); + }, "name", { value: "MutateRow" }); + + /** + * Calls MutateRow. + * @function mutateRow + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IMutateRowRequest} request MutateRowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|mutateRows}. + * @memberof google.bigtable.v2.Bigtable + * @typedef MutateRowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.MutateRowsResponse} [response] MutateRowsResponse + */ + + /** + * Calls MutateRows. + * @function mutateRows + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IMutateRowsRequest} request MutateRowsRequest message or plain object + * @param {google.bigtable.v2.Bigtable.MutateRowsCallback} callback Node-style callback called with the error, if any, and MutateRowsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.mutateRows = function mutateRows(request, callback) { + return this.rpcCall(mutateRows, $root.google.bigtable.v2.MutateRowsRequest, $root.google.bigtable.v2.MutateRowsResponse, request, callback); + }, "name", { value: "MutateRows" }); + + /** + * Calls MutateRows. + * @function mutateRows + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IMutateRowsRequest} request MutateRowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|checkAndMutateRow}. + * @memberof google.bigtable.v2.Bigtable + * @typedef CheckAndMutateRowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.CheckAndMutateRowResponse} [response] CheckAndMutateRowResponse + */ + + /** + * Calls CheckAndMutateRow. + * @function checkAndMutateRow + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.ICheckAndMutateRowRequest} request CheckAndMutateRowRequest message or plain object + * @param {google.bigtable.v2.Bigtable.CheckAndMutateRowCallback} callback Node-style callback called with the error, if any, and CheckAndMutateRowResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.checkAndMutateRow = function checkAndMutateRow(request, callback) { + return this.rpcCall(checkAndMutateRow, $root.google.bigtable.v2.CheckAndMutateRowRequest, $root.google.bigtable.v2.CheckAndMutateRowResponse, request, callback); + }, "name", { value: "CheckAndMutateRow" }); + + /** + * Calls CheckAndMutateRow. + * @function checkAndMutateRow + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.ICheckAndMutateRowRequest} request CheckAndMutateRowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|pingAndWarm}. + * @memberof google.bigtable.v2.Bigtable + * @typedef PingAndWarmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.PingAndWarmResponse} [response] PingAndWarmResponse + */ + + /** + * Calls PingAndWarm. + * @function pingAndWarm + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IPingAndWarmRequest} request PingAndWarmRequest message or plain object + * @param {google.bigtable.v2.Bigtable.PingAndWarmCallback} callback Node-style callback called with the error, if any, and PingAndWarmResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.pingAndWarm = function pingAndWarm(request, callback) { + return this.rpcCall(pingAndWarm, $root.google.bigtable.v2.PingAndWarmRequest, $root.google.bigtable.v2.PingAndWarmResponse, request, callback); + }, "name", { value: "PingAndWarm" }); + + /** + * Calls PingAndWarm. + * @function pingAndWarm + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IPingAndWarmRequest} request PingAndWarmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|readModifyWriteRow}. + * @memberof google.bigtable.v2.Bigtable + * @typedef ReadModifyWriteRowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.ReadModifyWriteRowResponse} [response] ReadModifyWriteRowResponse + */ + + /** + * Calls ReadModifyWriteRow. + * @function readModifyWriteRow + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IReadModifyWriteRowRequest} request ReadModifyWriteRowRequest message or plain object + * @param {google.bigtable.v2.Bigtable.ReadModifyWriteRowCallback} callback Node-style callback called with the error, if any, and ReadModifyWriteRowResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.readModifyWriteRow = function readModifyWriteRow(request, callback) { + return this.rpcCall(readModifyWriteRow, $root.google.bigtable.v2.ReadModifyWriteRowRequest, $root.google.bigtable.v2.ReadModifyWriteRowResponse, request, callback); + }, "name", { value: "ReadModifyWriteRow" }); + + /** + * Calls ReadModifyWriteRow. + * @function readModifyWriteRow + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IReadModifyWriteRowRequest} request ReadModifyWriteRowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|generateInitialChangeStreamPartitions}. + * @memberof google.bigtable.v2.Bigtable + * @typedef GenerateInitialChangeStreamPartitionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} [response] GenerateInitialChangeStreamPartitionsResponse + */ + + /** + * Calls GenerateInitialChangeStreamPartitions. + * @function generateInitialChangeStreamPartitions + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest} request GenerateInitialChangeStreamPartitionsRequest message or plain object + * @param {google.bigtable.v2.Bigtable.GenerateInitialChangeStreamPartitionsCallback} callback Node-style callback called with the error, if any, and GenerateInitialChangeStreamPartitionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.generateInitialChangeStreamPartitions = function generateInitialChangeStreamPartitions(request, callback) { + return this.rpcCall(generateInitialChangeStreamPartitions, $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest, $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse, request, callback); + }, "name", { value: "GenerateInitialChangeStreamPartitions" }); + + /** + * Calls GenerateInitialChangeStreamPartitions. + * @function generateInitialChangeStreamPartitions + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest} request GenerateInitialChangeStreamPartitionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|readChangeStream}. + * @memberof google.bigtable.v2.Bigtable + * @typedef ReadChangeStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.ReadChangeStreamResponse} [response] ReadChangeStreamResponse + */ + + /** + * Calls ReadChangeStream. + * @function readChangeStream + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IReadChangeStreamRequest} request ReadChangeStreamRequest message or plain object + * @param {google.bigtable.v2.Bigtable.ReadChangeStreamCallback} callback Node-style callback called with the error, if any, and ReadChangeStreamResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.readChangeStream = function readChangeStream(request, callback) { + return this.rpcCall(readChangeStream, $root.google.bigtable.v2.ReadChangeStreamRequest, $root.google.bigtable.v2.ReadChangeStreamResponse, request, callback); + }, "name", { value: "ReadChangeStream" }); + + /** + * Calls ReadChangeStream. + * @function readChangeStream + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IReadChangeStreamRequest} request ReadChangeStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|prepareQuery}. + * @memberof google.bigtable.v2.Bigtable + * @typedef PrepareQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.PrepareQueryResponse} [response] PrepareQueryResponse + */ + + /** + * Calls PrepareQuery. + * @function prepareQuery + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IPrepareQueryRequest} request PrepareQueryRequest message or plain object + * @param {google.bigtable.v2.Bigtable.PrepareQueryCallback} callback Node-style callback called with the error, if any, and PrepareQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.prepareQuery = function prepareQuery(request, callback) { + return this.rpcCall(prepareQuery, $root.google.bigtable.v2.PrepareQueryRequest, $root.google.bigtable.v2.PrepareQueryResponse, request, callback); + }, "name", { value: "PrepareQuery" }); + + /** + * Calls PrepareQuery. + * @function prepareQuery + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IPrepareQueryRequest} request PrepareQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.v2.Bigtable|executeQuery}. + * @memberof google.bigtable.v2.Bigtable + * @typedef ExecuteQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.v2.ExecuteQueryResponse} [response] ExecuteQueryResponse + */ + + /** + * Calls ExecuteQuery. + * @function executeQuery + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IExecuteQueryRequest} request ExecuteQueryRequest message or plain object + * @param {google.bigtable.v2.Bigtable.ExecuteQueryCallback} callback Node-style callback called with the error, if any, and ExecuteQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Bigtable.prototype.executeQuery = function executeQuery(request, callback) { + return this.rpcCall(executeQuery, $root.google.bigtable.v2.ExecuteQueryRequest, $root.google.bigtable.v2.ExecuteQueryResponse, request, callback); + }, "name", { value: "ExecuteQuery" }); + + /** + * Calls ExecuteQuery. + * @function executeQuery + * @memberof google.bigtable.v2.Bigtable + * @instance + * @param {google.bigtable.v2.IExecuteQueryRequest} request ExecuteQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Bigtable; + })(); + + v2.ReadRowsRequest = (function() { + + /** + * Properties of a ReadRowsRequest. + * @memberof google.bigtable.v2 + * @interface IReadRowsRequest + * @property {string|null} [tableName] ReadRowsRequest tableName + * @property {string|null} [authorizedViewName] ReadRowsRequest authorizedViewName + * @property {string|null} [materializedViewName] ReadRowsRequest materializedViewName + * @property {string|null} [appProfileId] ReadRowsRequest appProfileId + * @property {google.bigtable.v2.IRowSet|null} [rows] ReadRowsRequest rows + * @property {google.bigtable.v2.IRowFilter|null} [filter] ReadRowsRequest filter + * @property {number|Long|null} [rowsLimit] ReadRowsRequest rowsLimit + * @property {google.bigtable.v2.ReadRowsRequest.RequestStatsView|null} [requestStatsView] ReadRowsRequest requestStatsView + * @property {boolean|null} [reversed] ReadRowsRequest reversed + */ + + /** + * Constructs a new ReadRowsRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadRowsRequest. + * @implements IReadRowsRequest + * @constructor + * @param {google.bigtable.v2.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 tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.tableName = ""; + + /** + * ReadRowsRequest authorizedViewName. + * @member {string} authorizedViewName + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.authorizedViewName = ""; + + /** + * ReadRowsRequest materializedViewName. + * @member {string} materializedViewName + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.materializedViewName = ""; + + /** + * ReadRowsRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.appProfileId = ""; + + /** + * ReadRowsRequest rows. + * @member {google.bigtable.v2.IRowSet|null|undefined} rows + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.rows = null; + + /** + * ReadRowsRequest filter. + * @member {google.bigtable.v2.IRowFilter|null|undefined} filter + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.filter = null; + + /** + * ReadRowsRequest rowsLimit. + * @member {number|Long} rowsLimit + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.rowsLimit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadRowsRequest requestStatsView. + * @member {google.bigtable.v2.ReadRowsRequest.RequestStatsView} requestStatsView + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.requestStatsView = 0; + + /** + * ReadRowsRequest reversed. + * @member {boolean} reversed + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.reversed = false; + + /** + * Creates a new ReadRowsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadRowsRequest + * @static + * @param {google.bigtable.v2.IReadRowsRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadRowsRequest} ReadRowsRequest instance + */ + ReadRowsRequest.create = function create(properties) { + return new ReadRowsRequest(properties); + }; + + /** + * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.bigtable.v2.ReadRowsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadRowsRequest + * @static + * @param {google.bigtable.v2.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.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.rows != null && Object.hasOwnProperty.call(message, "rows")) + $root.google.bigtable.v2.RowSet.encode(message.rows, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.bigtable.v2.RowFilter.encode(message.filter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rowsLimit != null && Object.hasOwnProperty.call(message, "rowsLimit")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.rowsLimit); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.appProfileId); + if (message.requestStatsView != null && Object.hasOwnProperty.call(message, "requestStatsView")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.requestStatsView); + if (message.reversed != null && Object.hasOwnProperty.call(message, "reversed")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.reversed); + if (message.authorizedViewName != null && Object.hasOwnProperty.call(message, "authorizedViewName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.authorizedViewName); + if (message.materializedViewName != null && Object.hasOwnProperty.call(message, "materializedViewName")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.materializedViewName); + return writer; + }; + + /** + * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadRowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadRowsRequest + * @static + * @param {google.bigtable.v2.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.bigtable.v2.ReadRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadRowsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 9: { + message.authorizedViewName = reader.string(); + break; + } + case 11: { + message.materializedViewName = reader.string(); + break; + } + case 5: { + message.appProfileId = reader.string(); + break; + } + case 2: { + message.rows = $root.google.bigtable.v2.RowSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.filter = $root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32()); + break; + } + case 4: { + message.rowsLimit = reader.int64(); + break; + } + case 6: { + message.requestStatsView = reader.int32(); + break; + } + case 7: { + message.reversed = reader.bool(); + 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.bigtable.v2.ReadRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.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.bigtable.v2.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.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + if (!$util.isString(message.authorizedViewName)) + return "authorizedViewName: string expected"; + if (message.materializedViewName != null && message.hasOwnProperty("materializedViewName")) + if (!$util.isString(message.materializedViewName)) + return "materializedViewName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.rows != null && message.hasOwnProperty("rows")) { + var error = $root.google.bigtable.v2.RowSet.verify(message.rows); + if (error) + return "rows." + error; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.filter); + if (error) + return "filter." + error; + } + if (message.rowsLimit != null && message.hasOwnProperty("rowsLimit")) + if (!$util.isInteger(message.rowsLimit) && !(message.rowsLimit && $util.isInteger(message.rowsLimit.low) && $util.isInteger(message.rowsLimit.high))) + return "rowsLimit: integer|Long expected"; + if (message.requestStatsView != null && message.hasOwnProperty("requestStatsView")) + switch (message.requestStatsView) { + default: + return "requestStatsView: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.reversed != null && message.hasOwnProperty("reversed")) + if (typeof message.reversed !== "boolean") + return "reversed: boolean expected"; + return null; + }; + + /** + * Creates a ReadRowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadRowsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadRowsRequest} ReadRowsRequest + */ + ReadRowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadRowsRequest) + return object; + var message = new $root.google.bigtable.v2.ReadRowsRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.authorizedViewName != null) + message.authorizedViewName = String(object.authorizedViewName); + if (object.materializedViewName != null) + message.materializedViewName = String(object.materializedViewName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.rows != null) { + if (typeof object.rows !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsRequest.rows: object expected"); + message.rows = $root.google.bigtable.v2.RowSet.fromObject(object.rows); + } + if (object.filter != null) { + if (typeof object.filter !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsRequest.filter: object expected"); + message.filter = $root.google.bigtable.v2.RowFilter.fromObject(object.filter); + } + if (object.rowsLimit != null) + if ($util.Long) + (message.rowsLimit = $util.Long.fromValue(object.rowsLimit)).unsigned = false; + else if (typeof object.rowsLimit === "string") + message.rowsLimit = parseInt(object.rowsLimit, 10); + else if (typeof object.rowsLimit === "number") + message.rowsLimit = object.rowsLimit; + else if (typeof object.rowsLimit === "object") + message.rowsLimit = new $util.LongBits(object.rowsLimit.low >>> 0, object.rowsLimit.high >>> 0).toNumber(); + switch (object.requestStatsView) { + default: + if (typeof object.requestStatsView === "number") { + message.requestStatsView = object.requestStatsView; + break; + } + break; + case "REQUEST_STATS_VIEW_UNSPECIFIED": + case 0: + message.requestStatsView = 0; + break; + case "REQUEST_STATS_NONE": + case 1: + message.requestStatsView = 1; + break; + case "REQUEST_STATS_FULL": + case 2: + message.requestStatsView = 2; + break; + } + if (object.reversed != null) + message.reversed = Boolean(object.reversed); + return message; + }; + + /** + * Creates a plain object from a ReadRowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadRowsRequest + * @static + * @param {google.bigtable.v2.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.tableName = ""; + object.rows = null; + object.filter = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowsLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowsLimit = options.longs === String ? "0" : 0; + object.appProfileId = ""; + object.requestStatsView = options.enums === String ? "REQUEST_STATS_VIEW_UNSPECIFIED" : 0; + object.reversed = false; + object.authorizedViewName = ""; + object.materializedViewName = ""; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.rows != null && message.hasOwnProperty("rows")) + object.rows = $root.google.bigtable.v2.RowSet.toObject(message.rows, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = $root.google.bigtable.v2.RowFilter.toObject(message.filter, options); + if (message.rowsLimit != null && message.hasOwnProperty("rowsLimit")) + if (typeof message.rowsLimit === "number") + object.rowsLimit = options.longs === String ? String(message.rowsLimit) : message.rowsLimit; + else + object.rowsLimit = options.longs === String ? $util.Long.prototype.toString.call(message.rowsLimit) : options.longs === Number ? new $util.LongBits(message.rowsLimit.low >>> 0, message.rowsLimit.high >>> 0).toNumber() : message.rowsLimit; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.requestStatsView != null && message.hasOwnProperty("requestStatsView")) + object.requestStatsView = options.enums === String ? $root.google.bigtable.v2.ReadRowsRequest.RequestStatsView[message.requestStatsView] === undefined ? message.requestStatsView : $root.google.bigtable.v2.ReadRowsRequest.RequestStatsView[message.requestStatsView] : message.requestStatsView; + if (message.reversed != null && message.hasOwnProperty("reversed")) + object.reversed = message.reversed; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + object.authorizedViewName = message.authorizedViewName; + if (message.materializedViewName != null && message.hasOwnProperty("materializedViewName")) + object.materializedViewName = message.materializedViewName; + return object; + }; + + /** + * Converts this ReadRowsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + * @returns {Object.} JSON object + */ + ReadRowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadRowsRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadRowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadRowsRequest"; + }; + + /** + * RequestStatsView enum. + * @name google.bigtable.v2.ReadRowsRequest.RequestStatsView + * @enum {number} + * @property {number} REQUEST_STATS_VIEW_UNSPECIFIED=0 REQUEST_STATS_VIEW_UNSPECIFIED value + * @property {number} REQUEST_STATS_NONE=1 REQUEST_STATS_NONE value + * @property {number} REQUEST_STATS_FULL=2 REQUEST_STATS_FULL value + */ + ReadRowsRequest.RequestStatsView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REQUEST_STATS_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "REQUEST_STATS_NONE"] = 1; + values[valuesById[2] = "REQUEST_STATS_FULL"] = 2; + return values; + })(); + + return ReadRowsRequest; + })(); + + v2.ReadRowsResponse = (function() { + + /** + * Properties of a ReadRowsResponse. + * @memberof google.bigtable.v2 + * @interface IReadRowsResponse + * @property {Array.|null} [chunks] ReadRowsResponse chunks + * @property {Uint8Array|null} [lastScannedRowKey] ReadRowsResponse lastScannedRowKey + * @property {google.bigtable.v2.IRequestStats|null} [requestStats] ReadRowsResponse requestStats + */ + + /** + * Constructs a new ReadRowsResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadRowsResponse. + * @implements IReadRowsResponse + * @constructor + * @param {google.bigtable.v2.IReadRowsResponse=} [properties] Properties to set + */ + function ReadRowsResponse(properties) { + this.chunks = []; + if (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 chunks. + * @member {Array.} chunks + * @memberof google.bigtable.v2.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.chunks = $util.emptyArray; + + /** + * ReadRowsResponse lastScannedRowKey. + * @member {Uint8Array} lastScannedRowKey + * @memberof google.bigtable.v2.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.lastScannedRowKey = $util.newBuffer([]); + + /** + * ReadRowsResponse requestStats. + * @member {google.bigtable.v2.IRequestStats|null|undefined} requestStats + * @memberof google.bigtable.v2.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.requestStats = null; + + /** + * Creates a new ReadRowsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadRowsResponse + * @static + * @param {google.bigtable.v2.IReadRowsResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadRowsResponse} ReadRowsResponse instance + */ + ReadRowsResponse.create = function create(properties) { + return new ReadRowsResponse(properties); + }; + + /** + * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.bigtable.v2.ReadRowsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadRowsResponse + * @static + * @param {google.bigtable.v2.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.chunks != null && message.chunks.length) + for (var i = 0; i < message.chunks.length; ++i) + $root.google.bigtable.v2.ReadRowsResponse.CellChunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lastScannedRowKey != null && Object.hasOwnProperty.call(message, "lastScannedRowKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.lastScannedRowKey); + if (message.requestStats != null && Object.hasOwnProperty.call(message, "requestStats")) + $root.google.bigtable.v2.RequestStats.encode(message.requestStats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadRowsResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadRowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadRowsResponse + * @static + * @param {google.bigtable.v2.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.bigtable.v2.ReadRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadRowsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.chunks && message.chunks.length)) + message.chunks = []; + message.chunks.push($root.google.bigtable.v2.ReadRowsResponse.CellChunk.decode(reader, reader.uint32())); + break; + } + case 2: { + message.lastScannedRowKey = reader.bytes(); + break; + } + case 3: { + message.requestStats = $root.google.bigtable.v2.RequestStats.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.bigtable.v2.ReadRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.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.bigtable.v2.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"; + if (message.chunks != null && message.hasOwnProperty("chunks")) { + if (!Array.isArray(message.chunks)) + return "chunks: array expected"; + for (var i = 0; i < message.chunks.length; ++i) { + var error = $root.google.bigtable.v2.ReadRowsResponse.CellChunk.verify(message.chunks[i]); + if (error) + return "chunks." + error; + } + } + if (message.lastScannedRowKey != null && message.hasOwnProperty("lastScannedRowKey")) + if (!(message.lastScannedRowKey && typeof message.lastScannedRowKey.length === "number" || $util.isString(message.lastScannedRowKey))) + return "lastScannedRowKey: buffer expected"; + if (message.requestStats != null && message.hasOwnProperty("requestStats")) { + var error = $root.google.bigtable.v2.RequestStats.verify(message.requestStats); + if (error) + return "requestStats." + error; + } + return null; + }; + + /** + * Creates a ReadRowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadRowsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadRowsResponse} ReadRowsResponse + */ + ReadRowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadRowsResponse) + return object; + var message = new $root.google.bigtable.v2.ReadRowsResponse(); + if (object.chunks) { + if (!Array.isArray(object.chunks)) + throw TypeError(".google.bigtable.v2.ReadRowsResponse.chunks: array expected"); + message.chunks = []; + for (var i = 0; i < object.chunks.length; ++i) { + if (typeof object.chunks[i] !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsResponse.chunks: object expected"); + message.chunks[i] = $root.google.bigtable.v2.ReadRowsResponse.CellChunk.fromObject(object.chunks[i]); + } + } + if (object.lastScannedRowKey != null) + if (typeof object.lastScannedRowKey === "string") + $util.base64.decode(object.lastScannedRowKey, message.lastScannedRowKey = $util.newBuffer($util.base64.length(object.lastScannedRowKey)), 0); + else if (object.lastScannedRowKey.length >= 0) + message.lastScannedRowKey = object.lastScannedRowKey; + if (object.requestStats != null) { + if (typeof object.requestStats !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsResponse.requestStats: object expected"); + message.requestStats = $root.google.bigtable.v2.RequestStats.fromObject(object.requestStats); + } + return message; + }; + + /** + * Creates a plain object from a ReadRowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadRowsResponse + * @static + * @param {google.bigtable.v2.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.arrays || options.defaults) + object.chunks = []; + if (options.defaults) { + if (options.bytes === String) + object.lastScannedRowKey = ""; + else { + object.lastScannedRowKey = []; + if (options.bytes !== Array) + object.lastScannedRowKey = $util.newBuffer(object.lastScannedRowKey); + } + object.requestStats = null; + } + if (message.chunks && message.chunks.length) { + object.chunks = []; + for (var j = 0; j < message.chunks.length; ++j) + object.chunks[j] = $root.google.bigtable.v2.ReadRowsResponse.CellChunk.toObject(message.chunks[j], options); + } + if (message.lastScannedRowKey != null && message.hasOwnProperty("lastScannedRowKey")) + object.lastScannedRowKey = options.bytes === String ? $util.base64.encode(message.lastScannedRowKey, 0, message.lastScannedRowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastScannedRowKey) : message.lastScannedRowKey; + if (message.requestStats != null && message.hasOwnProperty("requestStats")) + object.requestStats = $root.google.bigtable.v2.RequestStats.toObject(message.requestStats, options); + return object; + }; + + /** + * Converts this ReadRowsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadRowsResponse + * @instance + * @returns {Object.} JSON object + */ + ReadRowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadRowsResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadRowsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadRowsResponse"; + }; + + ReadRowsResponse.CellChunk = (function() { + + /** + * Properties of a CellChunk. + * @memberof google.bigtable.v2.ReadRowsResponse + * @interface ICellChunk + * @property {Uint8Array|null} [rowKey] CellChunk rowKey + * @property {google.protobuf.IStringValue|null} [familyName] CellChunk familyName + * @property {google.protobuf.IBytesValue|null} [qualifier] CellChunk qualifier + * @property {number|Long|null} [timestampMicros] CellChunk timestampMicros + * @property {Array.|null} [labels] CellChunk labels + * @property {Uint8Array|null} [value] CellChunk value + * @property {number|null} [valueSize] CellChunk valueSize + * @property {boolean|null} [resetRow] CellChunk resetRow + * @property {boolean|null} [commitRow] CellChunk commitRow + */ + + /** + * Constructs a new CellChunk. + * @memberof google.bigtable.v2.ReadRowsResponse + * @classdesc Represents a CellChunk. + * @implements ICellChunk + * @constructor + * @param {google.bigtable.v2.ReadRowsResponse.ICellChunk=} [properties] Properties to set + */ + function CellChunk(properties) { + this.labels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CellChunk rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.rowKey = $util.newBuffer([]); + + /** + * CellChunk familyName. + * @member {google.protobuf.IStringValue|null|undefined} familyName + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.familyName = null; + + /** + * CellChunk qualifier. + * @member {google.protobuf.IBytesValue|null|undefined} qualifier + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.qualifier = null; + + /** + * CellChunk timestampMicros. + * @member {number|Long} timestampMicros + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.timestampMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CellChunk labels. + * @member {Array.} labels + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.labels = $util.emptyArray; + + /** + * CellChunk value. + * @member {Uint8Array} value + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.value = $util.newBuffer([]); + + /** + * CellChunk valueSize. + * @member {number} valueSize + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.valueSize = 0; + + /** + * CellChunk resetRow. + * @member {boolean|null|undefined} resetRow + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.resetRow = null; + + /** + * CellChunk commitRow. + * @member {boolean|null|undefined} commitRow + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + CellChunk.prototype.commitRow = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CellChunk rowStatus. + * @member {"resetRow"|"commitRow"|undefined} rowStatus + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + */ + Object.defineProperty(CellChunk.prototype, "rowStatus", { + get: $util.oneOfGetter($oneOfFields = ["resetRow", "commitRow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CellChunk instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {google.bigtable.v2.ReadRowsResponse.ICellChunk=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadRowsResponse.CellChunk} CellChunk instance + */ + CellChunk.create = function create(properties) { + return new CellChunk(properties); + }; + + /** + * Encodes the specified CellChunk message. Does not implicitly {@link google.bigtable.v2.ReadRowsResponse.CellChunk.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {google.bigtable.v2.ReadRowsResponse.ICellChunk} message CellChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CellChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rowKey); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + $root.google.protobuf.StringValue.encode(message.familyName, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.qualifier != null && Object.hasOwnProperty.call(message, "qualifier")) + $root.google.protobuf.BytesValue.encode(message.qualifier, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timestampMicros != null && Object.hasOwnProperty.call(message, "timestampMicros")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.timestampMicros); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.labels[i]); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.value); + if (message.valueSize != null && Object.hasOwnProperty.call(message, "valueSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.valueSize); + if (message.resetRow != null && Object.hasOwnProperty.call(message, "resetRow")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.resetRow); + if (message.commitRow != null && Object.hasOwnProperty.call(message, "commitRow")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.commitRow); + return writer; + }; + + /** + * Encodes the specified CellChunk message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadRowsResponse.CellChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {google.bigtable.v2.ReadRowsResponse.ICellChunk} message CellChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CellChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CellChunk message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadRowsResponse.CellChunk} CellChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CellChunk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadRowsResponse.CellChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowKey = reader.bytes(); + break; + } + case 2: { + message.familyName = $root.google.protobuf.StringValue.decode(reader, reader.uint32()); + break; + } + case 3: { + message.qualifier = $root.google.protobuf.BytesValue.decode(reader, reader.uint32()); + break; + } + case 4: { + message.timestampMicros = reader.int64(); + break; + } + case 5: { + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push(reader.string()); + break; + } + case 6: { + message.value = reader.bytes(); + break; + } + case 7: { + message.valueSize = reader.int32(); + break; + } + case 8: { + message.resetRow = reader.bool(); + break; + } + case 9: { + message.commitRow = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CellChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadRowsResponse.CellChunk} CellChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CellChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CellChunk message. + * @function verify + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CellChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) { + var error = $root.google.protobuf.StringValue.verify(message.familyName); + if (error) + return "familyName." + error; + } + if (message.qualifier != null && message.hasOwnProperty("qualifier")) { + var error = $root.google.protobuf.BytesValue.verify(message.qualifier); + if (error) + return "qualifier." + error; + } + if (message.timestampMicros != null && message.hasOwnProperty("timestampMicros")) + if (!$util.isInteger(message.timestampMicros) && !(message.timestampMicros && $util.isInteger(message.timestampMicros.low) && $util.isInteger(message.timestampMicros.high))) + return "timestampMicros: integer|Long expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) + if (!$util.isString(message.labels[i])) + return "labels: string[] expected"; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.valueSize != null && message.hasOwnProperty("valueSize")) + if (!$util.isInteger(message.valueSize)) + return "valueSize: integer expected"; + if (message.resetRow != null && message.hasOwnProperty("resetRow")) { + properties.rowStatus = 1; + if (typeof message.resetRow !== "boolean") + return "resetRow: boolean expected"; + } + if (message.commitRow != null && message.hasOwnProperty("commitRow")) { + if (properties.rowStatus === 1) + return "rowStatus: multiple values"; + properties.rowStatus = 1; + if (typeof message.commitRow !== "boolean") + return "commitRow: boolean expected"; + } + return null; + }; + + /** + * Creates a CellChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadRowsResponse.CellChunk} CellChunk + */ + CellChunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadRowsResponse.CellChunk) + return object; + var message = new $root.google.bigtable.v2.ReadRowsResponse.CellChunk(); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.familyName != null) { + if (typeof object.familyName !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsResponse.CellChunk.familyName: object expected"); + message.familyName = $root.google.protobuf.StringValue.fromObject(object.familyName); + } + if (object.qualifier != null) { + if (typeof object.qualifier !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsResponse.CellChunk.qualifier: object expected"); + message.qualifier = $root.google.protobuf.BytesValue.fromObject(object.qualifier); + } + if (object.timestampMicros != null) + if ($util.Long) + (message.timestampMicros = $util.Long.fromValue(object.timestampMicros)).unsigned = false; + else if (typeof object.timestampMicros === "string") + message.timestampMicros = parseInt(object.timestampMicros, 10); + else if (typeof object.timestampMicros === "number") + message.timestampMicros = object.timestampMicros; + else if (typeof object.timestampMicros === "object") + message.timestampMicros = new $util.LongBits(object.timestampMicros.low >>> 0, object.timestampMicros.high >>> 0).toNumber(); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.bigtable.v2.ReadRowsResponse.CellChunk.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) + message.labels[i] = String(object.labels[i]); + } + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + if (object.valueSize != null) + message.valueSize = object.valueSize | 0; + if (object.resetRow != null) + message.resetRow = Boolean(object.resetRow); + if (object.commitRow != null) + message.commitRow = Boolean(object.commitRow); + return message; + }; + + /** + * Creates a plain object from a CellChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {google.bigtable.v2.ReadRowsResponse.CellChunk} message CellChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CellChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.labels = []; + if (options.defaults) { + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + object.familyName = null; + object.qualifier = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestampMicros = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + object.valueSize = 0; + } + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = $root.google.protobuf.StringValue.toObject(message.familyName, options); + if (message.qualifier != null && message.hasOwnProperty("qualifier")) + object.qualifier = $root.google.protobuf.BytesValue.toObject(message.qualifier, options); + if (message.timestampMicros != null && message.hasOwnProperty("timestampMicros")) + if (typeof message.timestampMicros === "number") + object.timestampMicros = options.longs === String ? String(message.timestampMicros) : message.timestampMicros; + else + object.timestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.timestampMicros) : options.longs === Number ? new $util.LongBits(message.timestampMicros.low >>> 0, message.timestampMicros.high >>> 0).toNumber() : message.timestampMicros; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = message.labels[j]; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.valueSize != null && message.hasOwnProperty("valueSize")) + object.valueSize = message.valueSize; + if (message.resetRow != null && message.hasOwnProperty("resetRow")) { + object.resetRow = message.resetRow; + if (options.oneofs) + object.rowStatus = "resetRow"; + } + if (message.commitRow != null && message.hasOwnProperty("commitRow")) { + object.commitRow = message.commitRow; + if (options.oneofs) + object.rowStatus = "commitRow"; + } + return object; + }; + + /** + * Converts this CellChunk to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @instance + * @returns {Object.} JSON object + */ + CellChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CellChunk + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadRowsResponse.CellChunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CellChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadRowsResponse.CellChunk"; + }; + + return CellChunk; + })(); + + return ReadRowsResponse; + })(); + + v2.SampleRowKeysRequest = (function() { + + /** + * Properties of a SampleRowKeysRequest. + * @memberof google.bigtable.v2 + * @interface ISampleRowKeysRequest + * @property {string|null} [tableName] SampleRowKeysRequest tableName + * @property {string|null} [authorizedViewName] SampleRowKeysRequest authorizedViewName + * @property {string|null} [materializedViewName] SampleRowKeysRequest materializedViewName + * @property {string|null} [appProfileId] SampleRowKeysRequest appProfileId + */ + + /** + * Constructs a new SampleRowKeysRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a SampleRowKeysRequest. + * @implements ISampleRowKeysRequest + * @constructor + * @param {google.bigtable.v2.ISampleRowKeysRequest=} [properties] Properties to set + */ + function SampleRowKeysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SampleRowKeysRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @instance + */ + SampleRowKeysRequest.prototype.tableName = ""; + + /** + * SampleRowKeysRequest authorizedViewName. + * @member {string} authorizedViewName + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @instance + */ + SampleRowKeysRequest.prototype.authorizedViewName = ""; + + /** + * SampleRowKeysRequest materializedViewName. + * @member {string} materializedViewName + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @instance + */ + SampleRowKeysRequest.prototype.materializedViewName = ""; + + /** + * SampleRowKeysRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @instance + */ + SampleRowKeysRequest.prototype.appProfileId = ""; + + /** + * Creates a new SampleRowKeysRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {google.bigtable.v2.ISampleRowKeysRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.SampleRowKeysRequest} SampleRowKeysRequest instance + */ + SampleRowKeysRequest.create = function create(properties) { + return new SampleRowKeysRequest(properties); + }; + + /** + * Encodes the specified SampleRowKeysRequest message. Does not implicitly {@link google.bigtable.v2.SampleRowKeysRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {google.bigtable.v2.ISampleRowKeysRequest} message SampleRowKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleRowKeysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + if (message.authorizedViewName != null && Object.hasOwnProperty.call(message, "authorizedViewName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.authorizedViewName); + if (message.materializedViewName != null && Object.hasOwnProperty.call(message, "materializedViewName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.materializedViewName); + return writer; + }; + + /** + * Encodes the specified SampleRowKeysRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.SampleRowKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {google.bigtable.v2.ISampleRowKeysRequest} message SampleRowKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleRowKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SampleRowKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.SampleRowKeysRequest} SampleRowKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleRowKeysRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.SampleRowKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 4: { + message.authorizedViewName = reader.string(); + break; + } + case 5: { + message.materializedViewName = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SampleRowKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.SampleRowKeysRequest} SampleRowKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleRowKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SampleRowKeysRequest message. + * @function verify + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SampleRowKeysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + if (!$util.isString(message.authorizedViewName)) + return "authorizedViewName: string expected"; + if (message.materializedViewName != null && message.hasOwnProperty("materializedViewName")) + if (!$util.isString(message.materializedViewName)) + return "materializedViewName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + return null; + }; + + /** + * Creates a SampleRowKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.SampleRowKeysRequest} SampleRowKeysRequest + */ + SampleRowKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.SampleRowKeysRequest) + return object; + var message = new $root.google.bigtable.v2.SampleRowKeysRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.authorizedViewName != null) + message.authorizedViewName = String(object.authorizedViewName); + if (object.materializedViewName != null) + message.materializedViewName = String(object.materializedViewName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + return message; + }; + + /** + * Creates a plain object from a SampleRowKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {google.bigtable.v2.SampleRowKeysRequest} message SampleRowKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SampleRowKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tableName = ""; + object.appProfileId = ""; + object.authorizedViewName = ""; + object.materializedViewName = ""; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + object.authorizedViewName = message.authorizedViewName; + if (message.materializedViewName != null && message.hasOwnProperty("materializedViewName")) + object.materializedViewName = message.materializedViewName; + return object; + }; + + /** + * Converts this SampleRowKeysRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @instance + * @returns {Object.} JSON object + */ + SampleRowKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SampleRowKeysRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.SampleRowKeysRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SampleRowKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.SampleRowKeysRequest"; + }; + + return SampleRowKeysRequest; + })(); + + v2.SampleRowKeysResponse = (function() { + + /** + * Properties of a SampleRowKeysResponse. + * @memberof google.bigtable.v2 + * @interface ISampleRowKeysResponse + * @property {Uint8Array|null} [rowKey] SampleRowKeysResponse rowKey + * @property {number|Long|null} [offsetBytes] SampleRowKeysResponse offsetBytes + */ + + /** + * Constructs a new SampleRowKeysResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a SampleRowKeysResponse. + * @implements ISampleRowKeysResponse + * @constructor + * @param {google.bigtable.v2.ISampleRowKeysResponse=} [properties] Properties to set + */ + function SampleRowKeysResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SampleRowKeysResponse rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @instance + */ + SampleRowKeysResponse.prototype.rowKey = $util.newBuffer([]); + + /** + * SampleRowKeysResponse offsetBytes. + * @member {number|Long} offsetBytes + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @instance + */ + SampleRowKeysResponse.prototype.offsetBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SampleRowKeysResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {google.bigtable.v2.ISampleRowKeysResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.SampleRowKeysResponse} SampleRowKeysResponse instance + */ + SampleRowKeysResponse.create = function create(properties) { + return new SampleRowKeysResponse(properties); + }; + + /** + * Encodes the specified SampleRowKeysResponse message. Does not implicitly {@link google.bigtable.v2.SampleRowKeysResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {google.bigtable.v2.ISampleRowKeysResponse} message SampleRowKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleRowKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rowKey); + if (message.offsetBytes != null && Object.hasOwnProperty.call(message, "offsetBytes")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.offsetBytes); + return writer; + }; + + /** + * Encodes the specified SampleRowKeysResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.SampleRowKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {google.bigtable.v2.ISampleRowKeysResponse} message SampleRowKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleRowKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SampleRowKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.SampleRowKeysResponse} SampleRowKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleRowKeysResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.SampleRowKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowKey = reader.bytes(); + break; + } + case 2: { + message.offsetBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SampleRowKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.SampleRowKeysResponse} SampleRowKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleRowKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SampleRowKeysResponse message. + * @function verify + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SampleRowKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer expected"; + if (message.offsetBytes != null && message.hasOwnProperty("offsetBytes")) + if (!$util.isInteger(message.offsetBytes) && !(message.offsetBytes && $util.isInteger(message.offsetBytes.low) && $util.isInteger(message.offsetBytes.high))) + return "offsetBytes: integer|Long expected"; + return null; + }; + + /** + * Creates a SampleRowKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.SampleRowKeysResponse} SampleRowKeysResponse + */ + SampleRowKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.SampleRowKeysResponse) + return object; + var message = new $root.google.bigtable.v2.SampleRowKeysResponse(); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.offsetBytes != null) + if ($util.Long) + (message.offsetBytes = $util.Long.fromValue(object.offsetBytes)).unsigned = false; + else if (typeof object.offsetBytes === "string") + message.offsetBytes = parseInt(object.offsetBytes, 10); + else if (typeof object.offsetBytes === "number") + message.offsetBytes = object.offsetBytes; + else if (typeof object.offsetBytes === "object") + message.offsetBytes = new $util.LongBits(object.offsetBytes.low >>> 0, object.offsetBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SampleRowKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {google.bigtable.v2.SampleRowKeysResponse} message SampleRowKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SampleRowKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.offsetBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offsetBytes = options.longs === String ? "0" : 0; + } + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.offsetBytes != null && message.hasOwnProperty("offsetBytes")) + if (typeof message.offsetBytes === "number") + object.offsetBytes = options.longs === String ? String(message.offsetBytes) : message.offsetBytes; + else + object.offsetBytes = options.longs === String ? $util.Long.prototype.toString.call(message.offsetBytes) : options.longs === Number ? new $util.LongBits(message.offsetBytes.low >>> 0, message.offsetBytes.high >>> 0).toNumber() : message.offsetBytes; + return object; + }; + + /** + * Converts this SampleRowKeysResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @instance + * @returns {Object.} JSON object + */ + SampleRowKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SampleRowKeysResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.SampleRowKeysResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SampleRowKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.SampleRowKeysResponse"; + }; + + return SampleRowKeysResponse; + })(); + + v2.MutateRowRequest = (function() { + + /** + * Properties of a MutateRowRequest. + * @memberof google.bigtable.v2 + * @interface IMutateRowRequest + * @property {string|null} [tableName] MutateRowRequest tableName + * @property {string|null} [authorizedViewName] MutateRowRequest authorizedViewName + * @property {string|null} [appProfileId] MutateRowRequest appProfileId + * @property {Uint8Array|null} [rowKey] MutateRowRequest rowKey + * @property {Array.|null} [mutations] MutateRowRequest mutations + * @property {google.bigtable.v2.IIdempotency|null} [idempotency] MutateRowRequest idempotency + */ + + /** + * Constructs a new MutateRowRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a MutateRowRequest. + * @implements IMutateRowRequest + * @constructor + * @param {google.bigtable.v2.IMutateRowRequest=} [properties] Properties to set + */ + function MutateRowRequest(properties) { + this.mutations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateRowRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.tableName = ""; + + /** + * MutateRowRequest authorizedViewName. + * @member {string} authorizedViewName + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.authorizedViewName = ""; + + /** + * MutateRowRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.appProfileId = ""; + + /** + * MutateRowRequest rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.rowKey = $util.newBuffer([]); + + /** + * MutateRowRequest mutations. + * @member {Array.} mutations + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.mutations = $util.emptyArray; + + /** + * MutateRowRequest idempotency. + * @member {google.bigtable.v2.IIdempotency|null|undefined} idempotency + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.idempotency = null; + + /** + * Creates a new MutateRowRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {google.bigtable.v2.IMutateRowRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.MutateRowRequest} MutateRowRequest instance + */ + MutateRowRequest.create = function create(properties) { + return new MutateRowRequest(properties); + }; + + /** + * Encodes the specified MutateRowRequest message. Does not implicitly {@link google.bigtable.v2.MutateRowRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {google.bigtable.v2.IMutateRowRequest} message MutateRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rowKey); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.bigtable.v2.Mutation.encode(message.mutations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.appProfileId); + if (message.authorizedViewName != null && Object.hasOwnProperty.call(message, "authorizedViewName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.authorizedViewName); + if (message.idempotency != null && Object.hasOwnProperty.call(message, "idempotency")) + $root.google.bigtable.v2.Idempotency.encode(message.idempotency, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateRowRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {google.bigtable.v2.IMutateRowRequest} message MutateRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateRowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.MutateRowRequest} MutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.MutateRowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 6: { + message.authorizedViewName = reader.string(); + break; + } + case 4: { + message.appProfileId = reader.string(); + break; + } + case 2: { + message.rowKey = reader.bytes(); + break; + } + case 3: { + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.bigtable.v2.Mutation.decode(reader, reader.uint32())); + break; + } + case 8: { + message.idempotency = $root.google.bigtable.v2.Idempotency.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateRowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.MutateRowRequest} MutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateRowRequest message. + * @function verify + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateRowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + if (!$util.isString(message.authorizedViewName)) + return "authorizedViewName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer expected"; + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.bigtable.v2.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } + if (message.idempotency != null && message.hasOwnProperty("idempotency")) { + var error = $root.google.bigtable.v2.Idempotency.verify(message.idempotency); + if (error) + return "idempotency." + error; + } + return null; + }; + + /** + * Creates a MutateRowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.MutateRowRequest} MutateRowRequest + */ + MutateRowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.MutateRowRequest) + return object; + var message = new $root.google.bigtable.v2.MutateRowRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.authorizedViewName != null) + message.authorizedViewName = String(object.authorizedViewName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.bigtable.v2.MutateRowRequest.mutations: array expected"); + message.mutations = []; + for (var i = 0; i < object.mutations.length; ++i) { + if (typeof object.mutations[i] !== "object") + throw TypeError(".google.bigtable.v2.MutateRowRequest.mutations: object expected"); + message.mutations[i] = $root.google.bigtable.v2.Mutation.fromObject(object.mutations[i]); + } + } + if (object.idempotency != null) { + if (typeof object.idempotency !== "object") + throw TypeError(".google.bigtable.v2.MutateRowRequest.idempotency: object expected"); + message.idempotency = $root.google.bigtable.v2.Idempotency.fromObject(object.idempotency); + } + return message; + }; + + /** + * Creates a plain object from a MutateRowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {google.bigtable.v2.MutateRowRequest} message MutateRowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateRowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mutations = []; + if (options.defaults) { + object.tableName = ""; + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + object.appProfileId = ""; + object.authorizedViewName = ""; + object.idempotency = null; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.bigtable.v2.Mutation.toObject(message.mutations[j], options); + } + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + object.authorizedViewName = message.authorizedViewName; + if (message.idempotency != null && message.hasOwnProperty("idempotency")) + object.idempotency = $root.google.bigtable.v2.Idempotency.toObject(message.idempotency, options); + return object; + }; + + /** + * Converts this MutateRowRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.MutateRowRequest + * @instance + * @returns {Object.} JSON object + */ + MutateRowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateRowRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.MutateRowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateRowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.MutateRowRequest"; + }; + + return MutateRowRequest; + })(); + + v2.MutateRowResponse = (function() { + + /** + * Properties of a MutateRowResponse. + * @memberof google.bigtable.v2 + * @interface IMutateRowResponse + */ + + /** + * Constructs a new MutateRowResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a MutateRowResponse. + * @implements IMutateRowResponse + * @constructor + * @param {google.bigtable.v2.IMutateRowResponse=} [properties] Properties to set + */ + function MutateRowResponse(properties) { + if (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 MutateRowResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {google.bigtable.v2.IMutateRowResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.MutateRowResponse} MutateRowResponse instance + */ + MutateRowResponse.create = function create(properties) { + return new MutateRowResponse(properties); + }; + + /** + * Encodes the specified MutateRowResponse message. Does not implicitly {@link google.bigtable.v2.MutateRowResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {google.bigtable.v2.IMutateRowResponse} message MutateRowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MutateRowResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {google.bigtable.v2.IMutateRowResponse} message MutateRowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateRowResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.MutateRowResponse} MutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.MutateRowResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateRowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.MutateRowResponse} MutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateRowResponse message. + * @function verify + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateRowResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MutateRowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.MutateRowResponse} MutateRowResponse + */ + MutateRowResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.MutateRowResponse) + return object; + return new $root.google.bigtable.v2.MutateRowResponse(); + }; + + /** + * Creates a plain object from a MutateRowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {google.bigtable.v2.MutateRowResponse} message MutateRowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateRowResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MutateRowResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.MutateRowResponse + * @instance + * @returns {Object.} JSON object + */ + MutateRowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateRowResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.MutateRowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateRowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.MutateRowResponse"; + }; + + return MutateRowResponse; + })(); + + v2.MutateRowsRequest = (function() { + + /** + * Properties of a MutateRowsRequest. + * @memberof google.bigtable.v2 + * @interface IMutateRowsRequest + * @property {string|null} [tableName] MutateRowsRequest tableName + * @property {string|null} [authorizedViewName] MutateRowsRequest authorizedViewName + * @property {string|null} [appProfileId] MutateRowsRequest appProfileId + * @property {Array.|null} [entries] MutateRowsRequest entries + */ + + /** + * Constructs a new MutateRowsRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a MutateRowsRequest. + * @implements IMutateRowsRequest + * @constructor + * @param {google.bigtable.v2.IMutateRowsRequest=} [properties] Properties to set + */ + function MutateRowsRequest(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateRowsRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.MutateRowsRequest + * @instance + */ + MutateRowsRequest.prototype.tableName = ""; + + /** + * MutateRowsRequest authorizedViewName. + * @member {string} authorizedViewName + * @memberof google.bigtable.v2.MutateRowsRequest + * @instance + */ + MutateRowsRequest.prototype.authorizedViewName = ""; + + /** + * MutateRowsRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.MutateRowsRequest + * @instance + */ + MutateRowsRequest.prototype.appProfileId = ""; + + /** + * MutateRowsRequest entries. + * @member {Array.} entries + * @memberof google.bigtable.v2.MutateRowsRequest + * @instance + */ + MutateRowsRequest.prototype.entries = $util.emptyArray; + + /** + * Creates a new MutateRowsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {google.bigtable.v2.IMutateRowsRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.MutateRowsRequest} MutateRowsRequest instance + */ + MutateRowsRequest.create = function create(properties) { + return new MutateRowsRequest(properties); + }; + + /** + * Encodes the specified MutateRowsRequest message. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {google.bigtable.v2.IMutateRowsRequest} message MutateRowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.bigtable.v2.MutateRowsRequest.Entry.encode(message.entries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.appProfileId); + if (message.authorizedViewName != null && Object.hasOwnProperty.call(message, "authorizedViewName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.authorizedViewName); + return writer; + }; + + /** + * Encodes the specified MutateRowsRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {google.bigtable.v2.IMutateRowsRequest} message MutateRowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateRowsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.MutateRowsRequest} MutateRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.MutateRowsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 5: { + message.authorizedViewName = reader.string(); + break; + } + case 3: { + message.appProfileId = reader.string(); + break; + } + case 2: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.bigtable.v2.MutateRowsRequest.Entry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateRowsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.MutateRowsRequest} MutateRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateRowsRequest message. + * @function verify + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateRowsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + if (!$util.isString(message.authorizedViewName)) + return "authorizedViewName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.bigtable.v2.MutateRowsRequest.Entry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a MutateRowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.MutateRowsRequest} MutateRowsRequest + */ + MutateRowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.MutateRowsRequest) + return object; + var message = new $root.google.bigtable.v2.MutateRowsRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.authorizedViewName != null) + message.authorizedViewName = String(object.authorizedViewName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.bigtable.v2.MutateRowsRequest.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.bigtable.v2.MutateRowsRequest.entries: object expected"); + message.entries[i] = $root.google.bigtable.v2.MutateRowsRequest.Entry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MutateRowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {google.bigtable.v2.MutateRowsRequest} message MutateRowsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateRowsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) { + object.tableName = ""; + object.appProfileId = ""; + object.authorizedViewName = ""; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.bigtable.v2.MutateRowsRequest.Entry.toObject(message.entries[j], options); + } + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + object.authorizedViewName = message.authorizedViewName; + return object; + }; + + /** + * Converts this MutateRowsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.MutateRowsRequest + * @instance + * @returns {Object.} JSON object + */ + MutateRowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateRowsRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.MutateRowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateRowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.MutateRowsRequest"; + }; + + MutateRowsRequest.Entry = (function() { + + /** + * Properties of an Entry. + * @memberof google.bigtable.v2.MutateRowsRequest + * @interface IEntry + * @property {Uint8Array|null} [rowKey] Entry rowKey + * @property {Array.|null} [mutations] Entry mutations + * @property {google.bigtable.v2.IIdempotency|null} [idempotency] Entry idempotency + */ + + /** + * Constructs a new Entry. + * @memberof google.bigtable.v2.MutateRowsRequest + * @classdesc Represents an Entry. + * @implements IEntry + * @constructor + * @param {google.bigtable.v2.MutateRowsRequest.IEntry=} [properties] Properties to set + */ + function Entry(properties) { + this.mutations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entry rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @instance + */ + Entry.prototype.rowKey = $util.newBuffer([]); + + /** + * Entry mutations. + * @member {Array.} mutations + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @instance + */ + Entry.prototype.mutations = $util.emptyArray; + + /** + * Entry idempotency. + * @member {google.bigtable.v2.IIdempotency|null|undefined} idempotency + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @instance + */ + Entry.prototype.idempotency = null; + + /** + * Creates a new Entry instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {google.bigtable.v2.MutateRowsRequest.IEntry=} [properties] Properties to set + * @returns {google.bigtable.v2.MutateRowsRequest.Entry} Entry instance + */ + Entry.create = function create(properties) { + return new Entry(properties); + }; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.Entry.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {google.bigtable.v2.MutateRowsRequest.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rowKey); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.bigtable.v2.Mutation.encode(message.mutations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.idempotency != null && Object.hasOwnProperty.call(message, "idempotency")) + $root.google.bigtable.v2.Idempotency.encode(message.idempotency, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsRequest.Entry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {google.bigtable.v2.MutateRowsRequest.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.MutateRowsRequest.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.MutateRowsRequest.Entry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowKey = reader.bytes(); + break; + } + case 2: { + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.bigtable.v2.Mutation.decode(reader, reader.uint32())); + break; + } + case 3: { + message.idempotency = $root.google.bigtable.v2.Idempotency.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.MutateRowsRequest.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entry message. + * @function verify + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer expected"; + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.bigtable.v2.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } + if (message.idempotency != null && message.hasOwnProperty("idempotency")) { + var error = $root.google.bigtable.v2.Idempotency.verify(message.idempotency); + if (error) + return "idempotency." + error; + } + return null; + }; + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.MutateRowsRequest.Entry} Entry + */ + Entry.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.MutateRowsRequest.Entry) + return object; + var message = new $root.google.bigtable.v2.MutateRowsRequest.Entry(); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.bigtable.v2.MutateRowsRequest.Entry.mutations: array expected"); + message.mutations = []; + for (var i = 0; i < object.mutations.length; ++i) { + if (typeof object.mutations[i] !== "object") + throw TypeError(".google.bigtable.v2.MutateRowsRequest.Entry.mutations: object expected"); + message.mutations[i] = $root.google.bigtable.v2.Mutation.fromObject(object.mutations[i]); + } + } + if (object.idempotency != null) { + if (typeof object.idempotency !== "object") + throw TypeError(".google.bigtable.v2.MutateRowsRequest.Entry.idempotency: object expected"); + message.idempotency = $root.google.bigtable.v2.Idempotency.fromObject(object.idempotency); + } + return message; + }; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {google.bigtable.v2.MutateRowsRequest.Entry} message Entry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mutations = []; + if (options.defaults) { + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + object.idempotency = null; + } + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.bigtable.v2.Mutation.toObject(message.mutations[j], options); + } + if (message.idempotency != null && message.hasOwnProperty("idempotency")) + object.idempotency = $root.google.bigtable.v2.Idempotency.toObject(message.idempotency, options); + return object; + }; + + /** + * Converts this Entry to JSON. + * @function toJSON + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @instance + * @returns {Object.} JSON object + */ + Entry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entry + * @function getTypeUrl + * @memberof google.bigtable.v2.MutateRowsRequest.Entry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.MutateRowsRequest.Entry"; + }; + + return Entry; + })(); + + return MutateRowsRequest; + })(); + + v2.MutateRowsResponse = (function() { + + /** + * Properties of a MutateRowsResponse. + * @memberof google.bigtable.v2 + * @interface IMutateRowsResponse + * @property {Array.|null} [entries] MutateRowsResponse entries + * @property {google.bigtable.v2.IRateLimitInfo|null} [rateLimitInfo] MutateRowsResponse rateLimitInfo + */ + + /** + * Constructs a new MutateRowsResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a MutateRowsResponse. + * @implements IMutateRowsResponse + * @constructor + * @param {google.bigtable.v2.IMutateRowsResponse=} [properties] Properties to set + */ + function MutateRowsResponse(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateRowsResponse entries. + * @member {Array.} entries + * @memberof google.bigtable.v2.MutateRowsResponse + * @instance + */ + MutateRowsResponse.prototype.entries = $util.emptyArray; + + /** + * MutateRowsResponse rateLimitInfo. + * @member {google.bigtable.v2.IRateLimitInfo|null|undefined} rateLimitInfo + * @memberof google.bigtable.v2.MutateRowsResponse + * @instance + */ + MutateRowsResponse.prototype.rateLimitInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MutateRowsResponse.prototype, "_rateLimitInfo", { + get: $util.oneOfGetter($oneOfFields = ["rateLimitInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MutateRowsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {google.bigtable.v2.IMutateRowsResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.MutateRowsResponse} MutateRowsResponse instance + */ + MutateRowsResponse.create = function create(properties) { + return new MutateRowsResponse(properties); + }; + + /** + * Encodes the specified MutateRowsResponse message. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {google.bigtable.v2.IMutateRowsResponse} message MutateRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.bigtable.v2.MutateRowsResponse.Entry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rateLimitInfo != null && Object.hasOwnProperty.call(message, "rateLimitInfo")) + $root.google.bigtable.v2.RateLimitInfo.encode(message.rateLimitInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateRowsResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {google.bigtable.v2.IMutateRowsResponse} message MutateRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateRowsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.MutateRowsResponse} MutateRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.MutateRowsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.bigtable.v2.MutateRowsResponse.Entry.decode(reader, reader.uint32())); + break; + } + case 3: { + message.rateLimitInfo = $root.google.bigtable.v2.RateLimitInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateRowsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.MutateRowsResponse} MutateRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateRowsResponse message. + * @function verify + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateRowsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.bigtable.v2.MutateRowsResponse.Entry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + if (message.rateLimitInfo != null && message.hasOwnProperty("rateLimitInfo")) { + properties._rateLimitInfo = 1; + { + var error = $root.google.bigtable.v2.RateLimitInfo.verify(message.rateLimitInfo); + if (error) + return "rateLimitInfo." + error; + } + } + return null; + }; + + /** + * Creates a MutateRowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.MutateRowsResponse} MutateRowsResponse + */ + MutateRowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.MutateRowsResponse) + return object; + var message = new $root.google.bigtable.v2.MutateRowsResponse(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.bigtable.v2.MutateRowsResponse.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.bigtable.v2.MutateRowsResponse.entries: object expected"); + message.entries[i] = $root.google.bigtable.v2.MutateRowsResponse.Entry.fromObject(object.entries[i]); + } + } + if (object.rateLimitInfo != null) { + if (typeof object.rateLimitInfo !== "object") + throw TypeError(".google.bigtable.v2.MutateRowsResponse.rateLimitInfo: object expected"); + message.rateLimitInfo = $root.google.bigtable.v2.RateLimitInfo.fromObject(object.rateLimitInfo); + } + return message; + }; + + /** + * Creates a plain object from a MutateRowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {google.bigtable.v2.MutateRowsResponse} message MutateRowsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateRowsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.bigtable.v2.MutateRowsResponse.Entry.toObject(message.entries[j], options); + } + if (message.rateLimitInfo != null && message.hasOwnProperty("rateLimitInfo")) { + object.rateLimitInfo = $root.google.bigtable.v2.RateLimitInfo.toObject(message.rateLimitInfo, options); + if (options.oneofs) + object._rateLimitInfo = "rateLimitInfo"; + } + return object; + }; + + /** + * Converts this MutateRowsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.MutateRowsResponse + * @instance + * @returns {Object.} JSON object + */ + MutateRowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateRowsResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.MutateRowsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateRowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.MutateRowsResponse"; + }; + + MutateRowsResponse.Entry = (function() { + + /** + * Properties of an Entry. + * @memberof google.bigtable.v2.MutateRowsResponse + * @interface IEntry + * @property {number|Long|null} [index] Entry index + * @property {google.rpc.IStatus|null} [status] Entry status + */ + + /** + * Constructs a new Entry. + * @memberof google.bigtable.v2.MutateRowsResponse + * @classdesc Represents an Entry. + * @implements IEntry + * @constructor + * @param {google.bigtable.v2.MutateRowsResponse.IEntry=} [properties] Properties to set + */ + function Entry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entry index. + * @member {number|Long} index + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @instance + */ + Entry.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Entry status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @instance + */ + Entry.prototype.status = null; + + /** + * Creates a new Entry instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {google.bigtable.v2.MutateRowsResponse.IEntry=} [properties] Properties to set + * @returns {google.bigtable.v2.MutateRowsResponse.Entry} Entry instance + */ + Entry.create = function create(properties) { + return new Entry(properties); + }; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.Entry.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {google.bigtable.v2.MutateRowsResponse.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.index); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.bigtable.v2.MutateRowsResponse.Entry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {google.bigtable.v2.MutateRowsResponse.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.MutateRowsResponse.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.MutateRowsResponse.Entry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.index = reader.int64(); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.MutateRowsResponse.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entry message. + * @function verify + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.MutateRowsResponse.Entry} Entry + */ + Entry.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.MutateRowsResponse.Entry) + return object; + var message = new $root.google.bigtable.v2.MutateRowsResponse.Entry(); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.bigtable.v2.MutateRowsResponse.Entry.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {google.bigtable.v2.MutateRowsResponse.Entry} message Entry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + object.status = null; + } + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this Entry to JSON. + * @function toJSON + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @instance + * @returns {Object.} JSON object + */ + Entry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entry + * @function getTypeUrl + * @memberof google.bigtable.v2.MutateRowsResponse.Entry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.MutateRowsResponse.Entry"; + }; + + return Entry; + })(); + + return MutateRowsResponse; + })(); + + v2.RateLimitInfo = (function() { + + /** + * Properties of a RateLimitInfo. + * @memberof google.bigtable.v2 + * @interface IRateLimitInfo + * @property {google.protobuf.IDuration|null} [period] RateLimitInfo period + * @property {number|null} [factor] RateLimitInfo factor + */ + + /** + * Constructs a new RateLimitInfo. + * @memberof google.bigtable.v2 + * @classdesc Represents a RateLimitInfo. + * @implements IRateLimitInfo + * @constructor + * @param {google.bigtable.v2.IRateLimitInfo=} [properties] Properties to set + */ + function RateLimitInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RateLimitInfo period. + * @member {google.protobuf.IDuration|null|undefined} period + * @memberof google.bigtable.v2.RateLimitInfo + * @instance + */ + RateLimitInfo.prototype.period = null; + + /** + * RateLimitInfo factor. + * @member {number} factor + * @memberof google.bigtable.v2.RateLimitInfo + * @instance + */ + RateLimitInfo.prototype.factor = 0; + + /** + * Creates a new RateLimitInfo instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {google.bigtable.v2.IRateLimitInfo=} [properties] Properties to set + * @returns {google.bigtable.v2.RateLimitInfo} RateLimitInfo instance + */ + RateLimitInfo.create = function create(properties) { + return new RateLimitInfo(properties); + }; + + /** + * Encodes the specified RateLimitInfo message. Does not implicitly {@link google.bigtable.v2.RateLimitInfo.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {google.bigtable.v2.IRateLimitInfo} message RateLimitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RateLimitInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.period != null && Object.hasOwnProperty.call(message, "period")) + $root.google.protobuf.Duration.encode(message.period, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.factor != null && Object.hasOwnProperty.call(message, "factor")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.factor); + return writer; + }; + + /** + * Encodes the specified RateLimitInfo message, length delimited. Does not implicitly {@link google.bigtable.v2.RateLimitInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {google.bigtable.v2.IRateLimitInfo} message RateLimitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RateLimitInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RateLimitInfo message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RateLimitInfo} RateLimitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RateLimitInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RateLimitInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.factor = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RateLimitInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RateLimitInfo} RateLimitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RateLimitInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RateLimitInfo message. + * @function verify + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RateLimitInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.period != null && message.hasOwnProperty("period")) { + var error = $root.google.protobuf.Duration.verify(message.period); + if (error) + return "period." + error; + } + if (message.factor != null && message.hasOwnProperty("factor")) + if (typeof message.factor !== "number") + return "factor: number expected"; + return null; + }; + + /** + * Creates a RateLimitInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RateLimitInfo} RateLimitInfo + */ + RateLimitInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RateLimitInfo) + return object; + var message = new $root.google.bigtable.v2.RateLimitInfo(); + if (object.period != null) { + if (typeof object.period !== "object") + throw TypeError(".google.bigtable.v2.RateLimitInfo.period: object expected"); + message.period = $root.google.protobuf.Duration.fromObject(object.period); + } + if (object.factor != null) + message.factor = Number(object.factor); + return message; + }; + + /** + * Creates a plain object from a RateLimitInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {google.bigtable.v2.RateLimitInfo} message RateLimitInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RateLimitInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.period = null; + object.factor = 0; + } + if (message.period != null && message.hasOwnProperty("period")) + object.period = $root.google.protobuf.Duration.toObject(message.period, options); + if (message.factor != null && message.hasOwnProperty("factor")) + object.factor = options.json && !isFinite(message.factor) ? String(message.factor) : message.factor; + return object; + }; + + /** + * Converts this RateLimitInfo to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RateLimitInfo + * @instance + * @returns {Object.} JSON object + */ + RateLimitInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RateLimitInfo + * @function getTypeUrl + * @memberof google.bigtable.v2.RateLimitInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RateLimitInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RateLimitInfo"; + }; + + return RateLimitInfo; + })(); + + v2.CheckAndMutateRowRequest = (function() { + + /** + * Properties of a CheckAndMutateRowRequest. + * @memberof google.bigtable.v2 + * @interface ICheckAndMutateRowRequest + * @property {string|null} [tableName] CheckAndMutateRowRequest tableName + * @property {string|null} [authorizedViewName] CheckAndMutateRowRequest authorizedViewName + * @property {string|null} [appProfileId] CheckAndMutateRowRequest appProfileId + * @property {Uint8Array|null} [rowKey] CheckAndMutateRowRequest rowKey + * @property {google.bigtable.v2.IRowFilter|null} [predicateFilter] CheckAndMutateRowRequest predicateFilter + * @property {Array.|null} [trueMutations] CheckAndMutateRowRequest trueMutations + * @property {Array.|null} [falseMutations] CheckAndMutateRowRequest falseMutations + */ + + /** + * Constructs a new CheckAndMutateRowRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a CheckAndMutateRowRequest. + * @implements ICheckAndMutateRowRequest + * @constructor + * @param {google.bigtable.v2.ICheckAndMutateRowRequest=} [properties] Properties to set + */ + function CheckAndMutateRowRequest(properties) { + this.trueMutations = []; + this.falseMutations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckAndMutateRowRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.tableName = ""; + + /** + * CheckAndMutateRowRequest authorizedViewName. + * @member {string} authorizedViewName + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.authorizedViewName = ""; + + /** + * CheckAndMutateRowRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.appProfileId = ""; + + /** + * CheckAndMutateRowRequest rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.rowKey = $util.newBuffer([]); + + /** + * CheckAndMutateRowRequest predicateFilter. + * @member {google.bigtable.v2.IRowFilter|null|undefined} predicateFilter + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.predicateFilter = null; + + /** + * CheckAndMutateRowRequest trueMutations. + * @member {Array.} trueMutations + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.trueMutations = $util.emptyArray; + + /** + * CheckAndMutateRowRequest falseMutations. + * @member {Array.} falseMutations + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.falseMutations = $util.emptyArray; + + /** + * Creates a new CheckAndMutateRowRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {google.bigtable.v2.ICheckAndMutateRowRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.CheckAndMutateRowRequest} CheckAndMutateRowRequest instance + */ + CheckAndMutateRowRequest.create = function create(properties) { + return new CheckAndMutateRowRequest(properties); + }; + + /** + * Encodes the specified CheckAndMutateRowRequest message. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {google.bigtable.v2.ICheckAndMutateRowRequest} message CheckAndMutateRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAndMutateRowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rowKey); + if (message.trueMutations != null && message.trueMutations.length) + for (var i = 0; i < message.trueMutations.length; ++i) + $root.google.bigtable.v2.Mutation.encode(message.trueMutations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.falseMutations != null && message.falseMutations.length) + for (var i = 0; i < message.falseMutations.length; ++i) + $root.google.bigtable.v2.Mutation.encode(message.falseMutations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.predicateFilter != null && Object.hasOwnProperty.call(message, "predicateFilter")) + $root.google.bigtable.v2.RowFilter.encode(message.predicateFilter, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.appProfileId); + if (message.authorizedViewName != null && Object.hasOwnProperty.call(message, "authorizedViewName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.authorizedViewName); + return writer; + }; + + /** + * Encodes the specified CheckAndMutateRowRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {google.bigtable.v2.ICheckAndMutateRowRequest} message CheckAndMutateRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAndMutateRowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckAndMutateRowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.CheckAndMutateRowRequest} CheckAndMutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAndMutateRowRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.CheckAndMutateRowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 9: { + message.authorizedViewName = reader.string(); + break; + } + case 7: { + message.appProfileId = reader.string(); + break; + } + case 2: { + message.rowKey = reader.bytes(); + break; + } + case 6: { + message.predicateFilter = $root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.trueMutations && message.trueMutations.length)) + message.trueMutations = []; + message.trueMutations.push($root.google.bigtable.v2.Mutation.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.falseMutations && message.falseMutations.length)) + message.falseMutations = []; + message.falseMutations.push($root.google.bigtable.v2.Mutation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckAndMutateRowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.CheckAndMutateRowRequest} CheckAndMutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAndMutateRowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckAndMutateRowRequest message. + * @function verify + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckAndMutateRowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + if (!$util.isString(message.authorizedViewName)) + return "authorizedViewName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer expected"; + if (message.predicateFilter != null && message.hasOwnProperty("predicateFilter")) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.predicateFilter); + if (error) + return "predicateFilter." + error; + } + if (message.trueMutations != null && message.hasOwnProperty("trueMutations")) { + if (!Array.isArray(message.trueMutations)) + return "trueMutations: array expected"; + for (var i = 0; i < message.trueMutations.length; ++i) { + var error = $root.google.bigtable.v2.Mutation.verify(message.trueMutations[i]); + if (error) + return "trueMutations." + error; + } + } + if (message.falseMutations != null && message.hasOwnProperty("falseMutations")) { + if (!Array.isArray(message.falseMutations)) + return "falseMutations: array expected"; + for (var i = 0; i < message.falseMutations.length; ++i) { + var error = $root.google.bigtable.v2.Mutation.verify(message.falseMutations[i]); + if (error) + return "falseMutations." + error; + } + } + return null; + }; + + /** + * Creates a CheckAndMutateRowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.CheckAndMutateRowRequest} CheckAndMutateRowRequest + */ + CheckAndMutateRowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.CheckAndMutateRowRequest) + return object; + var message = new $root.google.bigtable.v2.CheckAndMutateRowRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.authorizedViewName != null) + message.authorizedViewName = String(object.authorizedViewName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.predicateFilter != null) { + if (typeof object.predicateFilter !== "object") + throw TypeError(".google.bigtable.v2.CheckAndMutateRowRequest.predicateFilter: object expected"); + message.predicateFilter = $root.google.bigtable.v2.RowFilter.fromObject(object.predicateFilter); + } + if (object.trueMutations) { + if (!Array.isArray(object.trueMutations)) + throw TypeError(".google.bigtable.v2.CheckAndMutateRowRequest.trueMutations: array expected"); + message.trueMutations = []; + for (var i = 0; i < object.trueMutations.length; ++i) { + if (typeof object.trueMutations[i] !== "object") + throw TypeError(".google.bigtable.v2.CheckAndMutateRowRequest.trueMutations: object expected"); + message.trueMutations[i] = $root.google.bigtable.v2.Mutation.fromObject(object.trueMutations[i]); + } + } + if (object.falseMutations) { + if (!Array.isArray(object.falseMutations)) + throw TypeError(".google.bigtable.v2.CheckAndMutateRowRequest.falseMutations: array expected"); + message.falseMutations = []; + for (var i = 0; i < object.falseMutations.length; ++i) { + if (typeof object.falseMutations[i] !== "object") + throw TypeError(".google.bigtable.v2.CheckAndMutateRowRequest.falseMutations: object expected"); + message.falseMutations[i] = $root.google.bigtable.v2.Mutation.fromObject(object.falseMutations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CheckAndMutateRowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {google.bigtable.v2.CheckAndMutateRowRequest} message CheckAndMutateRowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckAndMutateRowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.trueMutations = []; + object.falseMutations = []; + } + if (options.defaults) { + object.tableName = ""; + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + object.predicateFilter = null; + object.appProfileId = ""; + object.authorizedViewName = ""; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.trueMutations && message.trueMutations.length) { + object.trueMutations = []; + for (var j = 0; j < message.trueMutations.length; ++j) + object.trueMutations[j] = $root.google.bigtable.v2.Mutation.toObject(message.trueMutations[j], options); + } + if (message.falseMutations && message.falseMutations.length) { + object.falseMutations = []; + for (var j = 0; j < message.falseMutations.length; ++j) + object.falseMutations[j] = $root.google.bigtable.v2.Mutation.toObject(message.falseMutations[j], options); + } + if (message.predicateFilter != null && message.hasOwnProperty("predicateFilter")) + object.predicateFilter = $root.google.bigtable.v2.RowFilter.toObject(message.predicateFilter, options); + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + object.authorizedViewName = message.authorizedViewName; + return object; + }; + + /** + * Converts this CheckAndMutateRowRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @instance + * @returns {Object.} JSON object + */ + CheckAndMutateRowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckAndMutateRowRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.CheckAndMutateRowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckAndMutateRowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.CheckAndMutateRowRequest"; + }; + + return CheckAndMutateRowRequest; + })(); + + v2.CheckAndMutateRowResponse = (function() { + + /** + * Properties of a CheckAndMutateRowResponse. + * @memberof google.bigtable.v2 + * @interface ICheckAndMutateRowResponse + * @property {boolean|null} [predicateMatched] CheckAndMutateRowResponse predicateMatched + */ + + /** + * Constructs a new CheckAndMutateRowResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a CheckAndMutateRowResponse. + * @implements ICheckAndMutateRowResponse + * @constructor + * @param {google.bigtable.v2.ICheckAndMutateRowResponse=} [properties] Properties to set + */ + function CheckAndMutateRowResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckAndMutateRowResponse predicateMatched. + * @member {boolean} predicateMatched + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @instance + */ + CheckAndMutateRowResponse.prototype.predicateMatched = false; + + /** + * Creates a new CheckAndMutateRowResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {google.bigtable.v2.ICheckAndMutateRowResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.CheckAndMutateRowResponse} CheckAndMutateRowResponse instance + */ + CheckAndMutateRowResponse.create = function create(properties) { + return new CheckAndMutateRowResponse(properties); + }; + + /** + * Encodes the specified CheckAndMutateRowResponse message. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {google.bigtable.v2.ICheckAndMutateRowResponse} message CheckAndMutateRowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAndMutateRowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.predicateMatched != null && Object.hasOwnProperty.call(message, "predicateMatched")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.predicateMatched); + return writer; + }; + + /** + * Encodes the specified CheckAndMutateRowResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.CheckAndMutateRowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {google.bigtable.v2.ICheckAndMutateRowResponse} message CheckAndMutateRowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAndMutateRowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckAndMutateRowResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.CheckAndMutateRowResponse} CheckAndMutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAndMutateRowResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.CheckAndMutateRowResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.predicateMatched = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckAndMutateRowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.CheckAndMutateRowResponse} CheckAndMutateRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAndMutateRowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckAndMutateRowResponse message. + * @function verify + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckAndMutateRowResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.predicateMatched != null && message.hasOwnProperty("predicateMatched")) + if (typeof message.predicateMatched !== "boolean") + return "predicateMatched: boolean expected"; + return null; + }; + + /** + * Creates a CheckAndMutateRowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.CheckAndMutateRowResponse} CheckAndMutateRowResponse + */ + CheckAndMutateRowResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.CheckAndMutateRowResponse) + return object; + var message = new $root.google.bigtable.v2.CheckAndMutateRowResponse(); + if (object.predicateMatched != null) + message.predicateMatched = Boolean(object.predicateMatched); + return message; + }; + + /** + * Creates a plain object from a CheckAndMutateRowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {google.bigtable.v2.CheckAndMutateRowResponse} message CheckAndMutateRowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckAndMutateRowResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.predicateMatched = false; + if (message.predicateMatched != null && message.hasOwnProperty("predicateMatched")) + object.predicateMatched = message.predicateMatched; + return object; + }; + + /** + * Converts this CheckAndMutateRowResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @instance + * @returns {Object.} JSON object + */ + CheckAndMutateRowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckAndMutateRowResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.CheckAndMutateRowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckAndMutateRowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.CheckAndMutateRowResponse"; + }; + + return CheckAndMutateRowResponse; + })(); + + v2.PingAndWarmRequest = (function() { + + /** + * Properties of a PingAndWarmRequest. + * @memberof google.bigtable.v2 + * @interface IPingAndWarmRequest + * @property {string|null} [name] PingAndWarmRequest name + * @property {string|null} [appProfileId] PingAndWarmRequest appProfileId + */ + + /** + * Constructs a new PingAndWarmRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a PingAndWarmRequest. + * @implements IPingAndWarmRequest + * @constructor + * @param {google.bigtable.v2.IPingAndWarmRequest=} [properties] Properties to set + */ + function PingAndWarmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PingAndWarmRequest name. + * @member {string} name + * @memberof google.bigtable.v2.PingAndWarmRequest + * @instance + */ + PingAndWarmRequest.prototype.name = ""; + + /** + * PingAndWarmRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.PingAndWarmRequest + * @instance + */ + PingAndWarmRequest.prototype.appProfileId = ""; + + /** + * Creates a new PingAndWarmRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {google.bigtable.v2.IPingAndWarmRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.PingAndWarmRequest} PingAndWarmRequest instance + */ + PingAndWarmRequest.create = function create(properties) { + return new PingAndWarmRequest(properties); + }; + + /** + * Encodes the specified PingAndWarmRequest message. Does not implicitly {@link google.bigtable.v2.PingAndWarmRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {google.bigtable.v2.IPingAndWarmRequest} message PingAndWarmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PingAndWarmRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + return writer; + }; + + /** + * Encodes the specified PingAndWarmRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.PingAndWarmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {google.bigtable.v2.IPingAndWarmRequest} message PingAndWarmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PingAndWarmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PingAndWarmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.PingAndWarmRequest} PingAndWarmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PingAndWarmRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.PingAndWarmRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PingAndWarmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.PingAndWarmRequest} PingAndWarmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PingAndWarmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PingAndWarmRequest message. + * @function verify + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PingAndWarmRequest.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.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + return null; + }; + + /** + * Creates a PingAndWarmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.PingAndWarmRequest} PingAndWarmRequest + */ + PingAndWarmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.PingAndWarmRequest) + return object; + var message = new $root.google.bigtable.v2.PingAndWarmRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + return message; + }; + + /** + * Creates a plain object from a PingAndWarmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {google.bigtable.v2.PingAndWarmRequest} message PingAndWarmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PingAndWarmRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.appProfileId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + return object; + }; + + /** + * Converts this PingAndWarmRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.PingAndWarmRequest + * @instance + * @returns {Object.} JSON object + */ + PingAndWarmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PingAndWarmRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.PingAndWarmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PingAndWarmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.PingAndWarmRequest"; + }; + + return PingAndWarmRequest; + })(); + + v2.PingAndWarmResponse = (function() { + + /** + * Properties of a PingAndWarmResponse. + * @memberof google.bigtable.v2 + * @interface IPingAndWarmResponse + */ + + /** + * Constructs a new PingAndWarmResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a PingAndWarmResponse. + * @implements IPingAndWarmResponse + * @constructor + * @param {google.bigtable.v2.IPingAndWarmResponse=} [properties] Properties to set + */ + function PingAndWarmResponse(properties) { + if (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 PingAndWarmResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {google.bigtable.v2.IPingAndWarmResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.PingAndWarmResponse} PingAndWarmResponse instance + */ + PingAndWarmResponse.create = function create(properties) { + return new PingAndWarmResponse(properties); + }; + + /** + * Encodes the specified PingAndWarmResponse message. Does not implicitly {@link google.bigtable.v2.PingAndWarmResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {google.bigtable.v2.IPingAndWarmResponse} message PingAndWarmResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PingAndWarmResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PingAndWarmResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.PingAndWarmResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {google.bigtable.v2.IPingAndWarmResponse} message PingAndWarmResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PingAndWarmResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PingAndWarmResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.PingAndWarmResponse} PingAndWarmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PingAndWarmResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.PingAndWarmResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PingAndWarmResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.PingAndWarmResponse} PingAndWarmResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PingAndWarmResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PingAndWarmResponse message. + * @function verify + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PingAndWarmResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PingAndWarmResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.PingAndWarmResponse} PingAndWarmResponse + */ + PingAndWarmResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.PingAndWarmResponse) + return object; + return new $root.google.bigtable.v2.PingAndWarmResponse(); + }; + + /** + * Creates a plain object from a PingAndWarmResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {google.bigtable.v2.PingAndWarmResponse} message PingAndWarmResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PingAndWarmResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PingAndWarmResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.PingAndWarmResponse + * @instance + * @returns {Object.} JSON object + */ + PingAndWarmResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PingAndWarmResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.PingAndWarmResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PingAndWarmResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.PingAndWarmResponse"; + }; + + return PingAndWarmResponse; + })(); + + v2.ReadModifyWriteRowRequest = (function() { + + /** + * Properties of a ReadModifyWriteRowRequest. + * @memberof google.bigtable.v2 + * @interface IReadModifyWriteRowRequest + * @property {string|null} [tableName] ReadModifyWriteRowRequest tableName + * @property {string|null} [authorizedViewName] ReadModifyWriteRowRequest authorizedViewName + * @property {string|null} [appProfileId] ReadModifyWriteRowRequest appProfileId + * @property {Uint8Array|null} [rowKey] ReadModifyWriteRowRequest rowKey + * @property {Array.|null} [rules] ReadModifyWriteRowRequest rules + */ + + /** + * Constructs a new ReadModifyWriteRowRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadModifyWriteRowRequest. + * @implements IReadModifyWriteRowRequest + * @constructor + * @param {google.bigtable.v2.IReadModifyWriteRowRequest=} [properties] Properties to set + */ + function ReadModifyWriteRowRequest(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]]; + } + + /** + * ReadModifyWriteRowRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @instance + */ + ReadModifyWriteRowRequest.prototype.tableName = ""; + + /** + * ReadModifyWriteRowRequest authorizedViewName. + * @member {string} authorizedViewName + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @instance + */ + ReadModifyWriteRowRequest.prototype.authorizedViewName = ""; + + /** + * ReadModifyWriteRowRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @instance + */ + ReadModifyWriteRowRequest.prototype.appProfileId = ""; + + /** + * ReadModifyWriteRowRequest rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @instance + */ + ReadModifyWriteRowRequest.prototype.rowKey = $util.newBuffer([]); + + /** + * ReadModifyWriteRowRequest rules. + * @member {Array.} rules + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @instance + */ + ReadModifyWriteRowRequest.prototype.rules = $util.emptyArray; + + /** + * Creates a new ReadModifyWriteRowRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {google.bigtable.v2.IReadModifyWriteRowRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadModifyWriteRowRequest} ReadModifyWriteRowRequest instance + */ + ReadModifyWriteRowRequest.create = function create(properties) { + return new ReadModifyWriteRowRequest(properties); + }; + + /** + * Encodes the specified ReadModifyWriteRowRequest message. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {google.bigtable.v2.IReadModifyWriteRowRequest} message ReadModifyWriteRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rowKey); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.bigtable.v2.ReadModifyWriteRule.encode(message.rules[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.appProfileId); + if (message.authorizedViewName != null && Object.hasOwnProperty.call(message, "authorizedViewName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.authorizedViewName); + return writer; + }; + + /** + * Encodes the specified ReadModifyWriteRowRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {google.bigtable.v2.IReadModifyWriteRowRequest} message ReadModifyWriteRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadModifyWriteRowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadModifyWriteRowRequest} ReadModifyWriteRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRowRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadModifyWriteRowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 6: { + message.authorizedViewName = reader.string(); + break; + } + case 4: { + message.appProfileId = reader.string(); + break; + } + case 2: { + message.rowKey = reader.bytes(); + break; + } + case 3: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.bigtable.v2.ReadModifyWriteRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadModifyWriteRowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadModifyWriteRowRequest} ReadModifyWriteRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadModifyWriteRowRequest message. + * @function verify + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadModifyWriteRowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + if (!$util.isString(message.authorizedViewName)) + return "authorizedViewName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer 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.bigtable.v2.ReadModifyWriteRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates a ReadModifyWriteRowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadModifyWriteRowRequest} ReadModifyWriteRowRequest + */ + ReadModifyWriteRowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadModifyWriteRowRequest) + return object; + var message = new $root.google.bigtable.v2.ReadModifyWriteRowRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.authorizedViewName != null) + message.authorizedViewName = String(object.authorizedViewName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.bigtable.v2.ReadModifyWriteRowRequest.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.bigtable.v2.ReadModifyWriteRowRequest.rules: object expected"); + message.rules[i] = $root.google.bigtable.v2.ReadModifyWriteRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ReadModifyWriteRowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {google.bigtable.v2.ReadModifyWriteRowRequest} message ReadModifyWriteRowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadModifyWriteRowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) { + object.tableName = ""; + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + object.appProfileId = ""; + object.authorizedViewName = ""; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.bigtable.v2.ReadModifyWriteRule.toObject(message.rules[j], options); + } + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.authorizedViewName != null && message.hasOwnProperty("authorizedViewName")) + object.authorizedViewName = message.authorizedViewName; + return object; + }; + + /** + * Converts this ReadModifyWriteRowRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @instance + * @returns {Object.} JSON object + */ + ReadModifyWriteRowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadModifyWriteRowRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadModifyWriteRowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadModifyWriteRowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadModifyWriteRowRequest"; + }; + + return ReadModifyWriteRowRequest; + })(); + + v2.ReadModifyWriteRowResponse = (function() { + + /** + * Properties of a ReadModifyWriteRowResponse. + * @memberof google.bigtable.v2 + * @interface IReadModifyWriteRowResponse + * @property {google.bigtable.v2.IRow|null} [row] ReadModifyWriteRowResponse row + */ + + /** + * Constructs a new ReadModifyWriteRowResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadModifyWriteRowResponse. + * @implements IReadModifyWriteRowResponse + * @constructor + * @param {google.bigtable.v2.IReadModifyWriteRowResponse=} [properties] Properties to set + */ + function ReadModifyWriteRowResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadModifyWriteRowResponse row. + * @member {google.bigtable.v2.IRow|null|undefined} row + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @instance + */ + ReadModifyWriteRowResponse.prototype.row = null; + + /** + * Creates a new ReadModifyWriteRowResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {google.bigtable.v2.IReadModifyWriteRowResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadModifyWriteRowResponse} ReadModifyWriteRowResponse instance + */ + ReadModifyWriteRowResponse.create = function create(properties) { + return new ReadModifyWriteRowResponse(properties); + }; + + /** + * Encodes the specified ReadModifyWriteRowResponse message. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {google.bigtable.v2.IReadModifyWriteRowResponse} message ReadModifyWriteRowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRowResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.row != null && Object.hasOwnProperty.call(message, "row")) + $root.google.bigtable.v2.Row.encode(message.row, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadModifyWriteRowResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRowResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {google.bigtable.v2.IReadModifyWriteRowResponse} message ReadModifyWriteRowResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRowResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadModifyWriteRowResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadModifyWriteRowResponse} ReadModifyWriteRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRowResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadModifyWriteRowResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.row = $root.google.bigtable.v2.Row.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadModifyWriteRowResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadModifyWriteRowResponse} ReadModifyWriteRowResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRowResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadModifyWriteRowResponse message. + * @function verify + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadModifyWriteRowResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.row != null && message.hasOwnProperty("row")) { + var error = $root.google.bigtable.v2.Row.verify(message.row); + if (error) + return "row." + error; + } + return null; + }; + + /** + * Creates a ReadModifyWriteRowResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadModifyWriteRowResponse} ReadModifyWriteRowResponse + */ + ReadModifyWriteRowResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadModifyWriteRowResponse) + return object; + var message = new $root.google.bigtable.v2.ReadModifyWriteRowResponse(); + if (object.row != null) { + if (typeof object.row !== "object") + throw TypeError(".google.bigtable.v2.ReadModifyWriteRowResponse.row: object expected"); + message.row = $root.google.bigtable.v2.Row.fromObject(object.row); + } + return message; + }; + + /** + * Creates a plain object from a ReadModifyWriteRowResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {google.bigtable.v2.ReadModifyWriteRowResponse} message ReadModifyWriteRowResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadModifyWriteRowResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.row = null; + if (message.row != null && message.hasOwnProperty("row")) + object.row = $root.google.bigtable.v2.Row.toObject(message.row, options); + return object; + }; + + /** + * Converts this ReadModifyWriteRowResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @instance + * @returns {Object.} JSON object + */ + ReadModifyWriteRowResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadModifyWriteRowResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadModifyWriteRowResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadModifyWriteRowResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadModifyWriteRowResponse"; + }; + + return ReadModifyWriteRowResponse; + })(); + + v2.GenerateInitialChangeStreamPartitionsRequest = (function() { + + /** + * Properties of a GenerateInitialChangeStreamPartitionsRequest. + * @memberof google.bigtable.v2 + * @interface IGenerateInitialChangeStreamPartitionsRequest + * @property {string|null} [tableName] GenerateInitialChangeStreamPartitionsRequest tableName + * @property {string|null} [appProfileId] GenerateInitialChangeStreamPartitionsRequest appProfileId + */ + + /** + * Constructs a new GenerateInitialChangeStreamPartitionsRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a GenerateInitialChangeStreamPartitionsRequest. + * @implements IGenerateInitialChangeStreamPartitionsRequest + * @constructor + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest=} [properties] Properties to set + */ + function GenerateInitialChangeStreamPartitionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateInitialChangeStreamPartitionsRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @instance + */ + GenerateInitialChangeStreamPartitionsRequest.prototype.tableName = ""; + + /** + * GenerateInitialChangeStreamPartitionsRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @instance + */ + GenerateInitialChangeStreamPartitionsRequest.prototype.appProfileId = ""; + + /** + * Creates a new GenerateInitialChangeStreamPartitionsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest} GenerateInitialChangeStreamPartitionsRequest instance + */ + GenerateInitialChangeStreamPartitionsRequest.create = function create(properties) { + return new GenerateInitialChangeStreamPartitionsRequest(properties); + }; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsRequest message. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest} message GenerateInitialChangeStreamPartitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateInitialChangeStreamPartitionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + return writer; + }; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest} message GenerateInitialChangeStreamPartitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateInitialChangeStreamPartitionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest} GenerateInitialChangeStreamPartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateInitialChangeStreamPartitionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest} GenerateInitialChangeStreamPartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateInitialChangeStreamPartitionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateInitialChangeStreamPartitionsRequest message. + * @function verify + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateInitialChangeStreamPartitionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + return null; + }; + + /** + * Creates a GenerateInitialChangeStreamPartitionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest} GenerateInitialChangeStreamPartitionsRequest + */ + GenerateInitialChangeStreamPartitionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest) + return object; + var message = new $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + return message; + }; + + /** + * Creates a plain object from a GenerateInitialChangeStreamPartitionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest} message GenerateInitialChangeStreamPartitionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateInitialChangeStreamPartitionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tableName = ""; + object.appProfileId = ""; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + return object; + }; + + /** + * Converts this GenerateInitialChangeStreamPartitionsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateInitialChangeStreamPartitionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateInitialChangeStreamPartitionsRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateInitialChangeStreamPartitionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest"; + }; + + return GenerateInitialChangeStreamPartitionsRequest; + })(); + + v2.GenerateInitialChangeStreamPartitionsResponse = (function() { + + /** + * Properties of a GenerateInitialChangeStreamPartitionsResponse. + * @memberof google.bigtable.v2 + * @interface IGenerateInitialChangeStreamPartitionsResponse + * @property {google.bigtable.v2.IStreamPartition|null} [partition] GenerateInitialChangeStreamPartitionsResponse partition + */ + + /** + * Constructs a new GenerateInitialChangeStreamPartitionsResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a GenerateInitialChangeStreamPartitionsResponse. + * @implements IGenerateInitialChangeStreamPartitionsResponse + * @constructor + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse=} [properties] Properties to set + */ + function GenerateInitialChangeStreamPartitionsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateInitialChangeStreamPartitionsResponse partition. + * @member {google.bigtable.v2.IStreamPartition|null|undefined} partition + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @instance + */ + GenerateInitialChangeStreamPartitionsResponse.prototype.partition = null; + + /** + * Creates a new GenerateInitialChangeStreamPartitionsResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} GenerateInitialChangeStreamPartitionsResponse instance + */ + GenerateInitialChangeStreamPartitionsResponse.create = function create(properties) { + return new GenerateInitialChangeStreamPartitionsResponse(properties); + }; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsResponse message. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse} message GenerateInitialChangeStreamPartitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateInitialChangeStreamPartitionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) + $root.google.bigtable.v2.StreamPartition.encode(message.partition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateInitialChangeStreamPartitionsResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {google.bigtable.v2.IGenerateInitialChangeStreamPartitionsResponse} message GenerateInitialChangeStreamPartitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateInitialChangeStreamPartitionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} GenerateInitialChangeStreamPartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateInitialChangeStreamPartitionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partition = $root.google.bigtable.v2.StreamPartition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateInitialChangeStreamPartitionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} GenerateInitialChangeStreamPartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateInitialChangeStreamPartitionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateInitialChangeStreamPartitionsResponse message. + * @function verify + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateInitialChangeStreamPartitionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partition != null && message.hasOwnProperty("partition")) { + var error = $root.google.bigtable.v2.StreamPartition.verify(message.partition); + if (error) + return "partition." + error; + } + return null; + }; + + /** + * Creates a GenerateInitialChangeStreamPartitionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} GenerateInitialChangeStreamPartitionsResponse + */ + GenerateInitialChangeStreamPartitionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) + return object; + var message = new $root.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse(); + if (object.partition != null) { + if (typeof object.partition !== "object") + throw TypeError(".google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.partition: object expected"); + message.partition = $root.google.bigtable.v2.StreamPartition.fromObject(object.partition); + } + return message; + }; + + /** + * Creates a plain object from a GenerateInitialChangeStreamPartitionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} message GenerateInitialChangeStreamPartitionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateInitialChangeStreamPartitionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.partition = null; + if (message.partition != null && message.hasOwnProperty("partition")) + object.partition = $root.google.bigtable.v2.StreamPartition.toObject(message.partition, options); + return object; + }; + + /** + * Converts this GenerateInitialChangeStreamPartitionsResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateInitialChangeStreamPartitionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateInitialChangeStreamPartitionsResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateInitialChangeStreamPartitionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse"; + }; + + return GenerateInitialChangeStreamPartitionsResponse; + })(); + + v2.ReadChangeStreamRequest = (function() { + + /** + * Properties of a ReadChangeStreamRequest. + * @memberof google.bigtable.v2 + * @interface IReadChangeStreamRequest + * @property {string|null} [tableName] ReadChangeStreamRequest tableName + * @property {string|null} [appProfileId] ReadChangeStreamRequest appProfileId + * @property {google.bigtable.v2.IStreamPartition|null} [partition] ReadChangeStreamRequest partition + * @property {google.protobuf.ITimestamp|null} [startTime] ReadChangeStreamRequest startTime + * @property {google.bigtable.v2.IStreamContinuationTokens|null} [continuationTokens] ReadChangeStreamRequest continuationTokens + * @property {google.protobuf.ITimestamp|null} [endTime] ReadChangeStreamRequest endTime + * @property {google.protobuf.IDuration|null} [heartbeatDuration] ReadChangeStreamRequest heartbeatDuration + */ + + /** + * Constructs a new ReadChangeStreamRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadChangeStreamRequest. + * @implements IReadChangeStreamRequest + * @constructor + * @param {google.bigtable.v2.IReadChangeStreamRequest=} [properties] Properties to set + */ + function ReadChangeStreamRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadChangeStreamRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.tableName = ""; + + /** + * ReadChangeStreamRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.appProfileId = ""; + + /** + * ReadChangeStreamRequest partition. + * @member {google.bigtable.v2.IStreamPartition|null|undefined} partition + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.partition = null; + + /** + * ReadChangeStreamRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.startTime = null; + + /** + * ReadChangeStreamRequest continuationTokens. + * @member {google.bigtable.v2.IStreamContinuationTokens|null|undefined} continuationTokens + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.continuationTokens = null; + + /** + * ReadChangeStreamRequest endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.endTime = null; + + /** + * ReadChangeStreamRequest heartbeatDuration. + * @member {google.protobuf.IDuration|null|undefined} heartbeatDuration + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + ReadChangeStreamRequest.prototype.heartbeatDuration = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadChangeStreamRequest startFrom. + * @member {"startTime"|"continuationTokens"|undefined} startFrom + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + */ + Object.defineProperty(ReadChangeStreamRequest.prototype, "startFrom", { + get: $util.oneOfGetter($oneOfFields = ["startTime", "continuationTokens"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadChangeStreamRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {google.bigtable.v2.IReadChangeStreamRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamRequest} ReadChangeStreamRequest instance + */ + ReadChangeStreamRequest.create = function create(properties) { + return new ReadChangeStreamRequest(properties); + }; + + /** + * Encodes the specified ReadChangeStreamRequest message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {google.bigtable.v2.IReadChangeStreamRequest} message ReadChangeStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadChangeStreamRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) + $root.google.bigtable.v2.StreamPartition.encode(message.partition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.continuationTokens != null && Object.hasOwnProperty.call(message, "continuationTokens")) + $root.google.bigtable.v2.StreamContinuationTokens.encode(message.continuationTokens, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.heartbeatDuration != null && Object.hasOwnProperty.call(message, "heartbeatDuration")) + $root.google.protobuf.Duration.encode(message.heartbeatDuration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadChangeStreamRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {google.bigtable.v2.IReadChangeStreamRequest} message ReadChangeStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadChangeStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadChangeStreamRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamRequest} ReadChangeStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadChangeStreamRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + case 3: { + message.partition = $root.google.bigtable.v2.StreamPartition.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.continuationTokens = $root.google.bigtable.v2.StreamContinuationTokens.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.heartbeatDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadChangeStreamRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamRequest} ReadChangeStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadChangeStreamRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadChangeStreamRequest message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadChangeStreamRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.partition != null && message.hasOwnProperty("partition")) { + var error = $root.google.bigtable.v2.StreamPartition.verify(message.partition); + if (error) + return "partition." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + properties.startFrom = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + } + if (message.continuationTokens != null && message.hasOwnProperty("continuationTokens")) { + if (properties.startFrom === 1) + return "startFrom: multiple values"; + properties.startFrom = 1; + { + var error = $root.google.bigtable.v2.StreamContinuationTokens.verify(message.continuationTokens); + if (error) + return "continuationTokens." + error; + } + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.heartbeatDuration != null && message.hasOwnProperty("heartbeatDuration")) { + var error = $root.google.protobuf.Duration.verify(message.heartbeatDuration); + if (error) + return "heartbeatDuration." + error; + } + return null; + }; + + /** + * Creates a ReadChangeStreamRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamRequest} ReadChangeStreamRequest + */ + ReadChangeStreamRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamRequest) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamRequest(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.partition != null) { + if (typeof object.partition !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamRequest.partition: object expected"); + message.partition = $root.google.bigtable.v2.StreamPartition.fromObject(object.partition); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.continuationTokens != null) { + if (typeof object.continuationTokens !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamRequest.continuationTokens: object expected"); + message.continuationTokens = $root.google.bigtable.v2.StreamContinuationTokens.fromObject(object.continuationTokens); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamRequest.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.heartbeatDuration != null) { + if (typeof object.heartbeatDuration !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamRequest.heartbeatDuration: object expected"); + message.heartbeatDuration = $root.google.protobuf.Duration.fromObject(object.heartbeatDuration); + } + return message; + }; + + /** + * Creates a plain object from a ReadChangeStreamRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {google.bigtable.v2.ReadChangeStreamRequest} message ReadChangeStreamRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadChangeStreamRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tableName = ""; + object.appProfileId = ""; + object.partition = null; + object.endTime = null; + object.heartbeatDuration = null; + } + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.partition != null && message.hasOwnProperty("partition")) + object.partition = $root.google.bigtable.v2.StreamPartition.toObject(message.partition, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) { + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (options.oneofs) + object.startFrom = "startTime"; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.continuationTokens != null && message.hasOwnProperty("continuationTokens")) { + object.continuationTokens = $root.google.bigtable.v2.StreamContinuationTokens.toObject(message.continuationTokens, options); + if (options.oneofs) + object.startFrom = "continuationTokens"; + } + if (message.heartbeatDuration != null && message.hasOwnProperty("heartbeatDuration")) + object.heartbeatDuration = $root.google.protobuf.Duration.toObject(message.heartbeatDuration, options); + return object; + }; + + /** + * Converts this ReadChangeStreamRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @instance + * @returns {Object.} JSON object + */ + ReadChangeStreamRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadChangeStreamRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadChangeStreamRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamRequest"; + }; + + return ReadChangeStreamRequest; + })(); + + v2.ReadChangeStreamResponse = (function() { + + /** + * Properties of a ReadChangeStreamResponse. + * @memberof google.bigtable.v2 + * @interface IReadChangeStreamResponse + * @property {google.bigtable.v2.ReadChangeStreamResponse.IDataChange|null} [dataChange] ReadChangeStreamResponse dataChange + * @property {google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat|null} [heartbeat] ReadChangeStreamResponse heartbeat + * @property {google.bigtable.v2.ReadChangeStreamResponse.ICloseStream|null} [closeStream] ReadChangeStreamResponse closeStream + */ + + /** + * Constructs a new ReadChangeStreamResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadChangeStreamResponse. + * @implements IReadChangeStreamResponse + * @constructor + * @param {google.bigtable.v2.IReadChangeStreamResponse=} [properties] Properties to set + */ + function ReadChangeStreamResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadChangeStreamResponse dataChange. + * @member {google.bigtable.v2.ReadChangeStreamResponse.IDataChange|null|undefined} dataChange + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @instance + */ + ReadChangeStreamResponse.prototype.dataChange = null; + + /** + * ReadChangeStreamResponse heartbeat. + * @member {google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat|null|undefined} heartbeat + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @instance + */ + ReadChangeStreamResponse.prototype.heartbeat = null; + + /** + * ReadChangeStreamResponse closeStream. + * @member {google.bigtable.v2.ReadChangeStreamResponse.ICloseStream|null|undefined} closeStream + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @instance + */ + ReadChangeStreamResponse.prototype.closeStream = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadChangeStreamResponse streamRecord. + * @member {"dataChange"|"heartbeat"|"closeStream"|undefined} streamRecord + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @instance + */ + Object.defineProperty(ReadChangeStreamResponse.prototype, "streamRecord", { + get: $util.oneOfGetter($oneOfFields = ["dataChange", "heartbeat", "closeStream"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadChangeStreamResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {google.bigtable.v2.IReadChangeStreamResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamResponse} ReadChangeStreamResponse instance + */ + ReadChangeStreamResponse.create = function create(properties) { + return new ReadChangeStreamResponse(properties); + }; + + /** + * Encodes the specified ReadChangeStreamResponse message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {google.bigtable.v2.IReadChangeStreamResponse} message ReadChangeStreamResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadChangeStreamResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataChange != null && Object.hasOwnProperty.call(message, "dataChange")) + $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.encode(message.dataChange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.heartbeat != null && Object.hasOwnProperty.call(message, "heartbeat")) + $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.encode(message.heartbeat, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.closeStream != null && Object.hasOwnProperty.call(message, "closeStream")) + $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.encode(message.closeStream, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadChangeStreamResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {google.bigtable.v2.IReadChangeStreamResponse} message ReadChangeStreamResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadChangeStreamResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadChangeStreamResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamResponse} ReadChangeStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadChangeStreamResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataChange = $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.decode(reader, reader.uint32()); + break; + } + case 2: { + message.heartbeat = $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.decode(reader, reader.uint32()); + break; + } + case 3: { + message.closeStream = $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadChangeStreamResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamResponse} ReadChangeStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadChangeStreamResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadChangeStreamResponse message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadChangeStreamResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataChange != null && message.hasOwnProperty("dataChange")) { + properties.streamRecord = 1; + { + var error = $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.verify(message.dataChange); + if (error) + return "dataChange." + error; + } + } + if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { + if (properties.streamRecord === 1) + return "streamRecord: multiple values"; + properties.streamRecord = 1; + { + var error = $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.verify(message.heartbeat); + if (error) + return "heartbeat." + error; + } + } + if (message.closeStream != null && message.hasOwnProperty("closeStream")) { + if (properties.streamRecord === 1) + return "streamRecord: multiple values"; + properties.streamRecord = 1; + { + var error = $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.verify(message.closeStream); + if (error) + return "closeStream." + error; + } + } + return null; + }; + + /** + * Creates a ReadChangeStreamResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamResponse} ReadChangeStreamResponse + */ + ReadChangeStreamResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamResponse) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamResponse(); + if (object.dataChange != null) { + if (typeof object.dataChange !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.dataChange: object expected"); + message.dataChange = $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.fromObject(object.dataChange); + } + if (object.heartbeat != null) { + if (typeof object.heartbeat !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.heartbeat: object expected"); + message.heartbeat = $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.fromObject(object.heartbeat); + } + if (object.closeStream != null) { + if (typeof object.closeStream !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.closeStream: object expected"); + message.closeStream = $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.fromObject(object.closeStream); + } + return message; + }; + + /** + * Creates a plain object from a ReadChangeStreamResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse} message ReadChangeStreamResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadChangeStreamResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.dataChange != null && message.hasOwnProperty("dataChange")) { + object.dataChange = $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.toObject(message.dataChange, options); + if (options.oneofs) + object.streamRecord = "dataChange"; + } + if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { + object.heartbeat = $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.toObject(message.heartbeat, options); + if (options.oneofs) + object.streamRecord = "heartbeat"; + } + if (message.closeStream != null && message.hasOwnProperty("closeStream")) { + object.closeStream = $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.toObject(message.closeStream, options); + if (options.oneofs) + object.streamRecord = "closeStream"; + } + return object; + }; + + /** + * Converts this ReadChangeStreamResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @instance + * @returns {Object.} JSON object + */ + ReadChangeStreamResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadChangeStreamResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadChangeStreamResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamResponse"; + }; + + ReadChangeStreamResponse.MutationChunk = (function() { + + /** + * Properties of a MutationChunk. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @interface IMutationChunk + * @property {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo|null} [chunkInfo] MutationChunk chunkInfo + * @property {google.bigtable.v2.IMutation|null} [mutation] MutationChunk mutation + */ + + /** + * Constructs a new MutationChunk. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @classdesc Represents a MutationChunk. + * @implements IMutationChunk + * @constructor + * @param {google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk=} [properties] Properties to set + */ + function MutationChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutationChunk chunkInfo. + * @member {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo|null|undefined} chunkInfo + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @instance + */ + MutationChunk.prototype.chunkInfo = null; + + /** + * MutationChunk mutation. + * @member {google.bigtable.v2.IMutation|null|undefined} mutation + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @instance + */ + MutationChunk.prototype.mutation = null; + + /** + * Creates a new MutationChunk instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk} MutationChunk instance + */ + MutationChunk.create = function create(properties) { + return new MutationChunk(properties); + }; + + /** + * Encodes the specified MutationChunk message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk} message MutationChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkInfo != null && Object.hasOwnProperty.call(message, "chunkInfo")) + $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.encode(message.chunkInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mutation != null && Object.hasOwnProperty.call(message, "mutation")) + $root.google.bigtable.v2.Mutation.encode(message.mutation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutationChunk message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IMutationChunk} message MutationChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutationChunk message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk} MutationChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationChunk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chunkInfo = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + message.mutation = $root.google.bigtable.v2.Mutation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutationChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk} MutationChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutationChunk message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutationChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkInfo != null && message.hasOwnProperty("chunkInfo")) { + var error = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.verify(message.chunkInfo); + if (error) + return "chunkInfo." + error; + } + if (message.mutation != null && message.hasOwnProperty("mutation")) { + var error = $root.google.bigtable.v2.Mutation.verify(message.mutation); + if (error) + return "mutation." + error; + } + return null; + }; + + /** + * Creates a MutationChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk} MutationChunk + */ + MutationChunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk(); + if (object.chunkInfo != null) { + if (typeof object.chunkInfo !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.chunkInfo: object expected"); + message.chunkInfo = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.fromObject(object.chunkInfo); + } + if (object.mutation != null) { + if (typeof object.mutation !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.mutation: object expected"); + message.mutation = $root.google.bigtable.v2.Mutation.fromObject(object.mutation); + } + return message; + }; + + /** + * Creates a plain object from a MutationChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk} message MutationChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutationChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chunkInfo = null; + object.mutation = null; + } + if (message.chunkInfo != null && message.hasOwnProperty("chunkInfo")) + object.chunkInfo = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.toObject(message.chunkInfo, options); + if (message.mutation != null && message.hasOwnProperty("mutation")) + object.mutation = $root.google.bigtable.v2.Mutation.toObject(message.mutation, options); + return object; + }; + + /** + * Converts this MutationChunk to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @instance + * @returns {Object.} JSON object + */ + MutationChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutationChunk + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutationChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamResponse.MutationChunk"; + }; + + MutationChunk.ChunkInfo = (function() { + + /** + * Properties of a ChunkInfo. + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @interface IChunkInfo + * @property {number|null} [chunkedValueSize] ChunkInfo chunkedValueSize + * @property {number|null} [chunkedValueOffset] ChunkInfo chunkedValueOffset + * @property {boolean|null} [lastChunk] ChunkInfo lastChunk + */ + + /** + * Constructs a new ChunkInfo. + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + * @classdesc Represents a ChunkInfo. + * @implements IChunkInfo + * @constructor + * @param {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo=} [properties] Properties to set + */ + function ChunkInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChunkInfo chunkedValueSize. + * @member {number} chunkedValueSize + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @instance + */ + ChunkInfo.prototype.chunkedValueSize = 0; + + /** + * ChunkInfo chunkedValueOffset. + * @member {number} chunkedValueOffset + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @instance + */ + ChunkInfo.prototype.chunkedValueOffset = 0; + + /** + * ChunkInfo lastChunk. + * @member {boolean} lastChunk + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @instance + */ + ChunkInfo.prototype.lastChunk = false; + + /** + * Creates a new ChunkInfo instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo} ChunkInfo instance + */ + ChunkInfo.create = function create(properties) { + return new ChunkInfo(properties); + }; + + /** + * Encodes the specified ChunkInfo message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo} message ChunkInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkedValueSize != null && Object.hasOwnProperty.call(message, "chunkedValueSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.chunkedValueSize); + if (message.chunkedValueOffset != null && Object.hasOwnProperty.call(message, "chunkedValueOffset")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.chunkedValueOffset); + if (message.lastChunk != null && Object.hasOwnProperty.call(message, "lastChunk")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.lastChunk); + return writer; + }; + + /** + * Encodes the specified ChunkInfo message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.IChunkInfo} message ChunkInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkInfo message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo} ChunkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chunkedValueSize = reader.int32(); + break; + } + case 2: { + message.chunkedValueOffset = reader.int32(); + break; + } + case 3: { + message.lastChunk = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo} ChunkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkInfo message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkedValueSize != null && message.hasOwnProperty("chunkedValueSize")) + if (!$util.isInteger(message.chunkedValueSize)) + return "chunkedValueSize: integer expected"; + if (message.chunkedValueOffset != null && message.hasOwnProperty("chunkedValueOffset")) + if (!$util.isInteger(message.chunkedValueOffset)) + return "chunkedValueOffset: integer expected"; + if (message.lastChunk != null && message.hasOwnProperty("lastChunk")) + if (typeof message.lastChunk !== "boolean") + return "lastChunk: boolean expected"; + return null; + }; + + /** + * Creates a ChunkInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo} ChunkInfo + */ + ChunkInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo(); + if (object.chunkedValueSize != null) + message.chunkedValueSize = object.chunkedValueSize | 0; + if (object.chunkedValueOffset != null) + message.chunkedValueOffset = object.chunkedValueOffset | 0; + if (object.lastChunk != null) + message.lastChunk = Boolean(object.lastChunk); + return message; + }; + + /** + * Creates a plain object from a ChunkInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo} message ChunkInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chunkedValueSize = 0; + object.chunkedValueOffset = 0; + object.lastChunk = false; + } + if (message.chunkedValueSize != null && message.hasOwnProperty("chunkedValueSize")) + object.chunkedValueSize = message.chunkedValueSize; + if (message.chunkedValueOffset != null && message.hasOwnProperty("chunkedValueOffset")) + object.chunkedValueOffset = message.chunkedValueOffset; + if (message.lastChunk != null && message.hasOwnProperty("lastChunk")) + object.lastChunk = message.lastChunk; + return object; + }; + + /** + * Converts this ChunkInfo to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @instance + * @returns {Object.} JSON object + */ + ChunkInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkInfo + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo"; + }; + + return ChunkInfo; + })(); + + return MutationChunk; + })(); + + ReadChangeStreamResponse.DataChange = (function() { + + /** + * Properties of a DataChange. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @interface IDataChange + * @property {google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type|null} [type] DataChange type + * @property {string|null} [sourceClusterId] DataChange sourceClusterId + * @property {Uint8Array|null} [rowKey] DataChange rowKey + * @property {google.protobuf.ITimestamp|null} [commitTimestamp] DataChange commitTimestamp + * @property {number|null} [tiebreaker] DataChange tiebreaker + * @property {Array.|null} [chunks] DataChange chunks + * @property {boolean|null} [done] DataChange done + * @property {string|null} [token] DataChange token + * @property {google.protobuf.ITimestamp|null} [estimatedLowWatermark] DataChange estimatedLowWatermark + */ + + /** + * Constructs a new DataChange. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @classdesc Represents a DataChange. + * @implements IDataChange + * @constructor + * @param {google.bigtable.v2.ReadChangeStreamResponse.IDataChange=} [properties] Properties to set + */ + function DataChange(properties) { + this.chunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataChange type. + * @member {google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type} type + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.type = 0; + + /** + * DataChange sourceClusterId. + * @member {string} sourceClusterId + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.sourceClusterId = ""; + + /** + * DataChange rowKey. + * @member {Uint8Array} rowKey + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.rowKey = $util.newBuffer([]); + + /** + * DataChange commitTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.commitTimestamp = null; + + /** + * DataChange tiebreaker. + * @member {number} tiebreaker + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.tiebreaker = 0; + + /** + * DataChange chunks. + * @member {Array.} chunks + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.chunks = $util.emptyArray; + + /** + * DataChange done. + * @member {boolean} done + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.done = false; + + /** + * DataChange token. + * @member {string} token + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.token = ""; + + /** + * DataChange estimatedLowWatermark. + * @member {google.protobuf.ITimestamp|null|undefined} estimatedLowWatermark + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + */ + DataChange.prototype.estimatedLowWatermark = null; + + /** + * Creates a new DataChange instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IDataChange=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamResponse.DataChange} DataChange instance + */ + DataChange.create = function create(properties) { + return new DataChange(properties); + }; + + /** + * Encodes the specified DataChange message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.DataChange.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IDataChange} message DataChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataChange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.sourceClusterId != null && Object.hasOwnProperty.call(message, "sourceClusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceClusterId); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.rowKey); + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tiebreaker != null && Object.hasOwnProperty.call(message, "tiebreaker")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.tiebreaker); + if (message.chunks != null && message.chunks.length) + for (var i = 0; i < message.chunks.length; ++i) + $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.encode(message.chunks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.done); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.token); + if (message.estimatedLowWatermark != null && Object.hasOwnProperty.call(message, "estimatedLowWatermark")) + $root.google.protobuf.Timestamp.encode(message.estimatedLowWatermark, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataChange message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.DataChange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IDataChange} message DataChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataChange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataChange message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamResponse.DataChange} DataChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataChange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.sourceClusterId = reader.string(); + break; + } + case 3: { + message.rowKey = reader.bytes(); + break; + } + case 4: { + message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.tiebreaker = reader.int32(); + break; + } + case 6: { + if (!(message.chunks && message.chunks.length)) + message.chunks = []; + message.chunks.push($root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.decode(reader, reader.uint32())); + break; + } + case 8: { + message.done = reader.bool(); + break; + } + case 9: { + message.token = reader.string(); + break; + } + case 10: { + message.estimatedLowWatermark = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataChange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamResponse.DataChange} DataChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataChange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataChange message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataChange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sourceClusterId != null && message.hasOwnProperty("sourceClusterId")) + if (!$util.isString(message.sourceClusterId)) + return "sourceClusterId: string expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!(message.rowKey && typeof message.rowKey.length === "number" || $util.isString(message.rowKey))) + return "rowKey: buffer expected"; + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); + if (error) + return "commitTimestamp." + error; + } + if (message.tiebreaker != null && message.hasOwnProperty("tiebreaker")) + if (!$util.isInteger(message.tiebreaker)) + return "tiebreaker: integer expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) { + if (!Array.isArray(message.chunks)) + return "chunks: array expected"; + for (var i = 0; i < message.chunks.length; ++i) { + var error = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.verify(message.chunks[i]); + if (error) + return "chunks." + error; + } + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.estimatedLowWatermark != null && message.hasOwnProperty("estimatedLowWatermark")) { + var error = $root.google.protobuf.Timestamp.verify(message.estimatedLowWatermark); + if (error) + return "estimatedLowWatermark." + error; + } + return null; + }; + + /** + * Creates a DataChange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamResponse.DataChange} DataChange + */ + DataChange.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "USER": + case 1: + message.type = 1; + break; + case "GARBAGE_COLLECTION": + case 2: + message.type = 2; + break; + case "CONTINUATION": + case 3: + message.type = 3; + break; + } + if (object.sourceClusterId != null) + message.sourceClusterId = String(object.sourceClusterId); + if (object.rowKey != null) + if (typeof object.rowKey === "string") + $util.base64.decode(object.rowKey, message.rowKey = $util.newBuffer($util.base64.length(object.rowKey)), 0); + else if (object.rowKey.length >= 0) + message.rowKey = object.rowKey; + if (object.commitTimestamp != null) { + if (typeof object.commitTimestamp !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.DataChange.commitTimestamp: object expected"); + message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); + } + if (object.tiebreaker != null) + message.tiebreaker = object.tiebreaker | 0; + if (object.chunks) { + if (!Array.isArray(object.chunks)) + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.DataChange.chunks: array expected"); + message.chunks = []; + for (var i = 0; i < object.chunks.length; ++i) { + if (typeof object.chunks[i] !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.DataChange.chunks: object expected"); + message.chunks[i] = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.fromObject(object.chunks[i]); + } + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.token != null) + message.token = String(object.token); + if (object.estimatedLowWatermark != null) { + if (typeof object.estimatedLowWatermark !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.DataChange.estimatedLowWatermark: object expected"); + message.estimatedLowWatermark = $root.google.protobuf.Timestamp.fromObject(object.estimatedLowWatermark); + } + return message; + }; + + /** + * Creates a plain object from a DataChange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.DataChange} message DataChange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataChange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.chunks = []; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.sourceClusterId = ""; + if (options.bytes === String) + object.rowKey = ""; + else { + object.rowKey = []; + if (options.bytes !== Array) + object.rowKey = $util.newBuffer(object.rowKey); + } + object.commitTimestamp = null; + object.tiebreaker = 0; + object.done = false; + object.token = ""; + object.estimatedLowWatermark = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type[message.type] === undefined ? message.type : $root.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type[message.type] : message.type; + if (message.sourceClusterId != null && message.hasOwnProperty("sourceClusterId")) + object.sourceClusterId = message.sourceClusterId; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = options.bytes === String ? $util.base64.encode(message.rowKey, 0, message.rowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKey) : message.rowKey; + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); + if (message.tiebreaker != null && message.hasOwnProperty("tiebreaker")) + object.tiebreaker = message.tiebreaker; + if (message.chunks && message.chunks.length) { + object.chunks = []; + for (var j = 0; j < message.chunks.length; ++j) + object.chunks[j] = $root.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.toObject(message.chunks[j], options); + } + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.estimatedLowWatermark != null && message.hasOwnProperty("estimatedLowWatermark")) + object.estimatedLowWatermark = $root.google.protobuf.Timestamp.toObject(message.estimatedLowWatermark, options); + return object; + }; + + /** + * Converts this DataChange to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @instance + * @returns {Object.} JSON object + */ + DataChange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataChange + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamResponse.DataChange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataChange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamResponse.DataChange"; + }; + + /** + * Type enum. + * @name google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} USER=1 USER value + * @property {number} GARBAGE_COLLECTION=2 GARBAGE_COLLECTION value + * @property {number} CONTINUATION=3 CONTINUATION value + */ + DataChange.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER"] = 1; + values[valuesById[2] = "GARBAGE_COLLECTION"] = 2; + values[valuesById[3] = "CONTINUATION"] = 3; + return values; + })(); + + return DataChange; + })(); + + ReadChangeStreamResponse.Heartbeat = (function() { + + /** + * Properties of a Heartbeat. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @interface IHeartbeat + * @property {google.bigtable.v2.IStreamContinuationToken|null} [continuationToken] Heartbeat continuationToken + * @property {google.protobuf.ITimestamp|null} [estimatedLowWatermark] Heartbeat estimatedLowWatermark + */ + + /** + * Constructs a new Heartbeat. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @classdesc Represents a Heartbeat. + * @implements IHeartbeat + * @constructor + * @param {google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat=} [properties] Properties to set + */ + function Heartbeat(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Heartbeat continuationToken. + * @member {google.bigtable.v2.IStreamContinuationToken|null|undefined} continuationToken + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @instance + */ + Heartbeat.prototype.continuationToken = null; + + /** + * Heartbeat estimatedLowWatermark. + * @member {google.protobuf.ITimestamp|null|undefined} estimatedLowWatermark + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @instance + */ + Heartbeat.prototype.estimatedLowWatermark = null; + + /** + * Creates a new Heartbeat instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamResponse.Heartbeat} Heartbeat instance + */ + Heartbeat.create = function create(properties) { + return new Heartbeat(properties); + }; + + /** + * Encodes the specified Heartbeat message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat} message Heartbeat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Heartbeat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.continuationToken != null && Object.hasOwnProperty.call(message, "continuationToken")) + $root.google.bigtable.v2.StreamContinuationToken.encode(message.continuationToken, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.estimatedLowWatermark != null && Object.hasOwnProperty.call(message, "estimatedLowWatermark")) + $root.google.protobuf.Timestamp.encode(message.estimatedLowWatermark, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Heartbeat message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.IHeartbeat} message Heartbeat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Heartbeat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Heartbeat message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamResponse.Heartbeat} Heartbeat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Heartbeat.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.continuationToken = $root.google.bigtable.v2.StreamContinuationToken.decode(reader, reader.uint32()); + break; + } + case 2: { + message.estimatedLowWatermark = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Heartbeat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamResponse.Heartbeat} Heartbeat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Heartbeat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Heartbeat message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Heartbeat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.continuationToken != null && message.hasOwnProperty("continuationToken")) { + var error = $root.google.bigtable.v2.StreamContinuationToken.verify(message.continuationToken); + if (error) + return "continuationToken." + error; + } + if (message.estimatedLowWatermark != null && message.hasOwnProperty("estimatedLowWatermark")) { + var error = $root.google.protobuf.Timestamp.verify(message.estimatedLowWatermark); + if (error) + return "estimatedLowWatermark." + error; + } + return null; + }; + + /** + * Creates a Heartbeat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamResponse.Heartbeat} Heartbeat + */ + Heartbeat.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat(); + if (object.continuationToken != null) { + if (typeof object.continuationToken !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.continuationToken: object expected"); + message.continuationToken = $root.google.bigtable.v2.StreamContinuationToken.fromObject(object.continuationToken); + } + if (object.estimatedLowWatermark != null) { + if (typeof object.estimatedLowWatermark !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.estimatedLowWatermark: object expected"); + message.estimatedLowWatermark = $root.google.protobuf.Timestamp.fromObject(object.estimatedLowWatermark); + } + return message; + }; + + /** + * Creates a plain object from a Heartbeat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.Heartbeat} message Heartbeat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Heartbeat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.continuationToken = null; + object.estimatedLowWatermark = null; + } + if (message.continuationToken != null && message.hasOwnProperty("continuationToken")) + object.continuationToken = $root.google.bigtable.v2.StreamContinuationToken.toObject(message.continuationToken, options); + if (message.estimatedLowWatermark != null && message.hasOwnProperty("estimatedLowWatermark")) + object.estimatedLowWatermark = $root.google.protobuf.Timestamp.toObject(message.estimatedLowWatermark, options); + return object; + }; + + /** + * Converts this Heartbeat to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @instance + * @returns {Object.} JSON object + */ + Heartbeat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Heartbeat + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamResponse.Heartbeat + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Heartbeat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamResponse.Heartbeat"; + }; + + return Heartbeat; + })(); + + ReadChangeStreamResponse.CloseStream = (function() { + + /** + * Properties of a CloseStream. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @interface ICloseStream + * @property {google.rpc.IStatus|null} [status] CloseStream status + * @property {Array.|null} [continuationTokens] CloseStream continuationTokens + * @property {Array.|null} [newPartitions] CloseStream newPartitions + */ + + /** + * Constructs a new CloseStream. + * @memberof google.bigtable.v2.ReadChangeStreamResponse + * @classdesc Represents a CloseStream. + * @implements ICloseStream + * @constructor + * @param {google.bigtable.v2.ReadChangeStreamResponse.ICloseStream=} [properties] Properties to set + */ + function CloseStream(properties) { + this.continuationTokens = []; + this.newPartitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloseStream status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @instance + */ + CloseStream.prototype.status = null; + + /** + * CloseStream continuationTokens. + * @member {Array.} continuationTokens + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @instance + */ + CloseStream.prototype.continuationTokens = $util.emptyArray; + + /** + * CloseStream newPartitions. + * @member {Array.} newPartitions + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @instance + */ + CloseStream.prototype.newPartitions = $util.emptyArray; + + /** + * Creates a new CloseStream instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.ICloseStream=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadChangeStreamResponse.CloseStream} CloseStream instance + */ + CloseStream.create = function create(properties) { + return new CloseStream(properties); + }; + + /** + * Encodes the specified CloseStream message. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.CloseStream.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.ICloseStream} message CloseStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseStream.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.continuationTokens != null && message.continuationTokens.length) + for (var i = 0; i < message.continuationTokens.length; ++i) + $root.google.bigtable.v2.StreamContinuationToken.encode(message.continuationTokens[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newPartitions != null && message.newPartitions.length) + for (var i = 0; i < message.newPartitions.length; ++i) + $root.google.bigtable.v2.StreamPartition.encode(message.newPartitions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloseStream message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadChangeStreamResponse.CloseStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.ICloseStream} message CloseStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseStream.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloseStream message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadChangeStreamResponse.CloseStream} CloseStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseStream.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.continuationTokens && message.continuationTokens.length)) + message.continuationTokens = []; + message.continuationTokens.push($root.google.bigtable.v2.StreamContinuationToken.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.newPartitions && message.newPartitions.length)) + message.newPartitions = []; + message.newPartitions.push($root.google.bigtable.v2.StreamPartition.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloseStream message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadChangeStreamResponse.CloseStream} CloseStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseStream.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloseStream message. + * @function verify + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloseStream.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.continuationTokens != null && message.hasOwnProperty("continuationTokens")) { + if (!Array.isArray(message.continuationTokens)) + return "continuationTokens: array expected"; + for (var i = 0; i < message.continuationTokens.length; ++i) { + var error = $root.google.bigtable.v2.StreamContinuationToken.verify(message.continuationTokens[i]); + if (error) + return "continuationTokens." + error; + } + } + if (message.newPartitions != null && message.hasOwnProperty("newPartitions")) { + if (!Array.isArray(message.newPartitions)) + return "newPartitions: array expected"; + for (var i = 0; i < message.newPartitions.length; ++i) { + var error = $root.google.bigtable.v2.StreamPartition.verify(message.newPartitions[i]); + if (error) + return "newPartitions." + error; + } + } + return null; + }; + + /** + * Creates a CloseStream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadChangeStreamResponse.CloseStream} CloseStream + */ + CloseStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) + return object; + var message = new $root.google.bigtable.v2.ReadChangeStreamResponse.CloseStream(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.CloseStream.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.continuationTokens) { + if (!Array.isArray(object.continuationTokens)) + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.CloseStream.continuationTokens: array expected"); + message.continuationTokens = []; + for (var i = 0; i < object.continuationTokens.length; ++i) { + if (typeof object.continuationTokens[i] !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.CloseStream.continuationTokens: object expected"); + message.continuationTokens[i] = $root.google.bigtable.v2.StreamContinuationToken.fromObject(object.continuationTokens[i]); + } + } + if (object.newPartitions) { + if (!Array.isArray(object.newPartitions)) + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.CloseStream.newPartitions: array expected"); + message.newPartitions = []; + for (var i = 0; i < object.newPartitions.length; ++i) { + if (typeof object.newPartitions[i] !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.CloseStream.newPartitions: object expected"); + message.newPartitions[i] = $root.google.bigtable.v2.StreamPartition.fromObject(object.newPartitions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CloseStream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {google.bigtable.v2.ReadChangeStreamResponse.CloseStream} message CloseStream + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloseStream.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.continuationTokens = []; + object.newPartitions = []; + } + if (options.defaults) + object.status = null; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.continuationTokens && message.continuationTokens.length) { + object.continuationTokens = []; + for (var j = 0; j < message.continuationTokens.length; ++j) + object.continuationTokens[j] = $root.google.bigtable.v2.StreamContinuationToken.toObject(message.continuationTokens[j], options); + } + if (message.newPartitions && message.newPartitions.length) { + object.newPartitions = []; + for (var j = 0; j < message.newPartitions.length; ++j) + object.newPartitions[j] = $root.google.bigtable.v2.StreamPartition.toObject(message.newPartitions[j], options); + } + return object; + }; + + /** + * Converts this CloseStream to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @instance + * @returns {Object.} JSON object + */ + CloseStream.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloseStream + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseStream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadChangeStreamResponse.CloseStream"; + }; + + return CloseStream; + })(); + + return ReadChangeStreamResponse; + })(); + + v2.ExecuteQueryRequest = (function() { + + /** + * Properties of an ExecuteQueryRequest. + * @memberof google.bigtable.v2 + * @interface IExecuteQueryRequest + * @property {string|null} [instanceName] ExecuteQueryRequest instanceName + * @property {string|null} [appProfileId] ExecuteQueryRequest appProfileId + * @property {string|null} [query] ExecuteQueryRequest query + * @property {Uint8Array|null} [preparedQuery] ExecuteQueryRequest preparedQuery + * @property {google.bigtable.v2.IProtoFormat|null} [protoFormat] ExecuteQueryRequest protoFormat + * @property {Uint8Array|null} [resumeToken] ExecuteQueryRequest resumeToken + * @property {Object.|null} [params] ExecuteQueryRequest params + */ + + /** + * Constructs a new ExecuteQueryRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents an ExecuteQueryRequest. + * @implements IExecuteQueryRequest + * @constructor + * @param {google.bigtable.v2.IExecuteQueryRequest=} [properties] Properties to set + */ + function ExecuteQueryRequest(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteQueryRequest instanceName. + * @member {string} instanceName + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.instanceName = ""; + + /** + * ExecuteQueryRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.appProfileId = ""; + + /** + * ExecuteQueryRequest query. + * @member {string} query + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.query = ""; + + /** + * ExecuteQueryRequest preparedQuery. + * @member {Uint8Array} preparedQuery + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.preparedQuery = $util.newBuffer([]); + + /** + * ExecuteQueryRequest protoFormat. + * @member {google.bigtable.v2.IProtoFormat|null|undefined} protoFormat + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.protoFormat = null; + + /** + * ExecuteQueryRequest resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.resumeToken = $util.newBuffer([]); + + /** + * ExecuteQueryRequest params. + * @member {Object.} params + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.params = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteQueryRequest dataFormat. + * @member {"protoFormat"|undefined} dataFormat + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + */ + Object.defineProperty(ExecuteQueryRequest.prototype, "dataFormat", { + get: $util.oneOfGetter($oneOfFields = ["protoFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteQueryRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {google.bigtable.v2.IExecuteQueryRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.ExecuteQueryRequest} ExecuteQueryRequest instance + */ + ExecuteQueryRequest.create = function create(properties) { + return new ExecuteQueryRequest(properties); + }; + + /** + * Encodes the specified ExecuteQueryRequest message. Does not implicitly {@link google.bigtable.v2.ExecuteQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {google.bigtable.v2.IExecuteQueryRequest} message ExecuteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceName != null && Object.hasOwnProperty.call(message, "instanceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceName); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + if (message.protoFormat != null && Object.hasOwnProperty.call(message, "protoFormat")) + $root.google.bigtable.v2.ProtoFormat.encode(message.protoFormat, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.v2.Value.encode(message.params[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.resumeToken); + if (message.preparedQuery != null && Object.hasOwnProperty.call(message, "preparedQuery")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.preparedQuery); + return writer; + }; + + /** + * Encodes the specified ExecuteQueryRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.ExecuteQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {google.bigtable.v2.IExecuteQueryRequest} message ExecuteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ExecuteQueryRequest} ExecuteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQueryRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ExecuteQueryRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceName = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + case 3: { + message.query = reader.string(); + break; + } + case 9: { + message.preparedQuery = reader.bytes(); + break; + } + case 4: { + message.protoFormat = $root.google.bigtable.v2.ProtoFormat.decode(reader, reader.uint32()); + break; + } + case 8: { + message.resumeToken = reader.bytes(); + break; + } + case 7: { + if (message.params === $util.emptyObject) + message.params = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ExecuteQueryRequest} ExecuteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteQueryRequest message. + * @function verify + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceName != null && message.hasOwnProperty("instanceName")) + if (!$util.isString(message.instanceName)) + return "instanceName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.preparedQuery != null && message.hasOwnProperty("preparedQuery")) + if (!(message.preparedQuery && typeof message.preparedQuery.length === "number" || $util.isString(message.preparedQuery))) + return "preparedQuery: buffer expected"; + if (message.protoFormat != null && message.hasOwnProperty("protoFormat")) { + properties.dataFormat = 1; + { + var error = $root.google.bigtable.v2.ProtoFormat.verify(message.protoFormat); + if (error) + return "protoFormat." + error; + } + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.v2.Value.verify(message.params[key[i]]); + if (error) + return "params." + error; + } + } + return null; + }; + + /** + * Creates an ExecuteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ExecuteQueryRequest} ExecuteQueryRequest + */ + ExecuteQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ExecuteQueryRequest) + return object; + var message = new $root.google.bigtable.v2.ExecuteQueryRequest(); + if (object.instanceName != null) + message.instanceName = String(object.instanceName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.query != null) + message.query = String(object.query); + if (object.preparedQuery != null) + if (typeof object.preparedQuery === "string") + $util.base64.decode(object.preparedQuery, message.preparedQuery = $util.newBuffer($util.base64.length(object.preparedQuery)), 0); + else if (object.preparedQuery.length >= 0) + message.preparedQuery = object.preparedQuery; + if (object.protoFormat != null) { + if (typeof object.protoFormat !== "object") + throw TypeError(".google.bigtable.v2.ExecuteQueryRequest.protoFormat: object expected"); + message.protoFormat = $root.google.bigtable.v2.ProtoFormat.fromObject(object.protoFormat); + } + if (object.resumeToken != null) + if (typeof object.resumeToken === "string") + $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); + else if (object.resumeToken.length >= 0) + message.resumeToken = object.resumeToken; + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.bigtable.v2.ExecuteQueryRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) { + if (typeof object.params[keys[i]] !== "object") + throw TypeError(".google.bigtable.v2.ExecuteQueryRequest.params: object expected"); + message.params[keys[i]] = $root.google.bigtable.v2.Value.fromObject(object.params[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExecuteQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {google.bigtable.v2.ExecuteQueryRequest} message ExecuteQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) { + object.instanceName = ""; + object.appProfileId = ""; + object.query = ""; + if (options.bytes === String) + object.resumeToken = ""; + else { + object.resumeToken = []; + if (options.bytes !== Array) + object.resumeToken = $util.newBuffer(object.resumeToken); + } + if (options.bytes === String) + object.preparedQuery = ""; + else { + object.preparedQuery = []; + if (options.bytes !== Array) + object.preparedQuery = $util.newBuffer(object.preparedQuery); + } + } + if (message.instanceName != null && message.hasOwnProperty("instanceName")) + object.instanceName = message.instanceName; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.protoFormat != null && message.hasOwnProperty("protoFormat")) { + object.protoFormat = $root.google.bigtable.v2.ProtoFormat.toObject(message.protoFormat, options); + if (options.oneofs) + object.dataFormat = "protoFormat"; + } + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = $root.google.bigtable.v2.Value.toObject(message.params[keys2[j]], options); + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; + if (message.preparedQuery != null && message.hasOwnProperty("preparedQuery")) + object.preparedQuery = options.bytes === String ? $util.base64.encode(message.preparedQuery, 0, message.preparedQuery.length) : options.bytes === Array ? Array.prototype.slice.call(message.preparedQuery) : message.preparedQuery; + return object; + }; + + /** + * Converts this ExecuteQueryRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteQueryRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.ExecuteQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ExecuteQueryRequest"; + }; + + return ExecuteQueryRequest; + })(); + + v2.ExecuteQueryResponse = (function() { + + /** + * Properties of an ExecuteQueryResponse. + * @memberof google.bigtable.v2 + * @interface IExecuteQueryResponse + * @property {google.bigtable.v2.IResultSetMetadata|null} [metadata] ExecuteQueryResponse metadata + * @property {google.bigtable.v2.IPartialResultSet|null} [results] ExecuteQueryResponse results + */ + + /** + * Constructs a new ExecuteQueryResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents an ExecuteQueryResponse. + * @implements IExecuteQueryResponse + * @constructor + * @param {google.bigtable.v2.IExecuteQueryResponse=} [properties] Properties to set + */ + function ExecuteQueryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteQueryResponse metadata. + * @member {google.bigtable.v2.IResultSetMetadata|null|undefined} metadata + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @instance + */ + ExecuteQueryResponse.prototype.metadata = null; + + /** + * ExecuteQueryResponse results. + * @member {google.bigtable.v2.IPartialResultSet|null|undefined} results + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @instance + */ + ExecuteQueryResponse.prototype.results = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteQueryResponse response. + * @member {"metadata"|"results"|undefined} response + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @instance + */ + Object.defineProperty(ExecuteQueryResponse.prototype, "response", { + get: $util.oneOfGetter($oneOfFields = ["metadata", "results"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteQueryResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {google.bigtable.v2.IExecuteQueryResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.ExecuteQueryResponse} ExecuteQueryResponse instance + */ + ExecuteQueryResponse.create = function create(properties) { + return new ExecuteQueryResponse(properties); + }; + + /** + * Encodes the specified ExecuteQueryResponse message. Does not implicitly {@link google.bigtable.v2.ExecuteQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {google.bigtable.v2.IExecuteQueryResponse} message ExecuteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.bigtable.v2.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.results != null && Object.hasOwnProperty.call(message, "results")) + $root.google.bigtable.v2.PartialResultSet.encode(message.results, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteQueryResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.ExecuteQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {google.bigtable.v2.IExecuteQueryResponse} message ExecuteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ExecuteQueryResponse} ExecuteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQueryResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ExecuteQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.bigtable.v2.ResultSetMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.results = $root.google.bigtable.v2.PartialResultSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ExecuteQueryResponse} ExecuteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteQueryResponse message. + * @function verify + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties.response = 1; + { + var error = $root.google.bigtable.v2.ResultSetMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + } + if (message.results != null && message.hasOwnProperty("results")) { + if (properties.response === 1) + return "response: multiple values"; + properties.response = 1; + { + var error = $root.google.bigtable.v2.PartialResultSet.verify(message.results); + if (error) + return "results." + error; + } + } + return null; + }; + + /** + * Creates an ExecuteQueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ExecuteQueryResponse} ExecuteQueryResponse + */ + ExecuteQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ExecuteQueryResponse) + return object; + var message = new $root.google.bigtable.v2.ExecuteQueryResponse(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.bigtable.v2.ExecuteQueryResponse.metadata: object expected"); + message.metadata = $root.google.bigtable.v2.ResultSetMetadata.fromObject(object.metadata); + } + if (object.results != null) { + if (typeof object.results !== "object") + throw TypeError(".google.bigtable.v2.ExecuteQueryResponse.results: object expected"); + message.results = $root.google.bigtable.v2.PartialResultSet.fromObject(object.results); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteQueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {google.bigtable.v2.ExecuteQueryResponse} message ExecuteQueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteQueryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = $root.google.bigtable.v2.ResultSetMetadata.toObject(message.metadata, options); + if (options.oneofs) + object.response = "metadata"; + } + if (message.results != null && message.hasOwnProperty("results")) { + object.results = $root.google.bigtable.v2.PartialResultSet.toObject(message.results, options); + if (options.oneofs) + object.response = "results"; + } + return object; + }; + + /** + * Converts this ExecuteQueryResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @instance + * @returns {Object.} JSON object + */ + ExecuteQueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteQueryResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.ExecuteQueryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteQueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ExecuteQueryResponse"; + }; + + return ExecuteQueryResponse; + })(); + + v2.PrepareQueryRequest = (function() { + + /** + * Properties of a PrepareQueryRequest. + * @memberof google.bigtable.v2 + * @interface IPrepareQueryRequest + * @property {string|null} [instanceName] PrepareQueryRequest instanceName + * @property {string|null} [appProfileId] PrepareQueryRequest appProfileId + * @property {string|null} [query] PrepareQueryRequest query + * @property {google.bigtable.v2.IProtoFormat|null} [protoFormat] PrepareQueryRequest protoFormat + * @property {Object.|null} [paramTypes] PrepareQueryRequest paramTypes + */ + + /** + * Constructs a new PrepareQueryRequest. + * @memberof google.bigtable.v2 + * @classdesc Represents a PrepareQueryRequest. + * @implements IPrepareQueryRequest + * @constructor + * @param {google.bigtable.v2.IPrepareQueryRequest=} [properties] Properties to set + */ + function PrepareQueryRequest(properties) { + this.paramTypes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrepareQueryRequest instanceName. + * @member {string} instanceName + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + */ + PrepareQueryRequest.prototype.instanceName = ""; + + /** + * PrepareQueryRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + */ + PrepareQueryRequest.prototype.appProfileId = ""; + + /** + * PrepareQueryRequest query. + * @member {string} query + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + */ + PrepareQueryRequest.prototype.query = ""; + + /** + * PrepareQueryRequest protoFormat. + * @member {google.bigtable.v2.IProtoFormat|null|undefined} protoFormat + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + */ + PrepareQueryRequest.prototype.protoFormat = null; + + /** + * PrepareQueryRequest paramTypes. + * @member {Object.} paramTypes + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + */ + PrepareQueryRequest.prototype.paramTypes = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PrepareQueryRequest dataFormat. + * @member {"protoFormat"|undefined} dataFormat + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + */ + Object.defineProperty(PrepareQueryRequest.prototype, "dataFormat", { + get: $util.oneOfGetter($oneOfFields = ["protoFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PrepareQueryRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {google.bigtable.v2.IPrepareQueryRequest=} [properties] Properties to set + * @returns {google.bigtable.v2.PrepareQueryRequest} PrepareQueryRequest instance + */ + PrepareQueryRequest.create = function create(properties) { + return new PrepareQueryRequest(properties); + }; + + /** + * Encodes the specified PrepareQueryRequest message. Does not implicitly {@link google.bigtable.v2.PrepareQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {google.bigtable.v2.IPrepareQueryRequest} message PrepareQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceName != null && Object.hasOwnProperty.call(message, "instanceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceName); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + if (message.protoFormat != null && Object.hasOwnProperty.call(message, "protoFormat")) + $root.google.bigtable.v2.ProtoFormat.encode(message.protoFormat, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) + for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.v2.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified PrepareQueryRequest message, length delimited. Does not implicitly {@link google.bigtable.v2.PrepareQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {google.bigtable.v2.IPrepareQueryRequest} message PrepareQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrepareQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.PrepareQueryRequest} PrepareQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareQueryRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.PrepareQueryRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceName = reader.string(); + break; + } + case 2: { + message.appProfileId = reader.string(); + break; + } + case 3: { + message.query = reader.string(); + break; + } + case 4: { + message.protoFormat = $root.google.bigtable.v2.ProtoFormat.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.paramTypes === $util.emptyObject) + message.paramTypes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.paramTypes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrepareQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.PrepareQueryRequest} PrepareQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrepareQueryRequest message. + * @function verify + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrepareQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceName != null && message.hasOwnProperty("instanceName")) + if (!$util.isString(message.instanceName)) + return "instanceName: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.protoFormat != null && message.hasOwnProperty("protoFormat")) { + properties.dataFormat = 1; + { + var error = $root.google.bigtable.v2.ProtoFormat.verify(message.protoFormat); + if (error) + return "protoFormat." + error; + } + } + if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (!$util.isObject(message.paramTypes)) + return "paramTypes: object expected"; + var key = Object.keys(message.paramTypes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.v2.Type.verify(message.paramTypes[key[i]]); + if (error) + return "paramTypes." + error; + } + } + return null; + }; + + /** + * Creates a PrepareQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.PrepareQueryRequest} PrepareQueryRequest + */ + PrepareQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.PrepareQueryRequest) + return object; + var message = new $root.google.bigtable.v2.PrepareQueryRequest(); + if (object.instanceName != null) + message.instanceName = String(object.instanceName); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.query != null) + message.query = String(object.query); + if (object.protoFormat != null) { + if (typeof object.protoFormat !== "object") + throw TypeError(".google.bigtable.v2.PrepareQueryRequest.protoFormat: object expected"); + message.protoFormat = $root.google.bigtable.v2.ProtoFormat.fromObject(object.protoFormat); + } + if (object.paramTypes) { + if (typeof object.paramTypes !== "object") + throw TypeError(".google.bigtable.v2.PrepareQueryRequest.paramTypes: object expected"); + message.paramTypes = {}; + for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { + if (typeof object.paramTypes[keys[i]] !== "object") + throw TypeError(".google.bigtable.v2.PrepareQueryRequest.paramTypes: object expected"); + message.paramTypes[keys[i]] = $root.google.bigtable.v2.Type.fromObject(object.paramTypes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a PrepareQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {google.bigtable.v2.PrepareQueryRequest} message PrepareQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrepareQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.paramTypes = {}; + if (options.defaults) { + object.instanceName = ""; + object.appProfileId = ""; + object.query = ""; + } + if (message.instanceName != null && message.hasOwnProperty("instanceName")) + object.instanceName = message.instanceName; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.protoFormat != null && message.hasOwnProperty("protoFormat")) { + object.protoFormat = $root.google.bigtable.v2.ProtoFormat.toObject(message.protoFormat, options); + if (options.oneofs) + object.dataFormat = "protoFormat"; + } + var keys2; + if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { + object.paramTypes = {}; + for (var j = 0; j < keys2.length; ++j) + object.paramTypes[keys2[j]] = $root.google.bigtable.v2.Type.toObject(message.paramTypes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this PrepareQueryRequest to JSON. + * @function toJSON + * @memberof google.bigtable.v2.PrepareQueryRequest + * @instance + * @returns {Object.} JSON object + */ + PrepareQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrepareQueryRequest + * @function getTypeUrl + * @memberof google.bigtable.v2.PrepareQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrepareQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.PrepareQueryRequest"; + }; + + return PrepareQueryRequest; + })(); + + v2.PrepareQueryResponse = (function() { + + /** + * Properties of a PrepareQueryResponse. + * @memberof google.bigtable.v2 + * @interface IPrepareQueryResponse + * @property {google.bigtable.v2.IResultSetMetadata|null} [metadata] PrepareQueryResponse metadata + * @property {Uint8Array|null} [preparedQuery] PrepareQueryResponse preparedQuery + * @property {google.protobuf.ITimestamp|null} [validUntil] PrepareQueryResponse validUntil + */ + + /** + * Constructs a new PrepareQueryResponse. + * @memberof google.bigtable.v2 + * @classdesc Represents a PrepareQueryResponse. + * @implements IPrepareQueryResponse + * @constructor + * @param {google.bigtable.v2.IPrepareQueryResponse=} [properties] Properties to set + */ + function PrepareQueryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrepareQueryResponse metadata. + * @member {google.bigtable.v2.IResultSetMetadata|null|undefined} metadata + * @memberof google.bigtable.v2.PrepareQueryResponse + * @instance + */ + PrepareQueryResponse.prototype.metadata = null; + + /** + * PrepareQueryResponse preparedQuery. + * @member {Uint8Array} preparedQuery + * @memberof google.bigtable.v2.PrepareQueryResponse + * @instance + */ + PrepareQueryResponse.prototype.preparedQuery = $util.newBuffer([]); + + /** + * PrepareQueryResponse validUntil. + * @member {google.protobuf.ITimestamp|null|undefined} validUntil + * @memberof google.bigtable.v2.PrepareQueryResponse + * @instance + */ + PrepareQueryResponse.prototype.validUntil = null; + + /** + * Creates a new PrepareQueryResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {google.bigtable.v2.IPrepareQueryResponse=} [properties] Properties to set + * @returns {google.bigtable.v2.PrepareQueryResponse} PrepareQueryResponse instance + */ + PrepareQueryResponse.create = function create(properties) { + return new PrepareQueryResponse(properties); + }; + + /** + * Encodes the specified PrepareQueryResponse message. Does not implicitly {@link google.bigtable.v2.PrepareQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {google.bigtable.v2.IPrepareQueryResponse} message PrepareQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.bigtable.v2.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.preparedQuery != null && Object.hasOwnProperty.call(message, "preparedQuery")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.preparedQuery); + if (message.validUntil != null && Object.hasOwnProperty.call(message, "validUntil")) + $root.google.protobuf.Timestamp.encode(message.validUntil, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrepareQueryResponse message, length delimited. Does not implicitly {@link google.bigtable.v2.PrepareQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {google.bigtable.v2.IPrepareQueryResponse} message PrepareQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrepareQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.PrepareQueryResponse} PrepareQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareQueryResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.PrepareQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.bigtable.v2.ResultSetMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.preparedQuery = reader.bytes(); + break; + } + case 3: { + message.validUntil = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrepareQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.PrepareQueryResponse} PrepareQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrepareQueryResponse message. + * @function verify + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrepareQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.bigtable.v2.ResultSetMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.preparedQuery != null && message.hasOwnProperty("preparedQuery")) + if (!(message.preparedQuery && typeof message.preparedQuery.length === "number" || $util.isString(message.preparedQuery))) + return "preparedQuery: buffer expected"; + if (message.validUntil != null && message.hasOwnProperty("validUntil")) { + var error = $root.google.protobuf.Timestamp.verify(message.validUntil); + if (error) + return "validUntil." + error; + } + return null; + }; + + /** + * Creates a PrepareQueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.PrepareQueryResponse} PrepareQueryResponse + */ + PrepareQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.PrepareQueryResponse) + return object; + var message = new $root.google.bigtable.v2.PrepareQueryResponse(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.bigtable.v2.PrepareQueryResponse.metadata: object expected"); + message.metadata = $root.google.bigtable.v2.ResultSetMetadata.fromObject(object.metadata); + } + if (object.preparedQuery != null) + if (typeof object.preparedQuery === "string") + $util.base64.decode(object.preparedQuery, message.preparedQuery = $util.newBuffer($util.base64.length(object.preparedQuery)), 0); + else if (object.preparedQuery.length >= 0) + message.preparedQuery = object.preparedQuery; + if (object.validUntil != null) { + if (typeof object.validUntil !== "object") + throw TypeError(".google.bigtable.v2.PrepareQueryResponse.validUntil: object expected"); + message.validUntil = $root.google.protobuf.Timestamp.fromObject(object.validUntil); + } + return message; + }; + + /** + * Creates a plain object from a PrepareQueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {google.bigtable.v2.PrepareQueryResponse} message PrepareQueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrepareQueryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.metadata = null; + if (options.bytes === String) + object.preparedQuery = ""; + else { + object.preparedQuery = []; + if (options.bytes !== Array) + object.preparedQuery = $util.newBuffer(object.preparedQuery); + } + object.validUntil = null; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.bigtable.v2.ResultSetMetadata.toObject(message.metadata, options); + if (message.preparedQuery != null && message.hasOwnProperty("preparedQuery")) + object.preparedQuery = options.bytes === String ? $util.base64.encode(message.preparedQuery, 0, message.preparedQuery.length) : options.bytes === Array ? Array.prototype.slice.call(message.preparedQuery) : message.preparedQuery; + if (message.validUntil != null && message.hasOwnProperty("validUntil")) + object.validUntil = $root.google.protobuf.Timestamp.toObject(message.validUntil, options); + return object; + }; + + /** + * Converts this PrepareQueryResponse to JSON. + * @function toJSON + * @memberof google.bigtable.v2.PrepareQueryResponse + * @instance + * @returns {Object.} JSON object + */ + PrepareQueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrepareQueryResponse + * @function getTypeUrl + * @memberof google.bigtable.v2.PrepareQueryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrepareQueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.PrepareQueryResponse"; + }; + + return PrepareQueryResponse; + })(); + + v2.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.bigtable.v2 + * @interface IRow + * @property {Uint8Array|null} [key] Row key + * @property {Array.|null} [families] Row families + */ + + /** + * Constructs a new Row. + * @memberof google.bigtable.v2 + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.bigtable.v2.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.families = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row key. + * @member {Uint8Array} key + * @memberof google.bigtable.v2.Row + * @instance + */ + Row.prototype.key = $util.newBuffer([]); + + /** + * Row families. + * @member {Array.} families + * @memberof google.bigtable.v2.Row + * @instance + */ + Row.prototype.families = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Row + * @static + * @param {google.bigtable.v2.IRow=} [properties] Properties to set + * @returns {google.bigtable.v2.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.bigtable.v2.Row.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Row + * @static + * @param {google.bigtable.v2.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.families != null && message.families.length) + for (var i = 0; i < message.families.length; ++i) + $root.google.bigtable.v2.Family.encode(message.families[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.bigtable.v2.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Row + * @static + * @param {google.bigtable.v2.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.key = reader.bytes(); + break; + } + case 2: { + if (!(message.families && message.families.length)) + message.families = []; + message.families.push($root.google.bigtable.v2.Family.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.bigtable.v2.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.families != null && message.hasOwnProperty("families")) { + if (!Array.isArray(message.families)) + return "families: array expected"; + for (var i = 0; i < message.families.length; ++i) { + var error = $root.google.bigtable.v2.Family.verify(message.families[i]); + if (error) + return "families." + error; + } + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Row + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Row) + return object; + var message = new $root.google.bigtable.v2.Row(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length >= 0) + message.key = object.key; + if (object.families) { + if (!Array.isArray(object.families)) + throw TypeError(".google.bigtable.v2.Row.families: array expected"); + message.families = []; + for (var i = 0; i < object.families.length; ++i) { + if (typeof object.families[i] !== "object") + throw TypeError(".google.bigtable.v2.Row.families: object expected"); + message.families[i] = $root.google.bigtable.v2.Family.fromObject(object.families[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Row + * @static + * @param {google.bigtable.v2.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.families = []; + if (options.defaults) + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.families && message.families.length) { + object.families = []; + for (var j = 0; j < message.families.length; ++j) + object.families[j] = $root.google.bigtable.v2.Family.toObject(message.families[j], options); + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.bigtable.v2.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Row"; + }; + + return Row; + })(); + + v2.Family = (function() { + + /** + * Properties of a Family. + * @memberof google.bigtable.v2 + * @interface IFamily + * @property {string|null} [name] Family name + * @property {Array.|null} [columns] Family columns + */ + + /** + * Constructs a new Family. + * @memberof google.bigtable.v2 + * @classdesc Represents a Family. + * @implements IFamily + * @constructor + * @param {google.bigtable.v2.IFamily=} [properties] Properties to set + */ + function Family(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Family name. + * @member {string} name + * @memberof google.bigtable.v2.Family + * @instance + */ + Family.prototype.name = ""; + + /** + * Family columns. + * @member {Array.} columns + * @memberof google.bigtable.v2.Family + * @instance + */ + Family.prototype.columns = $util.emptyArray; + + /** + * Creates a new Family instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Family + * @static + * @param {google.bigtable.v2.IFamily=} [properties] Properties to set + * @returns {google.bigtable.v2.Family} Family instance + */ + Family.create = function create(properties) { + return new Family(properties); + }; + + /** + * Encodes the specified Family message. Does not implicitly {@link google.bigtable.v2.Family.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Family + * @static + * @param {google.bigtable.v2.IFamily} message Family message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Family.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.bigtable.v2.Column.encode(message.columns[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Family message, length delimited. Does not implicitly {@link google.bigtable.v2.Family.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Family + * @static + * @param {google.bigtable.v2.IFamily} message Family message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Family.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Family message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Family + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Family} Family + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Family.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Family(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.bigtable.v2.Column.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Family message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Family + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Family} Family + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Family.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Family message. + * @function verify + * @memberof google.bigtable.v2.Family + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Family.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.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.bigtable.v2.Column.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + return null; + }; + + /** + * Creates a Family message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Family + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Family} Family + */ + Family.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Family) + return object; + var message = new $root.google.bigtable.v2.Family(); + if (object.name != null) + message.name = String(object.name); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.bigtable.v2.Family.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".google.bigtable.v2.Family.columns: object expected"); + message.columns[i] = $root.google.bigtable.v2.Column.fromObject(object.columns[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Family message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Family + * @static + * @param {google.bigtable.v2.Family} message Family + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Family.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.bigtable.v2.Column.toObject(message.columns[j], options); + } + return object; + }; + + /** + * Converts this Family to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Family + * @instance + * @returns {Object.} JSON object + */ + Family.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Family + * @function getTypeUrl + * @memberof google.bigtable.v2.Family + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Family.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Family"; + }; + + return Family; + })(); + + v2.Column = (function() { + + /** + * Properties of a Column. + * @memberof google.bigtable.v2 + * @interface IColumn + * @property {Uint8Array|null} [qualifier] Column qualifier + * @property {Array.|null} [cells] Column cells + */ + + /** + * Constructs a new Column. + * @memberof google.bigtable.v2 + * @classdesc Represents a Column. + * @implements IColumn + * @constructor + * @param {google.bigtable.v2.IColumn=} [properties] Properties to set + */ + function Column(properties) { + this.cells = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Column qualifier. + * @member {Uint8Array} qualifier + * @memberof google.bigtable.v2.Column + * @instance + */ + Column.prototype.qualifier = $util.newBuffer([]); + + /** + * Column cells. + * @member {Array.} cells + * @memberof google.bigtable.v2.Column + * @instance + */ + Column.prototype.cells = $util.emptyArray; + + /** + * Creates a new Column instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Column + * @static + * @param {google.bigtable.v2.IColumn=} [properties] Properties to set + * @returns {google.bigtable.v2.Column} Column instance + */ + Column.create = function create(properties) { + return new Column(properties); + }; + + /** + * Encodes the specified Column message. Does not implicitly {@link google.bigtable.v2.Column.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Column + * @static + * @param {google.bigtable.v2.IColumn} message Column message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Column.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.qualifier != null && Object.hasOwnProperty.call(message, "qualifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.qualifier); + if (message.cells != null && message.cells.length) + for (var i = 0; i < message.cells.length; ++i) + $root.google.bigtable.v2.Cell.encode(message.cells[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Column message, length delimited. Does not implicitly {@link google.bigtable.v2.Column.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Column + * @static + * @param {google.bigtable.v2.IColumn} message Column message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Column.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Column message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Column + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Column} Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Column.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Column(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.qualifier = reader.bytes(); + break; + } + case 2: { + if (!(message.cells && message.cells.length)) + message.cells = []; + message.cells.push($root.google.bigtable.v2.Cell.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Column message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Column + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Column} Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Column.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Column message. + * @function verify + * @memberof google.bigtable.v2.Column + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Column.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.qualifier != null && message.hasOwnProperty("qualifier")) + if (!(message.qualifier && typeof message.qualifier.length === "number" || $util.isString(message.qualifier))) + return "qualifier: buffer expected"; + if (message.cells != null && message.hasOwnProperty("cells")) { + if (!Array.isArray(message.cells)) + return "cells: array expected"; + for (var i = 0; i < message.cells.length; ++i) { + var error = $root.google.bigtable.v2.Cell.verify(message.cells[i]); + if (error) + return "cells." + error; + } + } + return null; + }; + + /** + * Creates a Column message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Column + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Column} Column + */ + Column.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Column) + return object; + var message = new $root.google.bigtable.v2.Column(); + if (object.qualifier != null) + if (typeof object.qualifier === "string") + $util.base64.decode(object.qualifier, message.qualifier = $util.newBuffer($util.base64.length(object.qualifier)), 0); + else if (object.qualifier.length >= 0) + message.qualifier = object.qualifier; + if (object.cells) { + if (!Array.isArray(object.cells)) + throw TypeError(".google.bigtable.v2.Column.cells: array expected"); + message.cells = []; + for (var i = 0; i < object.cells.length; ++i) { + if (typeof object.cells[i] !== "object") + throw TypeError(".google.bigtable.v2.Column.cells: object expected"); + message.cells[i] = $root.google.bigtable.v2.Cell.fromObject(object.cells[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Column message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Column + * @static + * @param {google.bigtable.v2.Column} message Column + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Column.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cells = []; + if (options.defaults) + if (options.bytes === String) + object.qualifier = ""; + else { + object.qualifier = []; + if (options.bytes !== Array) + object.qualifier = $util.newBuffer(object.qualifier); + } + if (message.qualifier != null && message.hasOwnProperty("qualifier")) + object.qualifier = options.bytes === String ? $util.base64.encode(message.qualifier, 0, message.qualifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.qualifier) : message.qualifier; + if (message.cells && message.cells.length) { + object.cells = []; + for (var j = 0; j < message.cells.length; ++j) + object.cells[j] = $root.google.bigtable.v2.Cell.toObject(message.cells[j], options); + } + return object; + }; + + /** + * Converts this Column to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Column + * @instance + * @returns {Object.} JSON object + */ + Column.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Column + * @function getTypeUrl + * @memberof google.bigtable.v2.Column + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Column.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Column"; + }; + + return Column; + })(); + + v2.Cell = (function() { + + /** + * Properties of a Cell. + * @memberof google.bigtable.v2 + * @interface ICell + * @property {number|Long|null} [timestampMicros] Cell timestampMicros + * @property {Uint8Array|null} [value] Cell value + * @property {Array.|null} [labels] Cell labels + */ + + /** + * Constructs a new Cell. + * @memberof google.bigtable.v2 + * @classdesc Represents a Cell. + * @implements ICell + * @constructor + * @param {google.bigtable.v2.ICell=} [properties] Properties to set + */ + function Cell(properties) { + this.labels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cell timestampMicros. + * @member {number|Long} timestampMicros + * @memberof google.bigtable.v2.Cell + * @instance + */ + Cell.prototype.timestampMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Cell value. + * @member {Uint8Array} value + * @memberof google.bigtable.v2.Cell + * @instance + */ + Cell.prototype.value = $util.newBuffer([]); + + /** + * Cell labels. + * @member {Array.} labels + * @memberof google.bigtable.v2.Cell + * @instance + */ + Cell.prototype.labels = $util.emptyArray; + + /** + * Creates a new Cell instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Cell + * @static + * @param {google.bigtable.v2.ICell=} [properties] Properties to set + * @returns {google.bigtable.v2.Cell} Cell instance + */ + Cell.create = function create(properties) { + return new Cell(properties); + }; + + /** + * Encodes the specified Cell message. Does not implicitly {@link google.bigtable.v2.Cell.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Cell + * @static + * @param {google.bigtable.v2.ICell} message Cell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cell.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestampMicros != null && Object.hasOwnProperty.call(message, "timestampMicros")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.timestampMicros); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.labels[i]); + return writer; + }; + + /** + * Encodes the specified Cell message, length delimited. Does not implicitly {@link google.bigtable.v2.Cell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Cell + * @static + * @param {google.bigtable.v2.ICell} message Cell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cell.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cell message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Cell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Cell} Cell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cell.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Cell(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.timestampMicros = reader.int64(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + case 3: { + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cell message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Cell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Cell} Cell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cell.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cell message. + * @function verify + * @memberof google.bigtable.v2.Cell + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cell.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestampMicros != null && message.hasOwnProperty("timestampMicros")) + if (!$util.isInteger(message.timestampMicros) && !(message.timestampMicros && $util.isInteger(message.timestampMicros.low) && $util.isInteger(message.timestampMicros.high))) + return "timestampMicros: integer|Long expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) + if (!$util.isString(message.labels[i])) + return "labels: string[] expected"; + } + return null; + }; + + /** + * Creates a Cell message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Cell + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Cell} Cell + */ + Cell.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Cell) + return object; + var message = new $root.google.bigtable.v2.Cell(); + if (object.timestampMicros != null) + if ($util.Long) + (message.timestampMicros = $util.Long.fromValue(object.timestampMicros)).unsigned = false; + else if (typeof object.timestampMicros === "string") + message.timestampMicros = parseInt(object.timestampMicros, 10); + else if (typeof object.timestampMicros === "number") + message.timestampMicros = object.timestampMicros; + else if (typeof object.timestampMicros === "object") + message.timestampMicros = new $util.LongBits(object.timestampMicros.low >>> 0, object.timestampMicros.high >>> 0).toNumber(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.bigtable.v2.Cell.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) + message.labels[i] = String(object.labels[i]); + } + return message; + }; + + /** + * Creates a plain object from a Cell message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Cell + * @static + * @param {google.bigtable.v2.Cell} message Cell + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cell.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.labels = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestampMicros = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.timestampMicros != null && message.hasOwnProperty("timestampMicros")) + if (typeof message.timestampMicros === "number") + object.timestampMicros = options.longs === String ? String(message.timestampMicros) : message.timestampMicros; + else + object.timestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.timestampMicros) : options.longs === Number ? new $util.LongBits(message.timestampMicros.low >>> 0, message.timestampMicros.high >>> 0).toNumber() : message.timestampMicros; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = message.labels[j]; + } + return object; + }; + + /** + * Converts this Cell to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Cell + * @instance + * @returns {Object.} JSON object + */ + Cell.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cell + * @function getTypeUrl + * @memberof google.bigtable.v2.Cell + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cell.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Cell"; + }; + + return Cell; + })(); + + v2.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.bigtable.v2 + * @interface IValue + * @property {google.bigtable.v2.IType|null} [type] Value type + * @property {Uint8Array|null} [rawValue] Value rawValue + * @property {number|Long|null} [rawTimestampMicros] Value rawTimestampMicros + * @property {Uint8Array|null} [bytesValue] Value bytesValue + * @property {string|null} [stringValue] Value stringValue + * @property {number|Long|null} [intValue] Value intValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {number|null} [floatValue] Value floatValue + * @property {google.protobuf.ITimestamp|null} [timestampValue] Value timestampValue + * @property {google.type.IDate|null} [dateValue] Value dateValue + * @property {google.bigtable.v2.IArrayValue|null} [arrayValue] Value arrayValue + */ + + /** + * Constructs a new Value. + * @memberof google.bigtable.v2 + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.bigtable.v2.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value type. + * @member {google.bigtable.v2.IType|null|undefined} type + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.type = null; + + /** + * Value rawValue. + * @member {Uint8Array|null|undefined} rawValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.rawValue = null; + + /** + * Value rawTimestampMicros. + * @member {number|Long|null|undefined} rawTimestampMicros + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.rawTimestampMicros = null; + + /** + * Value bytesValue. + * @member {Uint8Array|null|undefined} bytesValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.bytesValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value intValue. + * @member {number|Long|null|undefined} intValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.intValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value floatValue. + * @member {number|null|undefined} floatValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.floatValue = null; + + /** + * Value timestampValue. + * @member {google.protobuf.ITimestamp|null|undefined} timestampValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.timestampValue = null; + + /** + * Value dateValue. + * @member {google.type.IDate|null|undefined} dateValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.dateValue = null; + + /** + * Value arrayValue. + * @member {google.bigtable.v2.IArrayValue|null|undefined} arrayValue + * @memberof google.bigtable.v2.Value + * @instance + */ + Value.prototype.arrayValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"rawValue"|"rawTimestampMicros"|"bytesValue"|"stringValue"|"intValue"|"boolValue"|"floatValue"|"timestampValue"|"dateValue"|"arrayValue"|undefined} kind + * @memberof google.bigtable.v2.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["rawValue", "rawTimestampMicros", "bytesValue", "stringValue", "intValue", "boolValue", "floatValue", "timestampValue", "dateValue", "arrayValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Value + * @static + * @param {google.bigtable.v2.IValue=} [properties] Properties to set + * @returns {google.bigtable.v2.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.bigtable.v2.Value.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Value + * @static + * @param {google.bigtable.v2.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesValue != null && Object.hasOwnProperty.call(message, "bytesValue")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.bytesValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) + $root.google.bigtable.v2.ArrayValue.encode(message.arrayValue, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.intValue); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.bigtable.v2.Type.encode(message.type, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.rawValue != null && Object.hasOwnProperty.call(message, "rawValue")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.rawValue); + if (message.rawTimestampMicros != null && Object.hasOwnProperty.call(message, "rawTimestampMicros")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.rawTimestampMicros); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.boolValue); + if (message.floatValue != null && Object.hasOwnProperty.call(message, "floatValue")) + writer.uint32(/* id 11, wireType 1 =*/89).double(message.floatValue); + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) + $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.dateValue != null && Object.hasOwnProperty.call(message, "dateValue")) + $root.google.type.Date.encode(message.dateValue, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.bigtable.v2.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Value + * @static + * @param {google.bigtable.v2.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 7: { + message.type = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + case 8: { + message.rawValue = reader.bytes(); + break; + } + case 9: { + message.rawTimestampMicros = reader.int64(); + break; + } + case 2: { + message.bytesValue = reader.bytes(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 6: { + message.intValue = reader.int64(); + break; + } + case 10: { + message.boolValue = reader.bool(); + break; + } + case 11: { + message.floatValue = reader.double(); + break; + } + case 12: { + message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.dateValue = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 4: { + message.arrayValue = $root.google.bigtable.v2.ArrayValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.bigtable.v2.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.bigtable.v2.Type.verify(message.type); + if (error) + return "type." + error; + } + if (message.rawValue != null && message.hasOwnProperty("rawValue")) { + properties.kind = 1; + if (!(message.rawValue && typeof message.rawValue.length === "number" || $util.isString(message.rawValue))) + return "rawValue: buffer expected"; + } + if (message.rawTimestampMicros != null && message.hasOwnProperty("rawTimestampMicros")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isInteger(message.rawTimestampMicros) && !(message.rawTimestampMicros && $util.isInteger(message.rawTimestampMicros.low) && $util.isInteger(message.rawTimestampMicros.high))) + return "rawTimestampMicros: integer|Long expected"; + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!(message.bytesValue && typeof message.bytesValue.length === "number" || $util.isString(message.bytesValue))) + return "bytesValue: buffer expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) + return "intValue: integer|Long expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.floatValue !== "number") + return "floatValue: number expected"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.timestampValue); + if (error) + return "timestampValue." + error; + } + } + if (message.dateValue != null && message.hasOwnProperty("dateValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.type.Date.verify(message.dateValue); + if (error) + return "dateValue." + error; + } + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.ArrayValue.verify(message.arrayValue); + if (error) + return "arrayValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Value + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Value) + return object; + var message = new $root.google.bigtable.v2.Value(); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.bigtable.v2.Value.type: object expected"); + message.type = $root.google.bigtable.v2.Type.fromObject(object.type); + } + if (object.rawValue != null) + if (typeof object.rawValue === "string") + $util.base64.decode(object.rawValue, message.rawValue = $util.newBuffer($util.base64.length(object.rawValue)), 0); + else if (object.rawValue.length >= 0) + message.rawValue = object.rawValue; + if (object.rawTimestampMicros != null) + if ($util.Long) + (message.rawTimestampMicros = $util.Long.fromValue(object.rawTimestampMicros)).unsigned = false; + else if (typeof object.rawTimestampMicros === "string") + message.rawTimestampMicros = parseInt(object.rawTimestampMicros, 10); + else if (typeof object.rawTimestampMicros === "number") + message.rawTimestampMicros = object.rawTimestampMicros; + else if (typeof object.rawTimestampMicros === "object") + message.rawTimestampMicros = new $util.LongBits(object.rawTimestampMicros.low >>> 0, object.rawTimestampMicros.high >>> 0).toNumber(); + if (object.bytesValue != null) + if (typeof object.bytesValue === "string") + $util.base64.decode(object.bytesValue, message.bytesValue = $util.newBuffer($util.base64.length(object.bytesValue)), 0); + else if (object.bytesValue.length >= 0) + message.bytesValue = object.bytesValue; + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.intValue != null) + if ($util.Long) + (message.intValue = $util.Long.fromValue(object.intValue)).unsigned = false; + else if (typeof object.intValue === "string") + message.intValue = parseInt(object.intValue, 10); + else if (typeof object.intValue === "number") + message.intValue = object.intValue; + else if (typeof object.intValue === "object") + message.intValue = new $util.LongBits(object.intValue.low >>> 0, object.intValue.high >>> 0).toNumber(); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.floatValue != null) + message.floatValue = Number(object.floatValue); + if (object.timestampValue != null) { + if (typeof object.timestampValue !== "object") + throw TypeError(".google.bigtable.v2.Value.timestampValue: object expected"); + message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); + } + if (object.dateValue != null) { + if (typeof object.dateValue !== "object") + throw TypeError(".google.bigtable.v2.Value.dateValue: object expected"); + message.dateValue = $root.google.type.Date.fromObject(object.dateValue); + } + if (object.arrayValue != null) { + if (typeof object.arrayValue !== "object") + throw TypeError(".google.bigtable.v2.Value.arrayValue: object expected"); + message.arrayValue = $root.google.bigtable.v2.ArrayValue.fromObject(object.arrayValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Value + * @static + * @param {google.bigtable.v2.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.type = null; + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + object.bytesValue = options.bytes === String ? $util.base64.encode(message.bytesValue, 0, message.bytesValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesValue) : message.bytesValue; + if (options.oneofs) + object.kind = "bytesValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + object.arrayValue = $root.google.bigtable.v2.ArrayValue.toObject(message.arrayValue, options); + if (options.oneofs) + object.kind = "arrayValue"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (typeof message.intValue === "number") + object.intValue = options.longs === String ? String(message.intValue) : message.intValue; + else + object.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; + if (options.oneofs) + object.kind = "intValue"; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.bigtable.v2.Type.toObject(message.type, options); + if (message.rawValue != null && message.hasOwnProperty("rawValue")) { + object.rawValue = options.bytes === String ? $util.base64.encode(message.rawValue, 0, message.rawValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawValue) : message.rawValue; + if (options.oneofs) + object.kind = "rawValue"; + } + if (message.rawTimestampMicros != null && message.hasOwnProperty("rawTimestampMicros")) { + if (typeof message.rawTimestampMicros === "number") + object.rawTimestampMicros = options.longs === String ? String(message.rawTimestampMicros) : message.rawTimestampMicros; + else + object.rawTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.rawTimestampMicros) : options.longs === Number ? new $util.LongBits(message.rawTimestampMicros.low >>> 0, message.rawTimestampMicros.high >>> 0).toNumber() : message.rawTimestampMicros; + if (options.oneofs) + object.kind = "rawTimestampMicros"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + object.floatValue = options.json && !isFinite(message.floatValue) ? String(message.floatValue) : message.floatValue; + if (options.oneofs) + object.kind = "floatValue"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options); + if (options.oneofs) + object.kind = "timestampValue"; + } + if (message.dateValue != null && message.hasOwnProperty("dateValue")) { + object.dateValue = $root.google.type.Date.toObject(message.dateValue, options); + if (options.oneofs) + object.kind = "dateValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.bigtable.v2.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Value"; + }; + + return Value; + })(); + + v2.ArrayValue = (function() { + + /** + * Properties of an ArrayValue. + * @memberof google.bigtable.v2 + * @interface IArrayValue + * @property {Array.|null} [values] ArrayValue values + */ + + /** + * Constructs a new ArrayValue. + * @memberof google.bigtable.v2 + * @classdesc Represents an ArrayValue. + * @implements IArrayValue + * @constructor + * @param {google.bigtable.v2.IArrayValue=} [properties] Properties to set + */ + function ArrayValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrayValue values. + * @member {Array.} values + * @memberof google.bigtable.v2.ArrayValue + * @instance + */ + ArrayValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ArrayValue instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {google.bigtable.v2.IArrayValue=} [properties] Properties to set + * @returns {google.bigtable.v2.ArrayValue} ArrayValue instance + */ + ArrayValue.create = function create(properties) { + return new ArrayValue(properties); + }; + + /** + * Encodes the specified ArrayValue message. Does not implicitly {@link google.bigtable.v2.ArrayValue.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {google.bigtable.v2.IArrayValue} message ArrayValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.bigtable.v2.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.bigtable.v2.ArrayValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {google.bigtable.v2.IArrayValue} message ArrayValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrayValue message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ArrayValue} ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ArrayValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.bigtable.v2.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrayValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ArrayValue} ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrayValue message. + * @function verify + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrayValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.bigtable.v2.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ArrayValue} ArrayValue + */ + ArrayValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ArrayValue) + return object; + var message = new $root.google.bigtable.v2.ArrayValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.bigtable.v2.ArrayValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.bigtable.v2.ArrayValue.values: object expected"); + message.values[i] = $root.google.bigtable.v2.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {google.bigtable.v2.ArrayValue} message ArrayValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrayValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.bigtable.v2.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ArrayValue to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ArrayValue + * @instance + * @returns {Object.} JSON object + */ + ArrayValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArrayValue + * @function getTypeUrl + * @memberof google.bigtable.v2.ArrayValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrayValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ArrayValue"; + }; + + return ArrayValue; + })(); + + v2.RowRange = (function() { + + /** + * Properties of a RowRange. + * @memberof google.bigtable.v2 + * @interface IRowRange + * @property {Uint8Array|null} [startKeyClosed] RowRange startKeyClosed + * @property {Uint8Array|null} [startKeyOpen] RowRange startKeyOpen + * @property {Uint8Array|null} [endKeyOpen] RowRange endKeyOpen + * @property {Uint8Array|null} [endKeyClosed] RowRange endKeyClosed + */ + + /** + * Constructs a new RowRange. + * @memberof google.bigtable.v2 + * @classdesc Represents a RowRange. + * @implements IRowRange + * @constructor + * @param {google.bigtable.v2.IRowRange=} [properties] Properties to set + */ + function RowRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowRange startKeyClosed. + * @member {Uint8Array|null|undefined} startKeyClosed + * @memberof google.bigtable.v2.RowRange + * @instance + */ + RowRange.prototype.startKeyClosed = null; + + /** + * RowRange startKeyOpen. + * @member {Uint8Array|null|undefined} startKeyOpen + * @memberof google.bigtable.v2.RowRange + * @instance + */ + RowRange.prototype.startKeyOpen = null; + + /** + * RowRange endKeyOpen. + * @member {Uint8Array|null|undefined} endKeyOpen + * @memberof google.bigtable.v2.RowRange + * @instance + */ + RowRange.prototype.endKeyOpen = null; + + /** + * RowRange endKeyClosed. + * @member {Uint8Array|null|undefined} endKeyClosed + * @memberof google.bigtable.v2.RowRange + * @instance + */ + RowRange.prototype.endKeyClosed = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RowRange startKey. + * @member {"startKeyClosed"|"startKeyOpen"|undefined} startKey + * @memberof google.bigtable.v2.RowRange + * @instance + */ + Object.defineProperty(RowRange.prototype, "startKey", { + get: $util.oneOfGetter($oneOfFields = ["startKeyClosed", "startKeyOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RowRange endKey. + * @member {"endKeyOpen"|"endKeyClosed"|undefined} endKey + * @memberof google.bigtable.v2.RowRange + * @instance + */ + Object.defineProperty(RowRange.prototype, "endKey", { + get: $util.oneOfGetter($oneOfFields = ["endKeyOpen", "endKeyClosed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RowRange instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RowRange + * @static + * @param {google.bigtable.v2.IRowRange=} [properties] Properties to set + * @returns {google.bigtable.v2.RowRange} RowRange instance + */ + RowRange.create = function create(properties) { + return new RowRange(properties); + }; + + /** + * Encodes the specified RowRange message. Does not implicitly {@link google.bigtable.v2.RowRange.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RowRange + * @static + * @param {google.bigtable.v2.IRowRange} message RowRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startKeyClosed != null && Object.hasOwnProperty.call(message, "startKeyClosed")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startKeyClosed); + if (message.startKeyOpen != null && Object.hasOwnProperty.call(message, "startKeyOpen")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.startKeyOpen); + if (message.endKeyOpen != null && Object.hasOwnProperty.call(message, "endKeyOpen")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.endKeyOpen); + if (message.endKeyClosed != null && Object.hasOwnProperty.call(message, "endKeyClosed")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.endKeyClosed); + return writer; + }; + + /** + * Encodes the specified RowRange message, length delimited. Does not implicitly {@link google.bigtable.v2.RowRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RowRange + * @static + * @param {google.bigtable.v2.IRowRange} message RowRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowRange message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RowRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RowRange} RowRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RowRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startKeyClosed = reader.bytes(); + break; + } + case 2: { + message.startKeyOpen = reader.bytes(); + break; + } + case 3: { + message.endKeyOpen = reader.bytes(); + break; + } + case 4: { + message.endKeyClosed = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RowRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RowRange} RowRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowRange message. + * @function verify + * @memberof google.bigtable.v2.RowRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startKeyClosed != null && message.hasOwnProperty("startKeyClosed")) { + properties.startKey = 1; + if (!(message.startKeyClosed && typeof message.startKeyClosed.length === "number" || $util.isString(message.startKeyClosed))) + return "startKeyClosed: buffer expected"; + } + if (message.startKeyOpen != null && message.hasOwnProperty("startKeyOpen")) { + if (properties.startKey === 1) + return "startKey: multiple values"; + properties.startKey = 1; + if (!(message.startKeyOpen && typeof message.startKeyOpen.length === "number" || $util.isString(message.startKeyOpen))) + return "startKeyOpen: buffer expected"; + } + if (message.endKeyOpen != null && message.hasOwnProperty("endKeyOpen")) { + properties.endKey = 1; + if (!(message.endKeyOpen && typeof message.endKeyOpen.length === "number" || $util.isString(message.endKeyOpen))) + return "endKeyOpen: buffer expected"; + } + if (message.endKeyClosed != null && message.hasOwnProperty("endKeyClosed")) { + if (properties.endKey === 1) + return "endKey: multiple values"; + properties.endKey = 1; + if (!(message.endKeyClosed && typeof message.endKeyClosed.length === "number" || $util.isString(message.endKeyClosed))) + return "endKeyClosed: buffer expected"; + } + return null; + }; + + /** + * Creates a RowRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RowRange + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RowRange} RowRange + */ + RowRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RowRange) + return object; + var message = new $root.google.bigtable.v2.RowRange(); + if (object.startKeyClosed != null) + if (typeof object.startKeyClosed === "string") + $util.base64.decode(object.startKeyClosed, message.startKeyClosed = $util.newBuffer($util.base64.length(object.startKeyClosed)), 0); + else if (object.startKeyClosed.length >= 0) + message.startKeyClosed = object.startKeyClosed; + if (object.startKeyOpen != null) + if (typeof object.startKeyOpen === "string") + $util.base64.decode(object.startKeyOpen, message.startKeyOpen = $util.newBuffer($util.base64.length(object.startKeyOpen)), 0); + else if (object.startKeyOpen.length >= 0) + message.startKeyOpen = object.startKeyOpen; + if (object.endKeyOpen != null) + if (typeof object.endKeyOpen === "string") + $util.base64.decode(object.endKeyOpen, message.endKeyOpen = $util.newBuffer($util.base64.length(object.endKeyOpen)), 0); + else if (object.endKeyOpen.length >= 0) + message.endKeyOpen = object.endKeyOpen; + if (object.endKeyClosed != null) + if (typeof object.endKeyClosed === "string") + $util.base64.decode(object.endKeyClosed, message.endKeyClosed = $util.newBuffer($util.base64.length(object.endKeyClosed)), 0); + else if (object.endKeyClosed.length >= 0) + message.endKeyClosed = object.endKeyClosed; + return message; + }; + + /** + * Creates a plain object from a RowRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RowRange + * @static + * @param {google.bigtable.v2.RowRange} message RowRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startKeyClosed != null && message.hasOwnProperty("startKeyClosed")) { + object.startKeyClosed = options.bytes === String ? $util.base64.encode(message.startKeyClosed, 0, message.startKeyClosed.length) : options.bytes === Array ? Array.prototype.slice.call(message.startKeyClosed) : message.startKeyClosed; + if (options.oneofs) + object.startKey = "startKeyClosed"; + } + if (message.startKeyOpen != null && message.hasOwnProperty("startKeyOpen")) { + object.startKeyOpen = options.bytes === String ? $util.base64.encode(message.startKeyOpen, 0, message.startKeyOpen.length) : options.bytes === Array ? Array.prototype.slice.call(message.startKeyOpen) : message.startKeyOpen; + if (options.oneofs) + object.startKey = "startKeyOpen"; + } + if (message.endKeyOpen != null && message.hasOwnProperty("endKeyOpen")) { + object.endKeyOpen = options.bytes === String ? $util.base64.encode(message.endKeyOpen, 0, message.endKeyOpen.length) : options.bytes === Array ? Array.prototype.slice.call(message.endKeyOpen) : message.endKeyOpen; + if (options.oneofs) + object.endKey = "endKeyOpen"; + } + if (message.endKeyClosed != null && message.hasOwnProperty("endKeyClosed")) { + object.endKeyClosed = options.bytes === String ? $util.base64.encode(message.endKeyClosed, 0, message.endKeyClosed.length) : options.bytes === Array ? Array.prototype.slice.call(message.endKeyClosed) : message.endKeyClosed; + if (options.oneofs) + object.endKey = "endKeyClosed"; + } + return object; + }; + + /** + * Converts this RowRange to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RowRange + * @instance + * @returns {Object.} JSON object + */ + RowRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowRange + * @function getTypeUrl + * @memberof google.bigtable.v2.RowRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RowRange"; + }; + + return RowRange; + })(); + + v2.RowSet = (function() { + + /** + * Properties of a RowSet. + * @memberof google.bigtable.v2 + * @interface IRowSet + * @property {Array.|null} [rowKeys] RowSet rowKeys + * @property {Array.|null} [rowRanges] RowSet rowRanges + */ + + /** + * Constructs a new RowSet. + * @memberof google.bigtable.v2 + * @classdesc Represents a RowSet. + * @implements IRowSet + * @constructor + * @param {google.bigtable.v2.IRowSet=} [properties] Properties to set + */ + function RowSet(properties) { + this.rowKeys = []; + this.rowRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowSet rowKeys. + * @member {Array.} rowKeys + * @memberof google.bigtable.v2.RowSet + * @instance + */ + RowSet.prototype.rowKeys = $util.emptyArray; + + /** + * RowSet rowRanges. + * @member {Array.} rowRanges + * @memberof google.bigtable.v2.RowSet + * @instance + */ + RowSet.prototype.rowRanges = $util.emptyArray; + + /** + * Creates a new RowSet instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RowSet + * @static + * @param {google.bigtable.v2.IRowSet=} [properties] Properties to set + * @returns {google.bigtable.v2.RowSet} RowSet instance + */ + RowSet.create = function create(properties) { + return new RowSet(properties); + }; + + /** + * Encodes the specified RowSet message. Does not implicitly {@link google.bigtable.v2.RowSet.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RowSet + * @static + * @param {google.bigtable.v2.IRowSet} message RowSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowKeys != null && message.rowKeys.length) + for (var i = 0; i < message.rowKeys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rowKeys[i]); + if (message.rowRanges != null && message.rowRanges.length) + for (var i = 0; i < message.rowRanges.length; ++i) + $root.google.bigtable.v2.RowRange.encode(message.rowRanges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RowSet message, length delimited. Does not implicitly {@link google.bigtable.v2.RowSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RowSet + * @static + * @param {google.bigtable.v2.IRowSet} message RowSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowSet message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RowSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RowSet} RowSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RowSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rowKeys && message.rowKeys.length)) + message.rowKeys = []; + message.rowKeys.push(reader.bytes()); + break; + } + case 2: { + if (!(message.rowRanges && message.rowRanges.length)) + message.rowRanges = []; + message.rowRanges.push($root.google.bigtable.v2.RowRange.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RowSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RowSet} RowSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowSet message. + * @function verify + * @memberof google.bigtable.v2.RowSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowKeys != null && message.hasOwnProperty("rowKeys")) { + if (!Array.isArray(message.rowKeys)) + return "rowKeys: array expected"; + for (var i = 0; i < message.rowKeys.length; ++i) + if (!(message.rowKeys[i] && typeof message.rowKeys[i].length === "number" || $util.isString(message.rowKeys[i]))) + return "rowKeys: buffer[] expected"; + } + if (message.rowRanges != null && message.hasOwnProperty("rowRanges")) { + if (!Array.isArray(message.rowRanges)) + return "rowRanges: array expected"; + for (var i = 0; i < message.rowRanges.length; ++i) { + var error = $root.google.bigtable.v2.RowRange.verify(message.rowRanges[i]); + if (error) + return "rowRanges." + error; + } + } + return null; + }; + + /** + * Creates a RowSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RowSet + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RowSet} RowSet + */ + RowSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RowSet) + return object; + var message = new $root.google.bigtable.v2.RowSet(); + if (object.rowKeys) { + if (!Array.isArray(object.rowKeys)) + throw TypeError(".google.bigtable.v2.RowSet.rowKeys: array expected"); + message.rowKeys = []; + for (var i = 0; i < object.rowKeys.length; ++i) + if (typeof object.rowKeys[i] === "string") + $util.base64.decode(object.rowKeys[i], message.rowKeys[i] = $util.newBuffer($util.base64.length(object.rowKeys[i])), 0); + else if (object.rowKeys[i].length >= 0) + message.rowKeys[i] = object.rowKeys[i]; + } + if (object.rowRanges) { + if (!Array.isArray(object.rowRanges)) + throw TypeError(".google.bigtable.v2.RowSet.rowRanges: array expected"); + message.rowRanges = []; + for (var i = 0; i < object.rowRanges.length; ++i) { + if (typeof object.rowRanges[i] !== "object") + throw TypeError(".google.bigtable.v2.RowSet.rowRanges: object expected"); + message.rowRanges[i] = $root.google.bigtable.v2.RowRange.fromObject(object.rowRanges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RowSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RowSet + * @static + * @param {google.bigtable.v2.RowSet} message RowSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.rowKeys = []; + object.rowRanges = []; + } + if (message.rowKeys && message.rowKeys.length) { + object.rowKeys = []; + for (var j = 0; j < message.rowKeys.length; ++j) + object.rowKeys[j] = options.bytes === String ? $util.base64.encode(message.rowKeys[j], 0, message.rowKeys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKeys[j]) : message.rowKeys[j]; + } + if (message.rowRanges && message.rowRanges.length) { + object.rowRanges = []; + for (var j = 0; j < message.rowRanges.length; ++j) + object.rowRanges[j] = $root.google.bigtable.v2.RowRange.toObject(message.rowRanges[j], options); + } + return object; + }; + + /** + * Converts this RowSet to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RowSet + * @instance + * @returns {Object.} JSON object + */ + RowSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowSet + * @function getTypeUrl + * @memberof google.bigtable.v2.RowSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RowSet"; + }; + + return RowSet; + })(); + + v2.ColumnRange = (function() { + + /** + * Properties of a ColumnRange. + * @memberof google.bigtable.v2 + * @interface IColumnRange + * @property {string|null} [familyName] ColumnRange familyName + * @property {Uint8Array|null} [startQualifierClosed] ColumnRange startQualifierClosed + * @property {Uint8Array|null} [startQualifierOpen] ColumnRange startQualifierOpen + * @property {Uint8Array|null} [endQualifierClosed] ColumnRange endQualifierClosed + * @property {Uint8Array|null} [endQualifierOpen] ColumnRange endQualifierOpen + */ + + /** + * Constructs a new ColumnRange. + * @memberof google.bigtable.v2 + * @classdesc Represents a ColumnRange. + * @implements IColumnRange + * @constructor + * @param {google.bigtable.v2.IColumnRange=} [properties] Properties to set + */ + function ColumnRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnRange familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + ColumnRange.prototype.familyName = ""; + + /** + * ColumnRange startQualifierClosed. + * @member {Uint8Array|null|undefined} startQualifierClosed + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + ColumnRange.prototype.startQualifierClosed = null; + + /** + * ColumnRange startQualifierOpen. + * @member {Uint8Array|null|undefined} startQualifierOpen + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + ColumnRange.prototype.startQualifierOpen = null; + + /** + * ColumnRange endQualifierClosed. + * @member {Uint8Array|null|undefined} endQualifierClosed + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + ColumnRange.prototype.endQualifierClosed = null; + + /** + * ColumnRange endQualifierOpen. + * @member {Uint8Array|null|undefined} endQualifierOpen + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + ColumnRange.prototype.endQualifierOpen = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ColumnRange startQualifier. + * @member {"startQualifierClosed"|"startQualifierOpen"|undefined} startQualifier + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + Object.defineProperty(ColumnRange.prototype, "startQualifier", { + get: $util.oneOfGetter($oneOfFields = ["startQualifierClosed", "startQualifierOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ColumnRange endQualifier. + * @member {"endQualifierClosed"|"endQualifierOpen"|undefined} endQualifier + * @memberof google.bigtable.v2.ColumnRange + * @instance + */ + Object.defineProperty(ColumnRange.prototype, "endQualifier", { + get: $util.oneOfGetter($oneOfFields = ["endQualifierClosed", "endQualifierOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ColumnRange instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {google.bigtable.v2.IColumnRange=} [properties] Properties to set + * @returns {google.bigtable.v2.ColumnRange} ColumnRange instance + */ + ColumnRange.create = function create(properties) { + return new ColumnRange(properties); + }; + + /** + * Encodes the specified ColumnRange message. Does not implicitly {@link google.bigtable.v2.ColumnRange.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {google.bigtable.v2.IColumnRange} message ColumnRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + if (message.startQualifierClosed != null && Object.hasOwnProperty.call(message, "startQualifierClosed")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.startQualifierClosed); + if (message.startQualifierOpen != null && Object.hasOwnProperty.call(message, "startQualifierOpen")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.startQualifierOpen); + if (message.endQualifierClosed != null && Object.hasOwnProperty.call(message, "endQualifierClosed")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.endQualifierClosed); + if (message.endQualifierOpen != null && Object.hasOwnProperty.call(message, "endQualifierOpen")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.endQualifierOpen); + return writer; + }; + + /** + * Encodes the specified ColumnRange message, length delimited. Does not implicitly {@link google.bigtable.v2.ColumnRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {google.bigtable.v2.IColumnRange} message ColumnRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnRange message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ColumnRange} ColumnRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ColumnRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + case 2: { + message.startQualifierClosed = reader.bytes(); + break; + } + case 3: { + message.startQualifierOpen = reader.bytes(); + break; + } + case 4: { + message.endQualifierClosed = reader.bytes(); + break; + } + case 5: { + message.endQualifierOpen = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ColumnRange} ColumnRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnRange message. + * @function verify + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + if (message.startQualifierClosed != null && message.hasOwnProperty("startQualifierClosed")) { + properties.startQualifier = 1; + if (!(message.startQualifierClosed && typeof message.startQualifierClosed.length === "number" || $util.isString(message.startQualifierClosed))) + return "startQualifierClosed: buffer expected"; + } + if (message.startQualifierOpen != null && message.hasOwnProperty("startQualifierOpen")) { + if (properties.startQualifier === 1) + return "startQualifier: multiple values"; + properties.startQualifier = 1; + if (!(message.startQualifierOpen && typeof message.startQualifierOpen.length === "number" || $util.isString(message.startQualifierOpen))) + return "startQualifierOpen: buffer expected"; + } + if (message.endQualifierClosed != null && message.hasOwnProperty("endQualifierClosed")) { + properties.endQualifier = 1; + if (!(message.endQualifierClosed && typeof message.endQualifierClosed.length === "number" || $util.isString(message.endQualifierClosed))) + return "endQualifierClosed: buffer expected"; + } + if (message.endQualifierOpen != null && message.hasOwnProperty("endQualifierOpen")) { + if (properties.endQualifier === 1) + return "endQualifier: multiple values"; + properties.endQualifier = 1; + if (!(message.endQualifierOpen && typeof message.endQualifierOpen.length === "number" || $util.isString(message.endQualifierOpen))) + return "endQualifierOpen: buffer expected"; + } + return null; + }; + + /** + * Creates a ColumnRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ColumnRange} ColumnRange + */ + ColumnRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ColumnRange) + return object; + var message = new $root.google.bigtable.v2.ColumnRange(); + if (object.familyName != null) + message.familyName = String(object.familyName); + if (object.startQualifierClosed != null) + if (typeof object.startQualifierClosed === "string") + $util.base64.decode(object.startQualifierClosed, message.startQualifierClosed = $util.newBuffer($util.base64.length(object.startQualifierClosed)), 0); + else if (object.startQualifierClosed.length >= 0) + message.startQualifierClosed = object.startQualifierClosed; + if (object.startQualifierOpen != null) + if (typeof object.startQualifierOpen === "string") + $util.base64.decode(object.startQualifierOpen, message.startQualifierOpen = $util.newBuffer($util.base64.length(object.startQualifierOpen)), 0); + else if (object.startQualifierOpen.length >= 0) + message.startQualifierOpen = object.startQualifierOpen; + if (object.endQualifierClosed != null) + if (typeof object.endQualifierClosed === "string") + $util.base64.decode(object.endQualifierClosed, message.endQualifierClosed = $util.newBuffer($util.base64.length(object.endQualifierClosed)), 0); + else if (object.endQualifierClosed.length >= 0) + message.endQualifierClosed = object.endQualifierClosed; + if (object.endQualifierOpen != null) + if (typeof object.endQualifierOpen === "string") + $util.base64.decode(object.endQualifierOpen, message.endQualifierOpen = $util.newBuffer($util.base64.length(object.endQualifierOpen)), 0); + else if (object.endQualifierOpen.length >= 0) + message.endQualifierOpen = object.endQualifierOpen; + return message; + }; + + /** + * Creates a plain object from a ColumnRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {google.bigtable.v2.ColumnRange} message ColumnRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.familyName = ""; + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + if (message.startQualifierClosed != null && message.hasOwnProperty("startQualifierClosed")) { + object.startQualifierClosed = options.bytes === String ? $util.base64.encode(message.startQualifierClosed, 0, message.startQualifierClosed.length) : options.bytes === Array ? Array.prototype.slice.call(message.startQualifierClosed) : message.startQualifierClosed; + if (options.oneofs) + object.startQualifier = "startQualifierClosed"; + } + if (message.startQualifierOpen != null && message.hasOwnProperty("startQualifierOpen")) { + object.startQualifierOpen = options.bytes === String ? $util.base64.encode(message.startQualifierOpen, 0, message.startQualifierOpen.length) : options.bytes === Array ? Array.prototype.slice.call(message.startQualifierOpen) : message.startQualifierOpen; + if (options.oneofs) + object.startQualifier = "startQualifierOpen"; + } + if (message.endQualifierClosed != null && message.hasOwnProperty("endQualifierClosed")) { + object.endQualifierClosed = options.bytes === String ? $util.base64.encode(message.endQualifierClosed, 0, message.endQualifierClosed.length) : options.bytes === Array ? Array.prototype.slice.call(message.endQualifierClosed) : message.endQualifierClosed; + if (options.oneofs) + object.endQualifier = "endQualifierClosed"; + } + if (message.endQualifierOpen != null && message.hasOwnProperty("endQualifierOpen")) { + object.endQualifierOpen = options.bytes === String ? $util.base64.encode(message.endQualifierOpen, 0, message.endQualifierOpen.length) : options.bytes === Array ? Array.prototype.slice.call(message.endQualifierOpen) : message.endQualifierOpen; + if (options.oneofs) + object.endQualifier = "endQualifierOpen"; + } + return object; + }; + + /** + * Converts this ColumnRange to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ColumnRange + * @instance + * @returns {Object.} JSON object + */ + ColumnRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnRange + * @function getTypeUrl + * @memberof google.bigtable.v2.ColumnRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ColumnRange"; + }; + + return ColumnRange; + })(); + + v2.TimestampRange = (function() { + + /** + * Properties of a TimestampRange. + * @memberof google.bigtable.v2 + * @interface ITimestampRange + * @property {number|Long|null} [startTimestampMicros] TimestampRange startTimestampMicros + * @property {number|Long|null} [endTimestampMicros] TimestampRange endTimestampMicros + */ + + /** + * Constructs a new TimestampRange. + * @memberof google.bigtable.v2 + * @classdesc Represents a TimestampRange. + * @implements ITimestampRange + * @constructor + * @param {google.bigtable.v2.ITimestampRange=} [properties] Properties to set + */ + function TimestampRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimestampRange startTimestampMicros. + * @member {number|Long} startTimestampMicros + * @memberof google.bigtable.v2.TimestampRange + * @instance + */ + TimestampRange.prototype.startTimestampMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TimestampRange endTimestampMicros. + * @member {number|Long} endTimestampMicros + * @memberof google.bigtable.v2.TimestampRange + * @instance + */ + TimestampRange.prototype.endTimestampMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampRange instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {google.bigtable.v2.ITimestampRange=} [properties] Properties to set + * @returns {google.bigtable.v2.TimestampRange} TimestampRange instance + */ + TimestampRange.create = function create(properties) { + return new TimestampRange(properties); + }; + + /** + * Encodes the specified TimestampRange message. Does not implicitly {@link google.bigtable.v2.TimestampRange.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {google.bigtable.v2.ITimestampRange} message TimestampRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimestampMicros != null && Object.hasOwnProperty.call(message, "startTimestampMicros")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.startTimestampMicros); + if (message.endTimestampMicros != null && Object.hasOwnProperty.call(message, "endTimestampMicros")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.endTimestampMicros); + return writer; + }; + + /** + * Encodes the specified TimestampRange message, length delimited. Does not implicitly {@link google.bigtable.v2.TimestampRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {google.bigtable.v2.ITimestampRange} message TimestampRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimestampRange message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.TimestampRange} TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.TimestampRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTimestampMicros = reader.int64(); + break; + } + case 2: { + message.endTimestampMicros = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimestampRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.TimestampRange} TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimestampRange message. + * @function verify + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimestampRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimestampMicros != null && message.hasOwnProperty("startTimestampMicros")) + if (!$util.isInteger(message.startTimestampMicros) && !(message.startTimestampMicros && $util.isInteger(message.startTimestampMicros.low) && $util.isInteger(message.startTimestampMicros.high))) + return "startTimestampMicros: integer|Long expected"; + if (message.endTimestampMicros != null && message.hasOwnProperty("endTimestampMicros")) + if (!$util.isInteger(message.endTimestampMicros) && !(message.endTimestampMicros && $util.isInteger(message.endTimestampMicros.low) && $util.isInteger(message.endTimestampMicros.high))) + return "endTimestampMicros: integer|Long expected"; + return null; + }; + + /** + * Creates a TimestampRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.TimestampRange} TimestampRange + */ + TimestampRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.TimestampRange) + return object; + var message = new $root.google.bigtable.v2.TimestampRange(); + if (object.startTimestampMicros != null) + if ($util.Long) + (message.startTimestampMicros = $util.Long.fromValue(object.startTimestampMicros)).unsigned = false; + else if (typeof object.startTimestampMicros === "string") + message.startTimestampMicros = parseInt(object.startTimestampMicros, 10); + else if (typeof object.startTimestampMicros === "number") + message.startTimestampMicros = object.startTimestampMicros; + else if (typeof object.startTimestampMicros === "object") + message.startTimestampMicros = new $util.LongBits(object.startTimestampMicros.low >>> 0, object.startTimestampMicros.high >>> 0).toNumber(); + if (object.endTimestampMicros != null) + if ($util.Long) + (message.endTimestampMicros = $util.Long.fromValue(object.endTimestampMicros)).unsigned = false; + else if (typeof object.endTimestampMicros === "string") + message.endTimestampMicros = parseInt(object.endTimestampMicros, 10); + else if (typeof object.endTimestampMicros === "number") + message.endTimestampMicros = object.endTimestampMicros; + else if (typeof object.endTimestampMicros === "object") + message.endTimestampMicros = new $util.LongBits(object.endTimestampMicros.low >>> 0, object.endTimestampMicros.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TimestampRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {google.bigtable.v2.TimestampRange} message TimestampRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimestampRange.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.startTimestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTimestampMicros = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endTimestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endTimestampMicros = options.longs === String ? "0" : 0; + } + if (message.startTimestampMicros != null && message.hasOwnProperty("startTimestampMicros")) + if (typeof message.startTimestampMicros === "number") + object.startTimestampMicros = options.longs === String ? String(message.startTimestampMicros) : message.startTimestampMicros; + else + object.startTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.startTimestampMicros) : options.longs === Number ? new $util.LongBits(message.startTimestampMicros.low >>> 0, message.startTimestampMicros.high >>> 0).toNumber() : message.startTimestampMicros; + if (message.endTimestampMicros != null && message.hasOwnProperty("endTimestampMicros")) + if (typeof message.endTimestampMicros === "number") + object.endTimestampMicros = options.longs === String ? String(message.endTimestampMicros) : message.endTimestampMicros; + else + object.endTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.endTimestampMicros) : options.longs === Number ? new $util.LongBits(message.endTimestampMicros.low >>> 0, message.endTimestampMicros.high >>> 0).toNumber() : message.endTimestampMicros; + return object; + }; + + /** + * Converts this TimestampRange to JSON. + * @function toJSON + * @memberof google.bigtable.v2.TimestampRange + * @instance + * @returns {Object.} JSON object + */ + TimestampRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimestampRange + * @function getTypeUrl + * @memberof google.bigtable.v2.TimestampRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.TimestampRange"; + }; + + return TimestampRange; + })(); + + v2.ValueRange = (function() { + + /** + * Properties of a ValueRange. + * @memberof google.bigtable.v2 + * @interface IValueRange + * @property {Uint8Array|null} [startValueClosed] ValueRange startValueClosed + * @property {Uint8Array|null} [startValueOpen] ValueRange startValueOpen + * @property {Uint8Array|null} [endValueClosed] ValueRange endValueClosed + * @property {Uint8Array|null} [endValueOpen] ValueRange endValueOpen + */ + + /** + * Constructs a new ValueRange. + * @memberof google.bigtable.v2 + * @classdesc Represents a ValueRange. + * @implements IValueRange + * @constructor + * @param {google.bigtable.v2.IValueRange=} [properties] Properties to set + */ + function ValueRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValueRange startValueClosed. + * @member {Uint8Array|null|undefined} startValueClosed + * @memberof google.bigtable.v2.ValueRange + * @instance + */ + ValueRange.prototype.startValueClosed = null; + + /** + * ValueRange startValueOpen. + * @member {Uint8Array|null|undefined} startValueOpen + * @memberof google.bigtable.v2.ValueRange + * @instance + */ + ValueRange.prototype.startValueOpen = null; + + /** + * ValueRange endValueClosed. + * @member {Uint8Array|null|undefined} endValueClosed + * @memberof google.bigtable.v2.ValueRange + * @instance + */ + ValueRange.prototype.endValueClosed = null; + + /** + * ValueRange endValueOpen. + * @member {Uint8Array|null|undefined} endValueOpen + * @memberof google.bigtable.v2.ValueRange + * @instance + */ + ValueRange.prototype.endValueOpen = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ValueRange startValue. + * @member {"startValueClosed"|"startValueOpen"|undefined} startValue + * @memberof google.bigtable.v2.ValueRange + * @instance + */ + Object.defineProperty(ValueRange.prototype, "startValue", { + get: $util.oneOfGetter($oneOfFields = ["startValueClosed", "startValueOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ValueRange endValue. + * @member {"endValueClosed"|"endValueOpen"|undefined} endValue + * @memberof google.bigtable.v2.ValueRange + * @instance + */ + Object.defineProperty(ValueRange.prototype, "endValue", { + get: $util.oneOfGetter($oneOfFields = ["endValueClosed", "endValueOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ValueRange instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {google.bigtable.v2.IValueRange=} [properties] Properties to set + * @returns {google.bigtable.v2.ValueRange} ValueRange instance + */ + ValueRange.create = function create(properties) { + return new ValueRange(properties); + }; + + /** + * Encodes the specified ValueRange message. Does not implicitly {@link google.bigtable.v2.ValueRange.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {google.bigtable.v2.IValueRange} message ValueRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startValueClosed != null && Object.hasOwnProperty.call(message, "startValueClosed")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startValueClosed); + if (message.startValueOpen != null && Object.hasOwnProperty.call(message, "startValueOpen")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.startValueOpen); + if (message.endValueClosed != null && Object.hasOwnProperty.call(message, "endValueClosed")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.endValueClosed); + if (message.endValueOpen != null && Object.hasOwnProperty.call(message, "endValueOpen")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.endValueOpen); + return writer; + }; + + /** + * Encodes the specified ValueRange message, length delimited. Does not implicitly {@link google.bigtable.v2.ValueRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {google.bigtable.v2.IValueRange} message ValueRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValueRange message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ValueRange} ValueRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ValueRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startValueClosed = reader.bytes(); + break; + } + case 2: { + message.startValueOpen = reader.bytes(); + break; + } + case 3: { + message.endValueClosed = reader.bytes(); + break; + } + case 4: { + message.endValueOpen = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValueRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ValueRange} ValueRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValueRange message. + * @function verify + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValueRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startValueClosed != null && message.hasOwnProperty("startValueClosed")) { + properties.startValue = 1; + if (!(message.startValueClosed && typeof message.startValueClosed.length === "number" || $util.isString(message.startValueClosed))) + return "startValueClosed: buffer expected"; + } + if (message.startValueOpen != null && message.hasOwnProperty("startValueOpen")) { + if (properties.startValue === 1) + return "startValue: multiple values"; + properties.startValue = 1; + if (!(message.startValueOpen && typeof message.startValueOpen.length === "number" || $util.isString(message.startValueOpen))) + return "startValueOpen: buffer expected"; + } + if (message.endValueClosed != null && message.hasOwnProperty("endValueClosed")) { + properties.endValue = 1; + if (!(message.endValueClosed && typeof message.endValueClosed.length === "number" || $util.isString(message.endValueClosed))) + return "endValueClosed: buffer expected"; + } + if (message.endValueOpen != null && message.hasOwnProperty("endValueOpen")) { + if (properties.endValue === 1) + return "endValue: multiple values"; + properties.endValue = 1; + if (!(message.endValueOpen && typeof message.endValueOpen.length === "number" || $util.isString(message.endValueOpen))) + return "endValueOpen: buffer expected"; + } + return null; + }; + + /** + * Creates a ValueRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ValueRange} ValueRange + */ + ValueRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ValueRange) + return object; + var message = new $root.google.bigtable.v2.ValueRange(); + if (object.startValueClosed != null) + if (typeof object.startValueClosed === "string") + $util.base64.decode(object.startValueClosed, message.startValueClosed = $util.newBuffer($util.base64.length(object.startValueClosed)), 0); + else if (object.startValueClosed.length >= 0) + message.startValueClosed = object.startValueClosed; + if (object.startValueOpen != null) + if (typeof object.startValueOpen === "string") + $util.base64.decode(object.startValueOpen, message.startValueOpen = $util.newBuffer($util.base64.length(object.startValueOpen)), 0); + else if (object.startValueOpen.length >= 0) + message.startValueOpen = object.startValueOpen; + if (object.endValueClosed != null) + if (typeof object.endValueClosed === "string") + $util.base64.decode(object.endValueClosed, message.endValueClosed = $util.newBuffer($util.base64.length(object.endValueClosed)), 0); + else if (object.endValueClosed.length >= 0) + message.endValueClosed = object.endValueClosed; + if (object.endValueOpen != null) + if (typeof object.endValueOpen === "string") + $util.base64.decode(object.endValueOpen, message.endValueOpen = $util.newBuffer($util.base64.length(object.endValueOpen)), 0); + else if (object.endValueOpen.length >= 0) + message.endValueOpen = object.endValueOpen; + return message; + }; + + /** + * Creates a plain object from a ValueRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {google.bigtable.v2.ValueRange} message ValueRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValueRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startValueClosed != null && message.hasOwnProperty("startValueClosed")) { + object.startValueClosed = options.bytes === String ? $util.base64.encode(message.startValueClosed, 0, message.startValueClosed.length) : options.bytes === Array ? Array.prototype.slice.call(message.startValueClosed) : message.startValueClosed; + if (options.oneofs) + object.startValue = "startValueClosed"; + } + if (message.startValueOpen != null && message.hasOwnProperty("startValueOpen")) { + object.startValueOpen = options.bytes === String ? $util.base64.encode(message.startValueOpen, 0, message.startValueOpen.length) : options.bytes === Array ? Array.prototype.slice.call(message.startValueOpen) : message.startValueOpen; + if (options.oneofs) + object.startValue = "startValueOpen"; + } + if (message.endValueClosed != null && message.hasOwnProperty("endValueClosed")) { + object.endValueClosed = options.bytes === String ? $util.base64.encode(message.endValueClosed, 0, message.endValueClosed.length) : options.bytes === Array ? Array.prototype.slice.call(message.endValueClosed) : message.endValueClosed; + if (options.oneofs) + object.endValue = "endValueClosed"; + } + if (message.endValueOpen != null && message.hasOwnProperty("endValueOpen")) { + object.endValueOpen = options.bytes === String ? $util.base64.encode(message.endValueOpen, 0, message.endValueOpen.length) : options.bytes === Array ? Array.prototype.slice.call(message.endValueOpen) : message.endValueOpen; + if (options.oneofs) + object.endValue = "endValueOpen"; + } + return object; + }; + + /** + * Converts this ValueRange to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ValueRange + * @instance + * @returns {Object.} JSON object + */ + ValueRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValueRange + * @function getTypeUrl + * @memberof google.bigtable.v2.ValueRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValueRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ValueRange"; + }; + + return ValueRange; + })(); + + v2.RowFilter = (function() { + + /** + * Properties of a RowFilter. + * @memberof google.bigtable.v2 + * @interface IRowFilter + * @property {google.bigtable.v2.RowFilter.IChain|null} [chain] RowFilter chain + * @property {google.bigtable.v2.RowFilter.IInterleave|null} [interleave] RowFilter interleave + * @property {google.bigtable.v2.RowFilter.ICondition|null} [condition] RowFilter condition + * @property {boolean|null} [sink] RowFilter sink + * @property {boolean|null} [passAllFilter] RowFilter passAllFilter + * @property {boolean|null} [blockAllFilter] RowFilter blockAllFilter + * @property {Uint8Array|null} [rowKeyRegexFilter] RowFilter rowKeyRegexFilter + * @property {number|null} [rowSampleFilter] RowFilter rowSampleFilter + * @property {string|null} [familyNameRegexFilter] RowFilter familyNameRegexFilter + * @property {Uint8Array|null} [columnQualifierRegexFilter] RowFilter columnQualifierRegexFilter + * @property {google.bigtable.v2.IColumnRange|null} [columnRangeFilter] RowFilter columnRangeFilter + * @property {google.bigtable.v2.ITimestampRange|null} [timestampRangeFilter] RowFilter timestampRangeFilter + * @property {Uint8Array|null} [valueRegexFilter] RowFilter valueRegexFilter + * @property {google.bigtable.v2.IValueRange|null} [valueRangeFilter] RowFilter valueRangeFilter + * @property {number|null} [cellsPerRowOffsetFilter] RowFilter cellsPerRowOffsetFilter + * @property {number|null} [cellsPerRowLimitFilter] RowFilter cellsPerRowLimitFilter + * @property {number|null} [cellsPerColumnLimitFilter] RowFilter cellsPerColumnLimitFilter + * @property {boolean|null} [stripValueTransformer] RowFilter stripValueTransformer + * @property {string|null} [applyLabelTransformer] RowFilter applyLabelTransformer + */ + + /** + * Constructs a new RowFilter. + * @memberof google.bigtable.v2 + * @classdesc Represents a RowFilter. + * @implements IRowFilter + * @constructor + * @param {google.bigtable.v2.IRowFilter=} [properties] Properties to set + */ + function RowFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowFilter chain. + * @member {google.bigtable.v2.RowFilter.IChain|null|undefined} chain + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.chain = null; + + /** + * RowFilter interleave. + * @member {google.bigtable.v2.RowFilter.IInterleave|null|undefined} interleave + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.interleave = null; + + /** + * RowFilter condition. + * @member {google.bigtable.v2.RowFilter.ICondition|null|undefined} condition + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.condition = null; + + /** + * RowFilter sink. + * @member {boolean|null|undefined} sink + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.sink = null; + + /** + * RowFilter passAllFilter. + * @member {boolean|null|undefined} passAllFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.passAllFilter = null; + + /** + * RowFilter blockAllFilter. + * @member {boolean|null|undefined} blockAllFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.blockAllFilter = null; + + /** + * RowFilter rowKeyRegexFilter. + * @member {Uint8Array|null|undefined} rowKeyRegexFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.rowKeyRegexFilter = null; + + /** + * RowFilter rowSampleFilter. + * @member {number|null|undefined} rowSampleFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.rowSampleFilter = null; + + /** + * RowFilter familyNameRegexFilter. + * @member {string|null|undefined} familyNameRegexFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.familyNameRegexFilter = null; + + /** + * RowFilter columnQualifierRegexFilter. + * @member {Uint8Array|null|undefined} columnQualifierRegexFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.columnQualifierRegexFilter = null; + + /** + * RowFilter columnRangeFilter. + * @member {google.bigtable.v2.IColumnRange|null|undefined} columnRangeFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.columnRangeFilter = null; + + /** + * RowFilter timestampRangeFilter. + * @member {google.bigtable.v2.ITimestampRange|null|undefined} timestampRangeFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.timestampRangeFilter = null; + + /** + * RowFilter valueRegexFilter. + * @member {Uint8Array|null|undefined} valueRegexFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.valueRegexFilter = null; + + /** + * RowFilter valueRangeFilter. + * @member {google.bigtable.v2.IValueRange|null|undefined} valueRangeFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.valueRangeFilter = null; + + /** + * RowFilter cellsPerRowOffsetFilter. + * @member {number|null|undefined} cellsPerRowOffsetFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.cellsPerRowOffsetFilter = null; + + /** + * RowFilter cellsPerRowLimitFilter. + * @member {number|null|undefined} cellsPerRowLimitFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.cellsPerRowLimitFilter = null; + + /** + * RowFilter cellsPerColumnLimitFilter. + * @member {number|null|undefined} cellsPerColumnLimitFilter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.cellsPerColumnLimitFilter = null; + + /** + * RowFilter stripValueTransformer. + * @member {boolean|null|undefined} stripValueTransformer + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.stripValueTransformer = null; + + /** + * RowFilter applyLabelTransformer. + * @member {string|null|undefined} applyLabelTransformer + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + RowFilter.prototype.applyLabelTransformer = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RowFilter filter. + * @member {"chain"|"interleave"|"condition"|"sink"|"passAllFilter"|"blockAllFilter"|"rowKeyRegexFilter"|"rowSampleFilter"|"familyNameRegexFilter"|"columnQualifierRegexFilter"|"columnRangeFilter"|"timestampRangeFilter"|"valueRegexFilter"|"valueRangeFilter"|"cellsPerRowOffsetFilter"|"cellsPerRowLimitFilter"|"cellsPerColumnLimitFilter"|"stripValueTransformer"|"applyLabelTransformer"|undefined} filter + * @memberof google.bigtable.v2.RowFilter + * @instance + */ + Object.defineProperty(RowFilter.prototype, "filter", { + get: $util.oneOfGetter($oneOfFields = ["chain", "interleave", "condition", "sink", "passAllFilter", "blockAllFilter", "rowKeyRegexFilter", "rowSampleFilter", "familyNameRegexFilter", "columnQualifierRegexFilter", "columnRangeFilter", "timestampRangeFilter", "valueRegexFilter", "valueRangeFilter", "cellsPerRowOffsetFilter", "cellsPerRowLimitFilter", "cellsPerColumnLimitFilter", "stripValueTransformer", "applyLabelTransformer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RowFilter instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {google.bigtable.v2.IRowFilter=} [properties] Properties to set + * @returns {google.bigtable.v2.RowFilter} RowFilter instance + */ + RowFilter.create = function create(properties) { + return new RowFilter(properties); + }; + + /** + * Encodes the specified RowFilter message. Does not implicitly {@link google.bigtable.v2.RowFilter.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {google.bigtable.v2.IRowFilter} message RowFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) + $root.google.bigtable.v2.RowFilter.Chain.encode(message.chain, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.interleave != null && Object.hasOwnProperty.call(message, "interleave")) + $root.google.bigtable.v2.RowFilter.Interleave.encode(message.interleave, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.bigtable.v2.RowFilter.Condition.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rowKeyRegexFilter != null && Object.hasOwnProperty.call(message, "rowKeyRegexFilter")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.rowKeyRegexFilter); + if (message.familyNameRegexFilter != null && Object.hasOwnProperty.call(message, "familyNameRegexFilter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.familyNameRegexFilter); + if (message.columnQualifierRegexFilter != null && Object.hasOwnProperty.call(message, "columnQualifierRegexFilter")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.columnQualifierRegexFilter); + if (message.columnRangeFilter != null && Object.hasOwnProperty.call(message, "columnRangeFilter")) + $root.google.bigtable.v2.ColumnRange.encode(message.columnRangeFilter, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timestampRangeFilter != null && Object.hasOwnProperty.call(message, "timestampRangeFilter")) + $root.google.bigtable.v2.TimestampRange.encode(message.timestampRangeFilter, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.valueRegexFilter != null && Object.hasOwnProperty.call(message, "valueRegexFilter")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.valueRegexFilter); + if (message.cellsPerRowOffsetFilter != null && Object.hasOwnProperty.call(message, "cellsPerRowOffsetFilter")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.cellsPerRowOffsetFilter); + if (message.cellsPerRowLimitFilter != null && Object.hasOwnProperty.call(message, "cellsPerRowLimitFilter")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.cellsPerRowLimitFilter); + if (message.cellsPerColumnLimitFilter != null && Object.hasOwnProperty.call(message, "cellsPerColumnLimitFilter")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.cellsPerColumnLimitFilter); + if (message.stripValueTransformer != null && Object.hasOwnProperty.call(message, "stripValueTransformer")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.stripValueTransformer); + if (message.rowSampleFilter != null && Object.hasOwnProperty.call(message, "rowSampleFilter")) + writer.uint32(/* id 14, wireType 1 =*/113).double(message.rowSampleFilter); + if (message.valueRangeFilter != null && Object.hasOwnProperty.call(message, "valueRangeFilter")) + $root.google.bigtable.v2.ValueRange.encode(message.valueRangeFilter, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.sink != null && Object.hasOwnProperty.call(message, "sink")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.sink); + if (message.passAllFilter != null && Object.hasOwnProperty.call(message, "passAllFilter")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.passAllFilter); + if (message.blockAllFilter != null && Object.hasOwnProperty.call(message, "blockAllFilter")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.blockAllFilter); + if (message.applyLabelTransformer != null && Object.hasOwnProperty.call(message, "applyLabelTransformer")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.applyLabelTransformer); + return writer; + }; + + /** + * Encodes the specified RowFilter message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {google.bigtable.v2.IRowFilter} message RowFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowFilter message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RowFilter} RowFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowFilter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RowFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chain = $root.google.bigtable.v2.RowFilter.Chain.decode(reader, reader.uint32()); + break; + } + case 2: { + message.interleave = $root.google.bigtable.v2.RowFilter.Interleave.decode(reader, reader.uint32()); + break; + } + case 3: { + message.condition = $root.google.bigtable.v2.RowFilter.Condition.decode(reader, reader.uint32()); + break; + } + case 16: { + message.sink = reader.bool(); + break; + } + case 17: { + message.passAllFilter = reader.bool(); + break; + } + case 18: { + message.blockAllFilter = reader.bool(); + break; + } + case 4: { + message.rowKeyRegexFilter = reader.bytes(); + break; + } + case 14: { + message.rowSampleFilter = reader.double(); + break; + } + case 5: { + message.familyNameRegexFilter = reader.string(); + break; + } + case 6: { + message.columnQualifierRegexFilter = reader.bytes(); + break; + } + case 7: { + message.columnRangeFilter = $root.google.bigtable.v2.ColumnRange.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timestampRangeFilter = $root.google.bigtable.v2.TimestampRange.decode(reader, reader.uint32()); + break; + } + case 9: { + message.valueRegexFilter = reader.bytes(); + break; + } + case 15: { + message.valueRangeFilter = $root.google.bigtable.v2.ValueRange.decode(reader, reader.uint32()); + break; + } + case 10: { + message.cellsPerRowOffsetFilter = reader.int32(); + break; + } + case 11: { + message.cellsPerRowLimitFilter = reader.int32(); + break; + } + case 12: { + message.cellsPerColumnLimitFilter = reader.int32(); + break; + } + case 13: { + message.stripValueTransformer = reader.bool(); + break; + } + case 19: { + message.applyLabelTransformer = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RowFilter} RowFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowFilter message. + * @function verify + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.chain != null && message.hasOwnProperty("chain")) { + properties.filter = 1; + { + var error = $root.google.bigtable.v2.RowFilter.Chain.verify(message.chain); + if (error) + return "chain." + error; + } + } + if (message.interleave != null && message.hasOwnProperty("interleave")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + { + var error = $root.google.bigtable.v2.RowFilter.Interleave.verify(message.interleave); + if (error) + return "interleave." + error; + } + } + if (message.condition != null && message.hasOwnProperty("condition")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + { + var error = $root.google.bigtable.v2.RowFilter.Condition.verify(message.condition); + if (error) + return "condition." + error; + } + } + if (message.sink != null && message.hasOwnProperty("sink")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (typeof message.sink !== "boolean") + return "sink: boolean expected"; + } + if (message.passAllFilter != null && message.hasOwnProperty("passAllFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (typeof message.passAllFilter !== "boolean") + return "passAllFilter: boolean expected"; + } + if (message.blockAllFilter != null && message.hasOwnProperty("blockAllFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (typeof message.blockAllFilter !== "boolean") + return "blockAllFilter: boolean expected"; + } + if (message.rowKeyRegexFilter != null && message.hasOwnProperty("rowKeyRegexFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!(message.rowKeyRegexFilter && typeof message.rowKeyRegexFilter.length === "number" || $util.isString(message.rowKeyRegexFilter))) + return "rowKeyRegexFilter: buffer expected"; + } + if (message.rowSampleFilter != null && message.hasOwnProperty("rowSampleFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (typeof message.rowSampleFilter !== "number") + return "rowSampleFilter: number expected"; + } + if (message.familyNameRegexFilter != null && message.hasOwnProperty("familyNameRegexFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!$util.isString(message.familyNameRegexFilter)) + return "familyNameRegexFilter: string expected"; + } + if (message.columnQualifierRegexFilter != null && message.hasOwnProperty("columnQualifierRegexFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!(message.columnQualifierRegexFilter && typeof message.columnQualifierRegexFilter.length === "number" || $util.isString(message.columnQualifierRegexFilter))) + return "columnQualifierRegexFilter: buffer expected"; + } + if (message.columnRangeFilter != null && message.hasOwnProperty("columnRangeFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + { + var error = $root.google.bigtable.v2.ColumnRange.verify(message.columnRangeFilter); + if (error) + return "columnRangeFilter." + error; + } + } + if (message.timestampRangeFilter != null && message.hasOwnProperty("timestampRangeFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + { + var error = $root.google.bigtable.v2.TimestampRange.verify(message.timestampRangeFilter); + if (error) + return "timestampRangeFilter." + error; + } + } + if (message.valueRegexFilter != null && message.hasOwnProperty("valueRegexFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!(message.valueRegexFilter && typeof message.valueRegexFilter.length === "number" || $util.isString(message.valueRegexFilter))) + return "valueRegexFilter: buffer expected"; + } + if (message.valueRangeFilter != null && message.hasOwnProperty("valueRangeFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + { + var error = $root.google.bigtable.v2.ValueRange.verify(message.valueRangeFilter); + if (error) + return "valueRangeFilter." + error; + } + } + if (message.cellsPerRowOffsetFilter != null && message.hasOwnProperty("cellsPerRowOffsetFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!$util.isInteger(message.cellsPerRowOffsetFilter)) + return "cellsPerRowOffsetFilter: integer expected"; + } + if (message.cellsPerRowLimitFilter != null && message.hasOwnProperty("cellsPerRowLimitFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!$util.isInteger(message.cellsPerRowLimitFilter)) + return "cellsPerRowLimitFilter: integer expected"; + } + if (message.cellsPerColumnLimitFilter != null && message.hasOwnProperty("cellsPerColumnLimitFilter")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!$util.isInteger(message.cellsPerColumnLimitFilter)) + return "cellsPerColumnLimitFilter: integer expected"; + } + if (message.stripValueTransformer != null && message.hasOwnProperty("stripValueTransformer")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (typeof message.stripValueTransformer !== "boolean") + return "stripValueTransformer: boolean expected"; + } + if (message.applyLabelTransformer != null && message.hasOwnProperty("applyLabelTransformer")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!$util.isString(message.applyLabelTransformer)) + return "applyLabelTransformer: string expected"; + } + return null; + }; + + /** + * Creates a RowFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RowFilter} RowFilter + */ + RowFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RowFilter) + return object; + var message = new $root.google.bigtable.v2.RowFilter(); + if (object.chain != null) { + if (typeof object.chain !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.chain: object expected"); + message.chain = $root.google.bigtable.v2.RowFilter.Chain.fromObject(object.chain); + } + if (object.interleave != null) { + if (typeof object.interleave !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.interleave: object expected"); + message.interleave = $root.google.bigtable.v2.RowFilter.Interleave.fromObject(object.interleave); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.condition: object expected"); + message.condition = $root.google.bigtable.v2.RowFilter.Condition.fromObject(object.condition); + } + if (object.sink != null) + message.sink = Boolean(object.sink); + if (object.passAllFilter != null) + message.passAllFilter = Boolean(object.passAllFilter); + if (object.blockAllFilter != null) + message.blockAllFilter = Boolean(object.blockAllFilter); + if (object.rowKeyRegexFilter != null) + if (typeof object.rowKeyRegexFilter === "string") + $util.base64.decode(object.rowKeyRegexFilter, message.rowKeyRegexFilter = $util.newBuffer($util.base64.length(object.rowKeyRegexFilter)), 0); + else if (object.rowKeyRegexFilter.length >= 0) + message.rowKeyRegexFilter = object.rowKeyRegexFilter; + if (object.rowSampleFilter != null) + message.rowSampleFilter = Number(object.rowSampleFilter); + if (object.familyNameRegexFilter != null) + message.familyNameRegexFilter = String(object.familyNameRegexFilter); + if (object.columnQualifierRegexFilter != null) + if (typeof object.columnQualifierRegexFilter === "string") + $util.base64.decode(object.columnQualifierRegexFilter, message.columnQualifierRegexFilter = $util.newBuffer($util.base64.length(object.columnQualifierRegexFilter)), 0); + else if (object.columnQualifierRegexFilter.length >= 0) + message.columnQualifierRegexFilter = object.columnQualifierRegexFilter; + if (object.columnRangeFilter != null) { + if (typeof object.columnRangeFilter !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.columnRangeFilter: object expected"); + message.columnRangeFilter = $root.google.bigtable.v2.ColumnRange.fromObject(object.columnRangeFilter); + } + if (object.timestampRangeFilter != null) { + if (typeof object.timestampRangeFilter !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.timestampRangeFilter: object expected"); + message.timestampRangeFilter = $root.google.bigtable.v2.TimestampRange.fromObject(object.timestampRangeFilter); + } + if (object.valueRegexFilter != null) + if (typeof object.valueRegexFilter === "string") + $util.base64.decode(object.valueRegexFilter, message.valueRegexFilter = $util.newBuffer($util.base64.length(object.valueRegexFilter)), 0); + else if (object.valueRegexFilter.length >= 0) + message.valueRegexFilter = object.valueRegexFilter; + if (object.valueRangeFilter != null) { + if (typeof object.valueRangeFilter !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.valueRangeFilter: object expected"); + message.valueRangeFilter = $root.google.bigtable.v2.ValueRange.fromObject(object.valueRangeFilter); + } + if (object.cellsPerRowOffsetFilter != null) + message.cellsPerRowOffsetFilter = object.cellsPerRowOffsetFilter | 0; + if (object.cellsPerRowLimitFilter != null) + message.cellsPerRowLimitFilter = object.cellsPerRowLimitFilter | 0; + if (object.cellsPerColumnLimitFilter != null) + message.cellsPerColumnLimitFilter = object.cellsPerColumnLimitFilter | 0; + if (object.stripValueTransformer != null) + message.stripValueTransformer = Boolean(object.stripValueTransformer); + if (object.applyLabelTransformer != null) + message.applyLabelTransformer = String(object.applyLabelTransformer); + return message; + }; + + /** + * Creates a plain object from a RowFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {google.bigtable.v2.RowFilter} message RowFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.chain != null && message.hasOwnProperty("chain")) { + object.chain = $root.google.bigtable.v2.RowFilter.Chain.toObject(message.chain, options); + if (options.oneofs) + object.filter = "chain"; + } + if (message.interleave != null && message.hasOwnProperty("interleave")) { + object.interleave = $root.google.bigtable.v2.RowFilter.Interleave.toObject(message.interleave, options); + if (options.oneofs) + object.filter = "interleave"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + object.condition = $root.google.bigtable.v2.RowFilter.Condition.toObject(message.condition, options); + if (options.oneofs) + object.filter = "condition"; + } + if (message.rowKeyRegexFilter != null && message.hasOwnProperty("rowKeyRegexFilter")) { + object.rowKeyRegexFilter = options.bytes === String ? $util.base64.encode(message.rowKeyRegexFilter, 0, message.rowKeyRegexFilter.length) : options.bytes === Array ? Array.prototype.slice.call(message.rowKeyRegexFilter) : message.rowKeyRegexFilter; + if (options.oneofs) + object.filter = "rowKeyRegexFilter"; + } + if (message.familyNameRegexFilter != null && message.hasOwnProperty("familyNameRegexFilter")) { + object.familyNameRegexFilter = message.familyNameRegexFilter; + if (options.oneofs) + object.filter = "familyNameRegexFilter"; + } + if (message.columnQualifierRegexFilter != null && message.hasOwnProperty("columnQualifierRegexFilter")) { + object.columnQualifierRegexFilter = options.bytes === String ? $util.base64.encode(message.columnQualifierRegexFilter, 0, message.columnQualifierRegexFilter.length) : options.bytes === Array ? Array.prototype.slice.call(message.columnQualifierRegexFilter) : message.columnQualifierRegexFilter; + if (options.oneofs) + object.filter = "columnQualifierRegexFilter"; + } + if (message.columnRangeFilter != null && message.hasOwnProperty("columnRangeFilter")) { + object.columnRangeFilter = $root.google.bigtable.v2.ColumnRange.toObject(message.columnRangeFilter, options); + if (options.oneofs) + object.filter = "columnRangeFilter"; + } + if (message.timestampRangeFilter != null && message.hasOwnProperty("timestampRangeFilter")) { + object.timestampRangeFilter = $root.google.bigtable.v2.TimestampRange.toObject(message.timestampRangeFilter, options); + if (options.oneofs) + object.filter = "timestampRangeFilter"; + } + if (message.valueRegexFilter != null && message.hasOwnProperty("valueRegexFilter")) { + object.valueRegexFilter = options.bytes === String ? $util.base64.encode(message.valueRegexFilter, 0, message.valueRegexFilter.length) : options.bytes === Array ? Array.prototype.slice.call(message.valueRegexFilter) : message.valueRegexFilter; + if (options.oneofs) + object.filter = "valueRegexFilter"; + } + if (message.cellsPerRowOffsetFilter != null && message.hasOwnProperty("cellsPerRowOffsetFilter")) { + object.cellsPerRowOffsetFilter = message.cellsPerRowOffsetFilter; + if (options.oneofs) + object.filter = "cellsPerRowOffsetFilter"; + } + if (message.cellsPerRowLimitFilter != null && message.hasOwnProperty("cellsPerRowLimitFilter")) { + object.cellsPerRowLimitFilter = message.cellsPerRowLimitFilter; + if (options.oneofs) + object.filter = "cellsPerRowLimitFilter"; + } + if (message.cellsPerColumnLimitFilter != null && message.hasOwnProperty("cellsPerColumnLimitFilter")) { + object.cellsPerColumnLimitFilter = message.cellsPerColumnLimitFilter; + if (options.oneofs) + object.filter = "cellsPerColumnLimitFilter"; + } + if (message.stripValueTransformer != null && message.hasOwnProperty("stripValueTransformer")) { + object.stripValueTransformer = message.stripValueTransformer; + if (options.oneofs) + object.filter = "stripValueTransformer"; + } + if (message.rowSampleFilter != null && message.hasOwnProperty("rowSampleFilter")) { + object.rowSampleFilter = options.json && !isFinite(message.rowSampleFilter) ? String(message.rowSampleFilter) : message.rowSampleFilter; + if (options.oneofs) + object.filter = "rowSampleFilter"; + } + if (message.valueRangeFilter != null && message.hasOwnProperty("valueRangeFilter")) { + object.valueRangeFilter = $root.google.bigtable.v2.ValueRange.toObject(message.valueRangeFilter, options); + if (options.oneofs) + object.filter = "valueRangeFilter"; + } + if (message.sink != null && message.hasOwnProperty("sink")) { + object.sink = message.sink; + if (options.oneofs) + object.filter = "sink"; + } + if (message.passAllFilter != null && message.hasOwnProperty("passAllFilter")) { + object.passAllFilter = message.passAllFilter; + if (options.oneofs) + object.filter = "passAllFilter"; + } + if (message.blockAllFilter != null && message.hasOwnProperty("blockAllFilter")) { + object.blockAllFilter = message.blockAllFilter; + if (options.oneofs) + object.filter = "blockAllFilter"; + } + if (message.applyLabelTransformer != null && message.hasOwnProperty("applyLabelTransformer")) { + object.applyLabelTransformer = message.applyLabelTransformer; + if (options.oneofs) + object.filter = "applyLabelTransformer"; + } + return object; + }; + + /** + * Converts this RowFilter to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RowFilter + * @instance + * @returns {Object.} JSON object + */ + RowFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowFilter + * @function getTypeUrl + * @memberof google.bigtable.v2.RowFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RowFilter"; + }; + + RowFilter.Chain = (function() { + + /** + * Properties of a Chain. + * @memberof google.bigtable.v2.RowFilter + * @interface IChain + * @property {Array.|null} [filters] Chain filters + */ + + /** + * Constructs a new Chain. + * @memberof google.bigtable.v2.RowFilter + * @classdesc Represents a Chain. + * @implements IChain + * @constructor + * @param {google.bigtable.v2.RowFilter.IChain=} [properties] Properties to set + */ + function Chain(properties) { + this.filters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chain filters. + * @member {Array.} filters + * @memberof google.bigtable.v2.RowFilter.Chain + * @instance + */ + Chain.prototype.filters = $util.emptyArray; + + /** + * Creates a new Chain instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {google.bigtable.v2.RowFilter.IChain=} [properties] Properties to set + * @returns {google.bigtable.v2.RowFilter.Chain} Chain instance + */ + Chain.create = function create(properties) { + return new Chain(properties); + }; + + /** + * Encodes the specified Chain message. Does not implicitly {@link google.bigtable.v2.RowFilter.Chain.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {google.bigtable.v2.RowFilter.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filters != null && message.filters.length) + for (var i = 0; i < message.filters.length; ++i) + $root.google.bigtable.v2.RowFilter.encode(message.filters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Chain message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.Chain.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {google.bigtable.v2.RowFilter.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chain message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RowFilter.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RowFilter.Chain(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.filters && message.filters.length)) + message.filters = []; + message.filters.push($root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RowFilter.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chain message. + * @function verify + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filters != null && message.hasOwnProperty("filters")) { + if (!Array.isArray(message.filters)) + return "filters: array expected"; + for (var i = 0; i < message.filters.length; ++i) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.filters[i]); + if (error) + return "filters." + error; + } + } + return null; + }; + + /** + * Creates a Chain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RowFilter.Chain} Chain + */ + Chain.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RowFilter.Chain) + return object; + var message = new $root.google.bigtable.v2.RowFilter.Chain(); + if (object.filters) { + if (!Array.isArray(object.filters)) + throw TypeError(".google.bigtable.v2.RowFilter.Chain.filters: array expected"); + message.filters = []; + for (var i = 0; i < object.filters.length; ++i) { + if (typeof object.filters[i] !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.Chain.filters: object expected"); + message.filters[i] = $root.google.bigtable.v2.RowFilter.fromObject(object.filters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Chain message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {google.bigtable.v2.RowFilter.Chain} message Chain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.filters = []; + if (message.filters && message.filters.length) { + object.filters = []; + for (var j = 0; j < message.filters.length; ++j) + object.filters[j] = $root.google.bigtable.v2.RowFilter.toObject(message.filters[j], options); + } + return object; + }; + + /** + * Converts this Chain to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RowFilter.Chain + * @instance + * @returns {Object.} JSON object + */ + Chain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Chain + * @function getTypeUrl + * @memberof google.bigtable.v2.RowFilter.Chain + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Chain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RowFilter.Chain"; + }; + + return Chain; + })(); + + RowFilter.Interleave = (function() { + + /** + * Properties of an Interleave. + * @memberof google.bigtable.v2.RowFilter + * @interface IInterleave + * @property {Array.|null} [filters] Interleave filters + */ + + /** + * Constructs a new Interleave. + * @memberof google.bigtable.v2.RowFilter + * @classdesc Represents an Interleave. + * @implements IInterleave + * @constructor + * @param {google.bigtable.v2.RowFilter.IInterleave=} [properties] Properties to set + */ + function Interleave(properties) { + this.filters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Interleave filters. + * @member {Array.} filters + * @memberof google.bigtable.v2.RowFilter.Interleave + * @instance + */ + Interleave.prototype.filters = $util.emptyArray; + + /** + * Creates a new Interleave instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {google.bigtable.v2.RowFilter.IInterleave=} [properties] Properties to set + * @returns {google.bigtable.v2.RowFilter.Interleave} Interleave instance + */ + Interleave.create = function create(properties) { + return new Interleave(properties); + }; + + /** + * Encodes the specified Interleave message. Does not implicitly {@link google.bigtable.v2.RowFilter.Interleave.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {google.bigtable.v2.RowFilter.IInterleave} message Interleave message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interleave.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filters != null && message.filters.length) + for (var i = 0; i < message.filters.length; ++i) + $root.google.bigtable.v2.RowFilter.encode(message.filters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Interleave message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.Interleave.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {google.bigtable.v2.RowFilter.IInterleave} message Interleave message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interleave.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Interleave message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RowFilter.Interleave} Interleave + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interleave.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RowFilter.Interleave(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.filters && message.filters.length)) + message.filters = []; + message.filters.push($root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Interleave message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RowFilter.Interleave} Interleave + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interleave.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Interleave message. + * @function verify + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Interleave.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filters != null && message.hasOwnProperty("filters")) { + if (!Array.isArray(message.filters)) + return "filters: array expected"; + for (var i = 0; i < message.filters.length; ++i) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.filters[i]); + if (error) + return "filters." + error; + } + } + return null; + }; + + /** + * Creates an Interleave message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RowFilter.Interleave} Interleave + */ + Interleave.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RowFilter.Interleave) + return object; + var message = new $root.google.bigtable.v2.RowFilter.Interleave(); + if (object.filters) { + if (!Array.isArray(object.filters)) + throw TypeError(".google.bigtable.v2.RowFilter.Interleave.filters: array expected"); + message.filters = []; + for (var i = 0; i < object.filters.length; ++i) { + if (typeof object.filters[i] !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.Interleave.filters: object expected"); + message.filters[i] = $root.google.bigtable.v2.RowFilter.fromObject(object.filters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Interleave message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {google.bigtable.v2.RowFilter.Interleave} message Interleave + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Interleave.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.filters = []; + if (message.filters && message.filters.length) { + object.filters = []; + for (var j = 0; j < message.filters.length; ++j) + object.filters[j] = $root.google.bigtable.v2.RowFilter.toObject(message.filters[j], options); + } + return object; + }; + + /** + * Converts this Interleave to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RowFilter.Interleave + * @instance + * @returns {Object.} JSON object + */ + Interleave.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Interleave + * @function getTypeUrl + * @memberof google.bigtable.v2.RowFilter.Interleave + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Interleave.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RowFilter.Interleave"; + }; + + return Interleave; + })(); + + RowFilter.Condition = (function() { + + /** + * Properties of a Condition. + * @memberof google.bigtable.v2.RowFilter + * @interface ICondition + * @property {google.bigtable.v2.IRowFilter|null} [predicateFilter] Condition predicateFilter + * @property {google.bigtable.v2.IRowFilter|null} [trueFilter] Condition trueFilter + * @property {google.bigtable.v2.IRowFilter|null} [falseFilter] Condition falseFilter + */ + + /** + * Constructs a new Condition. + * @memberof google.bigtable.v2.RowFilter + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.bigtable.v2.RowFilter.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Condition predicateFilter. + * @member {google.bigtable.v2.IRowFilter|null|undefined} predicateFilter + * @memberof google.bigtable.v2.RowFilter.Condition + * @instance + */ + Condition.prototype.predicateFilter = null; + + /** + * Condition trueFilter. + * @member {google.bigtable.v2.IRowFilter|null|undefined} trueFilter + * @memberof google.bigtable.v2.RowFilter.Condition + * @instance + */ + Condition.prototype.trueFilter = null; + + /** + * Condition falseFilter. + * @member {google.bigtable.v2.IRowFilter|null|undefined} falseFilter + * @memberof google.bigtable.v2.RowFilter.Condition + * @instance + */ + Condition.prototype.falseFilter = null; + + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {google.bigtable.v2.RowFilter.ICondition=} [properties] Properties to set + * @returns {google.bigtable.v2.RowFilter.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.bigtable.v2.RowFilter.Condition.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {google.bigtable.v2.RowFilter.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.predicateFilter != null && Object.hasOwnProperty.call(message, "predicateFilter")) + $root.google.bigtable.v2.RowFilter.encode(message.predicateFilter, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.trueFilter != null && Object.hasOwnProperty.call(message, "trueFilter")) + $root.google.bigtable.v2.RowFilter.encode(message.trueFilter, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.falseFilter != null && Object.hasOwnProperty.call(message, "falseFilter")) + $root.google.bigtable.v2.RowFilter.encode(message.falseFilter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.bigtable.v2.RowFilter.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {google.bigtable.v2.RowFilter.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RowFilter.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RowFilter.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.predicateFilter = $root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32()); + break; + } + case 2: { + message.trueFilter = $root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32()); + break; + } + case 3: { + message.falseFilter = $root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RowFilter.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Condition message. + * @function verify + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.predicateFilter != null && message.hasOwnProperty("predicateFilter")) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.predicateFilter); + if (error) + return "predicateFilter." + error; + } + if (message.trueFilter != null && message.hasOwnProperty("trueFilter")) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.trueFilter); + if (error) + return "trueFilter." + error; + } + if (message.falseFilter != null && message.hasOwnProperty("falseFilter")) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.falseFilter); + if (error) + return "falseFilter." + error; + } + return null; + }; + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RowFilter.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RowFilter.Condition) + return object; + var message = new $root.google.bigtable.v2.RowFilter.Condition(); + if (object.predicateFilter != null) { + if (typeof object.predicateFilter !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.Condition.predicateFilter: object expected"); + message.predicateFilter = $root.google.bigtable.v2.RowFilter.fromObject(object.predicateFilter); + } + if (object.trueFilter != null) { + if (typeof object.trueFilter !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.Condition.trueFilter: object expected"); + message.trueFilter = $root.google.bigtable.v2.RowFilter.fromObject(object.trueFilter); + } + if (object.falseFilter != null) { + if (typeof object.falseFilter !== "object") + throw TypeError(".google.bigtable.v2.RowFilter.Condition.falseFilter: object expected"); + message.falseFilter = $root.google.bigtable.v2.RowFilter.fromObject(object.falseFilter); + } + return message; + }; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {google.bigtable.v2.RowFilter.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.predicateFilter = null; + object.trueFilter = null; + object.falseFilter = null; + } + if (message.predicateFilter != null && message.hasOwnProperty("predicateFilter")) + object.predicateFilter = $root.google.bigtable.v2.RowFilter.toObject(message.predicateFilter, options); + if (message.trueFilter != null && message.hasOwnProperty("trueFilter")) + object.trueFilter = $root.google.bigtable.v2.RowFilter.toObject(message.trueFilter, options); + if (message.falseFilter != null && message.hasOwnProperty("falseFilter")) + object.falseFilter = $root.google.bigtable.v2.RowFilter.toObject(message.falseFilter, options); + return object; + }; + + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RowFilter.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Condition + * @function getTypeUrl + * @memberof google.bigtable.v2.RowFilter.Condition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RowFilter.Condition"; + }; + + return Condition; + })(); + + return RowFilter; + })(); + + v2.Mutation = (function() { + + /** + * Properties of a Mutation. + * @memberof google.bigtable.v2 + * @interface IMutation + * @property {google.bigtable.v2.Mutation.ISetCell|null} [setCell] Mutation setCell + * @property {google.bigtable.v2.Mutation.IAddToCell|null} [addToCell] Mutation addToCell + * @property {google.bigtable.v2.Mutation.IMergeToCell|null} [mergeToCell] Mutation mergeToCell + * @property {google.bigtable.v2.Mutation.IDeleteFromColumn|null} [deleteFromColumn] Mutation deleteFromColumn + * @property {google.bigtable.v2.Mutation.IDeleteFromFamily|null} [deleteFromFamily] Mutation deleteFromFamily + * @property {google.bigtable.v2.Mutation.IDeleteFromRow|null} [deleteFromRow] Mutation deleteFromRow + */ + + /** + * Constructs a new Mutation. + * @memberof google.bigtable.v2 + * @classdesc Represents a Mutation. + * @implements IMutation + * @constructor + * @param {google.bigtable.v2.IMutation=} [properties] Properties to set + */ + function Mutation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Mutation setCell. + * @member {google.bigtable.v2.Mutation.ISetCell|null|undefined} setCell + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Mutation.prototype.setCell = null; + + /** + * Mutation addToCell. + * @member {google.bigtable.v2.Mutation.IAddToCell|null|undefined} addToCell + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Mutation.prototype.addToCell = null; + + /** + * Mutation mergeToCell. + * @member {google.bigtable.v2.Mutation.IMergeToCell|null|undefined} mergeToCell + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Mutation.prototype.mergeToCell = null; + + /** + * Mutation deleteFromColumn. + * @member {google.bigtable.v2.Mutation.IDeleteFromColumn|null|undefined} deleteFromColumn + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Mutation.prototype.deleteFromColumn = null; + + /** + * Mutation deleteFromFamily. + * @member {google.bigtable.v2.Mutation.IDeleteFromFamily|null|undefined} deleteFromFamily + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Mutation.prototype.deleteFromFamily = null; + + /** + * Mutation deleteFromRow. + * @member {google.bigtable.v2.Mutation.IDeleteFromRow|null|undefined} deleteFromRow + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Mutation.prototype.deleteFromRow = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Mutation mutation. + * @member {"setCell"|"addToCell"|"mergeToCell"|"deleteFromColumn"|"deleteFromFamily"|"deleteFromRow"|undefined} mutation + * @memberof google.bigtable.v2.Mutation + * @instance + */ + Object.defineProperty(Mutation.prototype, "mutation", { + get: $util.oneOfGetter($oneOfFields = ["setCell", "addToCell", "mergeToCell", "deleteFromColumn", "deleteFromFamily", "deleteFromRow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Mutation instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation + * @static + * @param {google.bigtable.v2.IMutation=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation} Mutation instance + */ + Mutation.create = function create(properties) { + return new Mutation(properties); + }; + + /** + * Encodes the specified Mutation message. Does not implicitly {@link google.bigtable.v2.Mutation.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation + * @static + * @param {google.bigtable.v2.IMutation} message Mutation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mutation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.setCell != null && Object.hasOwnProperty.call(message, "setCell")) + $root.google.bigtable.v2.Mutation.SetCell.encode(message.setCell, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleteFromColumn != null && Object.hasOwnProperty.call(message, "deleteFromColumn")) + $root.google.bigtable.v2.Mutation.DeleteFromColumn.encode(message.deleteFromColumn, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deleteFromFamily != null && Object.hasOwnProperty.call(message, "deleteFromFamily")) + $root.google.bigtable.v2.Mutation.DeleteFromFamily.encode(message.deleteFromFamily, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.deleteFromRow != null && Object.hasOwnProperty.call(message, "deleteFromRow")) + $root.google.bigtable.v2.Mutation.DeleteFromRow.encode(message.deleteFromRow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.addToCell != null && Object.hasOwnProperty.call(message, "addToCell")) + $root.google.bigtable.v2.Mutation.AddToCell.encode(message.addToCell, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.mergeToCell != null && Object.hasOwnProperty.call(message, "mergeToCell")) + $root.google.bigtable.v2.Mutation.MergeToCell.encode(message.mergeToCell, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation + * @static + * @param {google.bigtable.v2.IMutation} message Mutation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mutation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Mutation message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation} Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mutation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.setCell = $root.google.bigtable.v2.Mutation.SetCell.decode(reader, reader.uint32()); + break; + } + case 5: { + message.addToCell = $root.google.bigtable.v2.Mutation.AddToCell.decode(reader, reader.uint32()); + break; + } + case 6: { + message.mergeToCell = $root.google.bigtable.v2.Mutation.MergeToCell.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deleteFromColumn = $root.google.bigtable.v2.Mutation.DeleteFromColumn.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deleteFromFamily = $root.google.bigtable.v2.Mutation.DeleteFromFamily.decode(reader, reader.uint32()); + break; + } + case 4: { + message.deleteFromRow = $root.google.bigtable.v2.Mutation.DeleteFromRow.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Mutation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation} Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mutation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Mutation message. + * @function verify + * @memberof google.bigtable.v2.Mutation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Mutation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.setCell != null && message.hasOwnProperty("setCell")) { + properties.mutation = 1; + { + var error = $root.google.bigtable.v2.Mutation.SetCell.verify(message.setCell); + if (error) + return "setCell." + error; + } + } + if (message.addToCell != null && message.hasOwnProperty("addToCell")) { + if (properties.mutation === 1) + return "mutation: multiple values"; + properties.mutation = 1; + { + var error = $root.google.bigtable.v2.Mutation.AddToCell.verify(message.addToCell); + if (error) + return "addToCell." + error; + } + } + if (message.mergeToCell != null && message.hasOwnProperty("mergeToCell")) { + if (properties.mutation === 1) + return "mutation: multiple values"; + properties.mutation = 1; + { + var error = $root.google.bigtable.v2.Mutation.MergeToCell.verify(message.mergeToCell); + if (error) + return "mergeToCell." + error; + } + } + if (message.deleteFromColumn != null && message.hasOwnProperty("deleteFromColumn")) { + if (properties.mutation === 1) + return "mutation: multiple values"; + properties.mutation = 1; + { + var error = $root.google.bigtable.v2.Mutation.DeleteFromColumn.verify(message.deleteFromColumn); + if (error) + return "deleteFromColumn." + error; + } + } + if (message.deleteFromFamily != null && message.hasOwnProperty("deleteFromFamily")) { + if (properties.mutation === 1) + return "mutation: multiple values"; + properties.mutation = 1; + { + var error = $root.google.bigtable.v2.Mutation.DeleteFromFamily.verify(message.deleteFromFamily); + if (error) + return "deleteFromFamily." + error; + } + } + if (message.deleteFromRow != null && message.hasOwnProperty("deleteFromRow")) { + if (properties.mutation === 1) + return "mutation: multiple values"; + properties.mutation = 1; + { + var error = $root.google.bigtable.v2.Mutation.DeleteFromRow.verify(message.deleteFromRow); + if (error) + return "deleteFromRow." + error; + } + } + return null; + }; + + /** + * Creates a Mutation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation} Mutation + */ + Mutation.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation) + return object; + var message = new $root.google.bigtable.v2.Mutation(); + if (object.setCell != null) { + if (typeof object.setCell !== "object") + throw TypeError(".google.bigtable.v2.Mutation.setCell: object expected"); + message.setCell = $root.google.bigtable.v2.Mutation.SetCell.fromObject(object.setCell); + } + if (object.addToCell != null) { + if (typeof object.addToCell !== "object") + throw TypeError(".google.bigtable.v2.Mutation.addToCell: object expected"); + message.addToCell = $root.google.bigtable.v2.Mutation.AddToCell.fromObject(object.addToCell); + } + if (object.mergeToCell != null) { + if (typeof object.mergeToCell !== "object") + throw TypeError(".google.bigtable.v2.Mutation.mergeToCell: object expected"); + message.mergeToCell = $root.google.bigtable.v2.Mutation.MergeToCell.fromObject(object.mergeToCell); + } + if (object.deleteFromColumn != null) { + if (typeof object.deleteFromColumn !== "object") + throw TypeError(".google.bigtable.v2.Mutation.deleteFromColumn: object expected"); + message.deleteFromColumn = $root.google.bigtable.v2.Mutation.DeleteFromColumn.fromObject(object.deleteFromColumn); + } + if (object.deleteFromFamily != null) { + if (typeof object.deleteFromFamily !== "object") + throw TypeError(".google.bigtable.v2.Mutation.deleteFromFamily: object expected"); + message.deleteFromFamily = $root.google.bigtable.v2.Mutation.DeleteFromFamily.fromObject(object.deleteFromFamily); + } + if (object.deleteFromRow != null) { + if (typeof object.deleteFromRow !== "object") + throw TypeError(".google.bigtable.v2.Mutation.deleteFromRow: object expected"); + message.deleteFromRow = $root.google.bigtable.v2.Mutation.DeleteFromRow.fromObject(object.deleteFromRow); + } + return message; + }; + + /** + * Creates a plain object from a Mutation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation + * @static + * @param {google.bigtable.v2.Mutation} message Mutation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Mutation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.setCell != null && message.hasOwnProperty("setCell")) { + object.setCell = $root.google.bigtable.v2.Mutation.SetCell.toObject(message.setCell, options); + if (options.oneofs) + object.mutation = "setCell"; + } + if (message.deleteFromColumn != null && message.hasOwnProperty("deleteFromColumn")) { + object.deleteFromColumn = $root.google.bigtable.v2.Mutation.DeleteFromColumn.toObject(message.deleteFromColumn, options); + if (options.oneofs) + object.mutation = "deleteFromColumn"; + } + if (message.deleteFromFamily != null && message.hasOwnProperty("deleteFromFamily")) { + object.deleteFromFamily = $root.google.bigtable.v2.Mutation.DeleteFromFamily.toObject(message.deleteFromFamily, options); + if (options.oneofs) + object.mutation = "deleteFromFamily"; + } + if (message.deleteFromRow != null && message.hasOwnProperty("deleteFromRow")) { + object.deleteFromRow = $root.google.bigtable.v2.Mutation.DeleteFromRow.toObject(message.deleteFromRow, options); + if (options.oneofs) + object.mutation = "deleteFromRow"; + } + if (message.addToCell != null && message.hasOwnProperty("addToCell")) { + object.addToCell = $root.google.bigtable.v2.Mutation.AddToCell.toObject(message.addToCell, options); + if (options.oneofs) + object.mutation = "addToCell"; + } + if (message.mergeToCell != null && message.hasOwnProperty("mergeToCell")) { + object.mergeToCell = $root.google.bigtable.v2.Mutation.MergeToCell.toObject(message.mergeToCell, options); + if (options.oneofs) + object.mutation = "mergeToCell"; + } + return object; + }; + + /** + * Converts this Mutation to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation + * @instance + * @returns {Object.} JSON object + */ + Mutation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Mutation + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Mutation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation"; + }; + + Mutation.SetCell = (function() { + + /** + * Properties of a SetCell. + * @memberof google.bigtable.v2.Mutation + * @interface ISetCell + * @property {string|null} [familyName] SetCell familyName + * @property {Uint8Array|null} [columnQualifier] SetCell columnQualifier + * @property {number|Long|null} [timestampMicros] SetCell timestampMicros + * @property {Uint8Array|null} [value] SetCell value + */ + + /** + * Constructs a new SetCell. + * @memberof google.bigtable.v2.Mutation + * @classdesc Represents a SetCell. + * @implements ISetCell + * @constructor + * @param {google.bigtable.v2.Mutation.ISetCell=} [properties] Properties to set + */ + function SetCell(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetCell familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.Mutation.SetCell + * @instance + */ + SetCell.prototype.familyName = ""; + + /** + * SetCell columnQualifier. + * @member {Uint8Array} columnQualifier + * @memberof google.bigtable.v2.Mutation.SetCell + * @instance + */ + SetCell.prototype.columnQualifier = $util.newBuffer([]); + + /** + * SetCell timestampMicros. + * @member {number|Long} timestampMicros + * @memberof google.bigtable.v2.Mutation.SetCell + * @instance + */ + SetCell.prototype.timestampMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SetCell value. + * @member {Uint8Array} value + * @memberof google.bigtable.v2.Mutation.SetCell + * @instance + */ + SetCell.prototype.value = $util.newBuffer([]); + + /** + * Creates a new SetCell instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {google.bigtable.v2.Mutation.ISetCell=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation.SetCell} SetCell instance + */ + SetCell.create = function create(properties) { + return new SetCell(properties); + }; + + /** + * Encodes the specified SetCell message. Does not implicitly {@link google.bigtable.v2.Mutation.SetCell.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {google.bigtable.v2.Mutation.ISetCell} message SetCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetCell.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + if (message.columnQualifier != null && Object.hasOwnProperty.call(message, "columnQualifier")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.columnQualifier); + if (message.timestampMicros != null && Object.hasOwnProperty.call(message, "timestampMicros")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.timestampMicros); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified SetCell message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.SetCell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {google.bigtable.v2.Mutation.ISetCell} message SetCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetCell.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetCell message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation.SetCell} SetCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetCell.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation.SetCell(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + case 2: { + message.columnQualifier = reader.bytes(); + break; + } + case 3: { + message.timestampMicros = reader.int64(); + break; + } + case 4: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetCell message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation.SetCell} SetCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetCell.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetCell message. + * @function verify + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetCell.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + if (!(message.columnQualifier && typeof message.columnQualifier.length === "number" || $util.isString(message.columnQualifier))) + return "columnQualifier: buffer expected"; + if (message.timestampMicros != null && message.hasOwnProperty("timestampMicros")) + if (!$util.isInteger(message.timestampMicros) && !(message.timestampMicros && $util.isInteger(message.timestampMicros.low) && $util.isInteger(message.timestampMicros.high))) + return "timestampMicros: integer|Long expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a SetCell message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation.SetCell} SetCell + */ + SetCell.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation.SetCell) + return object; + var message = new $root.google.bigtable.v2.Mutation.SetCell(); + if (object.familyName != null) + message.familyName = String(object.familyName); + if (object.columnQualifier != null) + if (typeof object.columnQualifier === "string") + $util.base64.decode(object.columnQualifier, message.columnQualifier = $util.newBuffer($util.base64.length(object.columnQualifier)), 0); + else if (object.columnQualifier.length >= 0) + message.columnQualifier = object.columnQualifier; + if (object.timestampMicros != null) + if ($util.Long) + (message.timestampMicros = $util.Long.fromValue(object.timestampMicros)).unsigned = false; + else if (typeof object.timestampMicros === "string") + message.timestampMicros = parseInt(object.timestampMicros, 10); + else if (typeof object.timestampMicros === "number") + message.timestampMicros = object.timestampMicros; + else if (typeof object.timestampMicros === "object") + message.timestampMicros = new $util.LongBits(object.timestampMicros.low >>> 0, object.timestampMicros.high >>> 0).toNumber(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a SetCell message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {google.bigtable.v2.Mutation.SetCell} message SetCell + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetCell.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.familyName = ""; + if (options.bytes === String) + object.columnQualifier = ""; + else { + object.columnQualifier = []; + if (options.bytes !== Array) + object.columnQualifier = $util.newBuffer(object.columnQualifier); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestampMicros = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + object.columnQualifier = options.bytes === String ? $util.base64.encode(message.columnQualifier, 0, message.columnQualifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.columnQualifier) : message.columnQualifier; + if (message.timestampMicros != null && message.hasOwnProperty("timestampMicros")) + if (typeof message.timestampMicros === "number") + object.timestampMicros = options.longs === String ? String(message.timestampMicros) : message.timestampMicros; + else + object.timestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.timestampMicros) : options.longs === Number ? new $util.LongBits(message.timestampMicros.low >>> 0, message.timestampMicros.high >>> 0).toNumber() : message.timestampMicros; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this SetCell to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation.SetCell + * @instance + * @returns {Object.} JSON object + */ + SetCell.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetCell + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation.SetCell + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetCell.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation.SetCell"; + }; + + return SetCell; + })(); + + Mutation.AddToCell = (function() { + + /** + * Properties of an AddToCell. + * @memberof google.bigtable.v2.Mutation + * @interface IAddToCell + * @property {string|null} [familyName] AddToCell familyName + * @property {google.bigtable.v2.IValue|null} [columnQualifier] AddToCell columnQualifier + * @property {google.bigtable.v2.IValue|null} [timestamp] AddToCell timestamp + * @property {google.bigtable.v2.IValue|null} [input] AddToCell input + */ + + /** + * Constructs a new AddToCell. + * @memberof google.bigtable.v2.Mutation + * @classdesc Represents an AddToCell. + * @implements IAddToCell + * @constructor + * @param {google.bigtable.v2.Mutation.IAddToCell=} [properties] Properties to set + */ + function AddToCell(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddToCell familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.Mutation.AddToCell + * @instance + */ + AddToCell.prototype.familyName = ""; + + /** + * AddToCell columnQualifier. + * @member {google.bigtable.v2.IValue|null|undefined} columnQualifier + * @memberof google.bigtable.v2.Mutation.AddToCell + * @instance + */ + AddToCell.prototype.columnQualifier = null; + + /** + * AddToCell timestamp. + * @member {google.bigtable.v2.IValue|null|undefined} timestamp + * @memberof google.bigtable.v2.Mutation.AddToCell + * @instance + */ + AddToCell.prototype.timestamp = null; + + /** + * AddToCell input. + * @member {google.bigtable.v2.IValue|null|undefined} input + * @memberof google.bigtable.v2.Mutation.AddToCell + * @instance + */ + AddToCell.prototype.input = null; + + /** + * Creates a new AddToCell instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {google.bigtable.v2.Mutation.IAddToCell=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation.AddToCell} AddToCell instance + */ + AddToCell.create = function create(properties) { + return new AddToCell(properties); + }; + + /** + * Encodes the specified AddToCell message. Does not implicitly {@link google.bigtable.v2.Mutation.AddToCell.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {google.bigtable.v2.Mutation.IAddToCell} message AddToCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddToCell.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + if (message.columnQualifier != null && Object.hasOwnProperty.call(message, "columnQualifier")) + $root.google.bigtable.v2.Value.encode(message.columnQualifier, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.bigtable.v2.Value.encode(message.timestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.bigtable.v2.Value.encode(message.input, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddToCell message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.AddToCell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {google.bigtable.v2.Mutation.IAddToCell} message AddToCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddToCell.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddToCell message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation.AddToCell} AddToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddToCell.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation.AddToCell(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + case 2: { + message.columnQualifier = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + } + case 3: { + message.timestamp = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + } + case 4: { + message.input = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddToCell message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation.AddToCell} AddToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddToCell.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddToCell message. + * @function verify + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddToCell.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) { + var error = $root.google.bigtable.v2.Value.verify(message.columnQualifier); + if (error) + return "columnQualifier." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.bigtable.v2.Value.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.bigtable.v2.Value.verify(message.input); + if (error) + return "input." + error; + } + return null; + }; + + /** + * Creates an AddToCell message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation.AddToCell} AddToCell + */ + AddToCell.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation.AddToCell) + return object; + var message = new $root.google.bigtable.v2.Mutation.AddToCell(); + if (object.familyName != null) + message.familyName = String(object.familyName); + if (object.columnQualifier != null) { + if (typeof object.columnQualifier !== "object") + throw TypeError(".google.bigtable.v2.Mutation.AddToCell.columnQualifier: object expected"); + message.columnQualifier = $root.google.bigtable.v2.Value.fromObject(object.columnQualifier); + } + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".google.bigtable.v2.Mutation.AddToCell.timestamp: object expected"); + message.timestamp = $root.google.bigtable.v2.Value.fromObject(object.timestamp); + } + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.bigtable.v2.Mutation.AddToCell.input: object expected"); + message.input = $root.google.bigtable.v2.Value.fromObject(object.input); + } + return message; + }; + + /** + * Creates a plain object from an AddToCell message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {google.bigtable.v2.Mutation.AddToCell} message AddToCell + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddToCell.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.familyName = ""; + object.columnQualifier = null; + object.timestamp = null; + object.input = null; + } + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + object.columnQualifier = $root.google.bigtable.v2.Value.toObject(message.columnQualifier, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.bigtable.v2.Value.toObject(message.timestamp, options); + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.bigtable.v2.Value.toObject(message.input, options); + return object; + }; + + /** + * Converts this AddToCell to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation.AddToCell + * @instance + * @returns {Object.} JSON object + */ + AddToCell.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddToCell + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation.AddToCell + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddToCell.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation.AddToCell"; + }; + + return AddToCell; + })(); + + Mutation.MergeToCell = (function() { + + /** + * Properties of a MergeToCell. + * @memberof google.bigtable.v2.Mutation + * @interface IMergeToCell + * @property {string|null} [familyName] MergeToCell familyName + * @property {google.bigtable.v2.IValue|null} [columnQualifier] MergeToCell columnQualifier + * @property {google.bigtable.v2.IValue|null} [timestamp] MergeToCell timestamp + * @property {google.bigtable.v2.IValue|null} [input] MergeToCell input + */ + + /** + * Constructs a new MergeToCell. + * @memberof google.bigtable.v2.Mutation + * @classdesc Represents a MergeToCell. + * @implements IMergeToCell + * @constructor + * @param {google.bigtable.v2.Mutation.IMergeToCell=} [properties] Properties to set + */ + function MergeToCell(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MergeToCell familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @instance + */ + MergeToCell.prototype.familyName = ""; + + /** + * MergeToCell columnQualifier. + * @member {google.bigtable.v2.IValue|null|undefined} columnQualifier + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @instance + */ + MergeToCell.prototype.columnQualifier = null; + + /** + * MergeToCell timestamp. + * @member {google.bigtable.v2.IValue|null|undefined} timestamp + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @instance + */ + MergeToCell.prototype.timestamp = null; + + /** + * MergeToCell input. + * @member {google.bigtable.v2.IValue|null|undefined} input + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @instance + */ + MergeToCell.prototype.input = null; + + /** + * Creates a new MergeToCell instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {google.bigtable.v2.Mutation.IMergeToCell=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation.MergeToCell} MergeToCell instance + */ + MergeToCell.create = function create(properties) { + return new MergeToCell(properties); + }; + + /** + * Encodes the specified MergeToCell message. Does not implicitly {@link google.bigtable.v2.Mutation.MergeToCell.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {google.bigtable.v2.Mutation.IMergeToCell} message MergeToCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergeToCell.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + if (message.columnQualifier != null && Object.hasOwnProperty.call(message, "columnQualifier")) + $root.google.bigtable.v2.Value.encode(message.columnQualifier, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.bigtable.v2.Value.encode(message.timestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.bigtable.v2.Value.encode(message.input, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MergeToCell message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.MergeToCell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {google.bigtable.v2.Mutation.IMergeToCell} message MergeToCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergeToCell.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MergeToCell message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation.MergeToCell} MergeToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergeToCell.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation.MergeToCell(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + case 2: { + message.columnQualifier = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + } + case 3: { + message.timestamp = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + } + case 4: { + message.input = $root.google.bigtable.v2.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MergeToCell message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation.MergeToCell} MergeToCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergeToCell.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MergeToCell message. + * @function verify + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MergeToCell.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) { + var error = $root.google.bigtable.v2.Value.verify(message.columnQualifier); + if (error) + return "columnQualifier." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.bigtable.v2.Value.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.bigtable.v2.Value.verify(message.input); + if (error) + return "input." + error; + } + return null; + }; + + /** + * Creates a MergeToCell message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation.MergeToCell} MergeToCell + */ + MergeToCell.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation.MergeToCell) + return object; + var message = new $root.google.bigtable.v2.Mutation.MergeToCell(); + if (object.familyName != null) + message.familyName = String(object.familyName); + if (object.columnQualifier != null) { + if (typeof object.columnQualifier !== "object") + throw TypeError(".google.bigtable.v2.Mutation.MergeToCell.columnQualifier: object expected"); + message.columnQualifier = $root.google.bigtable.v2.Value.fromObject(object.columnQualifier); + } + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".google.bigtable.v2.Mutation.MergeToCell.timestamp: object expected"); + message.timestamp = $root.google.bigtable.v2.Value.fromObject(object.timestamp); + } + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.bigtable.v2.Mutation.MergeToCell.input: object expected"); + message.input = $root.google.bigtable.v2.Value.fromObject(object.input); + } + return message; + }; + + /** + * Creates a plain object from a MergeToCell message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {google.bigtable.v2.Mutation.MergeToCell} message MergeToCell + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MergeToCell.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.familyName = ""; + object.columnQualifier = null; + object.timestamp = null; + object.input = null; + } + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + object.columnQualifier = $root.google.bigtable.v2.Value.toObject(message.columnQualifier, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.bigtable.v2.Value.toObject(message.timestamp, options); + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.bigtable.v2.Value.toObject(message.input, options); + return object; + }; + + /** + * Converts this MergeToCell to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @instance + * @returns {Object.} JSON object + */ + MergeToCell.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MergeToCell + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation.MergeToCell + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MergeToCell.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation.MergeToCell"; + }; + + return MergeToCell; + })(); + + Mutation.DeleteFromColumn = (function() { + + /** + * Properties of a DeleteFromColumn. + * @memberof google.bigtable.v2.Mutation + * @interface IDeleteFromColumn + * @property {string|null} [familyName] DeleteFromColumn familyName + * @property {Uint8Array|null} [columnQualifier] DeleteFromColumn columnQualifier + * @property {google.bigtable.v2.ITimestampRange|null} [timeRange] DeleteFromColumn timeRange + */ + + /** + * Constructs a new DeleteFromColumn. + * @memberof google.bigtable.v2.Mutation + * @classdesc Represents a DeleteFromColumn. + * @implements IDeleteFromColumn + * @constructor + * @param {google.bigtable.v2.Mutation.IDeleteFromColumn=} [properties] Properties to set + */ + function DeleteFromColumn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFromColumn familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @instance + */ + DeleteFromColumn.prototype.familyName = ""; + + /** + * DeleteFromColumn columnQualifier. + * @member {Uint8Array} columnQualifier + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @instance + */ + DeleteFromColumn.prototype.columnQualifier = $util.newBuffer([]); + + /** + * DeleteFromColumn timeRange. + * @member {google.bigtable.v2.ITimestampRange|null|undefined} timeRange + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @instance + */ + DeleteFromColumn.prototype.timeRange = null; + + /** + * Creates a new DeleteFromColumn instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromColumn=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation.DeleteFromColumn} DeleteFromColumn instance + */ + DeleteFromColumn.create = function create(properties) { + return new DeleteFromColumn(properties); + }; + + /** + * Encodes the specified DeleteFromColumn message. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromColumn.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromColumn} message DeleteFromColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFromColumn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + if (message.columnQualifier != null && Object.hasOwnProperty.call(message, "columnQualifier")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.columnQualifier); + if (message.timeRange != null && Object.hasOwnProperty.call(message, "timeRange")) + $root.google.bigtable.v2.TimestampRange.encode(message.timeRange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteFromColumn message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromColumn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromColumn} message DeleteFromColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFromColumn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFromColumn message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation.DeleteFromColumn} DeleteFromColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFromColumn.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation.DeleteFromColumn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + case 2: { + message.columnQualifier = reader.bytes(); + break; + } + case 3: { + message.timeRange = $root.google.bigtable.v2.TimestampRange.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFromColumn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation.DeleteFromColumn} DeleteFromColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFromColumn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFromColumn message. + * @function verify + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFromColumn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + if (!(message.columnQualifier && typeof message.columnQualifier.length === "number" || $util.isString(message.columnQualifier))) + return "columnQualifier: buffer expected"; + if (message.timeRange != null && message.hasOwnProperty("timeRange")) { + var error = $root.google.bigtable.v2.TimestampRange.verify(message.timeRange); + if (error) + return "timeRange." + error; + } + return null; + }; + + /** + * Creates a DeleteFromColumn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation.DeleteFromColumn} DeleteFromColumn + */ + DeleteFromColumn.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation.DeleteFromColumn) + return object; + var message = new $root.google.bigtable.v2.Mutation.DeleteFromColumn(); + if (object.familyName != null) + message.familyName = String(object.familyName); + if (object.columnQualifier != null) + if (typeof object.columnQualifier === "string") + $util.base64.decode(object.columnQualifier, message.columnQualifier = $util.newBuffer($util.base64.length(object.columnQualifier)), 0); + else if (object.columnQualifier.length >= 0) + message.columnQualifier = object.columnQualifier; + if (object.timeRange != null) { + if (typeof object.timeRange !== "object") + throw TypeError(".google.bigtable.v2.Mutation.DeleteFromColumn.timeRange: object expected"); + message.timeRange = $root.google.bigtable.v2.TimestampRange.fromObject(object.timeRange); + } + return message; + }; + + /** + * Creates a plain object from a DeleteFromColumn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {google.bigtable.v2.Mutation.DeleteFromColumn} message DeleteFromColumn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFromColumn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.familyName = ""; + if (options.bytes === String) + object.columnQualifier = ""; + else { + object.columnQualifier = []; + if (options.bytes !== Array) + object.columnQualifier = $util.newBuffer(object.columnQualifier); + } + object.timeRange = null; + } + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + object.columnQualifier = options.bytes === String ? $util.base64.encode(message.columnQualifier, 0, message.columnQualifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.columnQualifier) : message.columnQualifier; + if (message.timeRange != null && message.hasOwnProperty("timeRange")) + object.timeRange = $root.google.bigtable.v2.TimestampRange.toObject(message.timeRange, options); + return object; + }; + + /** + * Converts this DeleteFromColumn to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @instance + * @returns {Object.} JSON object + */ + DeleteFromColumn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFromColumn + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation.DeleteFromColumn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFromColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation.DeleteFromColumn"; + }; + + return DeleteFromColumn; + })(); + + Mutation.DeleteFromFamily = (function() { + + /** + * Properties of a DeleteFromFamily. + * @memberof google.bigtable.v2.Mutation + * @interface IDeleteFromFamily + * @property {string|null} [familyName] DeleteFromFamily familyName + */ + + /** + * Constructs a new DeleteFromFamily. + * @memberof google.bigtable.v2.Mutation + * @classdesc Represents a DeleteFromFamily. + * @implements IDeleteFromFamily + * @constructor + * @param {google.bigtable.v2.Mutation.IDeleteFromFamily=} [properties] Properties to set + */ + function DeleteFromFamily(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFromFamily familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @instance + */ + DeleteFromFamily.prototype.familyName = ""; + + /** + * Creates a new DeleteFromFamily instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromFamily=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation.DeleteFromFamily} DeleteFromFamily instance + */ + DeleteFromFamily.create = function create(properties) { + return new DeleteFromFamily(properties); + }; + + /** + * Encodes the specified DeleteFromFamily message. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromFamily.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromFamily} message DeleteFromFamily message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFromFamily.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + return writer; + }; + + /** + * Encodes the specified DeleteFromFamily message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromFamily.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromFamily} message DeleteFromFamily message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFromFamily.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFromFamily message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation.DeleteFromFamily} DeleteFromFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFromFamily.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation.DeleteFromFamily(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFromFamily message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation.DeleteFromFamily} DeleteFromFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFromFamily.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFromFamily message. + * @function verify + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFromFamily.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + return null; + }; + + /** + * Creates a DeleteFromFamily message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation.DeleteFromFamily} DeleteFromFamily + */ + DeleteFromFamily.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation.DeleteFromFamily) + return object; + var message = new $root.google.bigtable.v2.Mutation.DeleteFromFamily(); + if (object.familyName != null) + message.familyName = String(object.familyName); + return message; + }; + + /** + * Creates a plain object from a DeleteFromFamily message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {google.bigtable.v2.Mutation.DeleteFromFamily} message DeleteFromFamily + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFromFamily.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.familyName = ""; + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + return object; + }; + + /** + * Converts this DeleteFromFamily to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @instance + * @returns {Object.} JSON object + */ + DeleteFromFamily.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFromFamily + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation.DeleteFromFamily + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFromFamily.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation.DeleteFromFamily"; + }; + + return DeleteFromFamily; + })(); + + Mutation.DeleteFromRow = (function() { + + /** + * Properties of a DeleteFromRow. + * @memberof google.bigtable.v2.Mutation + * @interface IDeleteFromRow + */ + + /** + * Constructs a new DeleteFromRow. + * @memberof google.bigtable.v2.Mutation + * @classdesc Represents a DeleteFromRow. + * @implements IDeleteFromRow + * @constructor + * @param {google.bigtable.v2.Mutation.IDeleteFromRow=} [properties] Properties to set + */ + function DeleteFromRow(properties) { + if (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 DeleteFromRow instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromRow=} [properties] Properties to set + * @returns {google.bigtable.v2.Mutation.DeleteFromRow} DeleteFromRow instance + */ + DeleteFromRow.create = function create(properties) { + return new DeleteFromRow(properties); + }; + + /** + * Encodes the specified DeleteFromRow message. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromRow.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromRow} message DeleteFromRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFromRow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteFromRow message, length delimited. Does not implicitly {@link google.bigtable.v2.Mutation.DeleteFromRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {google.bigtable.v2.Mutation.IDeleteFromRow} message DeleteFromRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFromRow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFromRow message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Mutation.DeleteFromRow} DeleteFromRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFromRow.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Mutation.DeleteFromRow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFromRow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Mutation.DeleteFromRow} DeleteFromRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFromRow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFromRow message. + * @function verify + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFromRow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteFromRow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Mutation.DeleteFromRow} DeleteFromRow + */ + DeleteFromRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Mutation.DeleteFromRow) + return object; + return new $root.google.bigtable.v2.Mutation.DeleteFromRow(); + }; + + /** + * Creates a plain object from a DeleteFromRow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {google.bigtable.v2.Mutation.DeleteFromRow} message DeleteFromRow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFromRow.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteFromRow to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @instance + * @returns {Object.} JSON object + */ + DeleteFromRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFromRow + * @function getTypeUrl + * @memberof google.bigtable.v2.Mutation.DeleteFromRow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFromRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Mutation.DeleteFromRow"; + }; + + return DeleteFromRow; + })(); + + return Mutation; + })(); + + v2.ReadModifyWriteRule = (function() { + + /** + * Properties of a ReadModifyWriteRule. + * @memberof google.bigtable.v2 + * @interface IReadModifyWriteRule + * @property {string|null} [familyName] ReadModifyWriteRule familyName + * @property {Uint8Array|null} [columnQualifier] ReadModifyWriteRule columnQualifier + * @property {Uint8Array|null} [appendValue] ReadModifyWriteRule appendValue + * @property {number|Long|null} [incrementAmount] ReadModifyWriteRule incrementAmount + */ + + /** + * Constructs a new ReadModifyWriteRule. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadModifyWriteRule. + * @implements IReadModifyWriteRule + * @constructor + * @param {google.bigtable.v2.IReadModifyWriteRule=} [properties] Properties to set + */ + function ReadModifyWriteRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadModifyWriteRule familyName. + * @member {string} familyName + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @instance + */ + ReadModifyWriteRule.prototype.familyName = ""; + + /** + * ReadModifyWriteRule columnQualifier. + * @member {Uint8Array} columnQualifier + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @instance + */ + ReadModifyWriteRule.prototype.columnQualifier = $util.newBuffer([]); + + /** + * ReadModifyWriteRule appendValue. + * @member {Uint8Array|null|undefined} appendValue + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @instance + */ + ReadModifyWriteRule.prototype.appendValue = null; + + /** + * ReadModifyWriteRule incrementAmount. + * @member {number|Long|null|undefined} incrementAmount + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @instance + */ + ReadModifyWriteRule.prototype.incrementAmount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadModifyWriteRule rule. + * @member {"appendValue"|"incrementAmount"|undefined} rule + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @instance + */ + Object.defineProperty(ReadModifyWriteRule.prototype, "rule", { + get: $util.oneOfGetter($oneOfFields = ["appendValue", "incrementAmount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadModifyWriteRule instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {google.bigtable.v2.IReadModifyWriteRule=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadModifyWriteRule} ReadModifyWriteRule instance + */ + ReadModifyWriteRule.create = function create(properties) { + return new ReadModifyWriteRule(properties); + }; + + /** + * Encodes the specified ReadModifyWriteRule message. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRule.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {google.bigtable.v2.IReadModifyWriteRule} message ReadModifyWriteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyName); + if (message.columnQualifier != null && Object.hasOwnProperty.call(message, "columnQualifier")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.columnQualifier); + if (message.appendValue != null && Object.hasOwnProperty.call(message, "appendValue")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.appendValue); + if (message.incrementAmount != null && Object.hasOwnProperty.call(message, "incrementAmount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.incrementAmount); + return writer; + }; + + /** + * Encodes the specified ReadModifyWriteRule message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadModifyWriteRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {google.bigtable.v2.IReadModifyWriteRule} message ReadModifyWriteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadModifyWriteRule message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadModifyWriteRule} ReadModifyWriteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadModifyWriteRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyName = reader.string(); + break; + } + case 2: { + message.columnQualifier = reader.bytes(); + break; + } + case 3: { + message.appendValue = reader.bytes(); + break; + } + case 4: { + message.incrementAmount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadModifyWriteRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadModifyWriteRule} ReadModifyWriteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadModifyWriteRule message. + * @function verify + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadModifyWriteRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + if (!(message.columnQualifier && typeof message.columnQualifier.length === "number" || $util.isString(message.columnQualifier))) + return "columnQualifier: buffer expected"; + if (message.appendValue != null && message.hasOwnProperty("appendValue")) { + properties.rule = 1; + if (!(message.appendValue && typeof message.appendValue.length === "number" || $util.isString(message.appendValue))) + return "appendValue: buffer expected"; + } + if (message.incrementAmount != null && message.hasOwnProperty("incrementAmount")) { + if (properties.rule === 1) + return "rule: multiple values"; + properties.rule = 1; + if (!$util.isInteger(message.incrementAmount) && !(message.incrementAmount && $util.isInteger(message.incrementAmount.low) && $util.isInteger(message.incrementAmount.high))) + return "incrementAmount: integer|Long expected"; + } + return null; + }; + + /** + * Creates a ReadModifyWriteRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadModifyWriteRule} ReadModifyWriteRule + */ + ReadModifyWriteRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadModifyWriteRule) + return object; + var message = new $root.google.bigtable.v2.ReadModifyWriteRule(); + if (object.familyName != null) + message.familyName = String(object.familyName); + if (object.columnQualifier != null) + if (typeof object.columnQualifier === "string") + $util.base64.decode(object.columnQualifier, message.columnQualifier = $util.newBuffer($util.base64.length(object.columnQualifier)), 0); + else if (object.columnQualifier.length >= 0) + message.columnQualifier = object.columnQualifier; + if (object.appendValue != null) + if (typeof object.appendValue === "string") + $util.base64.decode(object.appendValue, message.appendValue = $util.newBuffer($util.base64.length(object.appendValue)), 0); + else if (object.appendValue.length >= 0) + message.appendValue = object.appendValue; + if (object.incrementAmount != null) + if ($util.Long) + (message.incrementAmount = $util.Long.fromValue(object.incrementAmount)).unsigned = false; + else if (typeof object.incrementAmount === "string") + message.incrementAmount = parseInt(object.incrementAmount, 10); + else if (typeof object.incrementAmount === "number") + message.incrementAmount = object.incrementAmount; + else if (typeof object.incrementAmount === "object") + message.incrementAmount = new $util.LongBits(object.incrementAmount.low >>> 0, object.incrementAmount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ReadModifyWriteRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {google.bigtable.v2.ReadModifyWriteRule} message ReadModifyWriteRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadModifyWriteRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.familyName = ""; + if (options.bytes === String) + object.columnQualifier = ""; + else { + object.columnQualifier = []; + if (options.bytes !== Array) + object.columnQualifier = $util.newBuffer(object.columnQualifier); + } + } + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + if (message.columnQualifier != null && message.hasOwnProperty("columnQualifier")) + object.columnQualifier = options.bytes === String ? $util.base64.encode(message.columnQualifier, 0, message.columnQualifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.columnQualifier) : message.columnQualifier; + if (message.appendValue != null && message.hasOwnProperty("appendValue")) { + object.appendValue = options.bytes === String ? $util.base64.encode(message.appendValue, 0, message.appendValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.appendValue) : message.appendValue; + if (options.oneofs) + object.rule = "appendValue"; + } + if (message.incrementAmount != null && message.hasOwnProperty("incrementAmount")) { + if (typeof message.incrementAmount === "number") + object.incrementAmount = options.longs === String ? String(message.incrementAmount) : message.incrementAmount; + else + object.incrementAmount = options.longs === String ? $util.Long.prototype.toString.call(message.incrementAmount) : options.longs === Number ? new $util.LongBits(message.incrementAmount.low >>> 0, message.incrementAmount.high >>> 0).toNumber() : message.incrementAmount; + if (options.oneofs) + object.rule = "incrementAmount"; + } + return object; + }; + + /** + * Converts this ReadModifyWriteRule to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @instance + * @returns {Object.} JSON object + */ + ReadModifyWriteRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadModifyWriteRule + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadModifyWriteRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadModifyWriteRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadModifyWriteRule"; + }; + + return ReadModifyWriteRule; + })(); + + v2.StreamPartition = (function() { + + /** + * Properties of a StreamPartition. + * @memberof google.bigtable.v2 + * @interface IStreamPartition + * @property {google.bigtable.v2.IRowRange|null} [rowRange] StreamPartition rowRange + */ + + /** + * Constructs a new StreamPartition. + * @memberof google.bigtable.v2 + * @classdesc Represents a StreamPartition. + * @implements IStreamPartition + * @constructor + * @param {google.bigtable.v2.IStreamPartition=} [properties] Properties to set + */ + function StreamPartition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamPartition rowRange. + * @member {google.bigtable.v2.IRowRange|null|undefined} rowRange + * @memberof google.bigtable.v2.StreamPartition + * @instance + */ + StreamPartition.prototype.rowRange = null; + + /** + * Creates a new StreamPartition instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {google.bigtable.v2.IStreamPartition=} [properties] Properties to set + * @returns {google.bigtable.v2.StreamPartition} StreamPartition instance + */ + StreamPartition.create = function create(properties) { + return new StreamPartition(properties); + }; + + /** + * Encodes the specified StreamPartition message. Does not implicitly {@link google.bigtable.v2.StreamPartition.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {google.bigtable.v2.IStreamPartition} message StreamPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamPartition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowRange != null && Object.hasOwnProperty.call(message, "rowRange")) + $root.google.bigtable.v2.RowRange.encode(message.rowRange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamPartition message, length delimited. Does not implicitly {@link google.bigtable.v2.StreamPartition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {google.bigtable.v2.IStreamPartition} message StreamPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamPartition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamPartition message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.StreamPartition} StreamPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamPartition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.StreamPartition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowRange = $root.google.bigtable.v2.RowRange.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamPartition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.StreamPartition} StreamPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamPartition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamPartition message. + * @function verify + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamPartition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowRange != null && message.hasOwnProperty("rowRange")) { + var error = $root.google.bigtable.v2.RowRange.verify(message.rowRange); + if (error) + return "rowRange." + error; + } + return null; + }; + + /** + * Creates a StreamPartition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.StreamPartition} StreamPartition + */ + StreamPartition.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.StreamPartition) + return object; + var message = new $root.google.bigtable.v2.StreamPartition(); + if (object.rowRange != null) { + if (typeof object.rowRange !== "object") + throw TypeError(".google.bigtable.v2.StreamPartition.rowRange: object expected"); + message.rowRange = $root.google.bigtable.v2.RowRange.fromObject(object.rowRange); + } + return message; + }; + + /** + * Creates a plain object from a StreamPartition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {google.bigtable.v2.StreamPartition} message StreamPartition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamPartition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.rowRange = null; + if (message.rowRange != null && message.hasOwnProperty("rowRange")) + object.rowRange = $root.google.bigtable.v2.RowRange.toObject(message.rowRange, options); + return object; + }; + + /** + * Converts this StreamPartition to JSON. + * @function toJSON + * @memberof google.bigtable.v2.StreamPartition + * @instance + * @returns {Object.} JSON object + */ + StreamPartition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamPartition + * @function getTypeUrl + * @memberof google.bigtable.v2.StreamPartition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamPartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.StreamPartition"; + }; + + return StreamPartition; + })(); + + v2.StreamContinuationTokens = (function() { + + /** + * Properties of a StreamContinuationTokens. + * @memberof google.bigtable.v2 + * @interface IStreamContinuationTokens + * @property {Array.|null} [tokens] StreamContinuationTokens tokens + */ + + /** + * Constructs a new StreamContinuationTokens. + * @memberof google.bigtable.v2 + * @classdesc Represents a StreamContinuationTokens. + * @implements IStreamContinuationTokens + * @constructor + * @param {google.bigtable.v2.IStreamContinuationTokens=} [properties] Properties to set + */ + function StreamContinuationTokens(properties) { + this.tokens = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamContinuationTokens tokens. + * @member {Array.} tokens + * @memberof google.bigtable.v2.StreamContinuationTokens + * @instance + */ + StreamContinuationTokens.prototype.tokens = $util.emptyArray; + + /** + * Creates a new StreamContinuationTokens instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {google.bigtable.v2.IStreamContinuationTokens=} [properties] Properties to set + * @returns {google.bigtable.v2.StreamContinuationTokens} StreamContinuationTokens instance + */ + StreamContinuationTokens.create = function create(properties) { + return new StreamContinuationTokens(properties); + }; + + /** + * Encodes the specified StreamContinuationTokens message. Does not implicitly {@link google.bigtable.v2.StreamContinuationTokens.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {google.bigtable.v2.IStreamContinuationTokens} message StreamContinuationTokens message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamContinuationTokens.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokens != null && message.tokens.length) + for (var i = 0; i < message.tokens.length; ++i) + $root.google.bigtable.v2.StreamContinuationToken.encode(message.tokens[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamContinuationTokens message, length delimited. Does not implicitly {@link google.bigtable.v2.StreamContinuationTokens.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {google.bigtable.v2.IStreamContinuationTokens} message StreamContinuationTokens message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamContinuationTokens.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamContinuationTokens message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.StreamContinuationTokens} StreamContinuationTokens + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamContinuationTokens.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.StreamContinuationTokens(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tokens && message.tokens.length)) + message.tokens = []; + message.tokens.push($root.google.bigtable.v2.StreamContinuationToken.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamContinuationTokens message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.StreamContinuationTokens} StreamContinuationTokens + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamContinuationTokens.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamContinuationTokens message. + * @function verify + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamContinuationTokens.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokens != null && message.hasOwnProperty("tokens")) { + if (!Array.isArray(message.tokens)) + return "tokens: array expected"; + for (var i = 0; i < message.tokens.length; ++i) { + var error = $root.google.bigtable.v2.StreamContinuationToken.verify(message.tokens[i]); + if (error) + return "tokens." + error; + } + } + return null; + }; + + /** + * Creates a StreamContinuationTokens message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.StreamContinuationTokens} StreamContinuationTokens + */ + StreamContinuationTokens.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.StreamContinuationTokens) + return object; + var message = new $root.google.bigtable.v2.StreamContinuationTokens(); + if (object.tokens) { + if (!Array.isArray(object.tokens)) + throw TypeError(".google.bigtable.v2.StreamContinuationTokens.tokens: array expected"); + message.tokens = []; + for (var i = 0; i < object.tokens.length; ++i) { + if (typeof object.tokens[i] !== "object") + throw TypeError(".google.bigtable.v2.StreamContinuationTokens.tokens: object expected"); + message.tokens[i] = $root.google.bigtable.v2.StreamContinuationToken.fromObject(object.tokens[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StreamContinuationTokens message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {google.bigtable.v2.StreamContinuationTokens} message StreamContinuationTokens + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamContinuationTokens.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokens = []; + if (message.tokens && message.tokens.length) { + object.tokens = []; + for (var j = 0; j < message.tokens.length; ++j) + object.tokens[j] = $root.google.bigtable.v2.StreamContinuationToken.toObject(message.tokens[j], options); + } + return object; + }; + + /** + * Converts this StreamContinuationTokens to JSON. + * @function toJSON + * @memberof google.bigtable.v2.StreamContinuationTokens + * @instance + * @returns {Object.} JSON object + */ + StreamContinuationTokens.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamContinuationTokens + * @function getTypeUrl + * @memberof google.bigtable.v2.StreamContinuationTokens + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamContinuationTokens.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.StreamContinuationTokens"; + }; + + return StreamContinuationTokens; + })(); + + v2.StreamContinuationToken = (function() { + + /** + * Properties of a StreamContinuationToken. + * @memberof google.bigtable.v2 + * @interface IStreamContinuationToken + * @property {google.bigtable.v2.IStreamPartition|null} [partition] StreamContinuationToken partition + * @property {string|null} [token] StreamContinuationToken token + */ + + /** + * Constructs a new StreamContinuationToken. + * @memberof google.bigtable.v2 + * @classdesc Represents a StreamContinuationToken. + * @implements IStreamContinuationToken + * @constructor + * @param {google.bigtable.v2.IStreamContinuationToken=} [properties] Properties to set + */ + function StreamContinuationToken(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamContinuationToken partition. + * @member {google.bigtable.v2.IStreamPartition|null|undefined} partition + * @memberof google.bigtable.v2.StreamContinuationToken + * @instance + */ + StreamContinuationToken.prototype.partition = null; + + /** + * StreamContinuationToken token. + * @member {string} token + * @memberof google.bigtable.v2.StreamContinuationToken + * @instance + */ + StreamContinuationToken.prototype.token = ""; + + /** + * Creates a new StreamContinuationToken instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {google.bigtable.v2.IStreamContinuationToken=} [properties] Properties to set + * @returns {google.bigtable.v2.StreamContinuationToken} StreamContinuationToken instance + */ + StreamContinuationToken.create = function create(properties) { + return new StreamContinuationToken(properties); + }; + + /** + * Encodes the specified StreamContinuationToken message. Does not implicitly {@link google.bigtable.v2.StreamContinuationToken.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {google.bigtable.v2.IStreamContinuationToken} message StreamContinuationToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamContinuationToken.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) + $root.google.bigtable.v2.StreamPartition.encode(message.partition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.token); + return writer; + }; + + /** + * Encodes the specified StreamContinuationToken message, length delimited. Does not implicitly {@link google.bigtable.v2.StreamContinuationToken.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {google.bigtable.v2.IStreamContinuationToken} message StreamContinuationToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamContinuationToken.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamContinuationToken message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.StreamContinuationToken} StreamContinuationToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamContinuationToken.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.StreamContinuationToken(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partition = $root.google.bigtable.v2.StreamPartition.decode(reader, reader.uint32()); + break; + } + case 2: { + message.token = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamContinuationToken message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.StreamContinuationToken} StreamContinuationToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamContinuationToken.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamContinuationToken message. + * @function verify + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamContinuationToken.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partition != null && message.hasOwnProperty("partition")) { + var error = $root.google.bigtable.v2.StreamPartition.verify(message.partition); + if (error) + return "partition." + error; + } + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + return null; + }; + + /** + * Creates a StreamContinuationToken message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.StreamContinuationToken} StreamContinuationToken + */ + StreamContinuationToken.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.StreamContinuationToken) + return object; + var message = new $root.google.bigtable.v2.StreamContinuationToken(); + if (object.partition != null) { + if (typeof object.partition !== "object") + throw TypeError(".google.bigtable.v2.StreamContinuationToken.partition: object expected"); + message.partition = $root.google.bigtable.v2.StreamPartition.fromObject(object.partition); + } + if (object.token != null) + message.token = String(object.token); + return message; + }; + + /** + * Creates a plain object from a StreamContinuationToken message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {google.bigtable.v2.StreamContinuationToken} message StreamContinuationToken + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamContinuationToken.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.partition = null; + object.token = ""; + } + if (message.partition != null && message.hasOwnProperty("partition")) + object.partition = $root.google.bigtable.v2.StreamPartition.toObject(message.partition, options); + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + return object; + }; + + /** + * Converts this StreamContinuationToken to JSON. + * @function toJSON + * @memberof google.bigtable.v2.StreamContinuationToken + * @instance + * @returns {Object.} JSON object + */ + StreamContinuationToken.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamContinuationToken + * @function getTypeUrl + * @memberof google.bigtable.v2.StreamContinuationToken + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamContinuationToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.StreamContinuationToken"; + }; + + return StreamContinuationToken; + })(); + + v2.ProtoFormat = (function() { + + /** + * Properties of a ProtoFormat. + * @memberof google.bigtable.v2 + * @interface IProtoFormat + */ + + /** + * Constructs a new ProtoFormat. + * @memberof google.bigtable.v2 + * @classdesc Represents a ProtoFormat. + * @implements IProtoFormat + * @constructor + * @param {google.bigtable.v2.IProtoFormat=} [properties] Properties to set + */ + function ProtoFormat(properties) { + if (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 ProtoFormat instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {google.bigtable.v2.IProtoFormat=} [properties] Properties to set + * @returns {google.bigtable.v2.ProtoFormat} ProtoFormat instance + */ + ProtoFormat.create = function create(properties) { + return new ProtoFormat(properties); + }; + + /** + * Encodes the specified ProtoFormat message. Does not implicitly {@link google.bigtable.v2.ProtoFormat.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {google.bigtable.v2.IProtoFormat} message ProtoFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoFormat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ProtoFormat message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoFormat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {google.bigtable.v2.IProtoFormat} message ProtoFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoFormat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoFormat message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ProtoFormat} ProtoFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoFormat.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ProtoFormat(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoFormat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ProtoFormat} ProtoFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoFormat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoFormat message. + * @function verify + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoFormat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ProtoFormat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ProtoFormat} ProtoFormat + */ + ProtoFormat.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ProtoFormat) + return object; + return new $root.google.bigtable.v2.ProtoFormat(); + }; + + /** + * Creates a plain object from a ProtoFormat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {google.bigtable.v2.ProtoFormat} message ProtoFormat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoFormat.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ProtoFormat to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ProtoFormat + * @instance + * @returns {Object.} JSON object + */ + ProtoFormat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProtoFormat + * @function getTypeUrl + * @memberof google.bigtable.v2.ProtoFormat + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoFormat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ProtoFormat"; + }; + + return ProtoFormat; + })(); + + v2.ColumnMetadata = (function() { + + /** + * Properties of a ColumnMetadata. + * @memberof google.bigtable.v2 + * @interface IColumnMetadata + * @property {string|null} [name] ColumnMetadata name + * @property {google.bigtable.v2.IType|null} [type] ColumnMetadata type + */ + + /** + * Constructs a new ColumnMetadata. + * @memberof google.bigtable.v2 + * @classdesc Represents a ColumnMetadata. + * @implements IColumnMetadata + * @constructor + * @param {google.bigtable.v2.IColumnMetadata=} [properties] Properties to set + */ + function ColumnMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnMetadata name. + * @member {string} name + * @memberof google.bigtable.v2.ColumnMetadata + * @instance + */ + ColumnMetadata.prototype.name = ""; + + /** + * ColumnMetadata type. + * @member {google.bigtable.v2.IType|null|undefined} type + * @memberof google.bigtable.v2.ColumnMetadata + * @instance + */ + ColumnMetadata.prototype.type = null; + + /** + * Creates a new ColumnMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {google.bigtable.v2.IColumnMetadata=} [properties] Properties to set + * @returns {google.bigtable.v2.ColumnMetadata} ColumnMetadata instance + */ + ColumnMetadata.create = function create(properties) { + return new ColumnMetadata(properties); + }; + + /** + * Encodes the specified ColumnMetadata message. Does not implicitly {@link google.bigtable.v2.ColumnMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {google.bigtable.v2.IColumnMetadata} message ColumnMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.bigtable.v2.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ColumnMetadata message, length delimited. Does not implicitly {@link google.bigtable.v2.ColumnMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {google.bigtable.v2.IColumnMetadata} message ColumnMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ColumnMetadata} ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ColumnMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ColumnMetadata} ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnMetadata message. + * @function verify + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnMetadata.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.type != null && message.hasOwnProperty("type")) { + var error = $root.google.bigtable.v2.Type.verify(message.type); + if (error) + return "type." + error; + } + return null; + }; + + /** + * Creates a ColumnMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ColumnMetadata} ColumnMetadata + */ + ColumnMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ColumnMetadata) + return object; + var message = new $root.google.bigtable.v2.ColumnMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.bigtable.v2.ColumnMetadata.type: object expected"); + message.type = $root.google.bigtable.v2.Type.fromObject(object.type); + } + return message; + }; + + /** + * Creates a plain object from a ColumnMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {google.bigtable.v2.ColumnMetadata} message ColumnMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.bigtable.v2.Type.toObject(message.type, options); + return object; + }; + + /** + * Converts this ColumnMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ColumnMetadata + * @instance + * @returns {Object.} JSON object + */ + ColumnMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnMetadata + * @function getTypeUrl + * @memberof google.bigtable.v2.ColumnMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ColumnMetadata"; + }; + + return ColumnMetadata; + })(); + + v2.ProtoSchema = (function() { + + /** + * Properties of a ProtoSchema. + * @memberof google.bigtable.v2 + * @interface IProtoSchema + * @property {Array.|null} [columns] ProtoSchema columns + */ + + /** + * Constructs a new ProtoSchema. + * @memberof google.bigtable.v2 + * @classdesc Represents a ProtoSchema. + * @implements IProtoSchema + * @constructor + * @param {google.bigtable.v2.IProtoSchema=} [properties] Properties to set + */ + function ProtoSchema(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtoSchema columns. + * @member {Array.} columns + * @memberof google.bigtable.v2.ProtoSchema + * @instance + */ + ProtoSchema.prototype.columns = $util.emptyArray; + + /** + * Creates a new ProtoSchema instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {google.bigtable.v2.IProtoSchema=} [properties] Properties to set + * @returns {google.bigtable.v2.ProtoSchema} ProtoSchema instance + */ + ProtoSchema.create = function create(properties) { + return new ProtoSchema(properties); + }; + + /** + * Encodes the specified ProtoSchema message. Does not implicitly {@link google.bigtable.v2.ProtoSchema.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {google.bigtable.v2.IProtoSchema} message ProtoSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.bigtable.v2.ColumnMetadata.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProtoSchema message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {google.bigtable.v2.IProtoSchema} message ProtoSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ProtoSchema} ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoSchema.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ProtoSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.bigtable.v2.ColumnMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ProtoSchema} ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoSchema message. + * @function verify + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.bigtable.v2.ColumnMetadata.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + return null; + }; + + /** + * Creates a ProtoSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ProtoSchema} ProtoSchema + */ + ProtoSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ProtoSchema) + return object; + var message = new $root.google.bigtable.v2.ProtoSchema(); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.bigtable.v2.ProtoSchema.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".google.bigtable.v2.ProtoSchema.columns: object expected"); + message.columns[i] = $root.google.bigtable.v2.ColumnMetadata.fromObject(object.columns[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProtoSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {google.bigtable.v2.ProtoSchema} message ProtoSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.bigtable.v2.ColumnMetadata.toObject(message.columns[j], options); + } + return object; + }; + + /** + * Converts this ProtoSchema to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ProtoSchema + * @instance + * @returns {Object.} JSON object + */ + ProtoSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProtoSchema + * @function getTypeUrl + * @memberof google.bigtable.v2.ProtoSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ProtoSchema"; + }; + + return ProtoSchema; + })(); + + v2.ResultSetMetadata = (function() { + + /** + * Properties of a ResultSetMetadata. + * @memberof google.bigtable.v2 + * @interface IResultSetMetadata + * @property {google.bigtable.v2.IProtoSchema|null} [protoSchema] ResultSetMetadata protoSchema + */ + + /** + * Constructs a new ResultSetMetadata. + * @memberof google.bigtable.v2 + * @classdesc Represents a ResultSetMetadata. + * @implements IResultSetMetadata + * @constructor + * @param {google.bigtable.v2.IResultSetMetadata=} [properties] Properties to set + */ + function ResultSetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultSetMetadata protoSchema. + * @member {google.bigtable.v2.IProtoSchema|null|undefined} protoSchema + * @memberof google.bigtable.v2.ResultSetMetadata + * @instance + */ + ResultSetMetadata.prototype.protoSchema = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResultSetMetadata schema. + * @member {"protoSchema"|undefined} schema + * @memberof google.bigtable.v2.ResultSetMetadata + * @instance + */ + Object.defineProperty(ResultSetMetadata.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["protoSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResultSetMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {google.bigtable.v2.IResultSetMetadata=} [properties] Properties to set + * @returns {google.bigtable.v2.ResultSetMetadata} ResultSetMetadata instance + */ + ResultSetMetadata.create = function create(properties) { + return new ResultSetMetadata(properties); + }; + + /** + * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.bigtable.v2.ResultSetMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {google.bigtable.v2.IResultSetMetadata} message ResultSetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protoSchema != null && Object.hasOwnProperty.call(message, "protoSchema")) + $root.google.bigtable.v2.ProtoSchema.encode(message.protoSchema, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.bigtable.v2.ResultSetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {google.bigtable.v2.IResultSetMetadata} message ResultSetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ResultSetMetadata} ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ResultSetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.protoSchema = $root.google.bigtable.v2.ProtoSchema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ResultSetMetadata} ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultSetMetadata message. + * @function verify + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultSetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.protoSchema != null && message.hasOwnProperty("protoSchema")) { + properties.schema = 1; + { + var error = $root.google.bigtable.v2.ProtoSchema.verify(message.protoSchema); + if (error) + return "protoSchema." + error; + } + } + return null; + }; + + /** + * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ResultSetMetadata} ResultSetMetadata + */ + ResultSetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ResultSetMetadata) + return object; + var message = new $root.google.bigtable.v2.ResultSetMetadata(); + if (object.protoSchema != null) { + if (typeof object.protoSchema !== "object") + throw TypeError(".google.bigtable.v2.ResultSetMetadata.protoSchema: object expected"); + message.protoSchema = $root.google.bigtable.v2.ProtoSchema.fromObject(object.protoSchema); + } + return message; + }; + + /** + * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {google.bigtable.v2.ResultSetMetadata} message ResultSetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultSetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.protoSchema != null && message.hasOwnProperty("protoSchema")) { + object.protoSchema = $root.google.bigtable.v2.ProtoSchema.toObject(message.protoSchema, options); + if (options.oneofs) + object.schema = "protoSchema"; + } + return object; + }; + + /** + * Converts this ResultSetMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ResultSetMetadata + * @instance + * @returns {Object.} JSON object + */ + ResultSetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultSetMetadata + * @function getTypeUrl + * @memberof google.bigtable.v2.ResultSetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultSetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ResultSetMetadata"; + }; + + return ResultSetMetadata; + })(); + + v2.ProtoRows = (function() { + + /** + * Properties of a ProtoRows. + * @memberof google.bigtable.v2 + * @interface IProtoRows + * @property {Array.|null} [values] ProtoRows values + */ + + /** + * Constructs a new ProtoRows. + * @memberof google.bigtable.v2 + * @classdesc Represents a ProtoRows. + * @implements IProtoRows + * @constructor + * @param {google.bigtable.v2.IProtoRows=} [properties] Properties to set + */ + function ProtoRows(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtoRows values. + * @member {Array.} values + * @memberof google.bigtable.v2.ProtoRows + * @instance + */ + ProtoRows.prototype.values = $util.emptyArray; + + /** + * Creates a new ProtoRows instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {google.bigtable.v2.IProtoRows=} [properties] Properties to set + * @returns {google.bigtable.v2.ProtoRows} ProtoRows instance + */ + ProtoRows.create = function create(properties) { + return new ProtoRows(properties); + }; + + /** + * Encodes the specified ProtoRows message. Does not implicitly {@link google.bigtable.v2.ProtoRows.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {google.bigtable.v2.IProtoRows} message ProtoRows message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoRows.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.bigtable.v2.Value.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProtoRows message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoRows.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {google.bigtable.v2.IProtoRows} message ProtoRows message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoRows.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoRows message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ProtoRows} ProtoRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoRows.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ProtoRows(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.bigtable.v2.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoRows message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ProtoRows} ProtoRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoRows.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoRows message. + * @function verify + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoRows.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.bigtable.v2.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ProtoRows message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ProtoRows} ProtoRows + */ + ProtoRows.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ProtoRows) + return object; + var message = new $root.google.bigtable.v2.ProtoRows(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.bigtable.v2.ProtoRows.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.bigtable.v2.ProtoRows.values: object expected"); + message.values[i] = $root.google.bigtable.v2.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProtoRows message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {google.bigtable.v2.ProtoRows} message ProtoRows + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoRows.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.bigtable.v2.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ProtoRows to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ProtoRows + * @instance + * @returns {Object.} JSON object + */ + ProtoRows.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProtoRows + * @function getTypeUrl + * @memberof google.bigtable.v2.ProtoRows + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoRows.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ProtoRows"; + }; + + return ProtoRows; + })(); + + v2.ProtoRowsBatch = (function() { + + /** + * Properties of a ProtoRowsBatch. + * @memberof google.bigtable.v2 + * @interface IProtoRowsBatch + * @property {Uint8Array|null} [batchData] ProtoRowsBatch batchData + */ + + /** + * Constructs a new ProtoRowsBatch. + * @memberof google.bigtable.v2 + * @classdesc Represents a ProtoRowsBatch. + * @implements IProtoRowsBatch + * @constructor + * @param {google.bigtable.v2.IProtoRowsBatch=} [properties] Properties to set + */ + function ProtoRowsBatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtoRowsBatch batchData. + * @member {Uint8Array} batchData + * @memberof google.bigtable.v2.ProtoRowsBatch + * @instance + */ + ProtoRowsBatch.prototype.batchData = $util.newBuffer([]); + + /** + * Creates a new ProtoRowsBatch instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {google.bigtable.v2.IProtoRowsBatch=} [properties] Properties to set + * @returns {google.bigtable.v2.ProtoRowsBatch} ProtoRowsBatch instance + */ + ProtoRowsBatch.create = function create(properties) { + return new ProtoRowsBatch(properties); + }; + + /** + * Encodes the specified ProtoRowsBatch message. Does not implicitly {@link google.bigtable.v2.ProtoRowsBatch.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {google.bigtable.v2.IProtoRowsBatch} message ProtoRowsBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoRowsBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.batchData != null && Object.hasOwnProperty.call(message, "batchData")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.batchData); + return writer; + }; + + /** + * Encodes the specified ProtoRowsBatch message, length delimited. Does not implicitly {@link google.bigtable.v2.ProtoRowsBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {google.bigtable.v2.IProtoRowsBatch} message ProtoRowsBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoRowsBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoRowsBatch message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ProtoRowsBatch} ProtoRowsBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoRowsBatch.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ProtoRowsBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.batchData = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoRowsBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ProtoRowsBatch} ProtoRowsBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoRowsBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoRowsBatch message. + * @function verify + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoRowsBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.batchData != null && message.hasOwnProperty("batchData")) + if (!(message.batchData && typeof message.batchData.length === "number" || $util.isString(message.batchData))) + return "batchData: buffer expected"; + return null; + }; + + /** + * Creates a ProtoRowsBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ProtoRowsBatch} ProtoRowsBatch + */ + ProtoRowsBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ProtoRowsBatch) + return object; + var message = new $root.google.bigtable.v2.ProtoRowsBatch(); + if (object.batchData != null) + if (typeof object.batchData === "string") + $util.base64.decode(object.batchData, message.batchData = $util.newBuffer($util.base64.length(object.batchData)), 0); + else if (object.batchData.length >= 0) + message.batchData = object.batchData; + return message; + }; + + /** + * Creates a plain object from a ProtoRowsBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {google.bigtable.v2.ProtoRowsBatch} message ProtoRowsBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoRowsBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.batchData = ""; + else { + object.batchData = []; + if (options.bytes !== Array) + object.batchData = $util.newBuffer(object.batchData); + } + if (message.batchData != null && message.hasOwnProperty("batchData")) + object.batchData = options.bytes === String ? $util.base64.encode(message.batchData, 0, message.batchData.length) : options.bytes === Array ? Array.prototype.slice.call(message.batchData) : message.batchData; + return object; + }; + + /** + * Converts this ProtoRowsBatch to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ProtoRowsBatch + * @instance + * @returns {Object.} JSON object + */ + ProtoRowsBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProtoRowsBatch + * @function getTypeUrl + * @memberof google.bigtable.v2.ProtoRowsBatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoRowsBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ProtoRowsBatch"; + }; + + return ProtoRowsBatch; + })(); + + v2.PartialResultSet = (function() { + + /** + * Properties of a PartialResultSet. + * @memberof google.bigtable.v2 + * @interface IPartialResultSet + * @property {google.bigtable.v2.IProtoRowsBatch|null} [protoRowsBatch] PartialResultSet protoRowsBatch + * @property {number|null} [batchChecksum] PartialResultSet batchChecksum + * @property {Uint8Array|null} [resumeToken] PartialResultSet resumeToken + * @property {boolean|null} [reset] PartialResultSet reset + * @property {number|null} [estimatedBatchSize] PartialResultSet estimatedBatchSize + */ + + /** + * Constructs a new PartialResultSet. + * @memberof google.bigtable.v2 + * @classdesc Represents a PartialResultSet. + * @implements IPartialResultSet + * @constructor + * @param {google.bigtable.v2.IPartialResultSet=} [properties] Properties to set + */ + function PartialResultSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartialResultSet protoRowsBatch. + * @member {google.bigtable.v2.IProtoRowsBatch|null|undefined} protoRowsBatch + * @memberof google.bigtable.v2.PartialResultSet + * @instance + */ + PartialResultSet.prototype.protoRowsBatch = null; + + /** + * PartialResultSet batchChecksum. + * @member {number|null|undefined} batchChecksum + * @memberof google.bigtable.v2.PartialResultSet + * @instance + */ + PartialResultSet.prototype.batchChecksum = null; + + /** + * PartialResultSet resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.bigtable.v2.PartialResultSet + * @instance + */ + PartialResultSet.prototype.resumeToken = $util.newBuffer([]); + + /** + * PartialResultSet reset. + * @member {boolean} reset + * @memberof google.bigtable.v2.PartialResultSet + * @instance + */ + PartialResultSet.prototype.reset = false; + + /** + * PartialResultSet estimatedBatchSize. + * @member {number} estimatedBatchSize + * @memberof google.bigtable.v2.PartialResultSet + * @instance + */ + PartialResultSet.prototype.estimatedBatchSize = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PartialResultSet partialRows. + * @member {"protoRowsBatch"|undefined} partialRows + * @memberof google.bigtable.v2.PartialResultSet + * @instance + */ + Object.defineProperty(PartialResultSet.prototype, "partialRows", { + get: $util.oneOfGetter($oneOfFields = ["protoRowsBatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PartialResultSet.prototype, "_batchChecksum", { + get: $util.oneOfGetter($oneOfFields = ["batchChecksum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PartialResultSet instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {google.bigtable.v2.IPartialResultSet=} [properties] Properties to set + * @returns {google.bigtable.v2.PartialResultSet} PartialResultSet instance + */ + PartialResultSet.create = function create(properties) { + return new PartialResultSet(properties); + }; + + /** + * Encodes the specified PartialResultSet message. Does not implicitly {@link google.bigtable.v2.PartialResultSet.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {google.bigtable.v2.IPartialResultSet} message PartialResultSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialResultSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protoRowsBatch != null && Object.hasOwnProperty.call(message, "protoRowsBatch")) + $root.google.bigtable.v2.ProtoRowsBatch.encode(message.protoRowsBatch, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.estimatedBatchSize != null && Object.hasOwnProperty.call(message, "estimatedBatchSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.estimatedBatchSize); + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.resumeToken); + if (message.batchChecksum != null && Object.hasOwnProperty.call(message, "batchChecksum")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.batchChecksum); + if (message.reset != null && Object.hasOwnProperty.call(message, "reset")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.reset); + return writer; + }; + + /** + * Encodes the specified PartialResultSet message, length delimited. Does not implicitly {@link google.bigtable.v2.PartialResultSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {google.bigtable.v2.IPartialResultSet} message PartialResultSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialResultSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.PartialResultSet} PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialResultSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.PartialResultSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.protoRowsBatch = $root.google.bigtable.v2.ProtoRowsBatch.decode(reader, reader.uint32()); + break; + } + case 6: { + message.batchChecksum = reader.uint32(); + break; + } + case 5: { + message.resumeToken = reader.bytes(); + break; + } + case 7: { + message.reset = reader.bool(); + break; + } + case 4: { + message.estimatedBatchSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.PartialResultSet} PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialResultSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartialResultSet message. + * @function verify + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartialResultSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.protoRowsBatch != null && message.hasOwnProperty("protoRowsBatch")) { + properties.partialRows = 1; + { + var error = $root.google.bigtable.v2.ProtoRowsBatch.verify(message.protoRowsBatch); + if (error) + return "protoRowsBatch." + error; + } + } + if (message.batchChecksum != null && message.hasOwnProperty("batchChecksum")) { + properties._batchChecksum = 1; + if (!$util.isInteger(message.batchChecksum)) + return "batchChecksum: integer expected"; + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.reset != null && message.hasOwnProperty("reset")) + if (typeof message.reset !== "boolean") + return "reset: boolean expected"; + if (message.estimatedBatchSize != null && message.hasOwnProperty("estimatedBatchSize")) + if (!$util.isInteger(message.estimatedBatchSize)) + return "estimatedBatchSize: integer expected"; + return null; + }; + + /** + * Creates a PartialResultSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.PartialResultSet} PartialResultSet + */ + PartialResultSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.PartialResultSet) + return object; + var message = new $root.google.bigtable.v2.PartialResultSet(); + if (object.protoRowsBatch != null) { + if (typeof object.protoRowsBatch !== "object") + throw TypeError(".google.bigtable.v2.PartialResultSet.protoRowsBatch: object expected"); + message.protoRowsBatch = $root.google.bigtable.v2.ProtoRowsBatch.fromObject(object.protoRowsBatch); + } + if (object.batchChecksum != null) + message.batchChecksum = object.batchChecksum >>> 0; + if (object.resumeToken != null) + if (typeof object.resumeToken === "string") + $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); + else if (object.resumeToken.length >= 0) + message.resumeToken = object.resumeToken; + if (object.reset != null) + message.reset = Boolean(object.reset); + if (object.estimatedBatchSize != null) + message.estimatedBatchSize = object.estimatedBatchSize | 0; + return message; + }; + + /** + * Creates a plain object from a PartialResultSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {google.bigtable.v2.PartialResultSet} message PartialResultSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartialResultSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.estimatedBatchSize = 0; + if (options.bytes === String) + object.resumeToken = ""; + else { + object.resumeToken = []; + if (options.bytes !== Array) + object.resumeToken = $util.newBuffer(object.resumeToken); + } + object.reset = false; + } + if (message.protoRowsBatch != null && message.hasOwnProperty("protoRowsBatch")) { + object.protoRowsBatch = $root.google.bigtable.v2.ProtoRowsBatch.toObject(message.protoRowsBatch, options); + if (options.oneofs) + object.partialRows = "protoRowsBatch"; + } + if (message.estimatedBatchSize != null && message.hasOwnProperty("estimatedBatchSize")) + object.estimatedBatchSize = message.estimatedBatchSize; + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; + if (message.batchChecksum != null && message.hasOwnProperty("batchChecksum")) { + object.batchChecksum = message.batchChecksum; + if (options.oneofs) + object._batchChecksum = "batchChecksum"; + } + if (message.reset != null && message.hasOwnProperty("reset")) + object.reset = message.reset; + return object; + }; + + /** + * Converts this PartialResultSet to JSON. + * @function toJSON + * @memberof google.bigtable.v2.PartialResultSet + * @instance + * @returns {Object.} JSON object + */ + PartialResultSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartialResultSet + * @function getTypeUrl + * @memberof google.bigtable.v2.PartialResultSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartialResultSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.PartialResultSet"; + }; + + return PartialResultSet; + })(); + + v2.Idempotency = (function() { + + /** + * Properties of an Idempotency. + * @memberof google.bigtable.v2 + * @interface IIdempotency + * @property {Uint8Array|null} [token] Idempotency token + * @property {google.protobuf.ITimestamp|null} [startTime] Idempotency startTime + */ + + /** + * Constructs a new Idempotency. + * @memberof google.bigtable.v2 + * @classdesc Represents an Idempotency. + * @implements IIdempotency + * @constructor + * @param {google.bigtable.v2.IIdempotency=} [properties] Properties to set + */ + function Idempotency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Idempotency token. + * @member {Uint8Array} token + * @memberof google.bigtable.v2.Idempotency + * @instance + */ + Idempotency.prototype.token = $util.newBuffer([]); + + /** + * Idempotency startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.bigtable.v2.Idempotency + * @instance + */ + Idempotency.prototype.startTime = null; + + /** + * Creates a new Idempotency instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {google.bigtable.v2.IIdempotency=} [properties] Properties to set + * @returns {google.bigtable.v2.Idempotency} Idempotency instance + */ + Idempotency.create = function create(properties) { + return new Idempotency(properties); + }; + + /** + * Encodes the specified Idempotency message. Does not implicitly {@link google.bigtable.v2.Idempotency.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {google.bigtable.v2.IIdempotency} message Idempotency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Idempotency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.token); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Idempotency message, length delimited. Does not implicitly {@link google.bigtable.v2.Idempotency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {google.bigtable.v2.IIdempotency} message Idempotency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Idempotency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Idempotency message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Idempotency} Idempotency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Idempotency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Idempotency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.token = reader.bytes(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Idempotency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Idempotency} Idempotency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Idempotency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Idempotency message. + * @function verify + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Idempotency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!(message.token && typeof message.token.length === "number" || $util.isString(message.token))) + return "token: buffer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates an Idempotency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Idempotency} Idempotency + */ + Idempotency.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Idempotency) + return object; + var message = new $root.google.bigtable.v2.Idempotency(); + if (object.token != null) + if (typeof object.token === "string") + $util.base64.decode(object.token, message.token = $util.newBuffer($util.base64.length(object.token)), 0); + else if (object.token.length >= 0) + message.token = object.token; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.bigtable.v2.Idempotency.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from an Idempotency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {google.bigtable.v2.Idempotency} message Idempotency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Idempotency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.token = ""; + else { + object.token = []; + if (options.bytes !== Array) + object.token = $util.newBuffer(object.token); + } + object.startTime = null; + } + if (message.token != null && message.hasOwnProperty("token")) + object.token = options.bytes === String ? $util.base64.encode(message.token, 0, message.token.length) : options.bytes === Array ? Array.prototype.slice.call(message.token) : message.token; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this Idempotency to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Idempotency + * @instance + * @returns {Object.} JSON object + */ + Idempotency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Idempotency + * @function getTypeUrl + * @memberof google.bigtable.v2.Idempotency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Idempotency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Idempotency"; + }; + + return Idempotency; + })(); + + v2.Type = (function() { + + /** + * Properties of a Type. + * @memberof google.bigtable.v2 + * @interface IType + * @property {google.bigtable.v2.Type.IBytes|null} [bytesType] Type bytesType + * @property {google.bigtable.v2.Type.IString|null} [stringType] Type stringType + * @property {google.bigtable.v2.Type.IInt64|null} [int64Type] Type int64Type + * @property {google.bigtable.v2.Type.IFloat32|null} [float32Type] Type float32Type + * @property {google.bigtable.v2.Type.IFloat64|null} [float64Type] Type float64Type + * @property {google.bigtable.v2.Type.IBool|null} [boolType] Type boolType + * @property {google.bigtable.v2.Type.ITimestamp|null} [timestampType] Type timestampType + * @property {google.bigtable.v2.Type.IDate|null} [dateType] Type dateType + * @property {google.bigtable.v2.Type.IAggregate|null} [aggregateType] Type aggregateType + * @property {google.bigtable.v2.Type.IStruct|null} [structType] Type structType + * @property {google.bigtable.v2.Type.IArray|null} [arrayType] Type arrayType + * @property {google.bigtable.v2.Type.IMap|null} [mapType] Type mapType + * @property {google.bigtable.v2.Type.IProto|null} [protoType] Type protoType + * @property {google.bigtable.v2.Type.IEnum|null} [enumType] Type enumType + */ + + /** + * Constructs a new Type. + * @memberof google.bigtable.v2 + * @classdesc Represents a Type. + * @implements IType + * @constructor + * @param {google.bigtable.v2.IType=} [properties] Properties to set + */ + function Type(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Type bytesType. + * @member {google.bigtable.v2.Type.IBytes|null|undefined} bytesType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.bytesType = null; + + /** + * Type stringType. + * @member {google.bigtable.v2.Type.IString|null|undefined} stringType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.stringType = null; + + /** + * Type int64Type. + * @member {google.bigtable.v2.Type.IInt64|null|undefined} int64Type + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.int64Type = null; + + /** + * Type float32Type. + * @member {google.bigtable.v2.Type.IFloat32|null|undefined} float32Type + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.float32Type = null; + + /** + * Type float64Type. + * @member {google.bigtable.v2.Type.IFloat64|null|undefined} float64Type + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.float64Type = null; + + /** + * Type boolType. + * @member {google.bigtable.v2.Type.IBool|null|undefined} boolType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.boolType = null; + + /** + * Type timestampType. + * @member {google.bigtable.v2.Type.ITimestamp|null|undefined} timestampType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.timestampType = null; + + /** + * Type dateType. + * @member {google.bigtable.v2.Type.IDate|null|undefined} dateType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.dateType = null; + + /** + * Type aggregateType. + * @member {google.bigtable.v2.Type.IAggregate|null|undefined} aggregateType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.aggregateType = null; + + /** + * Type structType. + * @member {google.bigtable.v2.Type.IStruct|null|undefined} structType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.structType = null; + + /** + * Type arrayType. + * @member {google.bigtable.v2.Type.IArray|null|undefined} arrayType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.arrayType = null; + + /** + * Type mapType. + * @member {google.bigtable.v2.Type.IMap|null|undefined} mapType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.mapType = null; + + /** + * Type protoType. + * @member {google.bigtable.v2.Type.IProto|null|undefined} protoType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.protoType = null; + + /** + * Type enumType. + * @member {google.bigtable.v2.Type.IEnum|null|undefined} enumType + * @memberof google.bigtable.v2.Type + * @instance + */ + Type.prototype.enumType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Type kind. + * @member {"bytesType"|"stringType"|"int64Type"|"float32Type"|"float64Type"|"boolType"|"timestampType"|"dateType"|"aggregateType"|"structType"|"arrayType"|"mapType"|"protoType"|"enumType"|undefined} kind + * @memberof google.bigtable.v2.Type + * @instance + */ + Object.defineProperty(Type.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["bytesType", "stringType", "int64Type", "float32Type", "float64Type", "boolType", "timestampType", "dateType", "aggregateType", "structType", "arrayType", "mapType", "protoType", "enumType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Type instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type + * @static + * @param {google.bigtable.v2.IType=} [properties] Properties to set + * @returns {google.bigtable.v2.Type} Type instance + */ + Type.create = function create(properties) { + return new Type(properties); + }; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.bigtable.v2.Type.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type + * @static + * @param {google.bigtable.v2.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesType != null && Object.hasOwnProperty.call(message, "bytesType")) + $root.google.bigtable.v2.Type.Bytes.encode(message.bytesType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stringType != null && Object.hasOwnProperty.call(message, "stringType")) + $root.google.bigtable.v2.Type.String.encode(message.stringType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.arrayType != null && Object.hasOwnProperty.call(message, "arrayType")) + $root.google.bigtable.v2.Type.Array.encode(message.arrayType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mapType != null && Object.hasOwnProperty.call(message, "mapType")) + $root.google.bigtable.v2.Type.Map.encode(message.mapType, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.int64Type != null && Object.hasOwnProperty.call(message, "int64Type")) + $root.google.bigtable.v2.Type.Int64.encode(message.int64Type, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.aggregateType != null && Object.hasOwnProperty.call(message, "aggregateType")) + $root.google.bigtable.v2.Type.Aggregate.encode(message.aggregateType, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) + $root.google.bigtable.v2.Type.Struct.encode(message.structType, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.boolType != null && Object.hasOwnProperty.call(message, "boolType")) + $root.google.bigtable.v2.Type.Bool.encode(message.boolType, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.float64Type != null && Object.hasOwnProperty.call(message, "float64Type")) + $root.google.bigtable.v2.Type.Float64.encode(message.float64Type, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.timestampType != null && Object.hasOwnProperty.call(message, "timestampType")) + $root.google.bigtable.v2.Type.Timestamp.encode(message.timestampType, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.dateType != null && Object.hasOwnProperty.call(message, "dateType")) + $root.google.bigtable.v2.Type.Date.encode(message.dateType, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.float32Type != null && Object.hasOwnProperty.call(message, "float32Type")) + $root.google.bigtable.v2.Type.Float32.encode(message.float32Type, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.protoType != null && Object.hasOwnProperty.call(message, "protoType")) + $root.google.bigtable.v2.Type.Proto.encode(message.protoType, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + $root.google.bigtable.v2.Type.Enum.encode(message.enumType, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type + * @static + * @param {google.bigtable.v2.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Type message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bytesType = $root.google.bigtable.v2.Type.Bytes.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stringType = $root.google.bigtable.v2.Type.String.decode(reader, reader.uint32()); + break; + } + case 5: { + message.int64Type = $root.google.bigtable.v2.Type.Int64.decode(reader, reader.uint32()); + break; + } + case 12: { + message.float32Type = $root.google.bigtable.v2.Type.Float32.decode(reader, reader.uint32()); + break; + } + case 9: { + message.float64Type = $root.google.bigtable.v2.Type.Float64.decode(reader, reader.uint32()); + break; + } + case 8: { + message.boolType = $root.google.bigtable.v2.Type.Bool.decode(reader, reader.uint32()); + break; + } + case 10: { + message.timestampType = $root.google.bigtable.v2.Type.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.dateType = $root.google.bigtable.v2.Type.Date.decode(reader, reader.uint32()); + break; + } + case 6: { + message.aggregateType = $root.google.bigtable.v2.Type.Aggregate.decode(reader, reader.uint32()); + break; + } + case 7: { + message.structType = $root.google.bigtable.v2.Type.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.arrayType = $root.google.bigtable.v2.Type.Array.decode(reader, reader.uint32()); + break; + } + case 4: { + message.mapType = $root.google.bigtable.v2.Type.Map.decode(reader, reader.uint32()); + break; + } + case 13: { + message.protoType = $root.google.bigtable.v2.Type.Proto.decode(reader, reader.uint32()); + break; + } + case 14: { + message.enumType = $root.google.bigtable.v2.Type.Enum.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Type message. + * @function verify + * @memberof google.bigtable.v2.Type + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Type.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) { + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Bytes.verify(message.bytesType); + if (error) + return "bytesType." + error; + } + } + if (message.stringType != null && message.hasOwnProperty("stringType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.String.verify(message.stringType); + if (error) + return "stringType." + error; + } + } + if (message.int64Type != null && message.hasOwnProperty("int64Type")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Int64.verify(message.int64Type); + if (error) + return "int64Type." + error; + } + } + if (message.float32Type != null && message.hasOwnProperty("float32Type")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Float32.verify(message.float32Type); + if (error) + return "float32Type." + error; + } + } + if (message.float64Type != null && message.hasOwnProperty("float64Type")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Float64.verify(message.float64Type); + if (error) + return "float64Type." + error; + } + } + if (message.boolType != null && message.hasOwnProperty("boolType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Bool.verify(message.boolType); + if (error) + return "boolType." + error; + } + } + if (message.timestampType != null && message.hasOwnProperty("timestampType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Timestamp.verify(message.timestampType); + if (error) + return "timestampType." + error; + } + } + if (message.dateType != null && message.hasOwnProperty("dateType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Date.verify(message.dateType); + if (error) + return "dateType." + error; + } + } + if (message.aggregateType != null && message.hasOwnProperty("aggregateType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Aggregate.verify(message.aggregateType); + if (error) + return "aggregateType." + error; + } + } + if (message.structType != null && message.hasOwnProperty("structType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Struct.verify(message.structType); + if (error) + return "structType." + error; + } + } + if (message.arrayType != null && message.hasOwnProperty("arrayType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Array.verify(message.arrayType); + if (error) + return "arrayType." + error; + } + } + if (message.mapType != null && message.hasOwnProperty("mapType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Map.verify(message.mapType); + if (error) + return "mapType." + error; + } + } + if (message.protoType != null && message.hasOwnProperty("protoType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Proto.verify(message.protoType); + if (error) + return "protoType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.bigtable.v2.Type.Enum.verify(message.enumType); + if (error) + return "enumType." + error; + } + } + return null; + }; + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type} Type + */ + Type.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type) + return object; + var message = new $root.google.bigtable.v2.Type(); + if (object.bytesType != null) { + if (typeof object.bytesType !== "object") + throw TypeError(".google.bigtable.v2.Type.bytesType: object expected"); + message.bytesType = $root.google.bigtable.v2.Type.Bytes.fromObject(object.bytesType); + } + if (object.stringType != null) { + if (typeof object.stringType !== "object") + throw TypeError(".google.bigtable.v2.Type.stringType: object expected"); + message.stringType = $root.google.bigtable.v2.Type.String.fromObject(object.stringType); + } + if (object.int64Type != null) { + if (typeof object.int64Type !== "object") + throw TypeError(".google.bigtable.v2.Type.int64Type: object expected"); + message.int64Type = $root.google.bigtable.v2.Type.Int64.fromObject(object.int64Type); + } + if (object.float32Type != null) { + if (typeof object.float32Type !== "object") + throw TypeError(".google.bigtable.v2.Type.float32Type: object expected"); + message.float32Type = $root.google.bigtable.v2.Type.Float32.fromObject(object.float32Type); + } + if (object.float64Type != null) { + if (typeof object.float64Type !== "object") + throw TypeError(".google.bigtable.v2.Type.float64Type: object expected"); + message.float64Type = $root.google.bigtable.v2.Type.Float64.fromObject(object.float64Type); + } + if (object.boolType != null) { + if (typeof object.boolType !== "object") + throw TypeError(".google.bigtable.v2.Type.boolType: object expected"); + message.boolType = $root.google.bigtable.v2.Type.Bool.fromObject(object.boolType); + } + if (object.timestampType != null) { + if (typeof object.timestampType !== "object") + throw TypeError(".google.bigtable.v2.Type.timestampType: object expected"); + message.timestampType = $root.google.bigtable.v2.Type.Timestamp.fromObject(object.timestampType); + } + if (object.dateType != null) { + if (typeof object.dateType !== "object") + throw TypeError(".google.bigtable.v2.Type.dateType: object expected"); + message.dateType = $root.google.bigtable.v2.Type.Date.fromObject(object.dateType); + } + if (object.aggregateType != null) { + if (typeof object.aggregateType !== "object") + throw TypeError(".google.bigtable.v2.Type.aggregateType: object expected"); + message.aggregateType = $root.google.bigtable.v2.Type.Aggregate.fromObject(object.aggregateType); + } + if (object.structType != null) { + if (typeof object.structType !== "object") + throw TypeError(".google.bigtable.v2.Type.structType: object expected"); + message.structType = $root.google.bigtable.v2.Type.Struct.fromObject(object.structType); + } + if (object.arrayType != null) { + if (typeof object.arrayType !== "object") + throw TypeError(".google.bigtable.v2.Type.arrayType: object expected"); + message.arrayType = $root.google.bigtable.v2.Type.Array.fromObject(object.arrayType); + } + if (object.mapType != null) { + if (typeof object.mapType !== "object") + throw TypeError(".google.bigtable.v2.Type.mapType: object expected"); + message.mapType = $root.google.bigtable.v2.Type.Map.fromObject(object.mapType); + } + if (object.protoType != null) { + if (typeof object.protoType !== "object") + throw TypeError(".google.bigtable.v2.Type.protoType: object expected"); + message.protoType = $root.google.bigtable.v2.Type.Proto.fromObject(object.protoType); + } + if (object.enumType != null) { + if (typeof object.enumType !== "object") + throw TypeError(".google.bigtable.v2.Type.enumType: object expected"); + message.enumType = $root.google.bigtable.v2.Type.Enum.fromObject(object.enumType); + } + return message; + }; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type + * @static + * @param {google.bigtable.v2.Type} message Type + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Type.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) { + object.bytesType = $root.google.bigtable.v2.Type.Bytes.toObject(message.bytesType, options); + if (options.oneofs) + object.kind = "bytesType"; + } + if (message.stringType != null && message.hasOwnProperty("stringType")) { + object.stringType = $root.google.bigtable.v2.Type.String.toObject(message.stringType, options); + if (options.oneofs) + object.kind = "stringType"; + } + if (message.arrayType != null && message.hasOwnProperty("arrayType")) { + object.arrayType = $root.google.bigtable.v2.Type.Array.toObject(message.arrayType, options); + if (options.oneofs) + object.kind = "arrayType"; + } + if (message.mapType != null && message.hasOwnProperty("mapType")) { + object.mapType = $root.google.bigtable.v2.Type.Map.toObject(message.mapType, options); + if (options.oneofs) + object.kind = "mapType"; + } + if (message.int64Type != null && message.hasOwnProperty("int64Type")) { + object.int64Type = $root.google.bigtable.v2.Type.Int64.toObject(message.int64Type, options); + if (options.oneofs) + object.kind = "int64Type"; + } + if (message.aggregateType != null && message.hasOwnProperty("aggregateType")) { + object.aggregateType = $root.google.bigtable.v2.Type.Aggregate.toObject(message.aggregateType, options); + if (options.oneofs) + object.kind = "aggregateType"; + } + if (message.structType != null && message.hasOwnProperty("structType")) { + object.structType = $root.google.bigtable.v2.Type.Struct.toObject(message.structType, options); + if (options.oneofs) + object.kind = "structType"; + } + if (message.boolType != null && message.hasOwnProperty("boolType")) { + object.boolType = $root.google.bigtable.v2.Type.Bool.toObject(message.boolType, options); + if (options.oneofs) + object.kind = "boolType"; + } + if (message.float64Type != null && message.hasOwnProperty("float64Type")) { + object.float64Type = $root.google.bigtable.v2.Type.Float64.toObject(message.float64Type, options); + if (options.oneofs) + object.kind = "float64Type"; + } + if (message.timestampType != null && message.hasOwnProperty("timestampType")) { + object.timestampType = $root.google.bigtable.v2.Type.Timestamp.toObject(message.timestampType, options); + if (options.oneofs) + object.kind = "timestampType"; + } + if (message.dateType != null && message.hasOwnProperty("dateType")) { + object.dateType = $root.google.bigtable.v2.Type.Date.toObject(message.dateType, options); + if (options.oneofs) + object.kind = "dateType"; + } + if (message.float32Type != null && message.hasOwnProperty("float32Type")) { + object.float32Type = $root.google.bigtable.v2.Type.Float32.toObject(message.float32Type, options); + if (options.oneofs) + object.kind = "float32Type"; + } + if (message.protoType != null && message.hasOwnProperty("protoType")) { + object.protoType = $root.google.bigtable.v2.Type.Proto.toObject(message.protoType, options); + if (options.oneofs) + object.kind = "protoType"; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + object.enumType = $root.google.bigtable.v2.Type.Enum.toObject(message.enumType, options); + if (options.oneofs) + object.kind = "enumType"; + } + return object; + }; + + /** + * Converts this Type to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type + * @instance + * @returns {Object.} JSON object + */ + Type.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Type + * @function getTypeUrl + * @memberof google.bigtable.v2.Type + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Type.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type"; + }; + + Type.Bytes = (function() { + + /** + * Properties of a Bytes. + * @memberof google.bigtable.v2.Type + * @interface IBytes + * @property {google.bigtable.v2.Type.Bytes.IEncoding|null} [encoding] Bytes encoding + */ + + /** + * Constructs a new Bytes. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Bytes. + * @implements IBytes + * @constructor + * @param {google.bigtable.v2.Type.IBytes=} [properties] Properties to set + */ + function Bytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bytes encoding. + * @member {google.bigtable.v2.Type.Bytes.IEncoding|null|undefined} encoding + * @memberof google.bigtable.v2.Type.Bytes + * @instance + */ + Bytes.prototype.encoding = null; + + /** + * Creates a new Bytes instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {google.bigtable.v2.Type.IBytes=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Bytes} Bytes instance + */ + Bytes.create = function create(properties) { + return new Bytes(properties); + }; + + /** + * Encodes the specified Bytes message. Does not implicitly {@link google.bigtable.v2.Type.Bytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {google.bigtable.v2.Type.IBytes} message Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.v2.Type.Bytes.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Bytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {google.bigtable.v2.Type.IBytes} message Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Bytes} Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Bytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.v2.Type.Bytes.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Bytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Bytes} Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bytes message. + * @function verify + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.v2.Type.Bytes.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a Bytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Bytes} Bytes + */ + Bytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Bytes) + return object; + var message = new $root.google.bigtable.v2.Type.Bytes(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.v2.Type.Bytes.encoding: object expected"); + message.encoding = $root.google.bigtable.v2.Type.Bytes.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a Bytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {google.bigtable.v2.Type.Bytes} message Bytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.v2.Type.Bytes.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Bytes to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Bytes + * @instance + * @returns {Object.} JSON object + */ + Bytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bytes + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Bytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Bytes"; + }; + + Bytes.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.v2.Type.Bytes + * @interface IEncoding + * @property {google.bigtable.v2.Type.Bytes.Encoding.IRaw|null} [raw] Encoding raw + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.v2.Type.Bytes + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.v2.Type.Bytes.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding raw. + * @member {google.bigtable.v2.Type.Bytes.Encoding.IRaw|null|undefined} raw + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @instance + */ + Encoding.prototype.raw = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"raw"|undefined} encoding + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["raw"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.v2.Type.Bytes.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Bytes.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.v2.Type.Bytes.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.raw != null && Object.hasOwnProperty.call(message, "raw")) + $root.google.bigtable.v2.Type.Bytes.Encoding.Raw.encode(message.raw, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.v2.Type.Bytes.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Bytes.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Bytes.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.raw = $root.google.bigtable.v2.Type.Bytes.Encoding.Raw.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Bytes.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.raw != null && message.hasOwnProperty("raw")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Bytes.Encoding.Raw.verify(message.raw); + if (error) + return "raw." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Bytes.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Bytes.Encoding) + return object; + var message = new $root.google.bigtable.v2.Type.Bytes.Encoding(); + if (object.raw != null) { + if (typeof object.raw !== "object") + throw TypeError(".google.bigtable.v2.Type.Bytes.Encoding.raw: object expected"); + message.raw = $root.google.bigtable.v2.Type.Bytes.Encoding.Raw.fromObject(object.raw); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {google.bigtable.v2.Type.Bytes.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.raw != null && message.hasOwnProperty("raw")) { + object.raw = $root.google.bigtable.v2.Type.Bytes.Encoding.Raw.toObject(message.raw, options); + if (options.oneofs) + object.encoding = "raw"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Bytes.Encoding"; + }; + + Encoding.Raw = (function() { + + /** + * Properties of a Raw. + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @interface IRaw + * @property {boolean|null} [escapeNulls] Raw escapeNulls + */ + + /** + * Constructs a new Raw. + * @memberof google.bigtable.v2.Type.Bytes.Encoding + * @classdesc Represents a Raw. + * @implements IRaw + * @constructor + * @param {google.bigtable.v2.Type.Bytes.Encoding.IRaw=} [properties] Properties to set + */ + function Raw(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Raw escapeNulls. + * @member {boolean} escapeNulls + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @instance + */ + Raw.prototype.escapeNulls = false; + + /** + * Creates a new Raw instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.v2.Type.Bytes.Encoding.IRaw=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Bytes.Encoding.Raw} Raw instance + */ + Raw.create = function create(properties) { + return new Raw(properties); + }; + + /** + * Encodes the specified Raw message. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.v2.Type.Bytes.Encoding.IRaw} message Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Raw.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.escapeNulls != null && Object.hasOwnProperty.call(message, "escapeNulls")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.escapeNulls); + return writer; + }; + + /** + * Encodes the specified Raw message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bytes.Encoding.Raw.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.v2.Type.Bytes.Encoding.IRaw} message Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Raw.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Raw message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Bytes.Encoding.Raw} Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Raw.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Bytes.Encoding.Raw(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.escapeNulls = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Raw message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Bytes.Encoding.Raw} Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Raw.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Raw message. + * @function verify + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Raw.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.escapeNulls != null && message.hasOwnProperty("escapeNulls")) + if (typeof message.escapeNulls !== "boolean") + return "escapeNulls: boolean expected"; + return null; + }; + + /** + * Creates a Raw message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Bytes.Encoding.Raw} Raw + */ + Raw.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Bytes.Encoding.Raw) + return object; + var message = new $root.google.bigtable.v2.Type.Bytes.Encoding.Raw(); + if (object.escapeNulls != null) + message.escapeNulls = Boolean(object.escapeNulls); + return message; + }; + + /** + * Creates a plain object from a Raw message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {google.bigtable.v2.Type.Bytes.Encoding.Raw} message Raw + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Raw.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.escapeNulls = false; + if (message.escapeNulls != null && message.hasOwnProperty("escapeNulls")) + object.escapeNulls = message.escapeNulls; + return object; + }; + + /** + * Converts this Raw to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @instance + * @returns {Object.} JSON object + */ + Raw.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Raw + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Bytes.Encoding.Raw + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Raw.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Bytes.Encoding.Raw"; + }; + + return Raw; + })(); + + return Encoding; + })(); + + return Bytes; + })(); + + Type.String = (function() { + + /** + * Properties of a String. + * @memberof google.bigtable.v2.Type + * @interface IString + * @property {google.bigtable.v2.Type.String.IEncoding|null} [encoding] String encoding + */ + + /** + * Constructs a new String. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a String. + * @implements IString + * @constructor + * @param {google.bigtable.v2.Type.IString=} [properties] Properties to set + */ + function String(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * String encoding. + * @member {google.bigtable.v2.Type.String.IEncoding|null|undefined} encoding + * @memberof google.bigtable.v2.Type.String + * @instance + */ + String.prototype.encoding = null; + + /** + * Creates a new String instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.String + * @static + * @param {google.bigtable.v2.Type.IString=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.String} String instance + */ + String.create = function create(properties) { + return new String(properties); + }; + + /** + * Encodes the specified String message. Does not implicitly {@link google.bigtable.v2.Type.String.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.String + * @static + * @param {google.bigtable.v2.Type.IString} message String message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + String.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.v2.Type.String.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified String message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.String + * @static + * @param {google.bigtable.v2.Type.IString} message String message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + String.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a String message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.String + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.String} String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + String.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.String(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.v2.Type.String.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a String message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.String + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.String} String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + String.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a String message. + * @function verify + * @memberof google.bigtable.v2.Type.String + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + String.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.v2.Type.String.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a String message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.String + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.String} String + */ + String.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.String) + return object; + var message = new $root.google.bigtable.v2.Type.String(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.v2.Type.String.encoding: object expected"); + message.encoding = $root.google.bigtable.v2.Type.String.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a String message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.String + * @static + * @param {google.bigtable.v2.Type.String} message String + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + String.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.v2.Type.String.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this String to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.String + * @instance + * @returns {Object.} JSON object + */ + String.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for String + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.String + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + String.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.String"; + }; + + String.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.v2.Type.String + * @interface IEncoding + * @property {google.bigtable.v2.Type.String.Encoding.IUtf8Raw|null} [utf8Raw] Encoding utf8Raw + * @property {google.bigtable.v2.Type.String.Encoding.IUtf8Bytes|null} [utf8Bytes] Encoding utf8Bytes + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.v2.Type.String + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.v2.Type.String.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding utf8Raw. + * @member {google.bigtable.v2.Type.String.Encoding.IUtf8Raw|null|undefined} utf8Raw + * @memberof google.bigtable.v2.Type.String.Encoding + * @instance + */ + Encoding.prototype.utf8Raw = null; + + /** + * Encoding utf8Bytes. + * @member {google.bigtable.v2.Type.String.Encoding.IUtf8Bytes|null|undefined} utf8Bytes + * @memberof google.bigtable.v2.Type.String.Encoding + * @instance + */ + Encoding.prototype.utf8Bytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"utf8Raw"|"utf8Bytes"|undefined} encoding + * @memberof google.bigtable.v2.Type.String.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["utf8Raw", "utf8Bytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {google.bigtable.v2.Type.String.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.String.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {google.bigtable.v2.Type.String.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.utf8Raw != null && Object.hasOwnProperty.call(message, "utf8Raw")) + $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw.encode(message.utf8Raw, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.utf8Bytes != null && Object.hasOwnProperty.call(message, "utf8Bytes")) + $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.encode(message.utf8Bytes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {google.bigtable.v2.Type.String.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.String.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.String.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.utf8Raw = $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw.decode(reader, reader.uint32()); + break; + } + case 2: { + message.utf8Bytes = $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.String.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.utf8Raw != null && message.hasOwnProperty("utf8Raw")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw.verify(message.utf8Raw); + if (error) + return "utf8Raw." + error; + } + } + if (message.utf8Bytes != null && message.hasOwnProperty("utf8Bytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.verify(message.utf8Bytes); + if (error) + return "utf8Bytes." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.String.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.String.Encoding) + return object; + var message = new $root.google.bigtable.v2.Type.String.Encoding(); + if (object.utf8Raw != null) { + if (typeof object.utf8Raw !== "object") + throw TypeError(".google.bigtable.v2.Type.String.Encoding.utf8Raw: object expected"); + message.utf8Raw = $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw.fromObject(object.utf8Raw); + } + if (object.utf8Bytes != null) { + if (typeof object.utf8Bytes !== "object") + throw TypeError(".google.bigtable.v2.Type.String.Encoding.utf8Bytes: object expected"); + message.utf8Bytes = $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.fromObject(object.utf8Bytes); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {google.bigtable.v2.Type.String.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.utf8Raw != null && message.hasOwnProperty("utf8Raw")) { + object.utf8Raw = $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw.toObject(message.utf8Raw, options); + if (options.oneofs) + object.encoding = "utf8Raw"; + } + if (message.utf8Bytes != null && message.hasOwnProperty("utf8Bytes")) { + object.utf8Bytes = $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.toObject(message.utf8Bytes, options); + if (options.oneofs) + object.encoding = "utf8Bytes"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.String.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.String.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.String.Encoding"; + }; + + Encoding.Utf8Raw = (function() { + + /** + * Properties of an Utf8Raw. + * @memberof google.bigtable.v2.Type.String.Encoding + * @interface IUtf8Raw + */ + + /** + * Constructs a new Utf8Raw. + * @memberof google.bigtable.v2.Type.String.Encoding + * @classdesc Represents an Utf8Raw. + * @implements IUtf8Raw + * @constructor + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Raw=} [properties] Properties to set + */ + function Utf8Raw(properties) { + if (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 Utf8Raw instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Raw=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Raw} Utf8Raw instance + */ + Utf8Raw.create = function create(properties) { + return new Utf8Raw(properties); + }; + + /** + * Encodes the specified Utf8Raw message. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Raw} message Utf8Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Raw.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Utf8Raw message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Raw.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Raw} message Utf8Raw message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Raw.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Raw} Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Raw.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Utf8Raw message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Raw} Utf8Raw + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Raw.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Utf8Raw message. + * @function verify + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Utf8Raw.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Utf8Raw message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Raw} Utf8Raw + */ + Utf8Raw.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw) + return object; + return new $root.google.bigtable.v2.Type.String.Encoding.Utf8Raw(); + }; + + /** + * Creates a plain object from an Utf8Raw message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {google.bigtable.v2.Type.String.Encoding.Utf8Raw} message Utf8Raw + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Utf8Raw.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Utf8Raw to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @instance + * @returns {Object.} JSON object + */ + Utf8Raw.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Utf8Raw + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Raw + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Utf8Raw.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.String.Encoding.Utf8Raw"; + }; + + return Utf8Raw; + })(); + + Encoding.Utf8Bytes = (function() { + + /** + * Properties of an Utf8Bytes. + * @memberof google.bigtable.v2.Type.String.Encoding + * @interface IUtf8Bytes + * @property {string|null} [nullEscapeChar] Utf8Bytes nullEscapeChar + */ + + /** + * Constructs a new Utf8Bytes. + * @memberof google.bigtable.v2.Type.String.Encoding + * @classdesc Represents an Utf8Bytes. + * @implements IUtf8Bytes + * @constructor + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Bytes=} [properties] Properties to set + */ + function Utf8Bytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Utf8Bytes nullEscapeChar. + * @member {string} nullEscapeChar + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @instance + */ + Utf8Bytes.prototype.nullEscapeChar = ""; + + /** + * Creates a new Utf8Bytes instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Bytes=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes instance + */ + Utf8Bytes.create = function create(properties) { + return new Utf8Bytes(properties); + }; + + /** + * Encodes the specified Utf8Bytes message. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Bytes} message Utf8Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Bytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullEscapeChar != null && Object.hasOwnProperty.call(message, "nullEscapeChar")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nullEscapeChar); + return writer; + }; + + /** + * Encodes the specified Utf8Bytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.String.Encoding.Utf8Bytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.v2.Type.String.Encoding.IUtf8Bytes} message Utf8Bytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Utf8Bytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Bytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nullEscapeChar = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Utf8Bytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Utf8Bytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Utf8Bytes message. + * @function verify + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Utf8Bytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nullEscapeChar != null && message.hasOwnProperty("nullEscapeChar")) + if (!$util.isString(message.nullEscapeChar)) + return "nullEscapeChar: string expected"; + return null; + }; + + /** + * Creates an Utf8Bytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.String.Encoding.Utf8Bytes} Utf8Bytes + */ + Utf8Bytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) + return object; + var message = new $root.google.bigtable.v2.Type.String.Encoding.Utf8Bytes(); + if (object.nullEscapeChar != null) + message.nullEscapeChar = String(object.nullEscapeChar); + return message; + }; + + /** + * Creates a plain object from an Utf8Bytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {google.bigtable.v2.Type.String.Encoding.Utf8Bytes} message Utf8Bytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Utf8Bytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.nullEscapeChar = ""; + if (message.nullEscapeChar != null && message.hasOwnProperty("nullEscapeChar")) + object.nullEscapeChar = message.nullEscapeChar; + return object; + }; + + /** + * Converts this Utf8Bytes to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @instance + * @returns {Object.} JSON object + */ + Utf8Bytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Utf8Bytes + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.String.Encoding.Utf8Bytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Utf8Bytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.String.Encoding.Utf8Bytes"; + }; + + return Utf8Bytes; + })(); + + return Encoding; + })(); + + return String; + })(); + + Type.Int64 = (function() { + + /** + * Properties of an Int64. + * @memberof google.bigtable.v2.Type + * @interface IInt64 + * @property {google.bigtable.v2.Type.Int64.IEncoding|null} [encoding] Int64 encoding + */ + + /** + * Constructs a new Int64. + * @memberof google.bigtable.v2.Type + * @classdesc Represents an Int64. + * @implements IInt64 + * @constructor + * @param {google.bigtable.v2.Type.IInt64=} [properties] Properties to set + */ + function Int64(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64 encoding. + * @member {google.bigtable.v2.Type.Int64.IEncoding|null|undefined} encoding + * @memberof google.bigtable.v2.Type.Int64 + * @instance + */ + Int64.prototype.encoding = null; + + /** + * Creates a new Int64 instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {google.bigtable.v2.Type.IInt64=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Int64} Int64 instance + */ + Int64.create = function create(properties) { + return new Int64(properties); + }; + + /** + * Encodes the specified Int64 message. Does not implicitly {@link google.bigtable.v2.Type.Int64.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {google.bigtable.v2.Type.IInt64} message Int64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.v2.Type.Int64.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Int64 message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {google.bigtable.v2.Type.IInt64} message Int64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64 message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Int64} Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Int64(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.v2.Type.Int64.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Int64} Int64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64 message. + * @function verify + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.v2.Type.Int64.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates an Int64 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Int64} Int64 + */ + Int64.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Int64) + return object; + var message = new $root.google.bigtable.v2.Type.Int64(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.v2.Type.Int64.encoding: object expected"); + message.encoding = $root.google.bigtable.v2.Type.Int64.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from an Int64 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {google.bigtable.v2.Type.Int64} message Int64 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.v2.Type.Int64.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Int64 to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Int64 + * @instance + * @returns {Object.} JSON object + */ + Int64.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64 + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Int64 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Int64"; + }; + + Int64.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.v2.Type.Int64 + * @interface IEncoding + * @property {google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes|null} [bigEndianBytes] Encoding bigEndianBytes + * @property {google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes|null} [orderedCodeBytes] Encoding orderedCodeBytes + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.v2.Type.Int64 + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.v2.Type.Int64.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding bigEndianBytes. + * @member {google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes|null|undefined} bigEndianBytes + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @instance + */ + Encoding.prototype.bigEndianBytes = null; + + /** + * Encoding orderedCodeBytes. + * @member {google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes|null|undefined} orderedCodeBytes + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @instance + */ + Encoding.prototype.orderedCodeBytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"bigEndianBytes"|"orderedCodeBytes"|undefined} encoding + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["bigEndianBytes", "orderedCodeBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.v2.Type.Int64.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Int64.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.v2.Type.Int64.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigEndianBytes != null && Object.hasOwnProperty.call(message, "bigEndianBytes")) + $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.encode(message.bigEndianBytes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.orderedCodeBytes != null && Object.hasOwnProperty.call(message, "orderedCodeBytes")) + $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.encode(message.orderedCodeBytes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.v2.Type.Int64.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Int64.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Int64.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bigEndianBytes = $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.decode(reader, reader.uint32()); + break; + } + case 2: { + message.orderedCodeBytes = $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Int64.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bigEndianBytes != null && message.hasOwnProperty("bigEndianBytes")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.verify(message.bigEndianBytes); + if (error) + return "bigEndianBytes." + error; + } + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.verify(message.orderedCodeBytes); + if (error) + return "orderedCodeBytes." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Int64.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Int64.Encoding) + return object; + var message = new $root.google.bigtable.v2.Type.Int64.Encoding(); + if (object.bigEndianBytes != null) { + if (typeof object.bigEndianBytes !== "object") + throw TypeError(".google.bigtable.v2.Type.Int64.Encoding.bigEndianBytes: object expected"); + message.bigEndianBytes = $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.fromObject(object.bigEndianBytes); + } + if (object.orderedCodeBytes != null) { + if (typeof object.orderedCodeBytes !== "object") + throw TypeError(".google.bigtable.v2.Type.Int64.Encoding.orderedCodeBytes: object expected"); + message.orderedCodeBytes = $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.fromObject(object.orderedCodeBytes); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bigEndianBytes != null && message.hasOwnProperty("bigEndianBytes")) { + object.bigEndianBytes = $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.toObject(message.bigEndianBytes, options); + if (options.oneofs) + object.encoding = "bigEndianBytes"; + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + object.orderedCodeBytes = $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.toObject(message.orderedCodeBytes, options); + if (options.oneofs) + object.encoding = "orderedCodeBytes"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Int64.Encoding"; + }; + + Encoding.BigEndianBytes = (function() { + + /** + * Properties of a BigEndianBytes. + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @interface IBigEndianBytes + * @property {google.bigtable.v2.Type.IBytes|null} [bytesType] BigEndianBytes bytesType + */ + + /** + * Constructs a new BigEndianBytes. + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @classdesc Represents a BigEndianBytes. + * @implements IBigEndianBytes + * @constructor + * @param {google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes=} [properties] Properties to set + */ + function BigEndianBytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigEndianBytes bytesType. + * @member {google.bigtable.v2.Type.IBytes|null|undefined} bytesType + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @instance + */ + BigEndianBytes.prototype.bytesType = null; + + /** + * Creates a new BigEndianBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes instance + */ + BigEndianBytes.create = function create(properties) { + return new BigEndianBytes(properties); + }; + + /** + * Encodes the specified BigEndianBytes message. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes} message BigEndianBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigEndianBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesType != null && Object.hasOwnProperty.call(message, "bytesType")) + $root.google.bigtable.v2.Type.Bytes.encode(message.bytesType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BigEndianBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.IBigEndianBytes} message BigEndianBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigEndianBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigEndianBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bytesType = $root.google.bigtable.v2.Type.Bytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigEndianBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigEndianBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigEndianBytes message. + * @function verify + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigEndianBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) { + var error = $root.google.bigtable.v2.Type.Bytes.verify(message.bytesType); + if (error) + return "bytesType." + error; + } + return null; + }; + + /** + * Creates a BigEndianBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes} BigEndianBytes + */ + BigEndianBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) + return object; + var message = new $root.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes(); + if (object.bytesType != null) { + if (typeof object.bytesType !== "object") + throw TypeError(".google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.bytesType: object expected"); + message.bytesType = $root.google.bigtable.v2.Type.Bytes.fromObject(object.bytesType); + } + return message; + }; + + /** + * Creates a plain object from a BigEndianBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes} message BigEndianBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigEndianBytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.bytesType = null; + if (message.bytesType != null && message.hasOwnProperty("bytesType")) + object.bytesType = $root.google.bigtable.v2.Type.Bytes.toObject(message.bytesType, options); + return object; + }; + + /** + * Converts this BigEndianBytes to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @instance + * @returns {Object.} JSON object + */ + BigEndianBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigEndianBytes + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigEndianBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes"; + }; + + return BigEndianBytes; + })(); + + Encoding.OrderedCodeBytes = (function() { + + /** + * Properties of an OrderedCodeBytes. + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @interface IOrderedCodeBytes + */ + + /** + * Constructs a new OrderedCodeBytes. + * @memberof google.bigtable.v2.Type.Int64.Encoding + * @classdesc Represents an OrderedCodeBytes. + * @implements IOrderedCodeBytes + * @constructor + * @param {google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes=} [properties] Properties to set + */ + function OrderedCodeBytes(properties) { + if (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 OrderedCodeBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes instance + */ + OrderedCodeBytes.create = function create(properties) { + return new OrderedCodeBytes(properties); + }; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrderedCodeBytes message. + * @function verify + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrderedCodeBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes} OrderedCodeBytes + */ + OrderedCodeBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) + return object; + return new $root.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes(); + }; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes} message OrderedCodeBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrderedCodeBytes.toObject = function toObject() { + return {}; + }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @instance + * @returns {Object.} JSON object + */ + OrderedCodeBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrderedCodeBytes + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrderedCodeBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes"; + }; + + return OrderedCodeBytes; + })(); + + return Encoding; + })(); + + return Int64; + })(); + + Type.Bool = (function() { + + /** + * Properties of a Bool. + * @memberof google.bigtable.v2.Type + * @interface IBool + */ + + /** + * Constructs a new Bool. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Bool. + * @implements IBool + * @constructor + * @param {google.bigtable.v2.Type.IBool=} [properties] Properties to set + */ + function Bool(properties) { + if (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 Bool instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {google.bigtable.v2.Type.IBool=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Bool} Bool instance + */ + Bool.create = function create(properties) { + return new Bool(properties); + }; + + /** + * Encodes the specified Bool message. Does not implicitly {@link google.bigtable.v2.Type.Bool.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {google.bigtable.v2.Type.IBool} message Bool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Bool message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Bool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {google.bigtable.v2.Type.IBool} message Bool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bool message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Bool} Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Bool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Bool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Bool} Bool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bool message. + * @function verify + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Bool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Bool} Bool + */ + Bool.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Bool) + return object; + return new $root.google.bigtable.v2.Type.Bool(); + }; + + /** + * Creates a plain object from a Bool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {google.bigtable.v2.Type.Bool} message Bool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bool.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Bool to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Bool + * @instance + * @returns {Object.} JSON object + */ + Bool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bool + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Bool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Bool"; + }; + + return Bool; + })(); + + Type.Float32 = (function() { + + /** + * Properties of a Float32. + * @memberof google.bigtable.v2.Type + * @interface IFloat32 + */ + + /** + * Constructs a new Float32. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Float32. + * @implements IFloat32 + * @constructor + * @param {google.bigtable.v2.Type.IFloat32=} [properties] Properties to set + */ + function Float32(properties) { + if (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 Float32 instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {google.bigtable.v2.Type.IFloat32=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Float32} Float32 instance + */ + Float32.create = function create(properties) { + return new Float32(properties); + }; + + /** + * Encodes the specified Float32 message. Does not implicitly {@link google.bigtable.v2.Type.Float32.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {google.bigtable.v2.Type.IFloat32} message Float32 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float32.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Float32 message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Float32.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {google.bigtable.v2.Type.IFloat32} message Float32 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float32.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Float32 message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Float32} Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float32.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Float32(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Float32 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Float32} Float32 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float32.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Float32 message. + * @function verify + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Float32.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Float32 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Float32} Float32 + */ + Float32.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Float32) + return object; + return new $root.google.bigtable.v2.Type.Float32(); + }; + + /** + * Creates a plain object from a Float32 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {google.bigtable.v2.Type.Float32} message Float32 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Float32.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Float32 to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Float32 + * @instance + * @returns {Object.} JSON object + */ + Float32.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Float32 + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Float32 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Float32.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Float32"; + }; + + return Float32; + })(); + + Type.Float64 = (function() { + + /** + * Properties of a Float64. + * @memberof google.bigtable.v2.Type + * @interface IFloat64 + */ + + /** + * Constructs a new Float64. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Float64. + * @implements IFloat64 + * @constructor + * @param {google.bigtable.v2.Type.IFloat64=} [properties] Properties to set + */ + function Float64(properties) { + if (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 Float64 instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {google.bigtable.v2.Type.IFloat64=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Float64} Float64 instance + */ + Float64.create = function create(properties) { + return new Float64(properties); + }; + + /** + * Encodes the specified Float64 message. Does not implicitly {@link google.bigtable.v2.Type.Float64.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {google.bigtable.v2.Type.IFloat64} message Float64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float64.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Float64 message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Float64.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {google.bigtable.v2.Type.IFloat64} message Float64 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float64.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Float64 message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Float64} Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float64.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Float64(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Float64 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Float64} Float64 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float64.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Float64 message. + * @function verify + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Float64.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Float64 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Float64} Float64 + */ + Float64.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Float64) + return object; + return new $root.google.bigtable.v2.Type.Float64(); + }; + + /** + * Creates a plain object from a Float64 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {google.bigtable.v2.Type.Float64} message Float64 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Float64.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Float64 to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Float64 + * @instance + * @returns {Object.} JSON object + */ + Float64.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Float64 + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Float64 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Float64.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Float64"; + }; + + return Float64; + })(); + + Type.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.bigtable.v2.Type + * @interface ITimestamp + * @property {google.bigtable.v2.Type.Timestamp.IEncoding|null} [encoding] Timestamp encoding + */ + + /** + * Constructs a new Timestamp. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.bigtable.v2.Type.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 encoding. + * @member {google.bigtable.v2.Type.Timestamp.IEncoding|null|undefined} encoding + * @memberof google.bigtable.v2.Type.Timestamp + * @instance + */ + Timestamp.prototype.encoding = null; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Timestamp + * @static + * @param {google.bigtable.v2.Type.ITimestamp=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.bigtable.v2.Type.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Timestamp + * @static + * @param {google.bigtable.v2.Type.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.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.v2.Type.Timestamp.Encoding.encode(message.encoding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Timestamp + * @static + * @param {google.bigtable.v2.Type.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.bigtable.v2.Type.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = $root.google.bigtable.v2.Type.Timestamp.Encoding.decode(reader, reader.uint32()); + 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.bigtable.v2.Type.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.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.bigtable.v2.Type.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.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.v2.Type.Timestamp.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Timestamp) + return object; + var message = new $root.google.bigtable.v2.Type.Timestamp(); + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.v2.Type.Timestamp.encoding: object expected"); + message.encoding = $root.google.bigtable.v2.Type.Timestamp.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Timestamp + * @static + * @param {google.bigtable.v2.Type.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) + object.encoding = null; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.v2.Type.Timestamp.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Timestamp"; + }; + + Timestamp.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.v2.Type.Timestamp + * @interface IEncoding + * @property {google.bigtable.v2.Type.Int64.IEncoding|null} [unixMicrosInt64] Encoding unixMicrosInt64 + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.v2.Type.Timestamp + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.v2.Type.Timestamp.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding unixMicrosInt64. + * @member {google.bigtable.v2.Type.Int64.IEncoding|null|undefined} unixMicrosInt64 + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @instance + */ + Encoding.prototype.unixMicrosInt64 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"unixMicrosInt64"|undefined} encoding + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["unixMicrosInt64"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.v2.Type.Timestamp.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Timestamp.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.v2.Type.Timestamp.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unixMicrosInt64 != null && Object.hasOwnProperty.call(message, "unixMicrosInt64")) + $root.google.bigtable.v2.Type.Int64.Encoding.encode(message.unixMicrosInt64, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Timestamp.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.v2.Type.Timestamp.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Timestamp.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Timestamp.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.unixMicrosInt64 = $root.google.bigtable.v2.Type.Int64.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Timestamp.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.unixMicrosInt64 != null && message.hasOwnProperty("unixMicrosInt64")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Int64.Encoding.verify(message.unixMicrosInt64); + if (error) + return "unixMicrosInt64." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Timestamp.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Timestamp.Encoding) + return object; + var message = new $root.google.bigtable.v2.Type.Timestamp.Encoding(); + if (object.unixMicrosInt64 != null) { + if (typeof object.unixMicrosInt64 !== "object") + throw TypeError(".google.bigtable.v2.Type.Timestamp.Encoding.unixMicrosInt64: object expected"); + message.unixMicrosInt64 = $root.google.bigtable.v2.Type.Int64.Encoding.fromObject(object.unixMicrosInt64); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {google.bigtable.v2.Type.Timestamp.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.unixMicrosInt64 != null && message.hasOwnProperty("unixMicrosInt64")) { + object.unixMicrosInt64 = $root.google.bigtable.v2.Type.Int64.Encoding.toObject(message.unixMicrosInt64, options); + if (options.oneofs) + object.encoding = "unixMicrosInt64"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Timestamp.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Timestamp.Encoding"; + }; + + return Encoding; + })(); + + return Timestamp; + })(); + + Type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.bigtable.v2.Type + * @interface IDate + */ + + /** + * Constructs a new Date. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.bigtable.v2.Type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {google.bigtable.v2.Type.IDate=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.bigtable.v2.Type.Date.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {google.bigtable.v2.Type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {google.bigtable.v2.Type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Date) + return object; + return new $root.google.bigtable.v2.Type.Date(); + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {google.bigtable.v2.Type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Date"; + }; + + return Date; + })(); + + Type.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.bigtable.v2.Type + * @interface IStruct + * @property {Array.|null} [fields] Struct fields + * @property {google.bigtable.v2.Type.Struct.IEncoding|null} [encoding] Struct encoding + */ + + /** + * Constructs a new Struct. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.bigtable.v2.Type.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Array.} fields + * @memberof google.bigtable.v2.Type.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyArray; + + /** + * Struct encoding. + * @member {google.bigtable.v2.Type.Struct.IEncoding|null|undefined} encoding + * @memberof google.bigtable.v2.Type.Struct + * @instance + */ + Struct.prototype.encoding = null; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {google.bigtable.v2.Type.IStruct=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.bigtable.v2.Type.Struct.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {google.bigtable.v2.Type.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.bigtable.v2.Type.Struct.Field.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + $root.google.bigtable.v2.Type.Struct.Encoding.encode(message.encoding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {google.bigtable.v2.Type.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Struct(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.bigtable.v2.Type.Struct.Field.decode(reader, reader.uint32())); + break; + } + case 2: { + message.encoding = $root.google.bigtable.v2.Type.Struct.Encoding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.bigtable.v2.Type.Struct.Field.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + if (message.encoding != null && message.hasOwnProperty("encoding")) { + var error = $root.google.bigtable.v2.Type.Struct.Encoding.verify(message.encoding); + if (error) + return "encoding." + error; + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Struct) + return object; + var message = new $root.google.bigtable.v2.Type.Struct(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.bigtable.v2.Type.Struct.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.bigtable.v2.Type.Struct.fields: object expected"); + message.fields[i] = $root.google.bigtable.v2.Type.Struct.Field.fromObject(object.fields[i]); + } + } + if (object.encoding != null) { + if (typeof object.encoding !== "object") + throw TypeError(".google.bigtable.v2.Type.Struct.encoding: object expected"); + message.encoding = $root.google.bigtable.v2.Type.Struct.Encoding.fromObject(object.encoding); + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {google.bigtable.v2.Type.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) + object.encoding = null; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.bigtable.v2.Type.Struct.Field.toObject(message.fields[j], options); + } + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = $root.google.bigtable.v2.Type.Struct.Encoding.toObject(message.encoding, options); + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Struct"; + }; + + Struct.Field = (function() { + + /** + * Properties of a Field. + * @memberof google.bigtable.v2.Type.Struct + * @interface IField + * @property {string|null} [fieldName] Field fieldName + * @property {google.bigtable.v2.IType|null} [type] Field type + */ + + /** + * Constructs a new Field. + * @memberof google.bigtable.v2.Type.Struct + * @classdesc Represents a Field. + * @implements IField + * @constructor + * @param {google.bigtable.v2.Type.Struct.IField=} [properties] Properties to set + */ + function Field(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Field fieldName. + * @member {string} fieldName + * @memberof google.bigtable.v2.Type.Struct.Field + * @instance + */ + Field.prototype.fieldName = ""; + + /** + * Field type. + * @member {google.bigtable.v2.IType|null|undefined} type + * @memberof google.bigtable.v2.Type.Struct.Field + * @instance + */ + Field.prototype.type = null; + + /** + * Creates a new Field instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {google.bigtable.v2.Type.Struct.IField=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Struct.Field} Field instance + */ + Field.create = function create(properties) { + return new Field(properties); + }; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Field.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {google.bigtable.v2.Type.Struct.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.bigtable.v2.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Field.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {google.bigtable.v2.Type.Struct.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Field message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Struct.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Struct.Field(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 2: { + message.type = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Struct.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Field message. + * @function verify + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Field.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.bigtable.v2.Type.verify(message.type); + if (error) + return "type." + error; + } + return null; + }; + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Struct.Field} Field + */ + Field.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Struct.Field) + return object; + var message = new $root.google.bigtable.v2.Type.Struct.Field(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.bigtable.v2.Type.Struct.Field.type: object expected"); + message.type = $root.google.bigtable.v2.Type.fromObject(object.type); + } + return message; + }; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {google.bigtable.v2.Type.Struct.Field} message Field + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Field.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldName = ""; + object.type = null; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.bigtable.v2.Type.toObject(message.type, options); + return object; + }; + + /** + * Converts this Field to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Struct.Field + * @instance + * @returns {Object.} JSON object + */ + Field.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Field + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Struct.Field + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Struct.Field"; + }; + + return Field; + })(); + + Struct.Encoding = (function() { + + /** + * Properties of an Encoding. + * @memberof google.bigtable.v2.Type.Struct + * @interface IEncoding + * @property {google.bigtable.v2.Type.Struct.Encoding.ISingleton|null} [singleton] Encoding singleton + * @property {google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes|null} [delimitedBytes] Encoding delimitedBytes + * @property {google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes|null} [orderedCodeBytes] Encoding orderedCodeBytes + */ + + /** + * Constructs a new Encoding. + * @memberof google.bigtable.v2.Type.Struct + * @classdesc Represents an Encoding. + * @implements IEncoding + * @constructor + * @param {google.bigtable.v2.Type.Struct.IEncoding=} [properties] Properties to set + */ + function Encoding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encoding singleton. + * @member {google.bigtable.v2.Type.Struct.Encoding.ISingleton|null|undefined} singleton + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @instance + */ + Encoding.prototype.singleton = null; + + /** + * Encoding delimitedBytes. + * @member {google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes|null|undefined} delimitedBytes + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @instance + */ + Encoding.prototype.delimitedBytes = null; + + /** + * Encoding orderedCodeBytes. + * @member {google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes|null|undefined} orderedCodeBytes + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @instance + */ + Encoding.prototype.orderedCodeBytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Encoding encoding. + * @member {"singleton"|"delimitedBytes"|"orderedCodeBytes"|undefined} encoding + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @instance + */ + Object.defineProperty(Encoding.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["singleton", "delimitedBytes", "orderedCodeBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encoding instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.v2.Type.Struct.IEncoding=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Struct.Encoding} Encoding instance + */ + Encoding.create = function create(properties) { + return new Encoding(properties); + }; + + /** + * Encodes the specified Encoding message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.v2.Type.Struct.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.singleton != null && Object.hasOwnProperty.call(message, "singleton")) + $root.google.bigtable.v2.Type.Struct.Encoding.Singleton.encode(message.singleton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.delimitedBytes != null && Object.hasOwnProperty.call(message, "delimitedBytes")) + $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.encode(message.delimitedBytes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.orderedCodeBytes != null && Object.hasOwnProperty.call(message, "orderedCodeBytes")) + $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.encode(message.orderedCodeBytes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encoding message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.v2.Type.Struct.IEncoding} message Encoding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encoding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encoding message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Struct.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Struct.Encoding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.singleton = $root.google.bigtable.v2.Type.Struct.Encoding.Singleton.decode(reader, reader.uint32()); + break; + } + case 2: { + message.delimitedBytes = $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.decode(reader, reader.uint32()); + break; + } + case 3: { + message.orderedCodeBytes = $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encoding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Struct.Encoding} Encoding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encoding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encoding message. + * @function verify + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encoding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.singleton != null && message.hasOwnProperty("singleton")) { + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Struct.Encoding.Singleton.verify(message.singleton); + if (error) + return "singleton." + error; + } + } + if (message.delimitedBytes != null && message.hasOwnProperty("delimitedBytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.verify(message.delimitedBytes); + if (error) + return "delimitedBytes." + error; + } + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + if (properties.encoding === 1) + return "encoding: multiple values"; + properties.encoding = 1; + { + var error = $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.verify(message.orderedCodeBytes); + if (error) + return "orderedCodeBytes." + error; + } + } + return null; + }; + + /** + * Creates an Encoding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Struct.Encoding} Encoding + */ + Encoding.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Struct.Encoding) + return object; + var message = new $root.google.bigtable.v2.Type.Struct.Encoding(); + if (object.singleton != null) { + if (typeof object.singleton !== "object") + throw TypeError(".google.bigtable.v2.Type.Struct.Encoding.singleton: object expected"); + message.singleton = $root.google.bigtable.v2.Type.Struct.Encoding.Singleton.fromObject(object.singleton); + } + if (object.delimitedBytes != null) { + if (typeof object.delimitedBytes !== "object") + throw TypeError(".google.bigtable.v2.Type.Struct.Encoding.delimitedBytes: object expected"); + message.delimitedBytes = $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.fromObject(object.delimitedBytes); + } + if (object.orderedCodeBytes != null) { + if (typeof object.orderedCodeBytes !== "object") + throw TypeError(".google.bigtable.v2.Type.Struct.Encoding.orderedCodeBytes: object expected"); + message.orderedCodeBytes = $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.fromObject(object.orderedCodeBytes); + } + return message; + }; + + /** + * Creates a plain object from an Encoding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding} message Encoding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encoding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.singleton != null && message.hasOwnProperty("singleton")) { + object.singleton = $root.google.bigtable.v2.Type.Struct.Encoding.Singleton.toObject(message.singleton, options); + if (options.oneofs) + object.encoding = "singleton"; + } + if (message.delimitedBytes != null && message.hasOwnProperty("delimitedBytes")) { + object.delimitedBytes = $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.toObject(message.delimitedBytes, options); + if (options.oneofs) + object.encoding = "delimitedBytes"; + } + if (message.orderedCodeBytes != null && message.hasOwnProperty("orderedCodeBytes")) { + object.orderedCodeBytes = $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.toObject(message.orderedCodeBytes, options); + if (options.oneofs) + object.encoding = "orderedCodeBytes"; + } + return object; + }; + + /** + * Converts this Encoding to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @instance + * @returns {Object.} JSON object + */ + Encoding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encoding + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encoding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Struct.Encoding"; + }; + + Encoding.Singleton = (function() { + + /** + * Properties of a Singleton. + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @interface ISingleton + */ + + /** + * Constructs a new Singleton. + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @classdesc Represents a Singleton. + * @implements ISingleton + * @constructor + * @param {google.bigtable.v2.Type.Struct.Encoding.ISingleton=} [properties] Properties to set + */ + function Singleton(properties) { + if (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 Singleton instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.ISingleton=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Struct.Encoding.Singleton} Singleton instance + */ + Singleton.create = function create(properties) { + return new Singleton(properties); + }; + + /** + * Encodes the specified Singleton message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.ISingleton} message Singleton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Singleton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Singleton message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.Singleton.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.ISingleton} message Singleton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Singleton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Singleton message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Struct.Encoding.Singleton} Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Singleton.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Struct.Encoding.Singleton(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Singleton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Struct.Encoding.Singleton} Singleton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Singleton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Singleton message. + * @function verify + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Singleton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Singleton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Struct.Encoding.Singleton} Singleton + */ + Singleton.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Struct.Encoding.Singleton) + return object; + return new $root.google.bigtable.v2.Type.Struct.Encoding.Singleton(); + }; + + /** + * Creates a plain object from a Singleton message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.Singleton} message Singleton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Singleton.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Singleton to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @instance + * @returns {Object.} JSON object + */ + Singleton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Singleton + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Struct.Encoding.Singleton + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Singleton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Struct.Encoding.Singleton"; + }; + + return Singleton; + })(); + + Encoding.DelimitedBytes = (function() { + + /** + * Properties of a DelimitedBytes. + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @interface IDelimitedBytes + * @property {Uint8Array|null} [delimiter] DelimitedBytes delimiter + */ + + /** + * Constructs a new DelimitedBytes. + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @classdesc Represents a DelimitedBytes. + * @implements IDelimitedBytes + * @constructor + * @param {google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes=} [properties] Properties to set + */ + function DelimitedBytes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DelimitedBytes delimiter. + * @member {Uint8Array} delimiter + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @instance + */ + DelimitedBytes.prototype.delimiter = $util.newBuffer([]); + + /** + * Creates a new DelimitedBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes instance + */ + DelimitedBytes.create = function create(properties) { + return new DelimitedBytes(properties); + }; + + /** + * Encodes the specified DelimitedBytes message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes} message DelimitedBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelimitedBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.delimiter); + return writer; + }; + + /** + * Encodes the specified DelimitedBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.IDelimitedBytes} message DelimitedBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DelimitedBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelimitedBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.delimiter = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DelimitedBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DelimitedBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DelimitedBytes message. + * @function verify + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DelimitedBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + if (!(message.delimiter && typeof message.delimiter.length === "number" || $util.isString(message.delimiter))) + return "delimiter: buffer expected"; + return null; + }; + + /** + * Creates a DelimitedBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes} DelimitedBytes + */ + DelimitedBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) + return object; + var message = new $root.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes(); + if (object.delimiter != null) + if (typeof object.delimiter === "string") + $util.base64.decode(object.delimiter, message.delimiter = $util.newBuffer($util.base64.length(object.delimiter)), 0); + else if (object.delimiter.length >= 0) + message.delimiter = object.delimiter; + return message; + }; + + /** + * Creates a plain object from a DelimitedBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes} message DelimitedBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DelimitedBytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.delimiter = ""; + else { + object.delimiter = []; + if (options.bytes !== Array) + object.delimiter = $util.newBuffer(object.delimiter); + } + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + object.delimiter = options.bytes === String ? $util.base64.encode(message.delimiter, 0, message.delimiter.length) : options.bytes === Array ? Array.prototype.slice.call(message.delimiter) : message.delimiter; + return object; + }; + + /** + * Converts this DelimitedBytes to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @instance + * @returns {Object.} JSON object + */ + DelimitedBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DelimitedBytes + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DelimitedBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes"; + }; + + return DelimitedBytes; + })(); + + Encoding.OrderedCodeBytes = (function() { + + /** + * Properties of an OrderedCodeBytes. + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @interface IOrderedCodeBytes + */ + + /** + * Constructs a new OrderedCodeBytes. + * @memberof google.bigtable.v2.Type.Struct.Encoding + * @classdesc Represents an OrderedCodeBytes. + * @implements IOrderedCodeBytes + * @constructor + * @param {google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes=} [properties] Properties to set + */ + function OrderedCodeBytes(properties) { + if (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 OrderedCodeBytes instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes instance + */ + OrderedCodeBytes.create = function create(properties) { + return new OrderedCodeBytes(properties); + }; + + /** + * Encodes the specified OrderedCodeBytes message. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified OrderedCodeBytes message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.IOrderedCodeBytes} message OrderedCodeBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedCodeBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrderedCodeBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedCodeBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrderedCodeBytes message. + * @function verify + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrderedCodeBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an OrderedCodeBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes} OrderedCodeBytes + */ + OrderedCodeBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) + return object; + return new $root.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes(); + }; + + /** + * Creates a plain object from an OrderedCodeBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes} message OrderedCodeBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrderedCodeBytes.toObject = function toObject() { + return {}; + }; + + /** + * Converts this OrderedCodeBytes to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @instance + * @returns {Object.} JSON object + */ + OrderedCodeBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrderedCodeBytes + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrderedCodeBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes"; + }; + + return OrderedCodeBytes; + })(); + + return Encoding; + })(); + + return Struct; + })(); + + Type.Proto = (function() { + + /** + * Properties of a Proto. + * @memberof google.bigtable.v2.Type + * @interface IProto + * @property {string|null} [schemaBundleId] Proto schemaBundleId + * @property {string|null} [messageName] Proto messageName + */ + + /** + * Constructs a new Proto. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Proto. + * @implements IProto + * @constructor + * @param {google.bigtable.v2.Type.IProto=} [properties] Properties to set + */ + function Proto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proto schemaBundleId. + * @member {string} schemaBundleId + * @memberof google.bigtable.v2.Type.Proto + * @instance + */ + Proto.prototype.schemaBundleId = ""; + + /** + * Proto messageName. + * @member {string} messageName + * @memberof google.bigtable.v2.Type.Proto + * @instance + */ + Proto.prototype.messageName = ""; + + /** + * Creates a new Proto instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {google.bigtable.v2.Type.IProto=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Proto} Proto instance + */ + Proto.create = function create(properties) { + return new Proto(properties); + }; + + /** + * Encodes the specified Proto message. Does not implicitly {@link google.bigtable.v2.Type.Proto.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {google.bigtable.v2.Type.IProto} message Proto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schemaBundleId); + if (message.messageName != null && Object.hasOwnProperty.call(message, "messageName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.messageName); + return writer; + }; + + /** + * Encodes the specified Proto message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Proto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {google.bigtable.v2.Type.IProto} message Proto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proto message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Proto} Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Proto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schemaBundleId = reader.string(); + break; + } + case 2: { + message.messageName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Proto} Proto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proto message. + * @function verify + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + if (!$util.isString(message.schemaBundleId)) + return "schemaBundleId: string expected"; + if (message.messageName != null && message.hasOwnProperty("messageName")) + if (!$util.isString(message.messageName)) + return "messageName: string expected"; + return null; + }; + + /** + * Creates a Proto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Proto} Proto + */ + Proto.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Proto) + return object; + var message = new $root.google.bigtable.v2.Type.Proto(); + if (object.schemaBundleId != null) + message.schemaBundleId = String(object.schemaBundleId); + if (object.messageName != null) + message.messageName = String(object.messageName); + return message; + }; + + /** + * Creates a plain object from a Proto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {google.bigtable.v2.Type.Proto} message Proto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schemaBundleId = ""; + object.messageName = ""; + } + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + object.schemaBundleId = message.schemaBundleId; + if (message.messageName != null && message.hasOwnProperty("messageName")) + object.messageName = message.messageName; + return object; + }; + + /** + * Converts this Proto to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Proto + * @instance + * @returns {Object.} JSON object + */ + Proto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Proto + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Proto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Proto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Proto"; + }; + + return Proto; + })(); + + Type.Enum = (function() { + + /** + * Properties of an Enum. + * @memberof google.bigtable.v2.Type + * @interface IEnum + * @property {string|null} [schemaBundleId] Enum schemaBundleId + * @property {string|null} [enumName] Enum enumName + */ + + /** + * Constructs a new Enum. + * @memberof google.bigtable.v2.Type + * @classdesc Represents an Enum. + * @implements IEnum + * @constructor + * @param {google.bigtable.v2.Type.IEnum=} [properties] Properties to set + */ + function Enum(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Enum schemaBundleId. + * @member {string} schemaBundleId + * @memberof google.bigtable.v2.Type.Enum + * @instance + */ + Enum.prototype.schemaBundleId = ""; + + /** + * Enum enumName. + * @member {string} enumName + * @memberof google.bigtable.v2.Type.Enum + * @instance + */ + Enum.prototype.enumName = ""; + + /** + * Creates a new Enum instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {google.bigtable.v2.Type.IEnum=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Enum} Enum instance + */ + Enum.create = function create(properties) { + return new Enum(properties); + }; + + /** + * Encodes the specified Enum message. Does not implicitly {@link google.bigtable.v2.Type.Enum.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {google.bigtable.v2.Type.IEnum} message Enum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Enum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schemaBundleId); + if (message.enumName != null && Object.hasOwnProperty.call(message, "enumName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.enumName); + return writer; + }; + + /** + * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Enum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {google.bigtable.v2.Type.IEnum} message Enum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Enum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Enum message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Enum} Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Enum.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Enum(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schemaBundleId = reader.string(); + break; + } + case 2: { + message.enumName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Enum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Enum} Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Enum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Enum message. + * @function verify + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Enum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + if (!$util.isString(message.schemaBundleId)) + return "schemaBundleId: string expected"; + if (message.enumName != null && message.hasOwnProperty("enumName")) + if (!$util.isString(message.enumName)) + return "enumName: string expected"; + return null; + }; + + /** + * Creates an Enum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Enum} Enum + */ + Enum.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Enum) + return object; + var message = new $root.google.bigtable.v2.Type.Enum(); + if (object.schemaBundleId != null) + message.schemaBundleId = String(object.schemaBundleId); + if (object.enumName != null) + message.enumName = String(object.enumName); + return message; + }; + + /** + * Creates a plain object from an Enum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {google.bigtable.v2.Type.Enum} message Enum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Enum.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schemaBundleId = ""; + object.enumName = ""; + } + if (message.schemaBundleId != null && message.hasOwnProperty("schemaBundleId")) + object.schemaBundleId = message.schemaBundleId; + if (message.enumName != null && message.hasOwnProperty("enumName")) + object.enumName = message.enumName; + return object; + }; + + /** + * Converts this Enum to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Enum + * @instance + * @returns {Object.} JSON object + */ + Enum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Enum + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Enum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Enum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Enum"; + }; + + return Enum; + })(); + + Type.Array = (function() { + + /** + * Properties of an Array. + * @memberof google.bigtable.v2.Type + * @interface IArray + * @property {google.bigtable.v2.IType|null} [elementType] Array elementType + */ + + /** + * Constructs a new Array. + * @memberof google.bigtable.v2.Type + * @classdesc Represents an Array. + * @implements IArray + * @constructor + * @param {google.bigtable.v2.Type.IArray=} [properties] Properties to set + */ + function Array(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Array elementType. + * @member {google.bigtable.v2.IType|null|undefined} elementType + * @memberof google.bigtable.v2.Type.Array + * @instance + */ + Array.prototype.elementType = null; + + /** + * Creates a new Array instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {google.bigtable.v2.Type.IArray=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Array} Array instance + */ + Array.create = function create(properties) { + return new Array(properties); + }; + + /** + * Encodes the specified Array message. Does not implicitly {@link google.bigtable.v2.Type.Array.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {google.bigtable.v2.Type.IArray} message Array message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Array.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.elementType != null && Object.hasOwnProperty.call(message, "elementType")) + $root.google.bigtable.v2.Type.encode(message.elementType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Array message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Array.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {google.bigtable.v2.Type.IArray} message Array message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Array.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Array message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Array} Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Array.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Array(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.elementType = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Array message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Array} Array + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Array.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Array message. + * @function verify + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Array.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.elementType != null && message.hasOwnProperty("elementType")) { + var error = $root.google.bigtable.v2.Type.verify(message.elementType); + if (error) + return "elementType." + error; + } + return null; + }; + + /** + * Creates an Array message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Array} Array + */ + Array.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Array) + return object; + var message = new $root.google.bigtable.v2.Type.Array(); + if (object.elementType != null) { + if (typeof object.elementType !== "object") + throw TypeError(".google.bigtable.v2.Type.Array.elementType: object expected"); + message.elementType = $root.google.bigtable.v2.Type.fromObject(object.elementType); + } + return message; + }; + + /** + * Creates a plain object from an Array message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {google.bigtable.v2.Type.Array} message Array + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Array.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.elementType = null; + if (message.elementType != null && message.hasOwnProperty("elementType")) + object.elementType = $root.google.bigtable.v2.Type.toObject(message.elementType, options); + return object; + }; + + /** + * Converts this Array to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Array + * @instance + * @returns {Object.} JSON object + */ + Array.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Array + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Array + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Array.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Array"; + }; + + return Array; + })(); + + Type.Map = (function() { + + /** + * Properties of a Map. + * @memberof google.bigtable.v2.Type + * @interface IMap + * @property {google.bigtable.v2.IType|null} [keyType] Map keyType + * @property {google.bigtable.v2.IType|null} [valueType] Map valueType + */ + + /** + * Constructs a new Map. + * @memberof google.bigtable.v2.Type + * @classdesc Represents a Map. + * @implements IMap + * @constructor + * @param {google.bigtable.v2.Type.IMap=} [properties] Properties to set + */ + function Map(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Map keyType. + * @member {google.bigtable.v2.IType|null|undefined} keyType + * @memberof google.bigtable.v2.Type.Map + * @instance + */ + Map.prototype.keyType = null; + + /** + * Map valueType. + * @member {google.bigtable.v2.IType|null|undefined} valueType + * @memberof google.bigtable.v2.Type.Map + * @instance + */ + Map.prototype.valueType = null; + + /** + * Creates a new Map instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {google.bigtable.v2.Type.IMap=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Map} Map instance + */ + Map.create = function create(properties) { + return new Map(properties); + }; + + /** + * Encodes the specified Map message. Does not implicitly {@link google.bigtable.v2.Type.Map.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {google.bigtable.v2.Type.IMap} message Map message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Map.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyType != null && Object.hasOwnProperty.call(message, "keyType")) + $root.google.bigtable.v2.Type.encode(message.keyType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + $root.google.bigtable.v2.Type.encode(message.valueType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Map message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Map.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {google.bigtable.v2.Type.IMap} message Map message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Map.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Map message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Map} Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Map.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Map(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyType = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + case 2: { + message.valueType = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Map message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Map} Map + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Map.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Map message. + * @function verify + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Map.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyType != null && message.hasOwnProperty("keyType")) { + var error = $root.google.bigtable.v2.Type.verify(message.keyType); + if (error) + return "keyType." + error; + } + if (message.valueType != null && message.hasOwnProperty("valueType")) { + var error = $root.google.bigtable.v2.Type.verify(message.valueType); + if (error) + return "valueType." + error; + } + return null; + }; + + /** + * Creates a Map message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Map} Map + */ + Map.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Map) + return object; + var message = new $root.google.bigtable.v2.Type.Map(); + if (object.keyType != null) { + if (typeof object.keyType !== "object") + throw TypeError(".google.bigtable.v2.Type.Map.keyType: object expected"); + message.keyType = $root.google.bigtable.v2.Type.fromObject(object.keyType); + } + if (object.valueType != null) { + if (typeof object.valueType !== "object") + throw TypeError(".google.bigtable.v2.Type.Map.valueType: object expected"); + message.valueType = $root.google.bigtable.v2.Type.fromObject(object.valueType); + } + return message; + }; + + /** + * Creates a plain object from a Map message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {google.bigtable.v2.Type.Map} message Map + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Map.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyType = null; + object.valueType = null; + } + if (message.keyType != null && message.hasOwnProperty("keyType")) + object.keyType = $root.google.bigtable.v2.Type.toObject(message.keyType, options); + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = $root.google.bigtable.v2.Type.toObject(message.valueType, options); + return object; + }; + + /** + * Converts this Map to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Map + * @instance + * @returns {Object.} JSON object + */ + Map.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Map + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Map + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Map.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Map"; + }; + + return Map; + })(); + + Type.Aggregate = (function() { + + /** + * Properties of an Aggregate. + * @memberof google.bigtable.v2.Type + * @interface IAggregate + * @property {google.bigtable.v2.IType|null} [inputType] Aggregate inputType + * @property {google.bigtable.v2.IType|null} [stateType] Aggregate stateType + * @property {google.bigtable.v2.Type.Aggregate.ISum|null} [sum] Aggregate sum + * @property {google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null} [hllppUniqueCount] Aggregate hllppUniqueCount + * @property {google.bigtable.v2.Type.Aggregate.IMax|null} [max] Aggregate max + * @property {google.bigtable.v2.Type.Aggregate.IMin|null} [min] Aggregate min + */ + + /** + * Constructs a new Aggregate. + * @memberof google.bigtable.v2.Type + * @classdesc Represents an Aggregate. + * @implements IAggregate + * @constructor + * @param {google.bigtable.v2.Type.IAggregate=} [properties] Properties to set + */ + function Aggregate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Aggregate inputType. + * @member {google.bigtable.v2.IType|null|undefined} inputType + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.inputType = null; + + /** + * Aggregate stateType. + * @member {google.bigtable.v2.IType|null|undefined} stateType + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.stateType = null; + + /** + * Aggregate sum. + * @member {google.bigtable.v2.Type.Aggregate.ISum|null|undefined} sum + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.sum = null; + + /** + * Aggregate hllppUniqueCount. + * @member {google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount|null|undefined} hllppUniqueCount + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.hllppUniqueCount = null; + + /** + * Aggregate max. + * @member {google.bigtable.v2.Type.Aggregate.IMax|null|undefined} max + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.max = null; + + /** + * Aggregate min. + * @member {google.bigtable.v2.Type.Aggregate.IMin|null|undefined} min + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Aggregate.prototype.min = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Aggregate aggregator. + * @member {"sum"|"hllppUniqueCount"|"max"|"min"|undefined} aggregator + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + */ + Object.defineProperty(Aggregate.prototype, "aggregator", { + get: $util.oneOfGetter($oneOfFields = ["sum", "hllppUniqueCount", "max", "min"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Aggregate instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {google.bigtable.v2.Type.IAggregate=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Aggregate} Aggregate instance + */ + Aggregate.create = function create(properties) { + return new Aggregate(properties); + }; + + /** + * Encodes the specified Aggregate message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {google.bigtable.v2.Type.IAggregate} message Aggregate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + $root.google.bigtable.v2.Type.encode(message.inputType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateType != null && Object.hasOwnProperty.call(message, "stateType")) + $root.google.bigtable.v2.Type.encode(message.stateType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + $root.google.bigtable.v2.Type.Aggregate.Sum.encode(message.sum, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hllppUniqueCount != null && Object.hasOwnProperty.call(message, "hllppUniqueCount")) + $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.encode(message.hllppUniqueCount, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + $root.google.bigtable.v2.Type.Aggregate.Max.encode(message.max, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + $root.google.bigtable.v2.Type.Aggregate.Min.encode(message.min, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Aggregate message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {google.bigtable.v2.Type.IAggregate} message Aggregate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Aggregate message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Aggregate} Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Aggregate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputType = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stateType = $root.google.bigtable.v2.Type.decode(reader, reader.uint32()); + break; + } + case 4: { + message.sum = $root.google.bigtable.v2.Type.Aggregate.Sum.decode(reader, reader.uint32()); + break; + } + case 5: { + message.hllppUniqueCount = $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.decode(reader, reader.uint32()); + break; + } + case 6: { + message.max = $root.google.bigtable.v2.Type.Aggregate.Max.decode(reader, reader.uint32()); + break; + } + case 7: { + message.min = $root.google.bigtable.v2.Type.Aggregate.Min.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Aggregate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Aggregate} Aggregate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Aggregate message. + * @function verify + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Aggregate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inputType != null && message.hasOwnProperty("inputType")) { + var error = $root.google.bigtable.v2.Type.verify(message.inputType); + if (error) + return "inputType." + error; + } + if (message.stateType != null && message.hasOwnProperty("stateType")) { + var error = $root.google.bigtable.v2.Type.verify(message.stateType); + if (error) + return "stateType." + error; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + properties.aggregator = 1; + { + var error = $root.google.bigtable.v2.Type.Aggregate.Sum.verify(message.sum); + if (error) + return "sum." + error; + } + } + if (message.hllppUniqueCount != null && message.hasOwnProperty("hllppUniqueCount")) { + if (properties.aggregator === 1) + return "aggregator: multiple values"; + properties.aggregator = 1; + { + var error = $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify(message.hllppUniqueCount); + if (error) + return "hllppUniqueCount." + error; + } + } + if (message.max != null && message.hasOwnProperty("max")) { + if (properties.aggregator === 1) + return "aggregator: multiple values"; + properties.aggregator = 1; + { + var error = $root.google.bigtable.v2.Type.Aggregate.Max.verify(message.max); + if (error) + return "max." + error; + } + } + if (message.min != null && message.hasOwnProperty("min")) { + if (properties.aggregator === 1) + return "aggregator: multiple values"; + properties.aggregator = 1; + { + var error = $root.google.bigtable.v2.Type.Aggregate.Min.verify(message.min); + if (error) + return "min." + error; + } + } + return null; + }; + + /** + * Creates an Aggregate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Aggregate} Aggregate + */ + Aggregate.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Aggregate) + return object; + var message = new $root.google.bigtable.v2.Type.Aggregate(); + if (object.inputType != null) { + if (typeof object.inputType !== "object") + throw TypeError(".google.bigtable.v2.Type.Aggregate.inputType: object expected"); + message.inputType = $root.google.bigtable.v2.Type.fromObject(object.inputType); + } + if (object.stateType != null) { + if (typeof object.stateType !== "object") + throw TypeError(".google.bigtable.v2.Type.Aggregate.stateType: object expected"); + message.stateType = $root.google.bigtable.v2.Type.fromObject(object.stateType); + } + if (object.sum != null) { + if (typeof object.sum !== "object") + throw TypeError(".google.bigtable.v2.Type.Aggregate.sum: object expected"); + message.sum = $root.google.bigtable.v2.Type.Aggregate.Sum.fromObject(object.sum); + } + if (object.hllppUniqueCount != null) { + if (typeof object.hllppUniqueCount !== "object") + throw TypeError(".google.bigtable.v2.Type.Aggregate.hllppUniqueCount: object expected"); + message.hllppUniqueCount = $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.fromObject(object.hllppUniqueCount); + } + if (object.max != null) { + if (typeof object.max !== "object") + throw TypeError(".google.bigtable.v2.Type.Aggregate.max: object expected"); + message.max = $root.google.bigtable.v2.Type.Aggregate.Max.fromObject(object.max); + } + if (object.min != null) { + if (typeof object.min !== "object") + throw TypeError(".google.bigtable.v2.Type.Aggregate.min: object expected"); + message.min = $root.google.bigtable.v2.Type.Aggregate.Min.fromObject(object.min); + } + return message; + }; + + /** + * Creates a plain object from an Aggregate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {google.bigtable.v2.Type.Aggregate} message Aggregate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Aggregate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputType = null; + object.stateType = null; + } + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = $root.google.bigtable.v2.Type.toObject(message.inputType, options); + if (message.stateType != null && message.hasOwnProperty("stateType")) + object.stateType = $root.google.bigtable.v2.Type.toObject(message.stateType, options); + if (message.sum != null && message.hasOwnProperty("sum")) { + object.sum = $root.google.bigtable.v2.Type.Aggregate.Sum.toObject(message.sum, options); + if (options.oneofs) + object.aggregator = "sum"; + } + if (message.hllppUniqueCount != null && message.hasOwnProperty("hllppUniqueCount")) { + object.hllppUniqueCount = $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.toObject(message.hllppUniqueCount, options); + if (options.oneofs) + object.aggregator = "hllppUniqueCount"; + } + if (message.max != null && message.hasOwnProperty("max")) { + object.max = $root.google.bigtable.v2.Type.Aggregate.Max.toObject(message.max, options); + if (options.oneofs) + object.aggregator = "max"; + } + if (message.min != null && message.hasOwnProperty("min")) { + object.min = $root.google.bigtable.v2.Type.Aggregate.Min.toObject(message.min, options); + if (options.oneofs) + object.aggregator = "min"; + } + return object; + }; + + /** + * Converts this Aggregate to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Aggregate + * @instance + * @returns {Object.} JSON object + */ + Aggregate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Aggregate + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Aggregate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Aggregate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Aggregate"; + }; + + Aggregate.Sum = (function() { + + /** + * Properties of a Sum. + * @memberof google.bigtable.v2.Type.Aggregate + * @interface ISum + */ + + /** + * Constructs a new Sum. + * @memberof google.bigtable.v2.Type.Aggregate + * @classdesc Represents a Sum. + * @implements ISum + * @constructor + * @param {google.bigtable.v2.Type.Aggregate.ISum=} [properties] Properties to set + */ + function Sum(properties) { + if (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 Sum instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.v2.Type.Aggregate.ISum=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Aggregate.Sum} Sum instance + */ + Sum.create = function create(properties) { + return new Sum(properties); + }; + + /** + * Encodes the specified Sum message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Sum.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.v2.Type.Aggregate.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Sum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.v2.Type.Aggregate.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sum message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Aggregate.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Aggregate.Sum(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Aggregate.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sum message. + * @function verify + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Aggregate.Sum} Sum + */ + Sum.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Aggregate.Sum) + return object; + return new $root.google.bigtable.v2.Type.Aggregate.Sum(); + }; + + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {google.bigtable.v2.Type.Aggregate.Sum} message Sum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sum.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Sum to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @instance + * @returns {Object.} JSON object + */ + Sum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Sum + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Aggregate.Sum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Aggregate.Sum"; + }; + + return Sum; + })(); + + Aggregate.Max = (function() { + + /** + * Properties of a Max. + * @memberof google.bigtable.v2.Type.Aggregate + * @interface IMax + */ + + /** + * Constructs a new Max. + * @memberof google.bigtable.v2.Type.Aggregate + * @classdesc Represents a Max. + * @implements IMax + * @constructor + * @param {google.bigtable.v2.Type.Aggregate.IMax=} [properties] Properties to set + */ + function Max(properties) { + if (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 Max instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.v2.Type.Aggregate.IMax=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Aggregate.Max} Max instance + */ + Max.create = function create(properties) { + return new Max(properties); + }; + + /** + * Encodes the specified Max message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Max.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.v2.Type.Aggregate.IMax} message Max message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Max.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Max message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Max.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.v2.Type.Aggregate.IMax} message Max message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Max.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Max message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Aggregate.Max} Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Max.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Aggregate.Max(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Max message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Aggregate.Max} Max + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Max.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Max message. + * @function verify + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Max.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Max message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Aggregate.Max} Max + */ + Max.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Aggregate.Max) + return object; + return new $root.google.bigtable.v2.Type.Aggregate.Max(); + }; + + /** + * Creates a plain object from a Max message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {google.bigtable.v2.Type.Aggregate.Max} message Max + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Max.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Max to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @instance + * @returns {Object.} JSON object + */ + Max.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Max + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Aggregate.Max + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Max.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Aggregate.Max"; + }; + + return Max; + })(); + + Aggregate.Min = (function() { + + /** + * Properties of a Min. + * @memberof google.bigtable.v2.Type.Aggregate + * @interface IMin + */ + + /** + * Constructs a new Min. + * @memberof google.bigtable.v2.Type.Aggregate + * @classdesc Represents a Min. + * @implements IMin + * @constructor + * @param {google.bigtable.v2.Type.Aggregate.IMin=} [properties] Properties to set + */ + function Min(properties) { + if (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 Min instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.v2.Type.Aggregate.IMin=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Aggregate.Min} Min instance + */ + Min.create = function create(properties) { + return new Min(properties); + }; + + /** + * Encodes the specified Min message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Min.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.v2.Type.Aggregate.IMin} message Min message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Min.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Min message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.Min.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.v2.Type.Aggregate.IMin} message Min message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Min.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Min message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Aggregate.Min} Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Min.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Aggregate.Min(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Min message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Aggregate.Min} Min + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Min.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Min message. + * @function verify + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Min.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Min message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Aggregate.Min} Min + */ + Min.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Aggregate.Min) + return object; + return new $root.google.bigtable.v2.Type.Aggregate.Min(); + }; + + /** + * Creates a plain object from a Min message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {google.bigtable.v2.Type.Aggregate.Min} message Min + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Min.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Min to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @instance + * @returns {Object.} JSON object + */ + Min.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Min + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Aggregate.Min + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Min.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Aggregate.Min"; + }; + + return Min; + })(); + + Aggregate.HyperLogLogPlusPlusUniqueCount = (function() { + + /** + * Properties of a HyperLogLogPlusPlusUniqueCount. + * @memberof google.bigtable.v2.Type.Aggregate + * @interface IHyperLogLogPlusPlusUniqueCount + */ + + /** + * Constructs a new HyperLogLogPlusPlusUniqueCount. + * @memberof google.bigtable.v2.Type.Aggregate + * @classdesc Represents a HyperLogLogPlusPlusUniqueCount. + * @implements IHyperLogLogPlusPlusUniqueCount + * @constructor + * @param {google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount=} [properties] Properties to set + */ + function HyperLogLogPlusPlusUniqueCount(properties) { + if (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 HyperLogLogPlusPlusUniqueCount instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount=} [properties] Properties to set + * @returns {google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount instance + */ + HyperLogLogPlusPlusUniqueCount.create = function create(properties) { + return new HyperLogLogPlusPlusUniqueCount(properties); + }; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount} message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HyperLogLogPlusPlusUniqueCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified HyperLogLogPlusPlusUniqueCount message, length delimited. Does not implicitly {@link google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.v2.Type.Aggregate.IHyperLogLogPlusPlusUniqueCount} message HyperLogLogPlusPlusUniqueCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HyperLogLogPlusPlusUniqueCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HyperLogLogPlusPlusUniqueCount.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HyperLogLogPlusPlusUniqueCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HyperLogLogPlusPlusUniqueCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HyperLogLogPlusPlusUniqueCount message. + * @function verify + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HyperLogLogPlusPlusUniqueCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a HyperLogLogPlusPlusUniqueCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} HyperLogLogPlusPlusUniqueCount + */ + HyperLogLogPlusPlusUniqueCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + return object; + return new $root.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount(); + }; + + /** + * Creates a plain object from a HyperLogLogPlusPlusUniqueCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} message HyperLogLogPlusPlusUniqueCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HyperLogLogPlusPlusUniqueCount.toObject = function toObject() { + return {}; + }; + + /** + * Converts this HyperLogLogPlusPlusUniqueCount to JSON. + * @function toJSON + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @instance + * @returns {Object.} JSON object + */ + HyperLogLogPlusPlusUniqueCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HyperLogLogPlusPlusUniqueCount + * @function getTypeUrl + * @memberof google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HyperLogLogPlusPlusUniqueCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount"; + }; + + return HyperLogLogPlusPlusUniqueCount; + })(); + + return Aggregate; + })(); + + return Type; + })(); + + v2.ReadIterationStats = (function() { + + /** + * Properties of a ReadIterationStats. + * @memberof google.bigtable.v2 + * @interface IReadIterationStats + * @property {number|Long|null} [rowsSeenCount] ReadIterationStats rowsSeenCount + * @property {number|Long|null} [rowsReturnedCount] ReadIterationStats rowsReturnedCount + * @property {number|Long|null} [cellsSeenCount] ReadIterationStats cellsSeenCount + * @property {number|Long|null} [cellsReturnedCount] ReadIterationStats cellsReturnedCount + */ + + /** + * Constructs a new ReadIterationStats. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadIterationStats. + * @implements IReadIterationStats + * @constructor + * @param {google.bigtable.v2.IReadIterationStats=} [properties] Properties to set + */ + function ReadIterationStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadIterationStats rowsSeenCount. + * @member {number|Long} rowsSeenCount + * @memberof google.bigtable.v2.ReadIterationStats + * @instance + */ + ReadIterationStats.prototype.rowsSeenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadIterationStats rowsReturnedCount. + * @member {number|Long} rowsReturnedCount + * @memberof google.bigtable.v2.ReadIterationStats + * @instance + */ + ReadIterationStats.prototype.rowsReturnedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadIterationStats cellsSeenCount. + * @member {number|Long} cellsSeenCount + * @memberof google.bigtable.v2.ReadIterationStats + * @instance + */ + ReadIterationStats.prototype.cellsSeenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadIterationStats cellsReturnedCount. + * @member {number|Long} cellsReturnedCount + * @memberof google.bigtable.v2.ReadIterationStats + * @instance + */ + ReadIterationStats.prototype.cellsReturnedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ReadIterationStats instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {google.bigtable.v2.IReadIterationStats=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadIterationStats} ReadIterationStats instance + */ + ReadIterationStats.create = function create(properties) { + return new ReadIterationStats(properties); + }; + + /** + * Encodes the specified ReadIterationStats message. Does not implicitly {@link google.bigtable.v2.ReadIterationStats.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {google.bigtable.v2.IReadIterationStats} message ReadIterationStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadIterationStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowsSeenCount != null && Object.hasOwnProperty.call(message, "rowsSeenCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.rowsSeenCount); + if (message.rowsReturnedCount != null && Object.hasOwnProperty.call(message, "rowsReturnedCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowsReturnedCount); + if (message.cellsSeenCount != null && Object.hasOwnProperty.call(message, "cellsSeenCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.cellsSeenCount); + if (message.cellsReturnedCount != null && Object.hasOwnProperty.call(message, "cellsReturnedCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.cellsReturnedCount); + return writer; + }; + + /** + * Encodes the specified ReadIterationStats message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadIterationStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {google.bigtable.v2.IReadIterationStats} message ReadIterationStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadIterationStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadIterationStats message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadIterationStats} ReadIterationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadIterationStats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadIterationStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowsSeenCount = reader.int64(); + break; + } + case 2: { + message.rowsReturnedCount = reader.int64(); + break; + } + case 3: { + message.cellsSeenCount = reader.int64(); + break; + } + case 4: { + message.cellsReturnedCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadIterationStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadIterationStats} ReadIterationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadIterationStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadIterationStats message. + * @function verify + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadIterationStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowsSeenCount != null && message.hasOwnProperty("rowsSeenCount")) + if (!$util.isInteger(message.rowsSeenCount) && !(message.rowsSeenCount && $util.isInteger(message.rowsSeenCount.low) && $util.isInteger(message.rowsSeenCount.high))) + return "rowsSeenCount: integer|Long expected"; + if (message.rowsReturnedCount != null && message.hasOwnProperty("rowsReturnedCount")) + if (!$util.isInteger(message.rowsReturnedCount) && !(message.rowsReturnedCount && $util.isInteger(message.rowsReturnedCount.low) && $util.isInteger(message.rowsReturnedCount.high))) + return "rowsReturnedCount: integer|Long expected"; + if (message.cellsSeenCount != null && message.hasOwnProperty("cellsSeenCount")) + if (!$util.isInteger(message.cellsSeenCount) && !(message.cellsSeenCount && $util.isInteger(message.cellsSeenCount.low) && $util.isInteger(message.cellsSeenCount.high))) + return "cellsSeenCount: integer|Long expected"; + if (message.cellsReturnedCount != null && message.hasOwnProperty("cellsReturnedCount")) + if (!$util.isInteger(message.cellsReturnedCount) && !(message.cellsReturnedCount && $util.isInteger(message.cellsReturnedCount.low) && $util.isInteger(message.cellsReturnedCount.high))) + return "cellsReturnedCount: integer|Long expected"; + return null; + }; + + /** + * Creates a ReadIterationStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadIterationStats} ReadIterationStats + */ + ReadIterationStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadIterationStats) + return object; + var message = new $root.google.bigtable.v2.ReadIterationStats(); + if (object.rowsSeenCount != null) + if ($util.Long) + (message.rowsSeenCount = $util.Long.fromValue(object.rowsSeenCount)).unsigned = false; + else if (typeof object.rowsSeenCount === "string") + message.rowsSeenCount = parseInt(object.rowsSeenCount, 10); + else if (typeof object.rowsSeenCount === "number") + message.rowsSeenCount = object.rowsSeenCount; + else if (typeof object.rowsSeenCount === "object") + message.rowsSeenCount = new $util.LongBits(object.rowsSeenCount.low >>> 0, object.rowsSeenCount.high >>> 0).toNumber(); + if (object.rowsReturnedCount != null) + if ($util.Long) + (message.rowsReturnedCount = $util.Long.fromValue(object.rowsReturnedCount)).unsigned = false; + else if (typeof object.rowsReturnedCount === "string") + message.rowsReturnedCount = parseInt(object.rowsReturnedCount, 10); + else if (typeof object.rowsReturnedCount === "number") + message.rowsReturnedCount = object.rowsReturnedCount; + else if (typeof object.rowsReturnedCount === "object") + message.rowsReturnedCount = new $util.LongBits(object.rowsReturnedCount.low >>> 0, object.rowsReturnedCount.high >>> 0).toNumber(); + if (object.cellsSeenCount != null) + if ($util.Long) + (message.cellsSeenCount = $util.Long.fromValue(object.cellsSeenCount)).unsigned = false; + else if (typeof object.cellsSeenCount === "string") + message.cellsSeenCount = parseInt(object.cellsSeenCount, 10); + else if (typeof object.cellsSeenCount === "number") + message.cellsSeenCount = object.cellsSeenCount; + else if (typeof object.cellsSeenCount === "object") + message.cellsSeenCount = new $util.LongBits(object.cellsSeenCount.low >>> 0, object.cellsSeenCount.high >>> 0).toNumber(); + if (object.cellsReturnedCount != null) + if ($util.Long) + (message.cellsReturnedCount = $util.Long.fromValue(object.cellsReturnedCount)).unsigned = false; + else if (typeof object.cellsReturnedCount === "string") + message.cellsReturnedCount = parseInt(object.cellsReturnedCount, 10); + else if (typeof object.cellsReturnedCount === "number") + message.cellsReturnedCount = object.cellsReturnedCount; + else if (typeof object.cellsReturnedCount === "object") + message.cellsReturnedCount = new $util.LongBits(object.cellsReturnedCount.low >>> 0, object.cellsReturnedCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ReadIterationStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {google.bigtable.v2.ReadIterationStats} message ReadIterationStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadIterationStats.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.rowsSeenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowsSeenCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowsReturnedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowsReturnedCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.cellsSeenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.cellsSeenCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.cellsReturnedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.cellsReturnedCount = options.longs === String ? "0" : 0; + } + if (message.rowsSeenCount != null && message.hasOwnProperty("rowsSeenCount")) + if (typeof message.rowsSeenCount === "number") + object.rowsSeenCount = options.longs === String ? String(message.rowsSeenCount) : message.rowsSeenCount; + else + object.rowsSeenCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowsSeenCount) : options.longs === Number ? new $util.LongBits(message.rowsSeenCount.low >>> 0, message.rowsSeenCount.high >>> 0).toNumber() : message.rowsSeenCount; + if (message.rowsReturnedCount != null && message.hasOwnProperty("rowsReturnedCount")) + if (typeof message.rowsReturnedCount === "number") + object.rowsReturnedCount = options.longs === String ? String(message.rowsReturnedCount) : message.rowsReturnedCount; + else + object.rowsReturnedCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowsReturnedCount) : options.longs === Number ? new $util.LongBits(message.rowsReturnedCount.low >>> 0, message.rowsReturnedCount.high >>> 0).toNumber() : message.rowsReturnedCount; + if (message.cellsSeenCount != null && message.hasOwnProperty("cellsSeenCount")) + if (typeof message.cellsSeenCount === "number") + object.cellsSeenCount = options.longs === String ? String(message.cellsSeenCount) : message.cellsSeenCount; + else + object.cellsSeenCount = options.longs === String ? $util.Long.prototype.toString.call(message.cellsSeenCount) : options.longs === Number ? new $util.LongBits(message.cellsSeenCount.low >>> 0, message.cellsSeenCount.high >>> 0).toNumber() : message.cellsSeenCount; + if (message.cellsReturnedCount != null && message.hasOwnProperty("cellsReturnedCount")) + if (typeof message.cellsReturnedCount === "number") + object.cellsReturnedCount = options.longs === String ? String(message.cellsReturnedCount) : message.cellsReturnedCount; + else + object.cellsReturnedCount = options.longs === String ? $util.Long.prototype.toString.call(message.cellsReturnedCount) : options.longs === Number ? new $util.LongBits(message.cellsReturnedCount.low >>> 0, message.cellsReturnedCount.high >>> 0).toNumber() : message.cellsReturnedCount; + return object; + }; + + /** + * Converts this ReadIterationStats to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadIterationStats + * @instance + * @returns {Object.} JSON object + */ + ReadIterationStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadIterationStats + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadIterationStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadIterationStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadIterationStats"; + }; + + return ReadIterationStats; + })(); + + v2.RequestLatencyStats = (function() { + + /** + * Properties of a RequestLatencyStats. + * @memberof google.bigtable.v2 + * @interface IRequestLatencyStats + * @property {google.protobuf.IDuration|null} [frontendServerLatency] RequestLatencyStats frontendServerLatency + */ + + /** + * Constructs a new RequestLatencyStats. + * @memberof google.bigtable.v2 + * @classdesc Represents a RequestLatencyStats. + * @implements IRequestLatencyStats + * @constructor + * @param {google.bigtable.v2.IRequestLatencyStats=} [properties] Properties to set + */ + function RequestLatencyStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestLatencyStats frontendServerLatency. + * @member {google.protobuf.IDuration|null|undefined} frontendServerLatency + * @memberof google.bigtable.v2.RequestLatencyStats + * @instance + */ + RequestLatencyStats.prototype.frontendServerLatency = null; + + /** + * Creates a new RequestLatencyStats instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {google.bigtable.v2.IRequestLatencyStats=} [properties] Properties to set + * @returns {google.bigtable.v2.RequestLatencyStats} RequestLatencyStats instance + */ + RequestLatencyStats.create = function create(properties) { + return new RequestLatencyStats(properties); + }; + + /** + * Encodes the specified RequestLatencyStats message. Does not implicitly {@link google.bigtable.v2.RequestLatencyStats.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {google.bigtable.v2.IRequestLatencyStats} message RequestLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestLatencyStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frontendServerLatency != null && Object.hasOwnProperty.call(message, "frontendServerLatency")) + $root.google.protobuf.Duration.encode(message.frontendServerLatency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestLatencyStats message, length delimited. Does not implicitly {@link google.bigtable.v2.RequestLatencyStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {google.bigtable.v2.IRequestLatencyStats} message RequestLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestLatencyStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestLatencyStats message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RequestLatencyStats} RequestLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestLatencyStats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RequestLatencyStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.frontendServerLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestLatencyStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RequestLatencyStats} RequestLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestLatencyStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestLatencyStats message. + * @function verify + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestLatencyStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frontendServerLatency != null && message.hasOwnProperty("frontendServerLatency")) { + var error = $root.google.protobuf.Duration.verify(message.frontendServerLatency); + if (error) + return "frontendServerLatency." + error; + } + return null; + }; + + /** + * Creates a RequestLatencyStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RequestLatencyStats} RequestLatencyStats + */ + RequestLatencyStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RequestLatencyStats) + return object; + var message = new $root.google.bigtable.v2.RequestLatencyStats(); + if (object.frontendServerLatency != null) { + if (typeof object.frontendServerLatency !== "object") + throw TypeError(".google.bigtable.v2.RequestLatencyStats.frontendServerLatency: object expected"); + message.frontendServerLatency = $root.google.protobuf.Duration.fromObject(object.frontendServerLatency); + } + return message; + }; + + /** + * Creates a plain object from a RequestLatencyStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {google.bigtable.v2.RequestLatencyStats} message RequestLatencyStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestLatencyStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.frontendServerLatency = null; + if (message.frontendServerLatency != null && message.hasOwnProperty("frontendServerLatency")) + object.frontendServerLatency = $root.google.protobuf.Duration.toObject(message.frontendServerLatency, options); + return object; + }; + + /** + * Converts this RequestLatencyStats to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RequestLatencyStats + * @instance + * @returns {Object.} JSON object + */ + RequestLatencyStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestLatencyStats + * @function getTypeUrl + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestLatencyStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RequestLatencyStats"; + }; + + return RequestLatencyStats; + })(); + + v2.FullReadStatsView = (function() { + + /** + * Properties of a FullReadStatsView. + * @memberof google.bigtable.v2 + * @interface IFullReadStatsView + * @property {google.bigtable.v2.IReadIterationStats|null} [readIterationStats] FullReadStatsView readIterationStats + * @property {google.bigtable.v2.IRequestLatencyStats|null} [requestLatencyStats] FullReadStatsView requestLatencyStats + */ + + /** + * Constructs a new FullReadStatsView. + * @memberof google.bigtable.v2 + * @classdesc Represents a FullReadStatsView. + * @implements IFullReadStatsView + * @constructor + * @param {google.bigtable.v2.IFullReadStatsView=} [properties] Properties to set + */ + function FullReadStatsView(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FullReadStatsView readIterationStats. + * @member {google.bigtable.v2.IReadIterationStats|null|undefined} readIterationStats + * @memberof google.bigtable.v2.FullReadStatsView + * @instance + */ + FullReadStatsView.prototype.readIterationStats = null; + + /** + * FullReadStatsView requestLatencyStats. + * @member {google.bigtable.v2.IRequestLatencyStats|null|undefined} requestLatencyStats + * @memberof google.bigtable.v2.FullReadStatsView + * @instance + */ + FullReadStatsView.prototype.requestLatencyStats = null; + + /** + * Creates a new FullReadStatsView instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {google.bigtable.v2.IFullReadStatsView=} [properties] Properties to set + * @returns {google.bigtable.v2.FullReadStatsView} FullReadStatsView instance + */ + FullReadStatsView.create = function create(properties) { + return new FullReadStatsView(properties); + }; + + /** + * Encodes the specified FullReadStatsView message. Does not implicitly {@link google.bigtable.v2.FullReadStatsView.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {google.bigtable.v2.IFullReadStatsView} message FullReadStatsView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FullReadStatsView.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readIterationStats != null && Object.hasOwnProperty.call(message, "readIterationStats")) + $root.google.bigtable.v2.ReadIterationStats.encode(message.readIterationStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestLatencyStats != null && Object.hasOwnProperty.call(message, "requestLatencyStats")) + $root.google.bigtable.v2.RequestLatencyStats.encode(message.requestLatencyStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FullReadStatsView message, length delimited. Does not implicitly {@link google.bigtable.v2.FullReadStatsView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {google.bigtable.v2.IFullReadStatsView} message FullReadStatsView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FullReadStatsView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FullReadStatsView message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.FullReadStatsView} FullReadStatsView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FullReadStatsView.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.FullReadStatsView(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.readIterationStats = $root.google.bigtable.v2.ReadIterationStats.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestLatencyStats = $root.google.bigtable.v2.RequestLatencyStats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FullReadStatsView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.FullReadStatsView} FullReadStatsView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FullReadStatsView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FullReadStatsView message. + * @function verify + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FullReadStatsView.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readIterationStats != null && message.hasOwnProperty("readIterationStats")) { + var error = $root.google.bigtable.v2.ReadIterationStats.verify(message.readIterationStats); + if (error) + return "readIterationStats." + error; + } + if (message.requestLatencyStats != null && message.hasOwnProperty("requestLatencyStats")) { + var error = $root.google.bigtable.v2.RequestLatencyStats.verify(message.requestLatencyStats); + if (error) + return "requestLatencyStats." + error; + } + return null; + }; + + /** + * Creates a FullReadStatsView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.FullReadStatsView} FullReadStatsView + */ + FullReadStatsView.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.FullReadStatsView) + return object; + var message = new $root.google.bigtable.v2.FullReadStatsView(); + if (object.readIterationStats != null) { + if (typeof object.readIterationStats !== "object") + throw TypeError(".google.bigtable.v2.FullReadStatsView.readIterationStats: object expected"); + message.readIterationStats = $root.google.bigtable.v2.ReadIterationStats.fromObject(object.readIterationStats); + } + if (object.requestLatencyStats != null) { + if (typeof object.requestLatencyStats !== "object") + throw TypeError(".google.bigtable.v2.FullReadStatsView.requestLatencyStats: object expected"); + message.requestLatencyStats = $root.google.bigtable.v2.RequestLatencyStats.fromObject(object.requestLatencyStats); + } + return message; + }; + + /** + * Creates a plain object from a FullReadStatsView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {google.bigtable.v2.FullReadStatsView} message FullReadStatsView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FullReadStatsView.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readIterationStats = null; + object.requestLatencyStats = null; + } + if (message.readIterationStats != null && message.hasOwnProperty("readIterationStats")) + object.readIterationStats = $root.google.bigtable.v2.ReadIterationStats.toObject(message.readIterationStats, options); + if (message.requestLatencyStats != null && message.hasOwnProperty("requestLatencyStats")) + object.requestLatencyStats = $root.google.bigtable.v2.RequestLatencyStats.toObject(message.requestLatencyStats, options); + return object; + }; + + /** + * Converts this FullReadStatsView to JSON. + * @function toJSON + * @memberof google.bigtable.v2.FullReadStatsView + * @instance + * @returns {Object.} JSON object + */ + FullReadStatsView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FullReadStatsView + * @function getTypeUrl + * @memberof google.bigtable.v2.FullReadStatsView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FullReadStatsView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.FullReadStatsView"; + }; + + return FullReadStatsView; + })(); + + v2.RequestStats = (function() { + + /** + * Properties of a RequestStats. + * @memberof google.bigtable.v2 + * @interface IRequestStats + * @property {google.bigtable.v2.IFullReadStatsView|null} [fullReadStatsView] RequestStats fullReadStatsView + */ + + /** + * Constructs a new RequestStats. + * @memberof google.bigtable.v2 + * @classdesc Represents a RequestStats. + * @implements IRequestStats + * @constructor + * @param {google.bigtable.v2.IRequestStats=} [properties] Properties to set + */ + function RequestStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestStats fullReadStatsView. + * @member {google.bigtable.v2.IFullReadStatsView|null|undefined} fullReadStatsView + * @memberof google.bigtable.v2.RequestStats + * @instance + */ + RequestStats.prototype.fullReadStatsView = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RequestStats statsView. + * @member {"fullReadStatsView"|undefined} statsView + * @memberof google.bigtable.v2.RequestStats + * @instance + */ + Object.defineProperty(RequestStats.prototype, "statsView", { + get: $util.oneOfGetter($oneOfFields = ["fullReadStatsView"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RequestStats instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {google.bigtable.v2.IRequestStats=} [properties] Properties to set + * @returns {google.bigtable.v2.RequestStats} RequestStats instance + */ + RequestStats.create = function create(properties) { + return new RequestStats(properties); + }; + + /** + * Encodes the specified RequestStats message. Does not implicitly {@link google.bigtable.v2.RequestStats.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {google.bigtable.v2.IRequestStats} message RequestStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullReadStatsView != null && Object.hasOwnProperty.call(message, "fullReadStatsView")) + $root.google.bigtable.v2.FullReadStatsView.encode(message.fullReadStatsView, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestStats message, length delimited. Does not implicitly {@link google.bigtable.v2.RequestStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {google.bigtable.v2.IRequestStats} message RequestStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestStats message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RequestStats} RequestStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestStats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RequestStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fullReadStatsView = $root.google.bigtable.v2.FullReadStatsView.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RequestStats} RequestStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestStats message. + * @function verify + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fullReadStatsView != null && message.hasOwnProperty("fullReadStatsView")) { + properties.statsView = 1; + { + var error = $root.google.bigtable.v2.FullReadStatsView.verify(message.fullReadStatsView); + if (error) + return "fullReadStatsView." + error; + } + } + return null; + }; + + /** + * Creates a RequestStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RequestStats} RequestStats + */ + RequestStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RequestStats) + return object; + var message = new $root.google.bigtable.v2.RequestStats(); + if (object.fullReadStatsView != null) { + if (typeof object.fullReadStatsView !== "object") + throw TypeError(".google.bigtable.v2.RequestStats.fullReadStatsView: object expected"); + message.fullReadStatsView = $root.google.bigtable.v2.FullReadStatsView.fromObject(object.fullReadStatsView); + } + return message; + }; + + /** + * Creates a plain object from a RequestStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {google.bigtable.v2.RequestStats} message RequestStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.fullReadStatsView != null && message.hasOwnProperty("fullReadStatsView")) { + object.fullReadStatsView = $root.google.bigtable.v2.FullReadStatsView.toObject(message.fullReadStatsView, options); + if (options.oneofs) + object.statsView = "fullReadStatsView"; + } + return object; + }; + + /** + * Converts this RequestStats to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RequestStats + * @instance + * @returns {Object.} JSON object + */ + RequestStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestStats + * @function getTypeUrl + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RequestStats"; + }; + + return RequestStats; + })(); + + v2.FeatureFlags = (function() { + + /** + * Properties of a FeatureFlags. + * @memberof google.bigtable.v2 + * @interface IFeatureFlags + * @property {boolean|null} [reverseScans] FeatureFlags reverseScans + * @property {boolean|null} [mutateRowsRateLimit] FeatureFlags mutateRowsRateLimit + * @property {boolean|null} [mutateRowsRateLimit2] FeatureFlags mutateRowsRateLimit2 + * @property {boolean|null} [lastScannedRowResponses] FeatureFlags lastScannedRowResponses + * @property {boolean|null} [routingCookie] FeatureFlags routingCookie + * @property {boolean|null} [retryInfo] FeatureFlags retryInfo + * @property {boolean|null} [clientSideMetricsEnabled] FeatureFlags clientSideMetricsEnabled + * @property {boolean|null} [trafficDirectorEnabled] FeatureFlags trafficDirectorEnabled + * @property {boolean|null} [directAccessRequested] FeatureFlags directAccessRequested + * @property {boolean|null} [peerInfo] FeatureFlags peerInfo + */ + + /** + * Constructs a new FeatureFlags. + * @memberof google.bigtable.v2 + * @classdesc Represents a FeatureFlags. + * @implements IFeatureFlags + * @constructor + * @param {google.bigtable.v2.IFeatureFlags=} [properties] Properties to set + */ + function FeatureFlags(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureFlags reverseScans. + * @member {boolean} reverseScans + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.reverseScans = false; + + /** + * FeatureFlags mutateRowsRateLimit. + * @member {boolean} mutateRowsRateLimit + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.mutateRowsRateLimit = false; + + /** + * FeatureFlags mutateRowsRateLimit2. + * @member {boolean} mutateRowsRateLimit2 + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.mutateRowsRateLimit2 = false; + + /** + * FeatureFlags lastScannedRowResponses. + * @member {boolean} lastScannedRowResponses + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.lastScannedRowResponses = false; + + /** + * FeatureFlags routingCookie. + * @member {boolean} routingCookie + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.routingCookie = false; + + /** + * FeatureFlags retryInfo. + * @member {boolean} retryInfo + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.retryInfo = false; + + /** + * FeatureFlags clientSideMetricsEnabled. + * @member {boolean} clientSideMetricsEnabled + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.clientSideMetricsEnabled = false; + + /** + * FeatureFlags trafficDirectorEnabled. + * @member {boolean} trafficDirectorEnabled + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.trafficDirectorEnabled = false; + + /** + * FeatureFlags directAccessRequested. + * @member {boolean} directAccessRequested + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.directAccessRequested = false; + + /** + * FeatureFlags peerInfo. + * @member {boolean} peerInfo + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.peerInfo = false; + + /** + * Creates a new FeatureFlags instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {google.bigtable.v2.IFeatureFlags=} [properties] Properties to set + * @returns {google.bigtable.v2.FeatureFlags} FeatureFlags instance + */ + FeatureFlags.create = function create(properties) { + return new FeatureFlags(properties); + }; + + /** + * Encodes the specified FeatureFlags message. Does not implicitly {@link google.bigtable.v2.FeatureFlags.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {google.bigtable.v2.IFeatureFlags} message FeatureFlags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureFlags.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reverseScans != null && Object.hasOwnProperty.call(message, "reverseScans")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.reverseScans); + if (message.mutateRowsRateLimit != null && Object.hasOwnProperty.call(message, "mutateRowsRateLimit")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.mutateRowsRateLimit); + if (message.lastScannedRowResponses != null && Object.hasOwnProperty.call(message, "lastScannedRowResponses")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.lastScannedRowResponses); + if (message.mutateRowsRateLimit2 != null && Object.hasOwnProperty.call(message, "mutateRowsRateLimit2")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.mutateRowsRateLimit2); + if (message.routingCookie != null && Object.hasOwnProperty.call(message, "routingCookie")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.routingCookie); + if (message.retryInfo != null && Object.hasOwnProperty.call(message, "retryInfo")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.retryInfo); + if (message.clientSideMetricsEnabled != null && Object.hasOwnProperty.call(message, "clientSideMetricsEnabled")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.clientSideMetricsEnabled); + if (message.trafficDirectorEnabled != null && Object.hasOwnProperty.call(message, "trafficDirectorEnabled")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.trafficDirectorEnabled); + if (message.directAccessRequested != null && Object.hasOwnProperty.call(message, "directAccessRequested")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.directAccessRequested); + if (message.peerInfo != null && Object.hasOwnProperty.call(message, "peerInfo")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.peerInfo); + return writer; + }; + + /** + * Encodes the specified FeatureFlags message, length delimited. Does not implicitly {@link google.bigtable.v2.FeatureFlags.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {google.bigtable.v2.IFeatureFlags} message FeatureFlags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureFlags.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureFlags message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.FeatureFlags} FeatureFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureFlags.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.FeatureFlags(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.reverseScans = reader.bool(); + break; + } + case 3: { + message.mutateRowsRateLimit = reader.bool(); + break; + } + case 5: { + message.mutateRowsRateLimit2 = reader.bool(); + break; + } + case 4: { + message.lastScannedRowResponses = reader.bool(); + break; + } + case 6: { + message.routingCookie = reader.bool(); + break; + } + case 7: { + message.retryInfo = reader.bool(); + break; + } + case 8: { + message.clientSideMetricsEnabled = reader.bool(); + break; + } + case 9: { + message.trafficDirectorEnabled = reader.bool(); + break; + } + case 10: { + message.directAccessRequested = reader.bool(); + break; + } + case 11: { + message.peerInfo = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureFlags message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.FeatureFlags} FeatureFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureFlags.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureFlags message. + * @function verify + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureFlags.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reverseScans != null && message.hasOwnProperty("reverseScans")) + if (typeof message.reverseScans !== "boolean") + return "reverseScans: boolean expected"; + if (message.mutateRowsRateLimit != null && message.hasOwnProperty("mutateRowsRateLimit")) + if (typeof message.mutateRowsRateLimit !== "boolean") + return "mutateRowsRateLimit: boolean expected"; + if (message.mutateRowsRateLimit2 != null && message.hasOwnProperty("mutateRowsRateLimit2")) + if (typeof message.mutateRowsRateLimit2 !== "boolean") + return "mutateRowsRateLimit2: boolean expected"; + if (message.lastScannedRowResponses != null && message.hasOwnProperty("lastScannedRowResponses")) + if (typeof message.lastScannedRowResponses !== "boolean") + return "lastScannedRowResponses: boolean expected"; + if (message.routingCookie != null && message.hasOwnProperty("routingCookie")) + if (typeof message.routingCookie !== "boolean") + return "routingCookie: boolean expected"; + if (message.retryInfo != null && message.hasOwnProperty("retryInfo")) + if (typeof message.retryInfo !== "boolean") + return "retryInfo: boolean expected"; + if (message.clientSideMetricsEnabled != null && message.hasOwnProperty("clientSideMetricsEnabled")) + if (typeof message.clientSideMetricsEnabled !== "boolean") + return "clientSideMetricsEnabled: boolean expected"; + if (message.trafficDirectorEnabled != null && message.hasOwnProperty("trafficDirectorEnabled")) + if (typeof message.trafficDirectorEnabled !== "boolean") + return "trafficDirectorEnabled: boolean expected"; + if (message.directAccessRequested != null && message.hasOwnProperty("directAccessRequested")) + if (typeof message.directAccessRequested !== "boolean") + return "directAccessRequested: boolean expected"; + if (message.peerInfo != null && message.hasOwnProperty("peerInfo")) + if (typeof message.peerInfo !== "boolean") + return "peerInfo: boolean expected"; + return null; + }; + + /** + * Creates a FeatureFlags message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.FeatureFlags} FeatureFlags + */ + FeatureFlags.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.FeatureFlags) + return object; + var message = new $root.google.bigtable.v2.FeatureFlags(); + if (object.reverseScans != null) + message.reverseScans = Boolean(object.reverseScans); + if (object.mutateRowsRateLimit != null) + message.mutateRowsRateLimit = Boolean(object.mutateRowsRateLimit); + if (object.mutateRowsRateLimit2 != null) + message.mutateRowsRateLimit2 = Boolean(object.mutateRowsRateLimit2); + if (object.lastScannedRowResponses != null) + message.lastScannedRowResponses = Boolean(object.lastScannedRowResponses); + if (object.routingCookie != null) + message.routingCookie = Boolean(object.routingCookie); + if (object.retryInfo != null) + message.retryInfo = Boolean(object.retryInfo); + if (object.clientSideMetricsEnabled != null) + message.clientSideMetricsEnabled = Boolean(object.clientSideMetricsEnabled); + if (object.trafficDirectorEnabled != null) + message.trafficDirectorEnabled = Boolean(object.trafficDirectorEnabled); + if (object.directAccessRequested != null) + message.directAccessRequested = Boolean(object.directAccessRequested); + if (object.peerInfo != null) + message.peerInfo = Boolean(object.peerInfo); + return message; + }; + + /** + * Creates a plain object from a FeatureFlags message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {google.bigtable.v2.FeatureFlags} message FeatureFlags + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureFlags.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.reverseScans = false; + object.mutateRowsRateLimit = false; + object.lastScannedRowResponses = false; + object.mutateRowsRateLimit2 = false; + object.routingCookie = false; + object.retryInfo = false; + object.clientSideMetricsEnabled = false; + object.trafficDirectorEnabled = false; + object.directAccessRequested = false; + object.peerInfo = false; + } + if (message.reverseScans != null && message.hasOwnProperty("reverseScans")) + object.reverseScans = message.reverseScans; + if (message.mutateRowsRateLimit != null && message.hasOwnProperty("mutateRowsRateLimit")) + object.mutateRowsRateLimit = message.mutateRowsRateLimit; + if (message.lastScannedRowResponses != null && message.hasOwnProperty("lastScannedRowResponses")) + object.lastScannedRowResponses = message.lastScannedRowResponses; + if (message.mutateRowsRateLimit2 != null && message.hasOwnProperty("mutateRowsRateLimit2")) + object.mutateRowsRateLimit2 = message.mutateRowsRateLimit2; + if (message.routingCookie != null && message.hasOwnProperty("routingCookie")) + object.routingCookie = message.routingCookie; + if (message.retryInfo != null && message.hasOwnProperty("retryInfo")) + object.retryInfo = message.retryInfo; + if (message.clientSideMetricsEnabled != null && message.hasOwnProperty("clientSideMetricsEnabled")) + object.clientSideMetricsEnabled = message.clientSideMetricsEnabled; + if (message.trafficDirectorEnabled != null && message.hasOwnProperty("trafficDirectorEnabled")) + object.trafficDirectorEnabled = message.trafficDirectorEnabled; + if (message.directAccessRequested != null && message.hasOwnProperty("directAccessRequested")) + object.directAccessRequested = message.directAccessRequested; + if (message.peerInfo != null && message.hasOwnProperty("peerInfo")) + object.peerInfo = message.peerInfo; + return object; + }; + + /** + * Converts this FeatureFlags to JSON. + * @function toJSON + * @memberof google.bigtable.v2.FeatureFlags + * @instance + * @returns {Object.} JSON object + */ + FeatureFlags.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureFlags + * @function getTypeUrl + * @memberof google.bigtable.v2.FeatureFlags + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureFlags.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.FeatureFlags"; + }; + + return FeatureFlags; + })(); + + v2.PeerInfo = (function() { + + /** + * Properties of a PeerInfo. + * @memberof google.bigtable.v2 + * @interface IPeerInfo + * @property {number|Long|null} [googleFrontendId] PeerInfo googleFrontendId + * @property {number|Long|null} [applicationFrontendId] PeerInfo applicationFrontendId + * @property {string|null} [applicationFrontendZone] PeerInfo applicationFrontendZone + * @property {string|null} [applicationFrontendSubzone] PeerInfo applicationFrontendSubzone + * @property {google.bigtable.v2.PeerInfo.TransportType|null} [transportType] PeerInfo transportType + */ + + /** + * Constructs a new PeerInfo. + * @memberof google.bigtable.v2 + * @classdesc Represents a PeerInfo. + * @implements IPeerInfo + * @constructor + * @param {google.bigtable.v2.IPeerInfo=} [properties] Properties to set + */ + function PeerInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PeerInfo googleFrontendId. + * @member {number|Long} googleFrontendId + * @memberof google.bigtable.v2.PeerInfo + * @instance + */ + PeerInfo.prototype.googleFrontendId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PeerInfo applicationFrontendId. + * @member {number|Long} applicationFrontendId + * @memberof google.bigtable.v2.PeerInfo + * @instance + */ + PeerInfo.prototype.applicationFrontendId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PeerInfo applicationFrontendZone. + * @member {string} applicationFrontendZone + * @memberof google.bigtable.v2.PeerInfo + * @instance + */ + PeerInfo.prototype.applicationFrontendZone = ""; + + /** + * PeerInfo applicationFrontendSubzone. + * @member {string} applicationFrontendSubzone + * @memberof google.bigtable.v2.PeerInfo + * @instance + */ + PeerInfo.prototype.applicationFrontendSubzone = ""; + + /** + * PeerInfo transportType. + * @member {google.bigtable.v2.PeerInfo.TransportType} transportType + * @memberof google.bigtable.v2.PeerInfo + * @instance + */ + PeerInfo.prototype.transportType = 0; + + /** + * Creates a new PeerInfo instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {google.bigtable.v2.IPeerInfo=} [properties] Properties to set + * @returns {google.bigtable.v2.PeerInfo} PeerInfo instance + */ + PeerInfo.create = function create(properties) { + return new PeerInfo(properties); + }; + + /** + * Encodes the specified PeerInfo message. Does not implicitly {@link google.bigtable.v2.PeerInfo.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {google.bigtable.v2.IPeerInfo} message PeerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeerInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.googleFrontendId != null && Object.hasOwnProperty.call(message, "googleFrontendId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.googleFrontendId); + if (message.applicationFrontendId != null && Object.hasOwnProperty.call(message, "applicationFrontendId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.applicationFrontendId); + if (message.applicationFrontendZone != null && Object.hasOwnProperty.call(message, "applicationFrontendZone")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.applicationFrontendZone); + if (message.applicationFrontendSubzone != null && Object.hasOwnProperty.call(message, "applicationFrontendSubzone")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.applicationFrontendSubzone); + if (message.transportType != null && Object.hasOwnProperty.call(message, "transportType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.transportType); + return writer; + }; + + /** + * Encodes the specified PeerInfo message, length delimited. Does not implicitly {@link google.bigtable.v2.PeerInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {google.bigtable.v2.IPeerInfo} message PeerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeerInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PeerInfo message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.PeerInfo} PeerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeerInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.PeerInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.googleFrontendId = reader.int64(); + break; + } + case 2: { + message.applicationFrontendId = reader.int64(); + break; + } + case 3: { + message.applicationFrontendZone = reader.string(); + break; + } + case 4: { + message.applicationFrontendSubzone = reader.string(); + break; + } + case 5: { + message.transportType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PeerInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.PeerInfo} PeerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeerInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PeerInfo message. + * @function verify + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PeerInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.googleFrontendId != null && message.hasOwnProperty("googleFrontendId")) + if (!$util.isInteger(message.googleFrontendId) && !(message.googleFrontendId && $util.isInteger(message.googleFrontendId.low) && $util.isInteger(message.googleFrontendId.high))) + return "googleFrontendId: integer|Long expected"; + if (message.applicationFrontendId != null && message.hasOwnProperty("applicationFrontendId")) + if (!$util.isInteger(message.applicationFrontendId) && !(message.applicationFrontendId && $util.isInteger(message.applicationFrontendId.low) && $util.isInteger(message.applicationFrontendId.high))) + return "applicationFrontendId: integer|Long expected"; + if (message.applicationFrontendZone != null && message.hasOwnProperty("applicationFrontendZone")) + if (!$util.isString(message.applicationFrontendZone)) + return "applicationFrontendZone: string expected"; + if (message.applicationFrontendSubzone != null && message.hasOwnProperty("applicationFrontendSubzone")) + if (!$util.isString(message.applicationFrontendSubzone)) + return "applicationFrontendSubzone: string expected"; + if (message.transportType != null && message.hasOwnProperty("transportType")) + switch (message.transportType) { + default: + return "transportType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + return null; + }; + + /** + * Creates a PeerInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.PeerInfo} PeerInfo + */ + PeerInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.PeerInfo) + return object; + var message = new $root.google.bigtable.v2.PeerInfo(); + if (object.googleFrontendId != null) + if ($util.Long) + (message.googleFrontendId = $util.Long.fromValue(object.googleFrontendId)).unsigned = false; + else if (typeof object.googleFrontendId === "string") + message.googleFrontendId = parseInt(object.googleFrontendId, 10); + else if (typeof object.googleFrontendId === "number") + message.googleFrontendId = object.googleFrontendId; + else if (typeof object.googleFrontendId === "object") + message.googleFrontendId = new $util.LongBits(object.googleFrontendId.low >>> 0, object.googleFrontendId.high >>> 0).toNumber(); + if (object.applicationFrontendId != null) + if ($util.Long) + (message.applicationFrontendId = $util.Long.fromValue(object.applicationFrontendId)).unsigned = false; + else if (typeof object.applicationFrontendId === "string") + message.applicationFrontendId = parseInt(object.applicationFrontendId, 10); + else if (typeof object.applicationFrontendId === "number") + message.applicationFrontendId = object.applicationFrontendId; + else if (typeof object.applicationFrontendId === "object") + message.applicationFrontendId = new $util.LongBits(object.applicationFrontendId.low >>> 0, object.applicationFrontendId.high >>> 0).toNumber(); + if (object.applicationFrontendZone != null) + message.applicationFrontendZone = String(object.applicationFrontendZone); + if (object.applicationFrontendSubzone != null) + message.applicationFrontendSubzone = String(object.applicationFrontendSubzone); + switch (object.transportType) { + default: + if (typeof object.transportType === "number") { + message.transportType = object.transportType; + break; + } + break; + case "TRANSPORT_TYPE_UNKNOWN": + case 0: + message.transportType = 0; + break; + case "TRANSPORT_TYPE_EXTERNAL": + case 1: + message.transportType = 1; + break; + case "TRANSPORT_TYPE_CLOUD_PATH": + case 2: + message.transportType = 2; + break; + case "TRANSPORT_TYPE_DIRECT_ACCESS": + case 3: + message.transportType = 3; + break; + case "TRANSPORT_TYPE_SESSION_UNKNOWN": + case 4: + message.transportType = 4; + break; + case "TRANSPORT_TYPE_SESSION_EXTERNAL": + case 5: + message.transportType = 5; + break; + case "TRANSPORT_TYPE_SESSION_CLOUD_PATH": + case 6: + message.transportType = 6; + break; + case "TRANSPORT_TYPE_SESSION_DIRECT_ACCESS": + case 7: + message.transportType = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from a PeerInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {google.bigtable.v2.PeerInfo} message PeerInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PeerInfo.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.googleFrontendId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.googleFrontendId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.applicationFrontendId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.applicationFrontendId = options.longs === String ? "0" : 0; + object.applicationFrontendZone = ""; + object.applicationFrontendSubzone = ""; + object.transportType = options.enums === String ? "TRANSPORT_TYPE_UNKNOWN" : 0; + } + if (message.googleFrontendId != null && message.hasOwnProperty("googleFrontendId")) + if (typeof message.googleFrontendId === "number") + object.googleFrontendId = options.longs === String ? String(message.googleFrontendId) : message.googleFrontendId; + else + object.googleFrontendId = options.longs === String ? $util.Long.prototype.toString.call(message.googleFrontendId) : options.longs === Number ? new $util.LongBits(message.googleFrontendId.low >>> 0, message.googleFrontendId.high >>> 0).toNumber() : message.googleFrontendId; + if (message.applicationFrontendId != null && message.hasOwnProperty("applicationFrontendId")) + if (typeof message.applicationFrontendId === "number") + object.applicationFrontendId = options.longs === String ? String(message.applicationFrontendId) : message.applicationFrontendId; + else + object.applicationFrontendId = options.longs === String ? $util.Long.prototype.toString.call(message.applicationFrontendId) : options.longs === Number ? new $util.LongBits(message.applicationFrontendId.low >>> 0, message.applicationFrontendId.high >>> 0).toNumber() : message.applicationFrontendId; + if (message.applicationFrontendZone != null && message.hasOwnProperty("applicationFrontendZone")) + object.applicationFrontendZone = message.applicationFrontendZone; + if (message.applicationFrontendSubzone != null && message.hasOwnProperty("applicationFrontendSubzone")) + object.applicationFrontendSubzone = message.applicationFrontendSubzone; + if (message.transportType != null && message.hasOwnProperty("transportType")) + object.transportType = options.enums === String ? $root.google.bigtable.v2.PeerInfo.TransportType[message.transportType] === undefined ? message.transportType : $root.google.bigtable.v2.PeerInfo.TransportType[message.transportType] : message.transportType; + return object; + }; + + /** + * Converts this PeerInfo to JSON. + * @function toJSON + * @memberof google.bigtable.v2.PeerInfo + * @instance + * @returns {Object.} JSON object + */ + PeerInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PeerInfo + * @function getTypeUrl + * @memberof google.bigtable.v2.PeerInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PeerInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.PeerInfo"; + }; + + /** + * TransportType enum. + * @name google.bigtable.v2.PeerInfo.TransportType + * @enum {number} + * @property {number} TRANSPORT_TYPE_UNKNOWN=0 TRANSPORT_TYPE_UNKNOWN value + * @property {number} TRANSPORT_TYPE_EXTERNAL=1 TRANSPORT_TYPE_EXTERNAL value + * @property {number} TRANSPORT_TYPE_CLOUD_PATH=2 TRANSPORT_TYPE_CLOUD_PATH value + * @property {number} TRANSPORT_TYPE_DIRECT_ACCESS=3 TRANSPORT_TYPE_DIRECT_ACCESS value + * @property {number} TRANSPORT_TYPE_SESSION_UNKNOWN=4 TRANSPORT_TYPE_SESSION_UNKNOWN value + * @property {number} TRANSPORT_TYPE_SESSION_EXTERNAL=5 TRANSPORT_TYPE_SESSION_EXTERNAL value + * @property {number} TRANSPORT_TYPE_SESSION_CLOUD_PATH=6 TRANSPORT_TYPE_SESSION_CLOUD_PATH value + * @property {number} TRANSPORT_TYPE_SESSION_DIRECT_ACCESS=7 TRANSPORT_TYPE_SESSION_DIRECT_ACCESS value + */ + PeerInfo.TransportType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSPORT_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TRANSPORT_TYPE_EXTERNAL"] = 1; + values[valuesById[2] = "TRANSPORT_TYPE_CLOUD_PATH"] = 2; + values[valuesById[3] = "TRANSPORT_TYPE_DIRECT_ACCESS"] = 3; + values[valuesById[4] = "TRANSPORT_TYPE_SESSION_UNKNOWN"] = 4; + values[valuesById[5] = "TRANSPORT_TYPE_SESSION_EXTERNAL"] = 5; + values[valuesById[6] = "TRANSPORT_TYPE_SESSION_CLOUD_PATH"] = 6; + values[valuesById[7] = "TRANSPORT_TYPE_SESSION_DIRECT_ACCESS"] = 7; + return values; + })(); + + return PeerInfo; + })(); + + v2.ResponseParams = (function() { + + /** + * Properties of a ResponseParams. + * @memberof google.bigtable.v2 + * @interface IResponseParams + * @property {string|null} [zoneId] ResponseParams zoneId + * @property {string|null} [clusterId] ResponseParams clusterId + * @property {number|Long|null} [afeId] ResponseParams afeId + */ + + /** + * Constructs a new ResponseParams. + * @memberof google.bigtable.v2 + * @classdesc Represents a ResponseParams. + * @implements IResponseParams + * @constructor + * @param {google.bigtable.v2.IResponseParams=} [properties] Properties to set + */ + function ResponseParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseParams zoneId. + * @member {string|null|undefined} zoneId + * @memberof google.bigtable.v2.ResponseParams + * @instance + */ + ResponseParams.prototype.zoneId = null; + + /** + * ResponseParams clusterId. + * @member {string|null|undefined} clusterId + * @memberof google.bigtable.v2.ResponseParams + * @instance + */ + ResponseParams.prototype.clusterId = null; + + /** + * ResponseParams afeId. + * @member {number|Long|null|undefined} afeId + * @memberof google.bigtable.v2.ResponseParams + * @instance + */ + ResponseParams.prototype.afeId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ResponseParams.prototype, "_zoneId", { + get: $util.oneOfGetter($oneOfFields = ["zoneId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ResponseParams.prototype, "_clusterId", { + get: $util.oneOfGetter($oneOfFields = ["clusterId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ResponseParams.prototype, "_afeId", { + get: $util.oneOfGetter($oneOfFields = ["afeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResponseParams instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {google.bigtable.v2.IResponseParams=} [properties] Properties to set + * @returns {google.bigtable.v2.ResponseParams} ResponseParams instance + */ + ResponseParams.create = function create(properties) { + return new ResponseParams(properties); + }; + + /** + * Encodes the specified ResponseParams message. Does not implicitly {@link google.bigtable.v2.ResponseParams.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {google.bigtable.v2.IResponseParams} message ResponseParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.afeId != null && Object.hasOwnProperty.call(message, "afeId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.afeId); + return writer; + }; + + /** + * Encodes the specified ResponseParams message, length delimited. Does not implicitly {@link google.bigtable.v2.ResponseParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {google.bigtable.v2.IResponseParams} message ResponseParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseParams message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ResponseParams} ResponseParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseParams.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ResponseParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.zoneId = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.afeId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ResponseParams} ResponseParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseParams message. + * @function verify + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) { + properties._zoneId = 1; + if (!$util.isString(message.zoneId)) + return "zoneId: string expected"; + } + if (message.clusterId != null && message.hasOwnProperty("clusterId")) { + properties._clusterId = 1; + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + } + if (message.afeId != null && message.hasOwnProperty("afeId")) { + properties._afeId = 1; + if (!$util.isInteger(message.afeId) && !(message.afeId && $util.isInteger(message.afeId.low) && $util.isInteger(message.afeId.high))) + return "afeId: integer|Long expected"; + } + return null; + }; + + /** + * Creates a ResponseParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ResponseParams} ResponseParams + */ + ResponseParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ResponseParams) + return object; + var message = new $root.google.bigtable.v2.ResponseParams(); + if (object.zoneId != null) + message.zoneId = String(object.zoneId); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.afeId != null) + if ($util.Long) + (message.afeId = $util.Long.fromValue(object.afeId)).unsigned = false; + else if (typeof object.afeId === "string") + message.afeId = parseInt(object.afeId, 10); + else if (typeof object.afeId === "number") + message.afeId = object.afeId; + else if (typeof object.afeId === "object") + message.afeId = new $util.LongBits(object.afeId.low >>> 0, object.afeId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ResponseParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {google.bigtable.v2.ResponseParams} message ResponseParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) { + object.zoneId = message.zoneId; + if (options.oneofs) + object._zoneId = "zoneId"; + } + if (message.clusterId != null && message.hasOwnProperty("clusterId")) { + object.clusterId = message.clusterId; + if (options.oneofs) + object._clusterId = "clusterId"; + } + if (message.afeId != null && message.hasOwnProperty("afeId")) { + if (typeof message.afeId === "number") + object.afeId = options.longs === String ? String(message.afeId) : message.afeId; + else + object.afeId = options.longs === String ? $util.Long.prototype.toString.call(message.afeId) : options.longs === Number ? new $util.LongBits(message.afeId.low >>> 0, message.afeId.high >>> 0).toNumber() : message.afeId; + if (options.oneofs) + object._afeId = "afeId"; + } + return object; + }; + + /** + * Converts this ResponseParams to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ResponseParams + * @instance + * @returns {Object.} JSON object + */ + ResponseParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResponseParams + * @function getTypeUrl + * @memberof google.bigtable.v2.ResponseParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResponseParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ResponseParams"; + }; + + return ResponseParams; + })(); + + return v2; + })(); + + bigtable.testproxy = (function() { + + /** + * Namespace testproxy. + * @memberof google.bigtable + * @namespace + */ + var testproxy = {}; + + /** + * OptionalFeatureConfig enum. + * @name google.bigtable.testproxy.OptionalFeatureConfig + * @enum {number} + * @property {number} OPTIONAL_FEATURE_CONFIG_DEFAULT=0 OPTIONAL_FEATURE_CONFIG_DEFAULT value + * @property {number} OPTIONAL_FEATURE_CONFIG_ENABLE_ALL=1 OPTIONAL_FEATURE_CONFIG_ENABLE_ALL value + */ + testproxy.OptionalFeatureConfig = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPTIONAL_FEATURE_CONFIG_DEFAULT"] = 0; + values[valuesById[1] = "OPTIONAL_FEATURE_CONFIG_ENABLE_ALL"] = 1; + return values; + })(); + + testproxy.CreateClientRequest = (function() { + + /** + * Properties of a CreateClientRequest. + * @memberof google.bigtable.testproxy + * @interface ICreateClientRequest + * @property {string|null} [clientId] CreateClientRequest clientId + * @property {string|null} [dataTarget] CreateClientRequest dataTarget + * @property {string|null} [projectId] CreateClientRequest projectId + * @property {string|null} [instanceId] CreateClientRequest instanceId + * @property {string|null} [appProfileId] CreateClientRequest appProfileId + * @property {google.protobuf.IDuration|null} [perOperationTimeout] CreateClientRequest perOperationTimeout + * @property {google.bigtable.testproxy.OptionalFeatureConfig|null} [optionalFeatureConfig] CreateClientRequest optionalFeatureConfig + * @property {google.bigtable.testproxy.CreateClientRequest.ISecurityOptions|null} [securityOptions] CreateClientRequest securityOptions + */ + + /** + * Constructs a new CreateClientRequest. + * @memberof google.bigtable.testproxy + * @classdesc Represents a CreateClientRequest. + * @implements ICreateClientRequest + * @constructor + * @param {google.bigtable.testproxy.ICreateClientRequest=} [properties] Properties to set + */ + function CreateClientRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClientRequest clientId. + * @member {string} clientId + * @memberof google.bigtable.testproxy.CreateClientRequest + * @instance + */ + CreateClientRequest.prototype.clientId = ""; + + /** + * CreateClientRequest dataTarget. + * @member {string} dataTarget + * @memberof google.bigtable.testproxy.CreateClientRequest + * @instance + */ + CreateClientRequest.prototype.dataTarget = ""; + + /** + * CreateClientRequest projectId. + * @member {string} projectId + * @memberof google.bigtable.testproxy.CreateClientRequest + * @instance + */ + CreateClientRequest.prototype.projectId = ""; + + /** + * CreateClientRequest instanceId. + * @member {string} instanceId + * @memberof google.bigtable.testproxy.CreateClientRequest + * @instance + */ + CreateClientRequest.prototype.instanceId = ""; + + /** + * CreateClientRequest appProfileId. + * @member {string} appProfileId + * @memberof google.bigtable.testproxy.CreateClientRequest + * @instance + */ + CreateClientRequest.prototype.appProfileId = ""; + + /** + * CreateClientRequest perOperationTimeout. + * @member {google.protobuf.IDuration|null|undefined} perOperationTimeout + * @memberof google.bigtable.testproxy.CreateClientRequest + * @instance + */ + CreateClientRequest.prototype.perOperationTimeout = null; + + /** + * CreateClientRequest optionalFeatureConfig. + * @member {google.bigtable.testproxy.OptionalFeatureConfig} optionalFeatureConfig + * @memberof google.bigtable.testproxy.CreateClientRequest + * @instance + */ + CreateClientRequest.prototype.optionalFeatureConfig = 0; + + /** + * CreateClientRequest securityOptions. + * @member {google.bigtable.testproxy.CreateClientRequest.ISecurityOptions|null|undefined} securityOptions + * @memberof google.bigtable.testproxy.CreateClientRequest + * @instance + */ + CreateClientRequest.prototype.securityOptions = null; + + /** + * Creates a new CreateClientRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.CreateClientRequest + * @static + * @param {google.bigtable.testproxy.ICreateClientRequest=} [properties] Properties to set + * @returns {google.bigtable.testproxy.CreateClientRequest} CreateClientRequest instance + */ + CreateClientRequest.create = function create(properties) { + return new CreateClientRequest(properties); + }; + + /** + * Encodes the specified CreateClientRequest message. Does not implicitly {@link google.bigtable.testproxy.CreateClientRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.CreateClientRequest + * @static + * @param {google.bigtable.testproxy.ICreateClientRequest} message CreateClientRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClientRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.dataTarget != null && Object.hasOwnProperty.call(message, "dataTarget")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataTarget); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.instanceId); + if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.appProfileId); + if (message.perOperationTimeout != null && Object.hasOwnProperty.call(message, "perOperationTimeout")) + $root.google.protobuf.Duration.encode(message.perOperationTimeout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.optionalFeatureConfig != null && Object.hasOwnProperty.call(message, "optionalFeatureConfig")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.optionalFeatureConfig); + if (message.securityOptions != null && Object.hasOwnProperty.call(message, "securityOptions")) + $root.google.bigtable.testproxy.CreateClientRequest.SecurityOptions.encode(message.securityOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateClientRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CreateClientRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.CreateClientRequest + * @static + * @param {google.bigtable.testproxy.ICreateClientRequest} message CreateClientRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClientRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClientRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.CreateClientRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.CreateClientRequest} CreateClientRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClientRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.CreateClientRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.dataTarget = reader.string(); + break; + } + case 3: { + message.projectId = reader.string(); + break; + } + case 4: { + message.instanceId = reader.string(); + break; + } + case 5: { + message.appProfileId = reader.string(); + break; + } + case 6: { + message.perOperationTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.optionalFeatureConfig = reader.int32(); + break; + } + case 8: { + message.securityOptions = $root.google.bigtable.testproxy.CreateClientRequest.SecurityOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClientRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.CreateClientRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.CreateClientRequest} CreateClientRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClientRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClientRequest message. + * @function verify + * @memberof google.bigtable.testproxy.CreateClientRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClientRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.dataTarget != null && message.hasOwnProperty("dataTarget")) + if (!$util.isString(message.dataTarget)) + return "dataTarget: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + if (!$util.isString(message.appProfileId)) + return "appProfileId: string expected"; + if (message.perOperationTimeout != null && message.hasOwnProperty("perOperationTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.perOperationTimeout); + if (error) + return "perOperationTimeout." + error; + } + if (message.optionalFeatureConfig != null && message.hasOwnProperty("optionalFeatureConfig")) + switch (message.optionalFeatureConfig) { + default: + return "optionalFeatureConfig: enum value expected"; + case 0: + case 1: + break; + } + if (message.securityOptions != null && message.hasOwnProperty("securityOptions")) { + var error = $root.google.bigtable.testproxy.CreateClientRequest.SecurityOptions.verify(message.securityOptions); + if (error) + return "securityOptions." + error; + } + return null; + }; + + /** + * Creates a CreateClientRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.CreateClientRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.CreateClientRequest} CreateClientRequest + */ + CreateClientRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.CreateClientRequest) + return object; + var message = new $root.google.bigtable.testproxy.CreateClientRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.dataTarget != null) + message.dataTarget = String(object.dataTarget); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.appProfileId != null) + message.appProfileId = String(object.appProfileId); + if (object.perOperationTimeout != null) { + if (typeof object.perOperationTimeout !== "object") + throw TypeError(".google.bigtable.testproxy.CreateClientRequest.perOperationTimeout: object expected"); + message.perOperationTimeout = $root.google.protobuf.Duration.fromObject(object.perOperationTimeout); + } + switch (object.optionalFeatureConfig) { + default: + if (typeof object.optionalFeatureConfig === "number") { + message.optionalFeatureConfig = object.optionalFeatureConfig; + break; + } + break; + case "OPTIONAL_FEATURE_CONFIG_DEFAULT": + case 0: + message.optionalFeatureConfig = 0; + break; + case "OPTIONAL_FEATURE_CONFIG_ENABLE_ALL": + case 1: + message.optionalFeatureConfig = 1; + break; + } + if (object.securityOptions != null) { + if (typeof object.securityOptions !== "object") + throw TypeError(".google.bigtable.testproxy.CreateClientRequest.securityOptions: object expected"); + message.securityOptions = $root.google.bigtable.testproxy.CreateClientRequest.SecurityOptions.fromObject(object.securityOptions); + } + return message; + }; + + /** + * Creates a plain object from a CreateClientRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.CreateClientRequest + * @static + * @param {google.bigtable.testproxy.CreateClientRequest} message CreateClientRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClientRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.dataTarget = ""; + object.projectId = ""; + object.instanceId = ""; + object.appProfileId = ""; + object.perOperationTimeout = null; + object.optionalFeatureConfig = options.enums === String ? "OPTIONAL_FEATURE_CONFIG_DEFAULT" : 0; + object.securityOptions = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.dataTarget != null && message.hasOwnProperty("dataTarget")) + object.dataTarget = message.dataTarget; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + object.appProfileId = message.appProfileId; + if (message.perOperationTimeout != null && message.hasOwnProperty("perOperationTimeout")) + object.perOperationTimeout = $root.google.protobuf.Duration.toObject(message.perOperationTimeout, options); + if (message.optionalFeatureConfig != null && message.hasOwnProperty("optionalFeatureConfig")) + object.optionalFeatureConfig = options.enums === String ? $root.google.bigtable.testproxy.OptionalFeatureConfig[message.optionalFeatureConfig] === undefined ? message.optionalFeatureConfig : $root.google.bigtable.testproxy.OptionalFeatureConfig[message.optionalFeatureConfig] : message.optionalFeatureConfig; + if (message.securityOptions != null && message.hasOwnProperty("securityOptions")) + object.securityOptions = $root.google.bigtable.testproxy.CreateClientRequest.SecurityOptions.toObject(message.securityOptions, options); + return object; + }; + + /** + * Converts this CreateClientRequest to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.CreateClientRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClientRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClientRequest + * @function getTypeUrl + * @memberof google.bigtable.testproxy.CreateClientRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClientRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.CreateClientRequest"; + }; + + CreateClientRequest.SecurityOptions = (function() { + + /** + * Properties of a SecurityOptions. + * @memberof google.bigtable.testproxy.CreateClientRequest + * @interface ISecurityOptions + * @property {string|null} [accessToken] SecurityOptions accessToken + * @property {boolean|null} [useSsl] SecurityOptions useSsl + * @property {string|null} [sslEndpointOverride] SecurityOptions sslEndpointOverride + * @property {string|null} [sslRootCertsPem] SecurityOptions sslRootCertsPem + */ + + /** + * Constructs a new SecurityOptions. + * @memberof google.bigtable.testproxy.CreateClientRequest + * @classdesc Represents a SecurityOptions. + * @implements ISecurityOptions + * @constructor + * @param {google.bigtable.testproxy.CreateClientRequest.ISecurityOptions=} [properties] Properties to set + */ + function SecurityOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityOptions accessToken. + * @member {string} accessToken + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @instance + */ + SecurityOptions.prototype.accessToken = ""; + + /** + * SecurityOptions useSsl. + * @member {boolean} useSsl + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @instance + */ + SecurityOptions.prototype.useSsl = false; + + /** + * SecurityOptions sslEndpointOverride. + * @member {string} sslEndpointOverride + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @instance + */ + SecurityOptions.prototype.sslEndpointOverride = ""; + + /** + * SecurityOptions sslRootCertsPem. + * @member {string} sslRootCertsPem + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @instance + */ + SecurityOptions.prototype.sslRootCertsPem = ""; + + /** + * Creates a new SecurityOptions instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @static + * @param {google.bigtable.testproxy.CreateClientRequest.ISecurityOptions=} [properties] Properties to set + * @returns {google.bigtable.testproxy.CreateClientRequest.SecurityOptions} SecurityOptions instance + */ + SecurityOptions.create = function create(properties) { + return new SecurityOptions(properties); + }; + + /** + * Encodes the specified SecurityOptions message. Does not implicitly {@link google.bigtable.testproxy.CreateClientRequest.SecurityOptions.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @static + * @param {google.bigtable.testproxy.CreateClientRequest.ISecurityOptions} message SecurityOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accessToken); + if (message.useSsl != null && Object.hasOwnProperty.call(message, "useSsl")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useSsl); + if (message.sslEndpointOverride != null && Object.hasOwnProperty.call(message, "sslEndpointOverride")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sslEndpointOverride); + if (message.sslRootCertsPem != null && Object.hasOwnProperty.call(message, "sslRootCertsPem")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sslRootCertsPem); + return writer; + }; + + /** + * Encodes the specified SecurityOptions message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CreateClientRequest.SecurityOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @static + * @param {google.bigtable.testproxy.CreateClientRequest.ISecurityOptions} message SecurityOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityOptions message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.CreateClientRequest.SecurityOptions} SecurityOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.CreateClientRequest.SecurityOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.accessToken = reader.string(); + break; + } + case 2: { + message.useSsl = reader.bool(); + break; + } + case 3: { + message.sslEndpointOverride = reader.string(); + break; + } + case 4: { + message.sslRootCertsPem = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.CreateClientRequest.SecurityOptions} SecurityOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityOptions message. + * @function verify + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (!$util.isString(message.accessToken)) + return "accessToken: string expected"; + if (message.useSsl != null && message.hasOwnProperty("useSsl")) + if (typeof message.useSsl !== "boolean") + return "useSsl: boolean expected"; + if (message.sslEndpointOverride != null && message.hasOwnProperty("sslEndpointOverride")) + if (!$util.isString(message.sslEndpointOverride)) + return "sslEndpointOverride: string expected"; + if (message.sslRootCertsPem != null && message.hasOwnProperty("sslRootCertsPem")) + if (!$util.isString(message.sslRootCertsPem)) + return "sslRootCertsPem: string expected"; + return null; + }; + + /** + * Creates a SecurityOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.CreateClientRequest.SecurityOptions} SecurityOptions + */ + SecurityOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.CreateClientRequest.SecurityOptions) + return object; + var message = new $root.google.bigtable.testproxy.CreateClientRequest.SecurityOptions(); + if (object.accessToken != null) + message.accessToken = String(object.accessToken); + if (object.useSsl != null) + message.useSsl = Boolean(object.useSsl); + if (object.sslEndpointOverride != null) + message.sslEndpointOverride = String(object.sslEndpointOverride); + if (object.sslRootCertsPem != null) + message.sslRootCertsPem = String(object.sslRootCertsPem); + return message; + }; + + /** + * Creates a plain object from a SecurityOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @static + * @param {google.bigtable.testproxy.CreateClientRequest.SecurityOptions} message SecurityOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.accessToken = ""; + object.useSsl = false; + object.sslEndpointOverride = ""; + object.sslRootCertsPem = ""; + } + if (message.accessToken != null && message.hasOwnProperty("accessToken")) + object.accessToken = message.accessToken; + if (message.useSsl != null && message.hasOwnProperty("useSsl")) + object.useSsl = message.useSsl; + if (message.sslEndpointOverride != null && message.hasOwnProperty("sslEndpointOverride")) + object.sslEndpointOverride = message.sslEndpointOverride; + if (message.sslRootCertsPem != null && message.hasOwnProperty("sslRootCertsPem")) + object.sslRootCertsPem = message.sslRootCertsPem; + return object; + }; + + /** + * Converts this SecurityOptions to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @instance + * @returns {Object.} JSON object + */ + SecurityOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityOptions + * @function getTypeUrl + * @memberof google.bigtable.testproxy.CreateClientRequest.SecurityOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.CreateClientRequest.SecurityOptions"; + }; + + return SecurityOptions; + })(); + + return CreateClientRequest; + })(); + + testproxy.CreateClientResponse = (function() { + + /** + * Properties of a CreateClientResponse. + * @memberof google.bigtable.testproxy + * @interface ICreateClientResponse + */ + + /** + * Constructs a new CreateClientResponse. + * @memberof google.bigtable.testproxy + * @classdesc Represents a CreateClientResponse. + * @implements ICreateClientResponse + * @constructor + * @param {google.bigtable.testproxy.ICreateClientResponse=} [properties] Properties to set + */ + function CreateClientResponse(properties) { + if (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 CreateClientResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.CreateClientResponse + * @static + * @param {google.bigtable.testproxy.ICreateClientResponse=} [properties] Properties to set + * @returns {google.bigtable.testproxy.CreateClientResponse} CreateClientResponse instance + */ + CreateClientResponse.create = function create(properties) { + return new CreateClientResponse(properties); + }; + + /** + * Encodes the specified CreateClientResponse message. Does not implicitly {@link google.bigtable.testproxy.CreateClientResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.CreateClientResponse + * @static + * @param {google.bigtable.testproxy.ICreateClientResponse} message CreateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClientResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateClientResponse message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CreateClientResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.CreateClientResponse + * @static + * @param {google.bigtable.testproxy.ICreateClientResponse} message CreateClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClientResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClientResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.CreateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.CreateClientResponse} CreateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClientResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.CreateClientResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClientResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.CreateClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.CreateClientResponse} CreateClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClientResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClientResponse message. + * @function verify + * @memberof google.bigtable.testproxy.CreateClientResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClientResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateClientResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.CreateClientResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.CreateClientResponse} CreateClientResponse + */ + CreateClientResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.CreateClientResponse) + return object; + return new $root.google.bigtable.testproxy.CreateClientResponse(); + }; + + /** + * Creates a plain object from a CreateClientResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.CreateClientResponse + * @static + * @param {google.bigtable.testproxy.CreateClientResponse} message CreateClientResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClientResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateClientResponse to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.CreateClientResponse + * @instance + * @returns {Object.} JSON object + */ + CreateClientResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClientResponse + * @function getTypeUrl + * @memberof google.bigtable.testproxy.CreateClientResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClientResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.CreateClientResponse"; + }; + + return CreateClientResponse; + })(); + + testproxy.CloseClientRequest = (function() { + + /** + * Properties of a CloseClientRequest. + * @memberof google.bigtable.testproxy + * @interface ICloseClientRequest + * @property {string|null} [clientId] CloseClientRequest clientId + */ + + /** + * Constructs a new CloseClientRequest. + * @memberof google.bigtable.testproxy + * @classdesc Represents a CloseClientRequest. + * @implements ICloseClientRequest + * @constructor + * @param {google.bigtable.testproxy.ICloseClientRequest=} [properties] Properties to set + */ + function CloseClientRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloseClientRequest clientId. + * @member {string} clientId + * @memberof google.bigtable.testproxy.CloseClientRequest + * @instance + */ + CloseClientRequest.prototype.clientId = ""; + + /** + * Creates a new CloseClientRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.CloseClientRequest + * @static + * @param {google.bigtable.testproxy.ICloseClientRequest=} [properties] Properties to set + * @returns {google.bigtable.testproxy.CloseClientRequest} CloseClientRequest instance + */ + CloseClientRequest.create = function create(properties) { + return new CloseClientRequest(properties); + }; + + /** + * Encodes the specified CloseClientRequest message. Does not implicitly {@link google.bigtable.testproxy.CloseClientRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.CloseClientRequest + * @static + * @param {google.bigtable.testproxy.ICloseClientRequest} message CloseClientRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseClientRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + return writer; + }; + + /** + * Encodes the specified CloseClientRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CloseClientRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.CloseClientRequest + * @static + * @param {google.bigtable.testproxy.ICloseClientRequest} message CloseClientRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseClientRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloseClientRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.CloseClientRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.CloseClientRequest} CloseClientRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseClientRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.CloseClientRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloseClientRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.CloseClientRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.CloseClientRequest} CloseClientRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseClientRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloseClientRequest message. + * @function verify + * @memberof google.bigtable.testproxy.CloseClientRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloseClientRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + return null; + }; + + /** + * Creates a CloseClientRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.CloseClientRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.CloseClientRequest} CloseClientRequest + */ + CloseClientRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.CloseClientRequest) + return object; + var message = new $root.google.bigtable.testproxy.CloseClientRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + return message; + }; + + /** + * Creates a plain object from a CloseClientRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.CloseClientRequest + * @static + * @param {google.bigtable.testproxy.CloseClientRequest} message CloseClientRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloseClientRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + return object; + }; + + /** + * Converts this CloseClientRequest to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.CloseClientRequest + * @instance + * @returns {Object.} JSON object + */ + CloseClientRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloseClientRequest + * @function getTypeUrl + * @memberof google.bigtable.testproxy.CloseClientRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseClientRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.CloseClientRequest"; + }; + + return CloseClientRequest; + })(); + + testproxy.CloseClientResponse = (function() { + + /** + * Properties of a CloseClientResponse. + * @memberof google.bigtable.testproxy + * @interface ICloseClientResponse + */ + + /** + * Constructs a new CloseClientResponse. + * @memberof google.bigtable.testproxy + * @classdesc Represents a CloseClientResponse. + * @implements ICloseClientResponse + * @constructor + * @param {google.bigtable.testproxy.ICloseClientResponse=} [properties] Properties to set + */ + function CloseClientResponse(properties) { + if (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 CloseClientResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.CloseClientResponse + * @static + * @param {google.bigtable.testproxy.ICloseClientResponse=} [properties] Properties to set + * @returns {google.bigtable.testproxy.CloseClientResponse} CloseClientResponse instance + */ + CloseClientResponse.create = function create(properties) { + return new CloseClientResponse(properties); + }; + + /** + * Encodes the specified CloseClientResponse message. Does not implicitly {@link google.bigtable.testproxy.CloseClientResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.CloseClientResponse + * @static + * @param {google.bigtable.testproxy.ICloseClientResponse} message CloseClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseClientResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CloseClientResponse message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CloseClientResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.CloseClientResponse + * @static + * @param {google.bigtable.testproxy.ICloseClientResponse} message CloseClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseClientResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloseClientResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.CloseClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.CloseClientResponse} CloseClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseClientResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.CloseClientResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloseClientResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.CloseClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.CloseClientResponse} CloseClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseClientResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloseClientResponse message. + * @function verify + * @memberof google.bigtable.testproxy.CloseClientResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloseClientResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CloseClientResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.CloseClientResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.CloseClientResponse} CloseClientResponse + */ + CloseClientResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.CloseClientResponse) + return object; + return new $root.google.bigtable.testproxy.CloseClientResponse(); + }; + + /** + * Creates a plain object from a CloseClientResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.CloseClientResponse + * @static + * @param {google.bigtable.testproxy.CloseClientResponse} message CloseClientResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloseClientResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CloseClientResponse to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.CloseClientResponse + * @instance + * @returns {Object.} JSON object + */ + CloseClientResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloseClientResponse + * @function getTypeUrl + * @memberof google.bigtable.testproxy.CloseClientResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseClientResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.CloseClientResponse"; + }; + + return CloseClientResponse; + })(); + + testproxy.RemoveClientRequest = (function() { + + /** + * Properties of a RemoveClientRequest. + * @memberof google.bigtable.testproxy + * @interface IRemoveClientRequest + * @property {string|null} [clientId] RemoveClientRequest clientId + */ + + /** + * Constructs a new RemoveClientRequest. + * @memberof google.bigtable.testproxy + * @classdesc Represents a RemoveClientRequest. + * @implements IRemoveClientRequest + * @constructor + * @param {google.bigtable.testproxy.IRemoveClientRequest=} [properties] Properties to set + */ + function RemoveClientRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveClientRequest clientId. + * @member {string} clientId + * @memberof google.bigtable.testproxy.RemoveClientRequest + * @instance + */ + RemoveClientRequest.prototype.clientId = ""; + + /** + * Creates a new RemoveClientRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.RemoveClientRequest + * @static + * @param {google.bigtable.testproxy.IRemoveClientRequest=} [properties] Properties to set + * @returns {google.bigtable.testproxy.RemoveClientRequest} RemoveClientRequest instance + */ + RemoveClientRequest.create = function create(properties) { + return new RemoveClientRequest(properties); + }; + + /** + * Encodes the specified RemoveClientRequest message. Does not implicitly {@link google.bigtable.testproxy.RemoveClientRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.RemoveClientRequest + * @static + * @param {google.bigtable.testproxy.IRemoveClientRequest} message RemoveClientRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveClientRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + return writer; + }; + + /** + * Encodes the specified RemoveClientRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.RemoveClientRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.RemoveClientRequest + * @static + * @param {google.bigtable.testproxy.IRemoveClientRequest} message RemoveClientRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveClientRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveClientRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.RemoveClientRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.RemoveClientRequest} RemoveClientRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveClientRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.RemoveClientRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveClientRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.RemoveClientRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.RemoveClientRequest} RemoveClientRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveClientRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveClientRequest message. + * @function verify + * @memberof google.bigtable.testproxy.RemoveClientRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveClientRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + return null; + }; + + /** + * Creates a RemoveClientRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.RemoveClientRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.RemoveClientRequest} RemoveClientRequest + */ + RemoveClientRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.RemoveClientRequest) + return object; + var message = new $root.google.bigtable.testproxy.RemoveClientRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + return message; + }; + + /** + * Creates a plain object from a RemoveClientRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.RemoveClientRequest + * @static + * @param {google.bigtable.testproxy.RemoveClientRequest} message RemoveClientRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveClientRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.clientId = ""; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + return object; + }; + + /** + * Converts this RemoveClientRequest to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.RemoveClientRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveClientRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoveClientRequest + * @function getTypeUrl + * @memberof google.bigtable.testproxy.RemoveClientRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveClientRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.RemoveClientRequest"; + }; + + return RemoveClientRequest; + })(); + + testproxy.RemoveClientResponse = (function() { + + /** + * Properties of a RemoveClientResponse. + * @memberof google.bigtable.testproxy + * @interface IRemoveClientResponse + */ + + /** + * Constructs a new RemoveClientResponse. + * @memberof google.bigtable.testproxy + * @classdesc Represents a RemoveClientResponse. + * @implements IRemoveClientResponse + * @constructor + * @param {google.bigtable.testproxy.IRemoveClientResponse=} [properties] Properties to set + */ + function RemoveClientResponse(properties) { + if (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 RemoveClientResponse instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.RemoveClientResponse + * @static + * @param {google.bigtable.testproxy.IRemoveClientResponse=} [properties] Properties to set + * @returns {google.bigtable.testproxy.RemoveClientResponse} RemoveClientResponse instance + */ + RemoveClientResponse.create = function create(properties) { + return new RemoveClientResponse(properties); + }; + + /** + * Encodes the specified RemoveClientResponse message. Does not implicitly {@link google.bigtable.testproxy.RemoveClientResponse.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.RemoveClientResponse + * @static + * @param {google.bigtable.testproxy.IRemoveClientResponse} message RemoveClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveClientResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RemoveClientResponse message, length delimited. Does not implicitly {@link google.bigtable.testproxy.RemoveClientResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.RemoveClientResponse + * @static + * @param {google.bigtable.testproxy.IRemoveClientResponse} message RemoveClientResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveClientResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveClientResponse message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.RemoveClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.RemoveClientResponse} RemoveClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveClientResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.RemoveClientResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveClientResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.RemoveClientResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.RemoveClientResponse} RemoveClientResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveClientResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveClientResponse message. + * @function verify + * @memberof google.bigtable.testproxy.RemoveClientResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveClientResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RemoveClientResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.RemoveClientResponse + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.RemoveClientResponse} RemoveClientResponse + */ + RemoveClientResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.RemoveClientResponse) + return object; + return new $root.google.bigtable.testproxy.RemoveClientResponse(); + }; + + /** + * Creates a plain object from a RemoveClientResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.RemoveClientResponse + * @static + * @param {google.bigtable.testproxy.RemoveClientResponse} message RemoveClientResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveClientResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RemoveClientResponse to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.RemoveClientResponse + * @instance + * @returns {Object.} JSON object + */ + RemoveClientResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoveClientResponse + * @function getTypeUrl + * @memberof google.bigtable.testproxy.RemoveClientResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveClientResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.RemoveClientResponse"; + }; + + return RemoveClientResponse; + })(); + + testproxy.ReadRowRequest = (function() { + + /** + * Properties of a ReadRowRequest. + * @memberof google.bigtable.testproxy + * @interface IReadRowRequest + * @property {string|null} [clientId] ReadRowRequest clientId + * @property {string|null} [tableName] ReadRowRequest tableName + * @property {string|null} [rowKey] ReadRowRequest rowKey + * @property {google.bigtable.v2.IRowFilter|null} [filter] ReadRowRequest filter + */ + + /** + * Constructs a new ReadRowRequest. + * @memberof google.bigtable.testproxy + * @classdesc Represents a ReadRowRequest. + * @implements IReadRowRequest + * @constructor + * @param {google.bigtable.testproxy.IReadRowRequest=} [properties] Properties to set + */ + function ReadRowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadRowRequest clientId. + * @member {string} clientId + * @memberof google.bigtable.testproxy.ReadRowRequest + * @instance + */ + ReadRowRequest.prototype.clientId = ""; + + /** + * ReadRowRequest tableName. + * @member {string} tableName + * @memberof google.bigtable.testproxy.ReadRowRequest + * @instance + */ + ReadRowRequest.prototype.tableName = ""; + + /** + * ReadRowRequest rowKey. + * @member {string} rowKey + * @memberof google.bigtable.testproxy.ReadRowRequest + * @instance + */ + ReadRowRequest.prototype.rowKey = ""; + + /** + * ReadRowRequest filter. + * @member {google.bigtable.v2.IRowFilter|null|undefined} filter + * @memberof google.bigtable.testproxy.ReadRowRequest + * @instance + */ + ReadRowRequest.prototype.filter = null; + + /** + * Creates a new ReadRowRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.ReadRowRequest + * @static + * @param {google.bigtable.testproxy.IReadRowRequest=} [properties] Properties to set + * @returns {google.bigtable.testproxy.ReadRowRequest} ReadRowRequest instance + */ + ReadRowRequest.create = function create(properties) { + return new ReadRowRequest(properties); + }; + + /** + * Encodes the specified ReadRowRequest message. Does not implicitly {@link google.bigtable.testproxy.ReadRowRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.ReadRowRequest + * @static + * @param {google.bigtable.testproxy.IReadRowRequest} message ReadRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.rowKey != null && Object.hasOwnProperty.call(message, "rowKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rowKey); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.bigtable.v2.RowFilter.encode(message.filter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tableName); + return writer; + }; + + /** + * Encodes the specified ReadRowRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.ReadRowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.ReadRowRequest + * @static + * @param {google.bigtable.testproxy.IReadRowRequest} message ReadRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadRowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.ReadRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.ReadRowRequest} ReadRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.ReadRowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 4: { + message.tableName = reader.string(); + break; + } + case 2: { + message.rowKey = reader.string(); + break; + } + case 3: { + message.filter = $root.google.bigtable.v2.RowFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadRowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.ReadRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.ReadRowRequest} ReadRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadRowRequest message. + * @function verify + * @memberof google.bigtable.testproxy.ReadRowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadRowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + if (!$util.isString(message.rowKey)) + return "rowKey: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) { + var error = $root.google.bigtable.v2.RowFilter.verify(message.filter); + if (error) + return "filter." + error; + } + return null; + }; + + /** + * Creates a ReadRowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.ReadRowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.ReadRowRequest} ReadRowRequest + */ + ReadRowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.ReadRowRequest) + return object; + var message = new $root.google.bigtable.testproxy.ReadRowRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.rowKey != null) + message.rowKey = String(object.rowKey); + if (object.filter != null) { + if (typeof object.filter !== "object") + throw TypeError(".google.bigtable.testproxy.ReadRowRequest.filter: object expected"); + message.filter = $root.google.bigtable.v2.RowFilter.fromObject(object.filter); + } + return message; + }; + + /** + * Creates a plain object from a ReadRowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.ReadRowRequest + * @static + * @param {google.bigtable.testproxy.ReadRowRequest} message ReadRowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadRowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.rowKey = ""; + object.filter = null; + object.tableName = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.rowKey != null && message.hasOwnProperty("rowKey")) + object.rowKey = message.rowKey; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = $root.google.bigtable.v2.RowFilter.toObject(message.filter, options); + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + return object; + }; + + /** + * Converts this ReadRowRequest to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.ReadRowRequest + * @instance + * @returns {Object.} JSON object + */ + ReadRowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadRowRequest + * @function getTypeUrl + * @memberof google.bigtable.testproxy.ReadRowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.ReadRowRequest"; + }; + + return ReadRowRequest; + })(); + + testproxy.RowResult = (function() { + + /** + * Properties of a RowResult. + * @memberof google.bigtable.testproxy + * @interface IRowResult + * @property {google.rpc.IStatus|null} [status] RowResult status + * @property {google.bigtable.v2.IRow|null} [row] RowResult row + */ + + /** + * Constructs a new RowResult. + * @memberof google.bigtable.testproxy + * @classdesc Represents a RowResult. + * @implements IRowResult + * @constructor + * @param {google.bigtable.testproxy.IRowResult=} [properties] Properties to set + */ + function RowResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowResult status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.bigtable.testproxy.RowResult + * @instance + */ + RowResult.prototype.status = null; + + /** + * RowResult row. + * @member {google.bigtable.v2.IRow|null|undefined} row + * @memberof google.bigtable.testproxy.RowResult + * @instance + */ + RowResult.prototype.row = null; + + /** + * Creates a new RowResult instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.RowResult + * @static + * @param {google.bigtable.testproxy.IRowResult=} [properties] Properties to set + * @returns {google.bigtable.testproxy.RowResult} RowResult instance + */ + RowResult.create = function create(properties) { + return new RowResult(properties); + }; + + /** + * Encodes the specified RowResult message. Does not implicitly {@link google.bigtable.testproxy.RowResult.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.RowResult + * @static + * @param {google.bigtable.testproxy.IRowResult} message RowResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.row != null && Object.hasOwnProperty.call(message, "row")) + $root.google.bigtable.v2.Row.encode(message.row, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RowResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.RowResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.RowResult + * @static + * @param {google.bigtable.testproxy.IRowResult} message RowResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowResult message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.RowResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.RowResult} RowResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.RowResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.row = $root.google.bigtable.v2.Row.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.RowResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.RowResult} RowResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowResult message. + * @function verify + * @memberof google.bigtable.testproxy.RowResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.row != null && message.hasOwnProperty("row")) { + var error = $root.google.bigtable.v2.Row.verify(message.row); + if (error) + return "row." + error; + } + return null; + }; + + /** + * Creates a RowResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.RowResult + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.RowResult} RowResult + */ + RowResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.RowResult) + return object; + var message = new $root.google.bigtable.testproxy.RowResult(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.bigtable.testproxy.RowResult.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.row != null) { + if (typeof object.row !== "object") + throw TypeError(".google.bigtable.testproxy.RowResult.row: object expected"); + message.row = $root.google.bigtable.v2.Row.fromObject(object.row); + } + return message; + }; + + /** + * Creates a plain object from a RowResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.RowResult + * @static + * @param {google.bigtable.testproxy.RowResult} message RowResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = null; + object.row = null; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.row != null && message.hasOwnProperty("row")) + object.row = $root.google.bigtable.v2.Row.toObject(message.row, options); + return object; + }; + + /** + * Converts this RowResult to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.RowResult + * @instance + * @returns {Object.} JSON object + */ + RowResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowResult + * @function getTypeUrl + * @memberof google.bigtable.testproxy.RowResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.RowResult"; + }; + + return RowResult; + })(); + + testproxy.ReadRowsRequest = (function() { + + /** + * Properties of a ReadRowsRequest. + * @memberof google.bigtable.testproxy + * @interface IReadRowsRequest + * @property {string|null} [clientId] ReadRowsRequest clientId + * @property {google.bigtable.v2.IReadRowsRequest|null} [request] ReadRowsRequest request + * @property {number|null} [cancelAfterRows] ReadRowsRequest cancelAfterRows + */ + + /** + * Constructs a new ReadRowsRequest. + * @memberof google.bigtable.testproxy + * @classdesc Represents a ReadRowsRequest. + * @implements IReadRowsRequest + * @constructor + * @param {google.bigtable.testproxy.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 clientId. + * @member {string} clientId + * @memberof google.bigtable.testproxy.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.clientId = ""; + + /** + * ReadRowsRequest request. + * @member {google.bigtable.v2.IReadRowsRequest|null|undefined} request + * @memberof google.bigtable.testproxy.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.request = null; + + /** + * ReadRowsRequest cancelAfterRows. + * @member {number} cancelAfterRows + * @memberof google.bigtable.testproxy.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.cancelAfterRows = 0; + + /** + * Creates a new ReadRowsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.ReadRowsRequest + * @static + * @param {google.bigtable.testproxy.IReadRowsRequest=} [properties] Properties to set + * @returns {google.bigtable.testproxy.ReadRowsRequest} ReadRowsRequest instance + */ + ReadRowsRequest.create = function create(properties) { + return new ReadRowsRequest(properties); + }; + + /** + * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.bigtable.testproxy.ReadRowsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.ReadRowsRequest + * @static + * @param {google.bigtable.testproxy.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.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.bigtable.v2.ReadRowsRequest.encode(message.request, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelAfterRows != null && Object.hasOwnProperty.call(message, "cancelAfterRows")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.cancelAfterRows); + return writer; + }; + + /** + * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.ReadRowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.ReadRowsRequest + * @static + * @param {google.bigtable.testproxy.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.bigtable.testproxy.ReadRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.ReadRowsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.request = $root.google.bigtable.v2.ReadRowsRequest.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelAfterRows = reader.int32(); + 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.bigtable.testproxy.ReadRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.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.bigtable.testproxy.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.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.bigtable.v2.ReadRowsRequest.verify(message.request); + if (error) + return "request." + error; + } + if (message.cancelAfterRows != null && message.hasOwnProperty("cancelAfterRows")) + if (!$util.isInteger(message.cancelAfterRows)) + return "cancelAfterRows: integer expected"; + return null; + }; + + /** + * Creates a ReadRowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.ReadRowsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.ReadRowsRequest} ReadRowsRequest + */ + ReadRowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.ReadRowsRequest) + return object; + var message = new $root.google.bigtable.testproxy.ReadRowsRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.bigtable.testproxy.ReadRowsRequest.request: object expected"); + message.request = $root.google.bigtable.v2.ReadRowsRequest.fromObject(object.request); + } + if (object.cancelAfterRows != null) + message.cancelAfterRows = object.cancelAfterRows | 0; + return message; + }; + + /** + * Creates a plain object from a ReadRowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.ReadRowsRequest + * @static + * @param {google.bigtable.testproxy.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.clientId = ""; + object.request = null; + object.cancelAfterRows = 0; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.bigtable.v2.ReadRowsRequest.toObject(message.request, options); + if (message.cancelAfterRows != null && message.hasOwnProperty("cancelAfterRows")) + object.cancelAfterRows = message.cancelAfterRows; + return object; + }; + + /** + * Converts this ReadRowsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.ReadRowsRequest + * @instance + * @returns {Object.} JSON object + */ + ReadRowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadRowsRequest + * @function getTypeUrl + * @memberof google.bigtable.testproxy.ReadRowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.ReadRowsRequest"; + }; + + return ReadRowsRequest; + })(); + + testproxy.RowsResult = (function() { + + /** + * Properties of a RowsResult. + * @memberof google.bigtable.testproxy + * @interface IRowsResult + * @property {google.rpc.IStatus|null} [status] RowsResult status + * @property {Array.|null} [rows] RowsResult rows + */ + + /** + * Constructs a new RowsResult. + * @memberof google.bigtable.testproxy + * @classdesc Represents a RowsResult. + * @implements IRowsResult + * @constructor + * @param {google.bigtable.testproxy.IRowsResult=} [properties] Properties to set + */ + function RowsResult(properties) { + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowsResult status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.bigtable.testproxy.RowsResult + * @instance + */ + RowsResult.prototype.status = null; + + /** + * RowsResult rows. + * @member {Array.} rows + * @memberof google.bigtable.testproxy.RowsResult + * @instance + */ + RowsResult.prototype.rows = $util.emptyArray; + + /** + * Creates a new RowsResult instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.RowsResult + * @static + * @param {google.bigtable.testproxy.IRowsResult=} [properties] Properties to set + * @returns {google.bigtable.testproxy.RowsResult} RowsResult instance + */ + RowsResult.create = function create(properties) { + return new RowsResult(properties); + }; + + /** + * Encodes the specified RowsResult message. Does not implicitly {@link google.bigtable.testproxy.RowsResult.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.RowsResult + * @static + * @param {google.bigtable.testproxy.IRowsResult} message RowsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.bigtable.v2.Row.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RowsResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.RowsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.RowsResult + * @static + * @param {google.bigtable.testproxy.IRowsResult} message RowsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowsResult message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.RowsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.RowsResult} RowsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowsResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.RowsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.bigtable.v2.Row.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.RowsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.RowsResult} RowsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowsResult message. + * @function verify + * @memberof google.bigtable.testproxy.RowsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.bigtable.v2.Row.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + return null; + }; + + /** + * Creates a RowsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.RowsResult + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.RowsResult} RowsResult + */ + RowsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.RowsResult) + return object; + var message = new $root.google.bigtable.testproxy.RowsResult(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.bigtable.testproxy.RowsResult.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.bigtable.testproxy.RowsResult.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.bigtable.testproxy.RowsResult.rows: object expected"); + message.rows[i] = $root.google.bigtable.v2.Row.fromObject(object.rows[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RowsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.RowsResult + * @static + * @param {google.bigtable.testproxy.RowsResult} message RowsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rows = []; + if (options.defaults) + object.status = null; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.bigtable.v2.Row.toObject(message.rows[j], options); + } + return object; + }; + + /** + * Converts this RowsResult to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.RowsResult + * @instance + * @returns {Object.} JSON object + */ + RowsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowsResult + * @function getTypeUrl + * @memberof google.bigtable.testproxy.RowsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.RowsResult"; + }; + + return RowsResult; + })(); + + testproxy.MutateRowRequest = (function() { + + /** + * Properties of a MutateRowRequest. + * @memberof google.bigtable.testproxy + * @interface IMutateRowRequest + * @property {string|null} [clientId] MutateRowRequest clientId + * @property {google.bigtable.v2.IMutateRowRequest|null} [request] MutateRowRequest request + */ + + /** + * Constructs a new MutateRowRequest. + * @memberof google.bigtable.testproxy + * @classdesc Represents a MutateRowRequest. + * @implements IMutateRowRequest + * @constructor + * @param {google.bigtable.testproxy.IMutateRowRequest=} [properties] Properties to set + */ + function MutateRowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateRowRequest clientId. + * @member {string} clientId + * @memberof google.bigtable.testproxy.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.clientId = ""; + + /** + * MutateRowRequest request. + * @member {google.bigtable.v2.IMutateRowRequest|null|undefined} request + * @memberof google.bigtable.testproxy.MutateRowRequest + * @instance + */ + MutateRowRequest.prototype.request = null; + + /** + * Creates a new MutateRowRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.MutateRowRequest + * @static + * @param {google.bigtable.testproxy.IMutateRowRequest=} [properties] Properties to set + * @returns {google.bigtable.testproxy.MutateRowRequest} MutateRowRequest instance + */ + MutateRowRequest.create = function create(properties) { + return new MutateRowRequest(properties); + }; + + /** + * Encodes the specified MutateRowRequest message. Does not implicitly {@link google.bigtable.testproxy.MutateRowRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.MutateRowRequest + * @static + * @param {google.bigtable.testproxy.IMutateRowRequest} message MutateRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.bigtable.v2.MutateRowRequest.encode(message.request, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateRowRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.MutateRowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.MutateRowRequest + * @static + * @param {google.bigtable.testproxy.IMutateRowRequest} message MutateRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateRowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.MutateRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.MutateRowRequest} MutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.MutateRowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.request = $root.google.bigtable.v2.MutateRowRequest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateRowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.MutateRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.MutateRowRequest} MutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateRowRequest message. + * @function verify + * @memberof google.bigtable.testproxy.MutateRowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateRowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.bigtable.v2.MutateRowRequest.verify(message.request); + if (error) + return "request." + error; + } + return null; + }; + + /** + * Creates a MutateRowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.MutateRowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.MutateRowRequest} MutateRowRequest + */ + MutateRowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.MutateRowRequest) + return object; + var message = new $root.google.bigtable.testproxy.MutateRowRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.bigtable.testproxy.MutateRowRequest.request: object expected"); + message.request = $root.google.bigtable.v2.MutateRowRequest.fromObject(object.request); + } + return message; + }; + + /** + * Creates a plain object from a MutateRowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.MutateRowRequest + * @static + * @param {google.bigtable.testproxy.MutateRowRequest} message MutateRowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateRowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.request = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.bigtable.v2.MutateRowRequest.toObject(message.request, options); + return object; + }; + + /** + * Converts this MutateRowRequest to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.MutateRowRequest + * @instance + * @returns {Object.} JSON object + */ + MutateRowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateRowRequest + * @function getTypeUrl + * @memberof google.bigtable.testproxy.MutateRowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateRowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.MutateRowRequest"; + }; + + return MutateRowRequest; + })(); + + testproxy.MutateRowResult = (function() { + + /** + * Properties of a MutateRowResult. + * @memberof google.bigtable.testproxy + * @interface IMutateRowResult + * @property {google.rpc.IStatus|null} [status] MutateRowResult status + */ + + /** + * Constructs a new MutateRowResult. + * @memberof google.bigtable.testproxy + * @classdesc Represents a MutateRowResult. + * @implements IMutateRowResult + * @constructor + * @param {google.bigtable.testproxy.IMutateRowResult=} [properties] Properties to set + */ + function MutateRowResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateRowResult status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.bigtable.testproxy.MutateRowResult + * @instance + */ + MutateRowResult.prototype.status = null; + + /** + * Creates a new MutateRowResult instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.MutateRowResult + * @static + * @param {google.bigtable.testproxy.IMutateRowResult=} [properties] Properties to set + * @returns {google.bigtable.testproxy.MutateRowResult} MutateRowResult instance + */ + MutateRowResult.create = function create(properties) { + return new MutateRowResult(properties); + }; + + /** + * Encodes the specified MutateRowResult message. Does not implicitly {@link google.bigtable.testproxy.MutateRowResult.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.MutateRowResult + * @static + * @param {google.bigtable.testproxy.IMutateRowResult} message MutateRowResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateRowResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.MutateRowResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.MutateRowResult + * @static + * @param {google.bigtable.testproxy.IMutateRowResult} message MutateRowResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateRowResult message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.MutateRowResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.MutateRowResult} MutateRowResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.MutateRowResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateRowResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.MutateRowResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.MutateRowResult} MutateRowResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateRowResult message. + * @function verify + * @memberof google.bigtable.testproxy.MutateRowResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateRowResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a MutateRowResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.MutateRowResult + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.MutateRowResult} MutateRowResult + */ + MutateRowResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.MutateRowResult) + return object; + var message = new $root.google.bigtable.testproxy.MutateRowResult(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.bigtable.testproxy.MutateRowResult.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a MutateRowResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.MutateRowResult + * @static + * @param {google.bigtable.testproxy.MutateRowResult} message MutateRowResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateRowResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.status = null; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this MutateRowResult to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.MutateRowResult + * @instance + * @returns {Object.} JSON object + */ + MutateRowResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateRowResult + * @function getTypeUrl + * @memberof google.bigtable.testproxy.MutateRowResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateRowResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.MutateRowResult"; + }; + + return MutateRowResult; + })(); + + testproxy.MutateRowsRequest = (function() { + + /** + * Properties of a MutateRowsRequest. + * @memberof google.bigtable.testproxy + * @interface IMutateRowsRequest + * @property {string|null} [clientId] MutateRowsRequest clientId + * @property {google.bigtable.v2.IMutateRowsRequest|null} [request] MutateRowsRequest request + */ + + /** + * Constructs a new MutateRowsRequest. + * @memberof google.bigtable.testproxy + * @classdesc Represents a MutateRowsRequest. + * @implements IMutateRowsRequest + * @constructor + * @param {google.bigtable.testproxy.IMutateRowsRequest=} [properties] Properties to set + */ + function MutateRowsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateRowsRequest clientId. + * @member {string} clientId + * @memberof google.bigtable.testproxy.MutateRowsRequest + * @instance + */ + MutateRowsRequest.prototype.clientId = ""; + + /** + * MutateRowsRequest request. + * @member {google.bigtable.v2.IMutateRowsRequest|null|undefined} request + * @memberof google.bigtable.testproxy.MutateRowsRequest + * @instance + */ + MutateRowsRequest.prototype.request = null; + + /** + * Creates a new MutateRowsRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.MutateRowsRequest + * @static + * @param {google.bigtable.testproxy.IMutateRowsRequest=} [properties] Properties to set + * @returns {google.bigtable.testproxy.MutateRowsRequest} MutateRowsRequest instance + */ + MutateRowsRequest.create = function create(properties) { + return new MutateRowsRequest(properties); + }; + + /** + * Encodes the specified MutateRowsRequest message. Does not implicitly {@link google.bigtable.testproxy.MutateRowsRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.MutateRowsRequest + * @static + * @param {google.bigtable.testproxy.IMutateRowsRequest} message MutateRowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.bigtable.v2.MutateRowsRequest.encode(message.request, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateRowsRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.MutateRowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.MutateRowsRequest + * @static + * @param {google.bigtable.testproxy.IMutateRowsRequest} message MutateRowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateRowsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.MutateRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.MutateRowsRequest} MutateRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.MutateRowsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.request = $root.google.bigtable.v2.MutateRowsRequest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateRowsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.MutateRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.MutateRowsRequest} MutateRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateRowsRequest message. + * @function verify + * @memberof google.bigtable.testproxy.MutateRowsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateRowsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.bigtable.v2.MutateRowsRequest.verify(message.request); + if (error) + return "request." + error; + } + return null; + }; + + /** + * Creates a MutateRowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.MutateRowsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.MutateRowsRequest} MutateRowsRequest + */ + MutateRowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.MutateRowsRequest) + return object; + var message = new $root.google.bigtable.testproxy.MutateRowsRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.bigtable.testproxy.MutateRowsRequest.request: object expected"); + message.request = $root.google.bigtable.v2.MutateRowsRequest.fromObject(object.request); + } + return message; + }; + + /** + * Creates a plain object from a MutateRowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.MutateRowsRequest + * @static + * @param {google.bigtable.testproxy.MutateRowsRequest} message MutateRowsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateRowsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.request = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.bigtable.v2.MutateRowsRequest.toObject(message.request, options); + return object; + }; + + /** + * Converts this MutateRowsRequest to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.MutateRowsRequest + * @instance + * @returns {Object.} JSON object + */ + MutateRowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateRowsRequest + * @function getTypeUrl + * @memberof google.bigtable.testproxy.MutateRowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateRowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.MutateRowsRequest"; + }; + + return MutateRowsRequest; + })(); + + testproxy.MutateRowsResult = (function() { + + /** + * Properties of a MutateRowsResult. + * @memberof google.bigtable.testproxy + * @interface IMutateRowsResult + * @property {google.rpc.IStatus|null} [status] MutateRowsResult status + * @property {Array.|null} [entries] MutateRowsResult entries + */ + + /** + * Constructs a new MutateRowsResult. + * @memberof google.bigtable.testproxy + * @classdesc Represents a MutateRowsResult. + * @implements IMutateRowsResult + * @constructor + * @param {google.bigtable.testproxy.IMutateRowsResult=} [properties] Properties to set + */ + function MutateRowsResult(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateRowsResult status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.bigtable.testproxy.MutateRowsResult + * @instance + */ + MutateRowsResult.prototype.status = null; + + /** + * MutateRowsResult entries. + * @member {Array.} entries + * @memberof google.bigtable.testproxy.MutateRowsResult + * @instance + */ + MutateRowsResult.prototype.entries = $util.emptyArray; + + /** + * Creates a new MutateRowsResult instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.MutateRowsResult + * @static + * @param {google.bigtable.testproxy.IMutateRowsResult=} [properties] Properties to set + * @returns {google.bigtable.testproxy.MutateRowsResult} MutateRowsResult instance + */ + MutateRowsResult.create = function create(properties) { + return new MutateRowsResult(properties); + }; + + /** + * Encodes the specified MutateRowsResult message. Does not implicitly {@link google.bigtable.testproxy.MutateRowsResult.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.MutateRowsResult + * @static + * @param {google.bigtable.testproxy.IMutateRowsResult} message MutateRowsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.bigtable.v2.MutateRowsResponse.Entry.encode(message.entries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateRowsResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.MutateRowsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.MutateRowsResult + * @static + * @param {google.bigtable.testproxy.IMutateRowsResult} message MutateRowsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateRowsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateRowsResult message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.MutateRowsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.MutateRowsResult} MutateRowsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowsResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.MutateRowsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.bigtable.v2.MutateRowsResponse.Entry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateRowsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.MutateRowsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.MutateRowsResult} MutateRowsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateRowsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateRowsResult message. + * @function verify + * @memberof google.bigtable.testproxy.MutateRowsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateRowsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.bigtable.v2.MutateRowsResponse.Entry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a MutateRowsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.MutateRowsResult + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.MutateRowsResult} MutateRowsResult + */ + MutateRowsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.MutateRowsResult) + return object; + var message = new $root.google.bigtable.testproxy.MutateRowsResult(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.bigtable.testproxy.MutateRowsResult.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.bigtable.testproxy.MutateRowsResult.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.bigtable.testproxy.MutateRowsResult.entries: object expected"); + message.entries[i] = $root.google.bigtable.v2.MutateRowsResponse.Entry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MutateRowsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.MutateRowsResult + * @static + * @param {google.bigtable.testproxy.MutateRowsResult} message MutateRowsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateRowsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) + object.status = null; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.bigtable.v2.MutateRowsResponse.Entry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this MutateRowsResult to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.MutateRowsResult + * @instance + * @returns {Object.} JSON object + */ + MutateRowsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateRowsResult + * @function getTypeUrl + * @memberof google.bigtable.testproxy.MutateRowsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateRowsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.MutateRowsResult"; + }; + + return MutateRowsResult; + })(); + + testproxy.CheckAndMutateRowRequest = (function() { + + /** + * Properties of a CheckAndMutateRowRequest. + * @memberof google.bigtable.testproxy + * @interface ICheckAndMutateRowRequest + * @property {string|null} [clientId] CheckAndMutateRowRequest clientId + * @property {google.bigtable.v2.ICheckAndMutateRowRequest|null} [request] CheckAndMutateRowRequest request + */ + + /** + * Constructs a new CheckAndMutateRowRequest. + * @memberof google.bigtable.testproxy + * @classdesc Represents a CheckAndMutateRowRequest. + * @implements ICheckAndMutateRowRequest + * @constructor + * @param {google.bigtable.testproxy.ICheckAndMutateRowRequest=} [properties] Properties to set + */ + function CheckAndMutateRowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckAndMutateRowRequest clientId. + * @member {string} clientId + * @memberof google.bigtable.testproxy.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.clientId = ""; + + /** + * CheckAndMutateRowRequest request. + * @member {google.bigtable.v2.ICheckAndMutateRowRequest|null|undefined} request + * @memberof google.bigtable.testproxy.CheckAndMutateRowRequest + * @instance + */ + CheckAndMutateRowRequest.prototype.request = null; + + /** + * Creates a new CheckAndMutateRowRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.CheckAndMutateRowRequest + * @static + * @param {google.bigtable.testproxy.ICheckAndMutateRowRequest=} [properties] Properties to set + * @returns {google.bigtable.testproxy.CheckAndMutateRowRequest} CheckAndMutateRowRequest instance + */ + CheckAndMutateRowRequest.create = function create(properties) { + return new CheckAndMutateRowRequest(properties); + }; + + /** + * Encodes the specified CheckAndMutateRowRequest message. Does not implicitly {@link google.bigtable.testproxy.CheckAndMutateRowRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.CheckAndMutateRowRequest + * @static + * @param {google.bigtable.testproxy.ICheckAndMutateRowRequest} message CheckAndMutateRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAndMutateRowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.bigtable.v2.CheckAndMutateRowRequest.encode(message.request, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CheckAndMutateRowRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CheckAndMutateRowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.CheckAndMutateRowRequest + * @static + * @param {google.bigtable.testproxy.ICheckAndMutateRowRequest} message CheckAndMutateRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAndMutateRowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckAndMutateRowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.CheckAndMutateRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.CheckAndMutateRowRequest} CheckAndMutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAndMutateRowRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.CheckAndMutateRowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.request = $root.google.bigtable.v2.CheckAndMutateRowRequest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckAndMutateRowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.CheckAndMutateRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.CheckAndMutateRowRequest} CheckAndMutateRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAndMutateRowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckAndMutateRowRequest message. + * @function verify + * @memberof google.bigtable.testproxy.CheckAndMutateRowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckAndMutateRowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.bigtable.v2.CheckAndMutateRowRequest.verify(message.request); + if (error) + return "request." + error; + } + return null; + }; + + /** + * Creates a CheckAndMutateRowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.CheckAndMutateRowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.CheckAndMutateRowRequest} CheckAndMutateRowRequest + */ + CheckAndMutateRowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.CheckAndMutateRowRequest) + return object; + var message = new $root.google.bigtable.testproxy.CheckAndMutateRowRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.bigtable.testproxy.CheckAndMutateRowRequest.request: object expected"); + message.request = $root.google.bigtable.v2.CheckAndMutateRowRequest.fromObject(object.request); + } + return message; + }; + + /** + * Creates a plain object from a CheckAndMutateRowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.CheckAndMutateRowRequest + * @static + * @param {google.bigtable.testproxy.CheckAndMutateRowRequest} message CheckAndMutateRowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckAndMutateRowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.request = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.bigtable.v2.CheckAndMutateRowRequest.toObject(message.request, options); + return object; + }; + + /** + * Converts this CheckAndMutateRowRequest to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.CheckAndMutateRowRequest + * @instance + * @returns {Object.} JSON object + */ + CheckAndMutateRowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckAndMutateRowRequest + * @function getTypeUrl + * @memberof google.bigtable.testproxy.CheckAndMutateRowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckAndMutateRowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.CheckAndMutateRowRequest"; + }; + + return CheckAndMutateRowRequest; + })(); + + testproxy.CheckAndMutateRowResult = (function() { + + /** + * Properties of a CheckAndMutateRowResult. + * @memberof google.bigtable.testproxy + * @interface ICheckAndMutateRowResult + * @property {google.rpc.IStatus|null} [status] CheckAndMutateRowResult status + * @property {google.bigtable.v2.ICheckAndMutateRowResponse|null} [result] CheckAndMutateRowResult result + */ + + /** + * Constructs a new CheckAndMutateRowResult. + * @memberof google.bigtable.testproxy + * @classdesc Represents a CheckAndMutateRowResult. + * @implements ICheckAndMutateRowResult + * @constructor + * @param {google.bigtable.testproxy.ICheckAndMutateRowResult=} [properties] Properties to set + */ + function CheckAndMutateRowResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckAndMutateRowResult status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.bigtable.testproxy.CheckAndMutateRowResult + * @instance + */ + CheckAndMutateRowResult.prototype.status = null; + + /** + * CheckAndMutateRowResult result. + * @member {google.bigtable.v2.ICheckAndMutateRowResponse|null|undefined} result + * @memberof google.bigtable.testproxy.CheckAndMutateRowResult + * @instance + */ + CheckAndMutateRowResult.prototype.result = null; + + /** + * Creates a new CheckAndMutateRowResult instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.CheckAndMutateRowResult + * @static + * @param {google.bigtable.testproxy.ICheckAndMutateRowResult=} [properties] Properties to set + * @returns {google.bigtable.testproxy.CheckAndMutateRowResult} CheckAndMutateRowResult instance + */ + CheckAndMutateRowResult.create = function create(properties) { + return new CheckAndMutateRowResult(properties); + }; + + /** + * Encodes the specified CheckAndMutateRowResult message. Does not implicitly {@link google.bigtable.testproxy.CheckAndMutateRowResult.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.CheckAndMutateRowResult + * @static + * @param {google.bigtable.testproxy.ICheckAndMutateRowResult} message CheckAndMutateRowResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAndMutateRowResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.bigtable.v2.CheckAndMutateRowResponse.encode(message.result, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CheckAndMutateRowResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.CheckAndMutateRowResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.CheckAndMutateRowResult + * @static + * @param {google.bigtable.testproxy.ICheckAndMutateRowResult} message CheckAndMutateRowResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAndMutateRowResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckAndMutateRowResult message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.CheckAndMutateRowResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.CheckAndMutateRowResult} CheckAndMutateRowResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAndMutateRowResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.CheckAndMutateRowResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.result = $root.google.bigtable.v2.CheckAndMutateRowResponse.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckAndMutateRowResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.CheckAndMutateRowResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.CheckAndMutateRowResult} CheckAndMutateRowResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAndMutateRowResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckAndMutateRowResult message. + * @function verify + * @memberof google.bigtable.testproxy.CheckAndMutateRowResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckAndMutateRowResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.bigtable.v2.CheckAndMutateRowResponse.verify(message.result); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates a CheckAndMutateRowResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.CheckAndMutateRowResult + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.CheckAndMutateRowResult} CheckAndMutateRowResult + */ + CheckAndMutateRowResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.CheckAndMutateRowResult) + return object; + var message = new $root.google.bigtable.testproxy.CheckAndMutateRowResult(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.bigtable.testproxy.CheckAndMutateRowResult.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.bigtable.testproxy.CheckAndMutateRowResult.result: object expected"); + message.result = $root.google.bigtable.v2.CheckAndMutateRowResponse.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from a CheckAndMutateRowResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.CheckAndMutateRowResult + * @static + * @param {google.bigtable.testproxy.CheckAndMutateRowResult} message CheckAndMutateRowResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckAndMutateRowResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = null; + object.result = null; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.google.bigtable.v2.CheckAndMutateRowResponse.toObject(message.result, options); + return object; + }; + + /** + * Converts this CheckAndMutateRowResult to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.CheckAndMutateRowResult + * @instance + * @returns {Object.} JSON object + */ + CheckAndMutateRowResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckAndMutateRowResult + * @function getTypeUrl + * @memberof google.bigtable.testproxy.CheckAndMutateRowResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckAndMutateRowResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.CheckAndMutateRowResult"; + }; + + return CheckAndMutateRowResult; + })(); + + testproxy.SampleRowKeysRequest = (function() { + + /** + * Properties of a SampleRowKeysRequest. + * @memberof google.bigtable.testproxy + * @interface ISampleRowKeysRequest + * @property {string|null} [clientId] SampleRowKeysRequest clientId + * @property {google.bigtable.v2.ISampleRowKeysRequest|null} [request] SampleRowKeysRequest request + */ + + /** + * Constructs a new SampleRowKeysRequest. + * @memberof google.bigtable.testproxy + * @classdesc Represents a SampleRowKeysRequest. + * @implements ISampleRowKeysRequest + * @constructor + * @param {google.bigtable.testproxy.ISampleRowKeysRequest=} [properties] Properties to set + */ + function SampleRowKeysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SampleRowKeysRequest clientId. + * @member {string} clientId + * @memberof google.bigtable.testproxy.SampleRowKeysRequest + * @instance + */ + SampleRowKeysRequest.prototype.clientId = ""; + + /** + * SampleRowKeysRequest request. + * @member {google.bigtable.v2.ISampleRowKeysRequest|null|undefined} request + * @memberof google.bigtable.testproxy.SampleRowKeysRequest + * @instance + */ + SampleRowKeysRequest.prototype.request = null; + + /** + * Creates a new SampleRowKeysRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.SampleRowKeysRequest + * @static + * @param {google.bigtable.testproxy.ISampleRowKeysRequest=} [properties] Properties to set + * @returns {google.bigtable.testproxy.SampleRowKeysRequest} SampleRowKeysRequest instance + */ + SampleRowKeysRequest.create = function create(properties) { + return new SampleRowKeysRequest(properties); + }; + + /** + * Encodes the specified SampleRowKeysRequest message. Does not implicitly {@link google.bigtable.testproxy.SampleRowKeysRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.SampleRowKeysRequest + * @static + * @param {google.bigtable.testproxy.ISampleRowKeysRequest} message SampleRowKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleRowKeysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.bigtable.v2.SampleRowKeysRequest.encode(message.request, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SampleRowKeysRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.SampleRowKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.SampleRowKeysRequest + * @static + * @param {google.bigtable.testproxy.ISampleRowKeysRequest} message SampleRowKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleRowKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SampleRowKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.SampleRowKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.SampleRowKeysRequest} SampleRowKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleRowKeysRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.SampleRowKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.request = $root.google.bigtable.v2.SampleRowKeysRequest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SampleRowKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.SampleRowKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.SampleRowKeysRequest} SampleRowKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleRowKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SampleRowKeysRequest message. + * @function verify + * @memberof google.bigtable.testproxy.SampleRowKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SampleRowKeysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.bigtable.v2.SampleRowKeysRequest.verify(message.request); + if (error) + return "request." + error; + } + return null; + }; + + /** + * Creates a SampleRowKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.SampleRowKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.SampleRowKeysRequest} SampleRowKeysRequest + */ + SampleRowKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.SampleRowKeysRequest) + return object; + var message = new $root.google.bigtable.testproxy.SampleRowKeysRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.bigtable.testproxy.SampleRowKeysRequest.request: object expected"); + message.request = $root.google.bigtable.v2.SampleRowKeysRequest.fromObject(object.request); + } + return message; + }; + + /** + * Creates a plain object from a SampleRowKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.SampleRowKeysRequest + * @static + * @param {google.bigtable.testproxy.SampleRowKeysRequest} message SampleRowKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SampleRowKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.request = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.bigtable.v2.SampleRowKeysRequest.toObject(message.request, options); + return object; + }; + + /** + * Converts this SampleRowKeysRequest to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.SampleRowKeysRequest + * @instance + * @returns {Object.} JSON object + */ + SampleRowKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SampleRowKeysRequest + * @function getTypeUrl + * @memberof google.bigtable.testproxy.SampleRowKeysRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SampleRowKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.SampleRowKeysRequest"; + }; + + return SampleRowKeysRequest; + })(); + + testproxy.SampleRowKeysResult = (function() { + + /** + * Properties of a SampleRowKeysResult. + * @memberof google.bigtable.testproxy + * @interface ISampleRowKeysResult + * @property {google.rpc.IStatus|null} [status] SampleRowKeysResult status + * @property {Array.|null} [samples] SampleRowKeysResult samples + */ + + /** + * Constructs a new SampleRowKeysResult. + * @memberof google.bigtable.testproxy + * @classdesc Represents a SampleRowKeysResult. + * @implements ISampleRowKeysResult + * @constructor + * @param {google.bigtable.testproxy.ISampleRowKeysResult=} [properties] Properties to set + */ + function SampleRowKeysResult(properties) { + this.samples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SampleRowKeysResult status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.bigtable.testproxy.SampleRowKeysResult + * @instance + */ + SampleRowKeysResult.prototype.status = null; + + /** + * SampleRowKeysResult samples. + * @member {Array.} samples + * @memberof google.bigtable.testproxy.SampleRowKeysResult + * @instance + */ + SampleRowKeysResult.prototype.samples = $util.emptyArray; + + /** + * Creates a new SampleRowKeysResult instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.SampleRowKeysResult + * @static + * @param {google.bigtable.testproxy.ISampleRowKeysResult=} [properties] Properties to set + * @returns {google.bigtable.testproxy.SampleRowKeysResult} SampleRowKeysResult instance + */ + SampleRowKeysResult.create = function create(properties) { + return new SampleRowKeysResult(properties); + }; + + /** + * Encodes the specified SampleRowKeysResult message. Does not implicitly {@link google.bigtable.testproxy.SampleRowKeysResult.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.SampleRowKeysResult + * @static + * @param {google.bigtable.testproxy.ISampleRowKeysResult} message SampleRowKeysResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleRowKeysResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.samples != null && message.samples.length) + for (var i = 0; i < message.samples.length; ++i) + $root.google.bigtable.v2.SampleRowKeysResponse.encode(message.samples[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SampleRowKeysResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.SampleRowKeysResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.SampleRowKeysResult + * @static + * @param {google.bigtable.testproxy.ISampleRowKeysResult} message SampleRowKeysResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleRowKeysResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SampleRowKeysResult message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.SampleRowKeysResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.SampleRowKeysResult} SampleRowKeysResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleRowKeysResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.SampleRowKeysResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.samples && message.samples.length)) + message.samples = []; + message.samples.push($root.google.bigtable.v2.SampleRowKeysResponse.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SampleRowKeysResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.SampleRowKeysResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.SampleRowKeysResult} SampleRowKeysResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleRowKeysResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SampleRowKeysResult message. + * @function verify + * @memberof google.bigtable.testproxy.SampleRowKeysResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SampleRowKeysResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.samples != null && message.hasOwnProperty("samples")) { + if (!Array.isArray(message.samples)) + return "samples: array expected"; + for (var i = 0; i < message.samples.length; ++i) { + var error = $root.google.bigtable.v2.SampleRowKeysResponse.verify(message.samples[i]); + if (error) + return "samples." + error; + } + } + return null; + }; + + /** + * Creates a SampleRowKeysResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.SampleRowKeysResult + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.SampleRowKeysResult} SampleRowKeysResult + */ + SampleRowKeysResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.SampleRowKeysResult) + return object; + var message = new $root.google.bigtable.testproxy.SampleRowKeysResult(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.bigtable.testproxy.SampleRowKeysResult.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.samples) { + if (!Array.isArray(object.samples)) + throw TypeError(".google.bigtable.testproxy.SampleRowKeysResult.samples: array expected"); + message.samples = []; + for (var i = 0; i < object.samples.length; ++i) { + if (typeof object.samples[i] !== "object") + throw TypeError(".google.bigtable.testproxy.SampleRowKeysResult.samples: object expected"); + message.samples[i] = $root.google.bigtable.v2.SampleRowKeysResponse.fromObject(object.samples[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SampleRowKeysResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.SampleRowKeysResult + * @static + * @param {google.bigtable.testproxy.SampleRowKeysResult} message SampleRowKeysResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SampleRowKeysResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.samples = []; + if (options.defaults) + object.status = null; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.samples && message.samples.length) { + object.samples = []; + for (var j = 0; j < message.samples.length; ++j) + object.samples[j] = $root.google.bigtable.v2.SampleRowKeysResponse.toObject(message.samples[j], options); + } + return object; + }; + + /** + * Converts this SampleRowKeysResult to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.SampleRowKeysResult + * @instance + * @returns {Object.} JSON object + */ + SampleRowKeysResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SampleRowKeysResult + * @function getTypeUrl + * @memberof google.bigtable.testproxy.SampleRowKeysResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SampleRowKeysResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.SampleRowKeysResult"; + }; + + return SampleRowKeysResult; + })(); + + testproxy.ReadModifyWriteRowRequest = (function() { + + /** + * Properties of a ReadModifyWriteRowRequest. + * @memberof google.bigtable.testproxy + * @interface IReadModifyWriteRowRequest + * @property {string|null} [clientId] ReadModifyWriteRowRequest clientId + * @property {google.bigtable.v2.IReadModifyWriteRowRequest|null} [request] ReadModifyWriteRowRequest request + */ + + /** + * Constructs a new ReadModifyWriteRowRequest. + * @memberof google.bigtable.testproxy + * @classdesc Represents a ReadModifyWriteRowRequest. + * @implements IReadModifyWriteRowRequest + * @constructor + * @param {google.bigtable.testproxy.IReadModifyWriteRowRequest=} [properties] Properties to set + */ + function ReadModifyWriteRowRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadModifyWriteRowRequest clientId. + * @member {string} clientId + * @memberof google.bigtable.testproxy.ReadModifyWriteRowRequest + * @instance + */ + ReadModifyWriteRowRequest.prototype.clientId = ""; + + /** + * ReadModifyWriteRowRequest request. + * @member {google.bigtable.v2.IReadModifyWriteRowRequest|null|undefined} request + * @memberof google.bigtable.testproxy.ReadModifyWriteRowRequest + * @instance + */ + ReadModifyWriteRowRequest.prototype.request = null; + + /** + * Creates a new ReadModifyWriteRowRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.ReadModifyWriteRowRequest + * @static + * @param {google.bigtable.testproxy.IReadModifyWriteRowRequest=} [properties] Properties to set + * @returns {google.bigtable.testproxy.ReadModifyWriteRowRequest} ReadModifyWriteRowRequest instance + */ + ReadModifyWriteRowRequest.create = function create(properties) { + return new ReadModifyWriteRowRequest(properties); + }; + + /** + * Encodes the specified ReadModifyWriteRowRequest message. Does not implicitly {@link google.bigtable.testproxy.ReadModifyWriteRowRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.ReadModifyWriteRowRequest + * @static + * @param {google.bigtable.testproxy.IReadModifyWriteRowRequest} message ReadModifyWriteRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.bigtable.v2.ReadModifyWriteRowRequest.encode(message.request, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadModifyWriteRowRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.ReadModifyWriteRowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.ReadModifyWriteRowRequest + * @static + * @param {google.bigtable.testproxy.IReadModifyWriteRowRequest} message ReadModifyWriteRowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadModifyWriteRowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadModifyWriteRowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.ReadModifyWriteRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.ReadModifyWriteRowRequest} ReadModifyWriteRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRowRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.ReadModifyWriteRowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.request = $root.google.bigtable.v2.ReadModifyWriteRowRequest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadModifyWriteRowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.ReadModifyWriteRowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.ReadModifyWriteRowRequest} ReadModifyWriteRowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadModifyWriteRowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadModifyWriteRowRequest message. + * @function verify + * @memberof google.bigtable.testproxy.ReadModifyWriteRowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadModifyWriteRowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.bigtable.v2.ReadModifyWriteRowRequest.verify(message.request); + if (error) + return "request." + error; + } + return null; + }; + + /** + * Creates a ReadModifyWriteRowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.ReadModifyWriteRowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.ReadModifyWriteRowRequest} ReadModifyWriteRowRequest + */ + ReadModifyWriteRowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.ReadModifyWriteRowRequest) + return object; + var message = new $root.google.bigtable.testproxy.ReadModifyWriteRowRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.bigtable.testproxy.ReadModifyWriteRowRequest.request: object expected"); + message.request = $root.google.bigtable.v2.ReadModifyWriteRowRequest.fromObject(object.request); + } + return message; + }; + + /** + * Creates a plain object from a ReadModifyWriteRowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.ReadModifyWriteRowRequest + * @static + * @param {google.bigtable.testproxy.ReadModifyWriteRowRequest} message ReadModifyWriteRowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadModifyWriteRowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.request = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.bigtable.v2.ReadModifyWriteRowRequest.toObject(message.request, options); + return object; + }; + + /** + * Converts this ReadModifyWriteRowRequest to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.ReadModifyWriteRowRequest + * @instance + * @returns {Object.} JSON object + */ + ReadModifyWriteRowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadModifyWriteRowRequest + * @function getTypeUrl + * @memberof google.bigtable.testproxy.ReadModifyWriteRowRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadModifyWriteRowRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.ReadModifyWriteRowRequest"; + }; + + return ReadModifyWriteRowRequest; + })(); + + testproxy.ExecuteQueryRequest = (function() { + + /** + * Properties of an ExecuteQueryRequest. + * @memberof google.bigtable.testproxy + * @interface IExecuteQueryRequest + * @property {string|null} [clientId] ExecuteQueryRequest clientId + * @property {google.bigtable.v2.IExecuteQueryRequest|null} [request] ExecuteQueryRequest request + */ + + /** + * Constructs a new ExecuteQueryRequest. + * @memberof google.bigtable.testproxy + * @classdesc Represents an ExecuteQueryRequest. + * @implements IExecuteQueryRequest + * @constructor + * @param {google.bigtable.testproxy.IExecuteQueryRequest=} [properties] Properties to set + */ + function ExecuteQueryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteQueryRequest clientId. + * @member {string} clientId + * @memberof google.bigtable.testproxy.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.clientId = ""; + + /** + * ExecuteQueryRequest request. + * @member {google.bigtable.v2.IExecuteQueryRequest|null|undefined} request + * @memberof google.bigtable.testproxy.ExecuteQueryRequest + * @instance + */ + ExecuteQueryRequest.prototype.request = null; + + /** + * Creates a new ExecuteQueryRequest instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.ExecuteQueryRequest + * @static + * @param {google.bigtable.testproxy.IExecuteQueryRequest=} [properties] Properties to set + * @returns {google.bigtable.testproxy.ExecuteQueryRequest} ExecuteQueryRequest instance + */ + ExecuteQueryRequest.create = function create(properties) { + return new ExecuteQueryRequest(properties); + }; + + /** + * Encodes the specified ExecuteQueryRequest message. Does not implicitly {@link google.bigtable.testproxy.ExecuteQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.ExecuteQueryRequest + * @static + * @param {google.bigtable.testproxy.IExecuteQueryRequest} message ExecuteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.bigtable.v2.ExecuteQueryRequest.encode(message.request, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteQueryRequest message, length delimited. Does not implicitly {@link google.bigtable.testproxy.ExecuteQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.ExecuteQueryRequest + * @static + * @param {google.bigtable.testproxy.IExecuteQueryRequest} message ExecuteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.ExecuteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.ExecuteQueryRequest} ExecuteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQueryRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.ExecuteQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.request = $root.google.bigtable.v2.ExecuteQueryRequest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.ExecuteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.ExecuteQueryRequest} ExecuteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteQueryRequest message. + * @function verify + * @memberof google.bigtable.testproxy.ExecuteQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.bigtable.v2.ExecuteQueryRequest.verify(message.request); + if (error) + return "request." + error; + } + return null; + }; + + /** + * Creates an ExecuteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.ExecuteQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.ExecuteQueryRequest} ExecuteQueryRequest + */ + ExecuteQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.ExecuteQueryRequest) + return object; + var message = new $root.google.bigtable.testproxy.ExecuteQueryRequest(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.bigtable.testproxy.ExecuteQueryRequest.request: object expected"); + message.request = $root.google.bigtable.v2.ExecuteQueryRequest.fromObject(object.request); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.ExecuteQueryRequest + * @static + * @param {google.bigtable.testproxy.ExecuteQueryRequest} message ExecuteQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.request = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.bigtable.v2.ExecuteQueryRequest.toObject(message.request, options); + return object; + }; + + /** + * Converts this ExecuteQueryRequest to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.ExecuteQueryRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteQueryRequest + * @function getTypeUrl + * @memberof google.bigtable.testproxy.ExecuteQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.ExecuteQueryRequest"; + }; + + return ExecuteQueryRequest; + })(); + + testproxy.ExecuteQueryResult = (function() { + + /** + * Properties of an ExecuteQueryResult. + * @memberof google.bigtable.testproxy + * @interface IExecuteQueryResult + * @property {google.rpc.IStatus|null} [status] ExecuteQueryResult status + * @property {google.bigtable.testproxy.IResultSetMetadata|null} [metadata] ExecuteQueryResult metadata + * @property {Array.|null} [rows] ExecuteQueryResult rows + */ + + /** + * Constructs a new ExecuteQueryResult. + * @memberof google.bigtable.testproxy + * @classdesc Represents an ExecuteQueryResult. + * @implements IExecuteQueryResult + * @constructor + * @param {google.bigtable.testproxy.IExecuteQueryResult=} [properties] Properties to set + */ + function ExecuteQueryResult(properties) { + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteQueryResult status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @instance + */ + ExecuteQueryResult.prototype.status = null; + + /** + * ExecuteQueryResult metadata. + * @member {google.bigtable.testproxy.IResultSetMetadata|null|undefined} metadata + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @instance + */ + ExecuteQueryResult.prototype.metadata = null; + + /** + * ExecuteQueryResult rows. + * @member {Array.} rows + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @instance + */ + ExecuteQueryResult.prototype.rows = $util.emptyArray; + + /** + * Creates a new ExecuteQueryResult instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @static + * @param {google.bigtable.testproxy.IExecuteQueryResult=} [properties] Properties to set + * @returns {google.bigtable.testproxy.ExecuteQueryResult} ExecuteQueryResult instance + */ + ExecuteQueryResult.create = function create(properties) { + return new ExecuteQueryResult(properties); + }; + + /** + * Encodes the specified ExecuteQueryResult message. Does not implicitly {@link google.bigtable.testproxy.ExecuteQueryResult.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @static + * @param {google.bigtable.testproxy.IExecuteQueryResult} message ExecuteQueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQueryResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.bigtable.testproxy.SqlRow.encode(message.rows[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.bigtable.testproxy.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteQueryResult message, length delimited. Does not implicitly {@link google.bigtable.testproxy.ExecuteQueryResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @static + * @param {google.bigtable.testproxy.IExecuteQueryResult} message ExecuteQueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQueryResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteQueryResult message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.ExecuteQueryResult} ExecuteQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQueryResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.ExecuteQueryResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 4: { + message.metadata = $root.google.bigtable.testproxy.ResultSetMetadata.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.bigtable.testproxy.SqlRow.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteQueryResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.ExecuteQueryResult} ExecuteQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQueryResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteQueryResult message. + * @function verify + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteQueryResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.bigtable.testproxy.ResultSetMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.bigtable.testproxy.SqlRow.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + return null; + }; + + /** + * Creates an ExecuteQueryResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.ExecuteQueryResult} ExecuteQueryResult + */ + ExecuteQueryResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.ExecuteQueryResult) + return object; + var message = new $root.google.bigtable.testproxy.ExecuteQueryResult(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.bigtable.testproxy.ExecuteQueryResult.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.bigtable.testproxy.ExecuteQueryResult.metadata: object expected"); + message.metadata = $root.google.bigtable.testproxy.ResultSetMetadata.fromObject(object.metadata); + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.bigtable.testproxy.ExecuteQueryResult.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.bigtable.testproxy.ExecuteQueryResult.rows: object expected"); + message.rows[i] = $root.google.bigtable.testproxy.SqlRow.fromObject(object.rows[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExecuteQueryResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @static + * @param {google.bigtable.testproxy.ExecuteQueryResult} message ExecuteQueryResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteQueryResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rows = []; + if (options.defaults) { + object.status = null; + object.metadata = null; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.bigtable.testproxy.SqlRow.toObject(message.rows[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.bigtable.testproxy.ResultSetMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ExecuteQueryResult to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @instance + * @returns {Object.} JSON object + */ + ExecuteQueryResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteQueryResult + * @function getTypeUrl + * @memberof google.bigtable.testproxy.ExecuteQueryResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteQueryResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.ExecuteQueryResult"; + }; + + return ExecuteQueryResult; + })(); + + testproxy.ResultSetMetadata = (function() { + + /** + * Properties of a ResultSetMetadata. + * @memberof google.bigtable.testproxy + * @interface IResultSetMetadata + * @property {Array.|null} [columns] ResultSetMetadata columns + */ + + /** + * Constructs a new ResultSetMetadata. + * @memberof google.bigtable.testproxy + * @classdesc Represents a ResultSetMetadata. + * @implements IResultSetMetadata + * @constructor + * @param {google.bigtable.testproxy.IResultSetMetadata=} [properties] Properties to set + */ + function ResultSetMetadata(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultSetMetadata columns. + * @member {Array.} columns + * @memberof google.bigtable.testproxy.ResultSetMetadata + * @instance + */ + ResultSetMetadata.prototype.columns = $util.emptyArray; + + /** + * Creates a new ResultSetMetadata instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.ResultSetMetadata + * @static + * @param {google.bigtable.testproxy.IResultSetMetadata=} [properties] Properties to set + * @returns {google.bigtable.testproxy.ResultSetMetadata} ResultSetMetadata instance + */ + ResultSetMetadata.create = function create(properties) { + return new ResultSetMetadata(properties); + }; + + /** + * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.bigtable.testproxy.ResultSetMetadata.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.ResultSetMetadata + * @static + * @param {google.bigtable.testproxy.IResultSetMetadata} message ResultSetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.bigtable.v2.ColumnMetadata.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.bigtable.testproxy.ResultSetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.ResultSetMetadata + * @static + * @param {google.bigtable.testproxy.IResultSetMetadata} message ResultSetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.ResultSetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.ResultSetMetadata} ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.ResultSetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.bigtable.v2.ColumnMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.ResultSetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.ResultSetMetadata} ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultSetMetadata message. + * @function verify + * @memberof google.bigtable.testproxy.ResultSetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultSetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.bigtable.v2.ColumnMetadata.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + return null; + }; + + /** + * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.ResultSetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.ResultSetMetadata} ResultSetMetadata + */ + ResultSetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.ResultSetMetadata) + return object; + var message = new $root.google.bigtable.testproxy.ResultSetMetadata(); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.bigtable.testproxy.ResultSetMetadata.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".google.bigtable.testproxy.ResultSetMetadata.columns: object expected"); + message.columns[i] = $root.google.bigtable.v2.ColumnMetadata.fromObject(object.columns[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.ResultSetMetadata + * @static + * @param {google.bigtable.testproxy.ResultSetMetadata} message ResultSetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultSetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.bigtable.v2.ColumnMetadata.toObject(message.columns[j], options); + } + return object; + }; + + /** + * Converts this ResultSetMetadata to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.ResultSetMetadata + * @instance + * @returns {Object.} JSON object + */ + ResultSetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultSetMetadata + * @function getTypeUrl + * @memberof google.bigtable.testproxy.ResultSetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultSetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.ResultSetMetadata"; + }; + + return ResultSetMetadata; + })(); + + testproxy.SqlRow = (function() { + + /** + * Properties of a SqlRow. + * @memberof google.bigtable.testproxy + * @interface ISqlRow + * @property {Array.|null} [values] SqlRow values + */ + + /** + * Constructs a new SqlRow. + * @memberof google.bigtable.testproxy + * @classdesc Represents a SqlRow. + * @implements ISqlRow + * @constructor + * @param {google.bigtable.testproxy.ISqlRow=} [properties] Properties to set + */ + function SqlRow(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlRow values. + * @member {Array.} values + * @memberof google.bigtable.testproxy.SqlRow + * @instance + */ + SqlRow.prototype.values = $util.emptyArray; + + /** + * Creates a new SqlRow instance using the specified properties. + * @function create + * @memberof google.bigtable.testproxy.SqlRow + * @static + * @param {google.bigtable.testproxy.ISqlRow=} [properties] Properties to set + * @returns {google.bigtable.testproxy.SqlRow} SqlRow instance + */ + SqlRow.create = function create(properties) { + return new SqlRow(properties); + }; + + /** + * Encodes the specified SqlRow message. Does not implicitly {@link google.bigtable.testproxy.SqlRow.verify|verify} messages. + * @function encode + * @memberof google.bigtable.testproxy.SqlRow + * @static + * @param {google.bigtable.testproxy.ISqlRow} message SqlRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlRow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.bigtable.v2.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SqlRow message, length delimited. Does not implicitly {@link google.bigtable.testproxy.SqlRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.testproxy.SqlRow + * @static + * @param {google.bigtable.testproxy.ISqlRow} message SqlRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlRow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlRow message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.testproxy.SqlRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.testproxy.SqlRow} SqlRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlRow.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.testproxy.SqlRow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.bigtable.v2.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlRow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.testproxy.SqlRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.testproxy.SqlRow} SqlRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlRow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlRow message. + * @function verify + * @memberof google.bigtable.testproxy.SqlRow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlRow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.bigtable.v2.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a SqlRow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.testproxy.SqlRow + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.testproxy.SqlRow} SqlRow + */ + SqlRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.testproxy.SqlRow) + return object; + var message = new $root.google.bigtable.testproxy.SqlRow(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.bigtable.testproxy.SqlRow.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.bigtable.testproxy.SqlRow.values: object expected"); + message.values[i] = $root.google.bigtable.v2.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SqlRow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.testproxy.SqlRow + * @static + * @param {google.bigtable.testproxy.SqlRow} message SqlRow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlRow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.bigtable.v2.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this SqlRow to JSON. + * @function toJSON + * @memberof google.bigtable.testproxy.SqlRow + * @instance + * @returns {Object.} JSON object + */ + SqlRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlRow + * @function getTypeUrl + * @memberof google.bigtable.testproxy.SqlRow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.testproxy.SqlRow"; + }; + + return SqlRow; + })(); + + testproxy.CloudBigtableV2TestProxy = (function() { + + /** + * Constructs a new CloudBigtableV2TestProxy service. + * @memberof google.bigtable.testproxy + * @classdesc Represents a CloudBigtableV2TestProxy + * @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 CloudBigtableV2TestProxy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudBigtableV2TestProxy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudBigtableV2TestProxy; + + /** + * Creates new CloudBigtableV2TestProxy service using the specified rpc implementation. + * @function create + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @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 {CloudBigtableV2TestProxy} RPC service. Useful where requests and/or responses are streamed. + */ + CloudBigtableV2TestProxy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|createClient}. + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @typedef CreateClientCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.testproxy.CreateClientResponse} [response] CreateClientResponse + */ + + /** + * Calls CreateClient. + * @function createClient + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.ICreateClientRequest} request CreateClientRequest message or plain object + * @param {google.bigtable.testproxy.CloudBigtableV2TestProxy.CreateClientCallback} callback Node-style callback called with the error, if any, and CreateClientResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBigtableV2TestProxy.prototype.createClient = function createClient(request, callback) { + return this.rpcCall(createClient, $root.google.bigtable.testproxy.CreateClientRequest, $root.google.bigtable.testproxy.CreateClientResponse, request, callback); + }, "name", { value: "CreateClient" }); + + /** + * Calls CreateClient. + * @function createClient + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.ICreateClientRequest} request CreateClientRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|closeClient}. + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @typedef CloseClientCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.testproxy.CloseClientResponse} [response] CloseClientResponse + */ + + /** + * Calls CloseClient. + * @function closeClient + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.ICloseClientRequest} request CloseClientRequest message or plain object + * @param {google.bigtable.testproxy.CloudBigtableV2TestProxy.CloseClientCallback} callback Node-style callback called with the error, if any, and CloseClientResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBigtableV2TestProxy.prototype.closeClient = function closeClient(request, callback) { + return this.rpcCall(closeClient, $root.google.bigtable.testproxy.CloseClientRequest, $root.google.bigtable.testproxy.CloseClientResponse, request, callback); + }, "name", { value: "CloseClient" }); + + /** + * Calls CloseClient. + * @function closeClient + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.ICloseClientRequest} request CloseClientRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|removeClient}. + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @typedef RemoveClientCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.testproxy.RemoveClientResponse} [response] RemoveClientResponse + */ + + /** + * Calls RemoveClient. + * @function removeClient + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IRemoveClientRequest} request RemoveClientRequest message or plain object + * @param {google.bigtable.testproxy.CloudBigtableV2TestProxy.RemoveClientCallback} callback Node-style callback called with the error, if any, and RemoveClientResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBigtableV2TestProxy.prototype.removeClient = function removeClient(request, callback) { + return this.rpcCall(removeClient, $root.google.bigtable.testproxy.RemoveClientRequest, $root.google.bigtable.testproxy.RemoveClientResponse, request, callback); + }, "name", { value: "RemoveClient" }); + + /** + * Calls RemoveClient. + * @function removeClient + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IRemoveClientRequest} request RemoveClientRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|readRow}. + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @typedef ReadRowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.testproxy.RowResult} [response] RowResult + */ + + /** + * Calls ReadRow. + * @function readRow + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IReadRowRequest} request ReadRowRequest message or plain object + * @param {google.bigtable.testproxy.CloudBigtableV2TestProxy.ReadRowCallback} callback Node-style callback called with the error, if any, and RowResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBigtableV2TestProxy.prototype.readRow = function readRow(request, callback) { + return this.rpcCall(readRow, $root.google.bigtable.testproxy.ReadRowRequest, $root.google.bigtable.testproxy.RowResult, request, callback); + }, "name", { value: "ReadRow" }); + + /** + * Calls ReadRow. + * @function readRow + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IReadRowRequest} request ReadRowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|readRows}. + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @typedef ReadRowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.testproxy.RowsResult} [response] RowsResult + */ + + /** + * Calls ReadRows. + * @function readRows + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IReadRowsRequest} request ReadRowsRequest message or plain object + * @param {google.bigtable.testproxy.CloudBigtableV2TestProxy.ReadRowsCallback} callback Node-style callback called with the error, if any, and RowsResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBigtableV2TestProxy.prototype.readRows = function readRows(request, callback) { + return this.rpcCall(readRows, $root.google.bigtable.testproxy.ReadRowsRequest, $root.google.bigtable.testproxy.RowsResult, request, callback); + }, "name", { value: "ReadRows" }); + + /** + * Calls ReadRows. + * @function readRows + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IReadRowsRequest} request ReadRowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|mutateRow}. + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @typedef MutateRowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.testproxy.MutateRowResult} [response] MutateRowResult + */ + + /** + * Calls MutateRow. + * @function mutateRow + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IMutateRowRequest} request MutateRowRequest message or plain object + * @param {google.bigtable.testproxy.CloudBigtableV2TestProxy.MutateRowCallback} callback Node-style callback called with the error, if any, and MutateRowResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBigtableV2TestProxy.prototype.mutateRow = function mutateRow(request, callback) { + return this.rpcCall(mutateRow, $root.google.bigtable.testproxy.MutateRowRequest, $root.google.bigtable.testproxy.MutateRowResult, request, callback); + }, "name", { value: "MutateRow" }); + + /** + * Calls MutateRow. + * @function mutateRow + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IMutateRowRequest} request MutateRowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|bulkMutateRows}. + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @typedef BulkMutateRowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.testproxy.MutateRowsResult} [response] MutateRowsResult + */ + + /** + * Calls BulkMutateRows. + * @function bulkMutateRows + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IMutateRowsRequest} request MutateRowsRequest message or plain object + * @param {google.bigtable.testproxy.CloudBigtableV2TestProxy.BulkMutateRowsCallback} callback Node-style callback called with the error, if any, and MutateRowsResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBigtableV2TestProxy.prototype.bulkMutateRows = function bulkMutateRows(request, callback) { + return this.rpcCall(bulkMutateRows, $root.google.bigtable.testproxy.MutateRowsRequest, $root.google.bigtable.testproxy.MutateRowsResult, request, callback); + }, "name", { value: "BulkMutateRows" }); + + /** + * Calls BulkMutateRows. + * @function bulkMutateRows + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IMutateRowsRequest} request MutateRowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|checkAndMutateRow}. + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @typedef CheckAndMutateRowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.testproxy.CheckAndMutateRowResult} [response] CheckAndMutateRowResult + */ + + /** + * Calls CheckAndMutateRow. + * @function checkAndMutateRow + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.ICheckAndMutateRowRequest} request CheckAndMutateRowRequest message or plain object + * @param {google.bigtable.testproxy.CloudBigtableV2TestProxy.CheckAndMutateRowCallback} callback Node-style callback called with the error, if any, and CheckAndMutateRowResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBigtableV2TestProxy.prototype.checkAndMutateRow = function checkAndMutateRow(request, callback) { + return this.rpcCall(checkAndMutateRow, $root.google.bigtable.testproxy.CheckAndMutateRowRequest, $root.google.bigtable.testproxy.CheckAndMutateRowResult, request, callback); + }, "name", { value: "CheckAndMutateRow" }); + + /** + * Calls CheckAndMutateRow. + * @function checkAndMutateRow + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.ICheckAndMutateRowRequest} request CheckAndMutateRowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|sampleRowKeys}. + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @typedef SampleRowKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.testproxy.SampleRowKeysResult} [response] SampleRowKeysResult + */ + + /** + * Calls SampleRowKeys. + * @function sampleRowKeys + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.ISampleRowKeysRequest} request SampleRowKeysRequest message or plain object + * @param {google.bigtable.testproxy.CloudBigtableV2TestProxy.SampleRowKeysCallback} callback Node-style callback called with the error, if any, and SampleRowKeysResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBigtableV2TestProxy.prototype.sampleRowKeys = function sampleRowKeys(request, callback) { + return this.rpcCall(sampleRowKeys, $root.google.bigtable.testproxy.SampleRowKeysRequest, $root.google.bigtable.testproxy.SampleRowKeysResult, request, callback); + }, "name", { value: "SampleRowKeys" }); + + /** + * Calls SampleRowKeys. + * @function sampleRowKeys + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.ISampleRowKeysRequest} request SampleRowKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|readModifyWriteRow}. + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @typedef ReadModifyWriteRowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.testproxy.RowResult} [response] RowResult + */ + + /** + * Calls ReadModifyWriteRow. + * @function readModifyWriteRow + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IReadModifyWriteRowRequest} request ReadModifyWriteRowRequest message or plain object + * @param {google.bigtable.testproxy.CloudBigtableV2TestProxy.ReadModifyWriteRowCallback} callback Node-style callback called with the error, if any, and RowResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBigtableV2TestProxy.prototype.readModifyWriteRow = function readModifyWriteRow(request, callback) { + return this.rpcCall(readModifyWriteRow, $root.google.bigtable.testproxy.ReadModifyWriteRowRequest, $root.google.bigtable.testproxy.RowResult, request, callback); + }, "name", { value: "ReadModifyWriteRow" }); + + /** + * Calls ReadModifyWriteRow. + * @function readModifyWriteRow + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IReadModifyWriteRowRequest} request ReadModifyWriteRowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.bigtable.testproxy.CloudBigtableV2TestProxy|executeQuery}. + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @typedef ExecuteQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.bigtable.testproxy.ExecuteQueryResult} [response] ExecuteQueryResult + */ + + /** + * Calls ExecuteQuery. + * @function executeQuery + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IExecuteQueryRequest} request ExecuteQueryRequest message or plain object + * @param {google.bigtable.testproxy.CloudBigtableV2TestProxy.ExecuteQueryCallback} callback Node-style callback called with the error, if any, and ExecuteQueryResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBigtableV2TestProxy.prototype.executeQuery = function executeQuery(request, callback) { + return this.rpcCall(executeQuery, $root.google.bigtable.testproxy.ExecuteQueryRequest, $root.google.bigtable.testproxy.ExecuteQueryResult, request, callback); + }, "name", { value: "ExecuteQuery" }); + + /** + * Calls ExecuteQuery. + * @function executeQuery + * @memberof google.bigtable.testproxy.CloudBigtableV2TestProxy + * @instance + * @param {google.bigtable.testproxy.IExecuteQueryRequest} request ExecuteQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudBigtableV2TestProxy; + })(); + + return testproxy; + })(); + + return bigtable; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + 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|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) { + object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.common = null; + object.experimentalFeatures = null; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + this.renamedServices = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * 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 = []; + this.style = []; + if (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 = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + 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); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + 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; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.RoutingRule = (function() { + + /** + * Properties of a RoutingRule. + * @memberof google.api + * @interface IRoutingRule + * @property {Array.|null} [routingParameters] RoutingRule routingParameters + */ + + /** + * Constructs a new RoutingRule. + * @memberof google.api + * @classdesc Represents a RoutingRule. + * @implements IRoutingRule + * @constructor + * @param {google.api.IRoutingRule=} [properties] Properties to set + */ + function RoutingRule(properties) { + this.routingParameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingRule routingParameters. + * @member {Array.} routingParameters + * @memberof google.api.RoutingRule + * @instance + */ + RoutingRule.prototype.routingParameters = $util.emptyArray; + + /** + * Creates a new RoutingRule instance using the specified properties. + * @function create + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule=} [properties] Properties to set + * @returns {google.api.RoutingRule} RoutingRule instance + */ + RoutingRule.create = function create(properties) { + return new RoutingRule(properties); + }; + + /** + * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @function encode + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routingParameters != null && message.routingParameters.length) + for (var i = 0; i < message.routingParameters.length; ++i) + $root.google.api.RoutingParameter.encode(message.routingParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.RoutingRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RoutingRule} RoutingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.routingParameters && message.routingParameters.length)) + message.routingParameters = []; + message.routingParameters.push($root.google.api.RoutingParameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RoutingRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RoutingRule} RoutingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingRule message. + * @function verify + * @memberof google.api.RoutingRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) { + if (!Array.isArray(message.routingParameters)) + return "routingParameters: array expected"; + for (var i = 0; i < message.routingParameters.length; ++i) { + var error = $root.google.api.RoutingParameter.verify(message.routingParameters[i]); + if (error) + return "routingParameters." + error; + } + } + return null; + }; + + /** + * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RoutingRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.RoutingRule} RoutingRule + */ + RoutingRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RoutingRule) + return object; + var message = new $root.google.api.RoutingRule(); + if (object.routingParameters) { + if (!Array.isArray(object.routingParameters)) + throw TypeError(".google.api.RoutingRule.routingParameters: array expected"); + message.routingParameters = []; + for (var i = 0; i < object.routingParameters.length; ++i) { + if (typeof object.routingParameters[i] !== "object") + throw TypeError(".google.api.RoutingRule.routingParameters: object expected"); + message.routingParameters[i] = $root.google.api.RoutingParameter.fromObject(object.routingParameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RoutingRule + * @static + * @param {google.api.RoutingRule} message RoutingRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.routingParameters = []; + if (message.routingParameters && message.routingParameters.length) { + object.routingParameters = []; + for (var j = 0; j < message.routingParameters.length; ++j) + object.routingParameters[j] = $root.google.api.RoutingParameter.toObject(message.routingParameters[j], options); + } + return object; + }; + + /** + * Converts this RoutingRule to JSON. + * @function toJSON + * @memberof google.api.RoutingRule + * @instance + * @returns {Object.} JSON object + */ + RoutingRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingRule + * @function getTypeUrl + * @memberof google.api.RoutingRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RoutingRule"; + }; + + return RoutingRule; + })(); + + api.RoutingParameter = (function() { + + /** + * Properties of a RoutingParameter. + * @memberof google.api + * @interface IRoutingParameter + * @property {string|null} [field] RoutingParameter field + * @property {string|null} [pathTemplate] RoutingParameter pathTemplate + */ + + /** + * Constructs a new RoutingParameter. + * @memberof google.api + * @classdesc Represents a RoutingParameter. + * @implements IRoutingParameter + * @constructor + * @param {google.api.IRoutingParameter=} [properties] Properties to set + */ + function RoutingParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingParameter field. + * @member {string} field + * @memberof google.api.RoutingParameter + * @instance + */ + RoutingParameter.prototype.field = ""; + + /** + * RoutingParameter pathTemplate. + * @member {string} pathTemplate + * @memberof google.api.RoutingParameter + * @instance + */ + RoutingParameter.prototype.pathTemplate = ""; + + /** + * Creates a new RoutingParameter instance using the specified properties. + * @function create + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter=} [properties] Properties to set + * @returns {google.api.RoutingParameter} RoutingParameter instance + */ + RoutingParameter.create = function create(properties) { + return new RoutingParameter(properties); + }; + + /** + * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @function encode + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pathTemplate); + return writer; + }; + + /** + * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer. + * @function decode + * @memberof google.api.RoutingParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RoutingParameter} RoutingParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingParameter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.pathTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RoutingParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RoutingParameter} RoutingParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingParameter message. + * @function verify + * @memberof google.api.RoutingParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + if (!$util.isString(message.pathTemplate)) + return "pathTemplate: string expected"; + return null; + }; + + /** + * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RoutingParameter + * @static + * @param {Object.} object Plain object + * @returns {google.api.RoutingParameter} RoutingParameter + */ + RoutingParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RoutingParameter) + return object; + var message = new $root.google.api.RoutingParameter(); + if (object.field != null) + message.field = String(object.field); + if (object.pathTemplate != null) + message.pathTemplate = String(object.pathTemplate); + return message; + }; + + /** + * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.RoutingParameter} message RoutingParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.pathTemplate = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + object.pathTemplate = message.pathTemplate; + return object; + }; + + /** + * Converts this RoutingParameter to JSON. + * @function toJSON + * @memberof google.api.RoutingParameter + * @instance + * @returns {Object.} JSON object + */ + RoutingParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingParameter + * @function getTypeUrl + * @memberof google.api.RoutingParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RoutingParameter"; + }; + + return RoutingParameter; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + 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} [optionDependency] FileDescriptorProto optionDependency + * @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 + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * 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.optionDependency = []; + 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 optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $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 = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); + 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, error) { + 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(); + if (tag === error) + break; + 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 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + 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.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] 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"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + 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.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } + 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); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + 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 = []; + object.optionDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + 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; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } + 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); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + 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 + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility + */ + + /** + * 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; + + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + case 11: { + message.visibility = reader.int32(); + 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"; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + 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; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + 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); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * 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 = []; + this.declaration = []; + if (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; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * 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.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + 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; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + 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.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + 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 + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility + */ + + /** + * 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; + + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + case 6: { + message.visibility = reader.int32(); + 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"; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + 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; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + 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); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + 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} [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 {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @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 deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + 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 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 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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.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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + 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.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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + 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] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + 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.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @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 deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + 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} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + 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 unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = 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 debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + 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) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + 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) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + 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.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + 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.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object.featureSupport = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); + 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]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + 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); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSupport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; + return object; + }; + + /** + * Converts this FeatureSupport to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + * @returns {Object.} JSON object + */ + FeatureSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSupport + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; + }; + + return FeatureSupport; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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 (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + 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 {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @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 deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } + 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; + object.features = null; + object.debugRedact = false; + object.featureSupport = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); + 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); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @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 + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * 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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * 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"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + 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.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + 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); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + 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 {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.api.IRoutingRule|null} [".google.api.routing"] MethodOptions .google.api.routing + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.api.routing. + * @member {google.api.IRoutingRule|null|undefined} .google.api.routing + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.routing"] = null; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + if (message[".google.api.routing"] != null && Object.hasOwnProperty.call(message, ".google.api.routing")) + $root.google.api.RoutingRule.encode(message[".google.api.routing"], writer.uint32(/* id 72295729, wireType 2 =*/578365834).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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 72295729: { + message[".google.api.routing"] = $root.google.api.RoutingRule.decode(reader, reader.uint32()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) { + var error = $root.google.api.RoutingRule.verify(message[".google.api.routing"]); + if (error) + return ".google.api.routing." + error; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + 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) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.api.routing"] != null) { + if (typeof object[".google.api.routing"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.routing: object expected"); + message[".google.api.routing"] = $root.google.api.RoutingRule.fromObject(object[".google.api.routing"]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + object[".google.api.routing"] = 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] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) + object[".google.api.routing"] = $root.google.api.RoutingRule.toObject(message[".google.api.routing"], 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); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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 >= 0) + 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); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (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 VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.fixedFeatures = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); + if (error) + return "fixedFeatures." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; + } + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * 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 + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * 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; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + 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, error) { + 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(); + if (tag === error) + break; + 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; + } + case 5: { + message.semantic = 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"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * 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; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * 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; + object.semantic = options.enums === String ? "NONE" : 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; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @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 IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @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 {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.updateMask = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/handwritten/bigtable/testproxy/protos/protos.json b/handwritten/bigtable/testproxy/protos/protos.json new file mode 100644 index 00000000000..c01461e3273 --- /dev/null +++ b/handwritten/bigtable/testproxy/protos/protos.json @@ -0,0 +1,10554 @@ +{ + "nested": { + "google": { + "nested": { + "bigtable": { + "nested": { + "admin": { + "nested": { + "v2": { + "options": { + "csharp_namespace": "Google.Cloud.Bigtable.Admin.V2", + "go_package": "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb", + "java_multiple_files": true, + "java_outer_classname": "TypesProto", + "java_package": "com.google.bigtable.admin.v2", + "php_namespace": "Google\\Cloud\\Bigtable\\Admin\\V2", + "ruby_package": "Google::Cloud::Bigtable::Admin::V2", + "(google.api.resource_definition).type": "cloudkms.googleapis.com/CryptoKeyVersion", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" + }, + "nested": { + "BigtableInstanceAdmin": { + "options": { + "(google.api.default_host)": "bigtableadmin.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigtable.admin,https://www.googleapis.com/auth/bigtable.admin.cluster,https://www.googleapis.com/auth/bigtable.admin.instance,https://www.googleapis.com/auth/cloud-bigtable.admin,https://www.googleapis.com/auth/cloud-bigtable.admin.cluster,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/instances", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,instance_id,instance,clusters", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "CreateInstanceMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/instances", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,instance_id,instance,clusters" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "CreateInstanceMetadata" + } + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateInstance": { + "requestType": "Instance", + "responseType": "Instance", + "options": { + "(google.api.http).put": "/v2/{name=projects/*/instances/*}", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v2/{name=projects/*/instances/*}", + "body": "*" + } + } + ] + }, + "PartialUpdateInstance": { + "requestType": "PartialUpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{instance.name=projects/*/instances/*}", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "instance,update_mask", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "UpdateInstanceMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{instance.name=projects/*/instances/*}", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "instance,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "UpdateInstanceMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCluster": { + "requestType": "CreateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/clusters", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "parent,cluster_id,cluster", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "CreateClusterMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/clusters", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "parent,cluster_id,cluster" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "CreateClusterMetadata" + } + } + ] + }, + "GetCluster": { + "requestType": "GetClusterRequest", + "responseType": "Cluster", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/clusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListClusters": { + "requestType": "ListClustersRequest", + "responseType": "ListClustersResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*}/clusters", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*}/clusters" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateCluster": { + "requestType": "Cluster", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).put": "/v2/{name=projects/*/instances/*/clusters/*}", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "UpdateClusterMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v2/{name=projects/*/instances/*/clusters/*}", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "UpdateClusterMetadata" + } + } + ] + }, + "PartialUpdateCluster": { + "requestType": "PartialUpdateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{cluster.name=projects/*/instances/*/clusters/*}", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "cluster,update_mask", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "PartialUpdateClusterMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{cluster.name=projects/*/instances/*/clusters/*}", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "cluster,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "PartialUpdateClusterMetadata" + } + } + ] + }, + "DeleteCluster": { + "requestType": "DeleteClusterRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/clusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAppProfile": { + "requestType": "CreateAppProfileRequest", + "responseType": "AppProfile", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/appProfiles", + "(google.api.http).body": "app_profile", + "(google.api.method_signature)": "parent,app_profile_id,app_profile" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/appProfiles", + "body": "app_profile" + } + }, + { + "(google.api.method_signature)": "parent,app_profile_id,app_profile" + } + ] + }, + "GetAppProfile": { + "requestType": "GetAppProfileRequest", + "responseType": "AppProfile", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/appProfiles/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/appProfiles/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAppProfiles": { + "requestType": "ListAppProfilesRequest", + "responseType": "ListAppProfilesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*}/appProfiles", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*}/appProfiles" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateAppProfile": { + "requestType": "UpdateAppProfileRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{app_profile.name=projects/*/instances/*/appProfiles/*}", + "(google.api.http).body": "app_profile", + "(google.api.method_signature)": "app_profile,update_mask", + "(google.longrunning.operation_info).response_type": "AppProfile", + "(google.longrunning.operation_info).metadata_type": "UpdateAppProfileMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{app_profile.name=projects/*/instances/*/appProfiles/*}", + "body": "app_profile" + } + }, + { + "(google.api.method_signature)": "app_profile,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AppProfile", + "metadata_type": "UpdateAppProfileMetadata" + } + } + ] + }, + "DeleteAppProfile": { + "requestType": "DeleteAppProfileRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/appProfiles/*}", + "(google.api.method_signature)": "name,ignore_warnings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/appProfiles/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.api.method_signature)": "name,ignore_warnings" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/instances/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{resource=projects/*/instances/*/logicalViews/*}:getIamPolicy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/instances/*}:getIamPolicy", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{resource=projects/*/instances/*/materializedViews/*}:getIamPolicy", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/logicalViews/*}:getIamPolicy", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/instances/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{resource=projects/*/instances/*/logicalViews/*}:setIamPolicy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/instances/*}:setIamPolicy", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{resource=projects/*/instances/*/materializedViews/*}:setIamPolicy", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/logicalViews/*}:setIamPolicy", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/instances/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{resource=projects/*/instances/*/logicalViews/*}:testIamPermissions", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/instances/*}:testIamPermissions", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{resource=projects/*/instances/*/materializedViews/*}:testIamPermissions", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/logicalViews/*}:testIamPermissions", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "ListHotTablets": { + "requestType": "ListHotTabletsRequest", + "responseType": "ListHotTabletsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*/clusters/*}/hotTablets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*/clusters/*}/hotTablets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateLogicalView": { + "requestType": "CreateLogicalViewRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/logicalViews", + "(google.api.http).body": "logical_view", + "(google.api.method_signature)": "parent,logical_view,logical_view_id", + "(google.longrunning.operation_info).response_type": "LogicalView", + "(google.longrunning.operation_info).metadata_type": "CreateLogicalViewMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/logicalViews", + "body": "logical_view" + } + }, + { + "(google.api.method_signature)": "parent,logical_view,logical_view_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "LogicalView", + "metadata_type": "CreateLogicalViewMetadata" + } + } + ] + }, + "GetLogicalView": { + "requestType": "GetLogicalViewRequest", + "responseType": "LogicalView", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/logicalViews/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/logicalViews/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListLogicalViews": { + "requestType": "ListLogicalViewsRequest", + "responseType": "ListLogicalViewsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*}/logicalViews", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*}/logicalViews" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateLogicalView": { + "requestType": "UpdateLogicalViewRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{logical_view.name=projects/*/instances/*/logicalViews/*}", + "(google.api.http).body": "logical_view", + "(google.api.method_signature)": "logical_view,update_mask", + "(google.longrunning.operation_info).response_type": "LogicalView", + "(google.longrunning.operation_info).metadata_type": "UpdateLogicalViewMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{logical_view.name=projects/*/instances/*/logicalViews/*}", + "body": "logical_view" + } + }, + { + "(google.api.method_signature)": "logical_view,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "LogicalView", + "metadata_type": "UpdateLogicalViewMetadata" + } + } + ] + }, + "DeleteLogicalView": { + "requestType": "DeleteLogicalViewRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/logicalViews/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/logicalViews/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateMaterializedView": { + "requestType": "CreateMaterializedViewRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/materializedViews", + "(google.api.http).body": "materialized_view", + "(google.api.method_signature)": "parent,materialized_view,materialized_view_id", + "(google.longrunning.operation_info).response_type": "MaterializedView", + "(google.longrunning.operation_info).metadata_type": "CreateMaterializedViewMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/materializedViews", + "body": "materialized_view" + } + }, + { + "(google.api.method_signature)": "parent,materialized_view,materialized_view_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MaterializedView", + "metadata_type": "CreateMaterializedViewMetadata" + } + } + ] + }, + "GetMaterializedView": { + "requestType": "GetMaterializedViewRequest", + "responseType": "MaterializedView", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/materializedViews/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/materializedViews/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListMaterializedViews": { + "requestType": "ListMaterializedViewsRequest", + "responseType": "ListMaterializedViewsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*}/materializedViews", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*}/materializedViews" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateMaterializedView": { + "requestType": "UpdateMaterializedViewRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{materialized_view.name=projects/*/instances/*/materializedViews/*}", + "(google.api.http).body": "materialized_view", + "(google.api.method_signature)": "materialized_view,update_mask", + "(google.longrunning.operation_info).response_type": "MaterializedView", + "(google.longrunning.operation_info).metadata_type": "UpdateMaterializedViewMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{materialized_view.name=projects/*/instances/*/materializedViews/*}", + "body": "materialized_view" + } + }, + { + "(google.api.method_signature)": "materialized_view,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MaterializedView", + "metadata_type": "UpdateMaterializedViewMetadata" + } + } + ] + }, + "DeleteMaterializedView": { + "requestType": "DeleteMaterializedViewRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/materializedViews/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/materializedViews/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusters": { + "keyType": "string", + "type": "Cluster", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "failedLocations": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "PartialUpdateInstanceRequest": { + "fields": { + "instance": { + "type": "Instance", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + } + } + }, + "CreateClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + } + } + }, + "ListClustersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "pageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListClustersResponse": { + "fields": { + "clusters": { + "rule": "repeated", + "type": "Cluster", + "id": 1 + }, + "failedLocations": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "DeleteClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + } + } + }, + "CreateInstanceMetadata": { + "fields": { + "originalRequest": { + "type": "CreateInstanceRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "UpdateInstanceMetadata": { + "fields": { + "originalRequest": { + "type": "PartialUpdateInstanceRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "CreateClusterMetadata": { + "fields": { + "originalRequest": { + "type": "CreateClusterRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "tables": { + "keyType": "string", + "type": "TableProgress", + "id": 4 + } + }, + "nested": { + "TableProgress": { + "fields": { + "estimatedSizeBytes": { + "type": "int64", + "id": 2 + }, + "estimatedCopiedBytes": { + "type": "int64", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "COPYING": 2, + "COMPLETED": 3, + "CANCELLED": 4 + } + } + } + } + } + }, + "UpdateClusterMetadata": { + "fields": { + "originalRequest": { + "type": "Cluster", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "PartialUpdateClusterMetadata": { + "fields": { + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "originalRequest": { + "type": "PartialUpdateClusterRequest", + "id": 3 + } + } + }, + "PartialUpdateClusterRequest": { + "fields": { + "cluster": { + "type": "Cluster", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateAppProfileRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "appProfileId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "appProfile": { + "type": "AppProfile", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 4 + } + } + }, + "GetAppProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AppProfile" + } + } + } + }, + "ListAppProfilesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListAppProfilesResponse": { + "fields": { + "appProfiles": { + "rule": "repeated", + "type": "AppProfile", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "failedLocations": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdateAppProfileRequest": { + "fields": { + "appProfile": { + "type": "AppProfile", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteAppProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AppProfile" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAppProfileMetadata": { + "fields": {} + }, + "ListHotTabletsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "ListHotTabletsResponse": { + "fields": { + "hotTablets": { + "rule": "repeated", + "type": "HotTablet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateLogicalViewRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "logicalViewId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "logicalView": { + "type": "LogicalView", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateLogicalViewMetadata": { + "fields": { + "originalRequest": { + "type": "CreateLogicalViewRequest", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "GetLogicalViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/LogicalView" + } + } + } + }, + "ListLogicalViewsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigtableadmin.googleapis.com/LogicalView" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListLogicalViewsResponse": { + "fields": { + "logicalViews": { + "rule": "repeated", + "type": "LogicalView", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateLogicalViewRequest": { + "fields": { + "logicalView": { + "type": "LogicalView", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateLogicalViewMetadata": { + "fields": { + "originalRequest": { + "type": "UpdateLogicalViewRequest", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "DeleteLogicalViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/LogicalView" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateMaterializedViewRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "materializedViewId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "materializedView": { + "type": "MaterializedView", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateMaterializedViewMetadata": { + "fields": { + "originalRequest": { + "type": "CreateMaterializedViewRequest", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "GetMaterializedViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/MaterializedView" + } + } + } + }, + "ListMaterializedViewsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigtableadmin.googleapis.com/MaterializedView" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListMaterializedViewsResponse": { + "fields": { + "materializedViews": { + "rule": "repeated", + "type": "MaterializedView", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateMaterializedViewRequest": { + "fields": { + "materializedView": { + "type": "MaterializedView", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateMaterializedViewMetadata": { + "fields": { + "originalRequest": { + "type": "UpdateMaterializedViewRequest", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "DeleteMaterializedViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/MaterializedView" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}", + "(google.api.resource).plural": "instances", + "(google.api.resource).singular": "instance" + }, + "oneofs": { + "_satisfiesPzs": { + "oneof": [ + "satisfiesPzs" + ] + }, + "_satisfiesPzi": { + "oneof": [ + "satisfiesPzi" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 4 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "tags": { + "keyType": "string", + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_NOT_KNOWN": 0, + "READY": 1, + "CREATING": 2 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "PRODUCTION": 1, + "DEVELOPMENT": 2 + } + } + } + }, + "AutoscalingTargets": { + "fields": { + "cpuUtilizationPercent": { + "type": "int32", + "id": 2 + }, + "storageUtilizationGibPerNode": { + "type": "int32", + "id": 3 + } + } + }, + "AutoscalingLimits": { + "fields": { + "minServeNodes": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxServeNodes": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Cluster": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/Cluster", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/clusters/{cluster}", + "(google.api.resource).plural": "clusters", + "(google.api.resource).singular": "cluster" + }, + "oneofs": { + "config": { + "oneof": [ + "clusterConfig" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "location": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serveNodes": { + "type": "int32", + "id": 4 + }, + "nodeScalingFactor": { + "type": "NodeScalingFactor", + "id": 9, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "clusterConfig": { + "type": "ClusterConfig", + "id": 7 + }, + "defaultStorageType": { + "type": "StorageType", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_NOT_KNOWN": 0, + "READY": 1, + "CREATING": 2, + "RESIZING": 3, + "DISABLED": 4 + } + }, + "NodeScalingFactor": { + "values": { + "NODE_SCALING_FACTOR_UNSPECIFIED": 0, + "NODE_SCALING_FACTOR_1X": 1, + "NODE_SCALING_FACTOR_2X": 2 + } + }, + "ClusterAutoscalingConfig": { + "fields": { + "autoscalingLimits": { + "type": "AutoscalingLimits", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "autoscalingTargets": { + "type": "AutoscalingTargets", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ClusterConfig": { + "fields": { + "clusterAutoscalingConfig": { + "type": "ClusterAutoscalingConfig", + "id": 1 + } + } + }, + "EncryptionConfig": { + "fields": { + "kmsKeyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + } + } + } + }, + "AppProfile": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/AppProfile", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/appProfiles/{app_profile}", + "(google.api.resource).plural": "appProfiles", + "(google.api.resource).singular": "appProfile" + }, + "oneofs": { + "routingPolicy": { + "oneof": [ + "multiClusterRoutingUseAny", + "singleClusterRouting" + ] + }, + "isolation": { + "oneof": [ + "priority", + "standardIsolation", + "dataBoostIsolationReadOnly" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "etag": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "multiClusterRoutingUseAny": { + "type": "MultiClusterRoutingUseAny", + "id": 5 + }, + "singleClusterRouting": { + "type": "SingleClusterRouting", + "id": 6 + }, + "priority": { + "type": "Priority", + "id": 7, + "options": { + "deprecated": true + } + }, + "standardIsolation": { + "type": "StandardIsolation", + "id": 11 + }, + "dataBoostIsolationReadOnly": { + "type": "DataBoostIsolationReadOnly", + "id": 10 + } + }, + "nested": { + "MultiClusterRoutingUseAny": { + "oneofs": { + "affinity": { + "oneof": [ + "rowAffinity" + ] + } + }, + "fields": { + "clusterIds": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "rowAffinity": { + "type": "RowAffinity", + "id": 3 + } + }, + "nested": { + "RowAffinity": { + "fields": {} + } + } + }, + "SingleClusterRouting": { + "fields": { + "clusterId": { + "type": "string", + "id": 1 + }, + "allowTransactionalWrites": { + "type": "bool", + "id": 2 + } + } + }, + "Priority": { + "values": { + "PRIORITY_UNSPECIFIED": 0, + "PRIORITY_LOW": 1, + "PRIORITY_MEDIUM": 2, + "PRIORITY_HIGH": 3 + } + }, + "StandardIsolation": { + "fields": { + "priority": { + "type": "Priority", + "id": 1 + } + } + }, + "DataBoostIsolationReadOnly": { + "oneofs": { + "_computeBillingOwner": { + "oneof": [ + "computeBillingOwner" + ] + } + }, + "fields": { + "computeBillingOwner": { + "type": "ComputeBillingOwner", + "id": 1, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "ComputeBillingOwner": { + "values": { + "COMPUTE_BILLING_OWNER_UNSPECIFIED": 0, + "HOST_PAYS": 1 + } + } + } + } + } + }, + "HotTablet": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/HotTablet", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}", + "(google.api.resource).plural": "hotTablets", + "(google.api.resource).singular": "hotTablet" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "tableName": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startKey": { + "type": "string", + "id": 5 + }, + "endKey": { + "type": "string", + "id": 6 + }, + "nodeCpuUsagePercent": { + "type": "float", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "LogicalView": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/LogicalView", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/logicalViews/{logical_view}", + "(google.api.resource).plural": "logicalViews", + "(google.api.resource).singular": "logicalView" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deletionProtection": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MaterializedView": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/MaterializedView", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/materializedViews/{materialized_view}", + "(google.api.resource).plural": "materializedViews", + "(google.api.resource).singular": "materializedView" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deletionProtection": { + "type": "bool", + "id": 6 + } + } + }, + "StorageType": { + "values": { + "STORAGE_TYPE_UNSPECIFIED": 0, + "SSD": 1, + "HDD": 2 + } + }, + "OperationProgress": { + "fields": { + "progressPercent": { + "type": "int32", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "BigtableTableAdmin": { + "options": { + "(google.api.default_host)": "bigtableadmin.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigtable.admin,https://www.googleapis.com/auth/bigtable.admin.table,https://www.googleapis.com/auth/cloud-bigtable.admin,https://www.googleapis.com/auth/cloud-bigtable.admin.table,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "CreateTable": { + "requestType": "CreateTableRequest", + "responseType": "Table", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/tables", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,table_id,table" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/tables", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,table_id,table" + } + ] + }, + "CreateTableFromSnapshot": { + "requestType": "CreateTableFromSnapshotRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,table_id,source_snapshot", + "(google.longrunning.operation_info).response_type": "Table", + "(google.longrunning.operation_info).metadata_type": "CreateTableFromSnapshotMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,table_id,source_snapshot" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Table", + "metadata_type": "CreateTableFromSnapshotMetadata" + } + } + ] + }, + "ListTables": { + "requestType": "ListTablesRequest", + "responseType": "ListTablesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*}/tables", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*}/tables" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTable": { + "requestType": "GetTableRequest", + "responseType": "Table", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/tables/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/tables/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateTable": { + "requestType": "UpdateTableRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{table.name=projects/*/instances/*/tables/*}", + "(google.api.http).body": "table", + "(google.api.method_signature)": "table,update_mask", + "(google.longrunning.operation_info).response_type": "Table", + "(google.longrunning.operation_info).metadata_type": "UpdateTableMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{table.name=projects/*/instances/*/tables/*}", + "body": "table" + } + }, + { + "(google.api.method_signature)": "table,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Table", + "metadata_type": "UpdateTableMetadata" + } + } + ] + }, + "DeleteTable": { + "requestType": "DeleteTableRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/tables/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/tables/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UndeleteTable": { + "requestType": "UndeleteTableRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*/tables/*}:undelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Table", + "(google.longrunning.operation_info).metadata_type": "UndeleteTableMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*/tables/*}:undelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Table", + "metadata_type": "UndeleteTableMetadata" + } + } + ] + }, + "CreateAuthorizedView": { + "requestType": "CreateAuthorizedViewRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews", + "(google.api.http).body": "authorized_view", + "(google.api.method_signature)": "parent,authorized_view,authorized_view_id", + "(google.longrunning.operation_info).response_type": "AuthorizedView", + "(google.longrunning.operation_info).metadata_type": "CreateAuthorizedViewMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews", + "body": "authorized_view" + } + }, + { + "(google.api.method_signature)": "parent,authorized_view,authorized_view_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AuthorizedView", + "metadata_type": "CreateAuthorizedViewMetadata" + } + } + ] + }, + "ListAuthorizedViews": { + "requestType": "ListAuthorizedViewsRequest", + "responseType": "ListAuthorizedViewsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAuthorizedView": { + "requestType": "GetAuthorizedViewRequest", + "responseType": "AuthorizedView", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateAuthorizedView": { + "requestType": "UpdateAuthorizedViewRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{authorized_view.name=projects/*/instances/*/tables/*/authorizedViews/*}", + "(google.api.http).body": "authorized_view", + "(google.api.method_signature)": "authorized_view,update_mask", + "(google.longrunning.operation_info).response_type": "AuthorizedView", + "(google.longrunning.operation_info).metadata_type": "UpdateAuthorizedViewMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{authorized_view.name=projects/*/instances/*/tables/*/authorizedViews/*}", + "body": "authorized_view" + } + }, + { + "(google.api.method_signature)": "authorized_view,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AuthorizedView", + "metadata_type": "UpdateAuthorizedViewMetadata" + } + } + ] + }, + "DeleteAuthorizedView": { + "requestType": "DeleteAuthorizedViewRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ModifyColumnFamilies": { + "requestType": "ModifyColumnFamiliesRequest", + "responseType": "Table", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*/tables/*}:modifyColumnFamilies", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,modifications" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*/tables/*}:modifyColumnFamilies", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,modifications" + } + ] + }, + "DropRowRange": { + "requestType": "DropRowRangeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*/tables/*}:dropRowRange", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*/tables/*}:dropRowRange", + "body": "*" + } + } + ] + }, + "GenerateConsistencyToken": { + "requestType": "GenerateConsistencyTokenRequest", + "responseType": "GenerateConsistencyTokenResponse", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CheckConsistency": { + "requestType": "CheckConsistencyRequest", + "responseType": "CheckConsistencyResponse", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*/tables/*}:checkConsistency", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,consistency_token" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*/tables/*}:checkConsistency", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,consistency_token" + } + ] + }, + "SnapshotTable": { + "requestType": "SnapshotTableRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*/tables/*}:snapshot", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,cluster,snapshot_id,description", + "(google.longrunning.operation_info).response_type": "Snapshot", + "(google.longrunning.operation_info).metadata_type": "SnapshotTableMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*/tables/*}:snapshot", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,cluster,snapshot_id,description" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Snapshot", + "metadata_type": "SnapshotTableMetadata" + } + } + ] + }, + "GetSnapshot": { + "requestType": "GetSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSnapshots": { + "requestType": "ListSnapshotsRequest", + "responseType": "ListSnapshotsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*/clusters/*}/snapshots", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*/clusters/*}/snapshots" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteSnapshot": { + "requestType": "DeleteSnapshotRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateBackup": { + "requestType": "CreateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*/clusters/*}/backups", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "parent,backup_id,backup", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "CreateBackupMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*/clusters/*}/backups", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "parent,backup_id,backup" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "CreateBackupMetadata" + } + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/clusters/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/clusters/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).patch": "/v2/{backup.name=projects/*/instances/*/clusters/*/backups/*}", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "backup,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{backup.name=projects/*/instances/*/clusters/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/clusters/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/clusters/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*/clusters/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*/clusters/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RestoreTable": { + "requestType": "RestoreTableRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*}/tables:restore", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Table", + "(google.longrunning.operation_info).metadata_type": "RestoreTableMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*}/tables:restore", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Table", + "metadata_type": "RestoreTableMetadata" + } + } + ] + }, + "CopyBackup": { + "requestType": "CopyBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*/clusters/*}/backups:copy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "CopyBackupMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*/clusters/*}/backups:copy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "CopyBackupMetadata" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/instances/*/tables/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:getIamPolicy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/instances/*/tables/*}:getIamPolicy", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:getIamPolicy", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/tables/*/authorizedViews/*}:getIamPolicy", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:getIamPolicy", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/instances/*/tables/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:setIamPolicy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/instances/*/tables/*}:setIamPolicy", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:setIamPolicy", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/tables/*/authorizedViews/*}:setIamPolicy", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:setIamPolicy", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/instances/*/tables/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:testIamPermissions", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/instances/*/tables/*}:testIamPermissions", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:testIamPermissions", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/tables/*/authorizedViews/*}:testIamPermissions", + "body": "*" + }, + { + "post": "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:testIamPermissions", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "CreateSchemaBundle": { + "requestType": "CreateSchemaBundleRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/instances/*/tables/*}/schemaBundles", + "(google.api.http).body": "schema_bundle", + "(google.api.method_signature)": "parent,schema_bundle_id,schema_bundle", + "(google.longrunning.operation_info).response_type": "SchemaBundle", + "(google.longrunning.operation_info).metadata_type": "CreateSchemaBundleMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/instances/*/tables/*}/schemaBundles", + "body": "schema_bundle" + } + }, + { + "(google.api.method_signature)": "parent,schema_bundle_id,schema_bundle" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "SchemaBundle", + "metadata_type": "CreateSchemaBundleMetadata" + } + } + ] + }, + "UpdateSchemaBundle": { + "requestType": "UpdateSchemaBundleRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{schema_bundle.name=projects/*/instances/*/tables/*/schemaBundles/*}", + "(google.api.http).body": "schema_bundle", + "(google.api.method_signature)": "schema_bundle,update_mask", + "(google.longrunning.operation_info).response_type": "SchemaBundle", + "(google.longrunning.operation_info).metadata_type": "UpdateSchemaBundleMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{schema_bundle.name=projects/*/instances/*/tables/*/schemaBundles/*}", + "body": "schema_bundle" + } + }, + { + "(google.api.method_signature)": "schema_bundle,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "SchemaBundle", + "metadata_type": "UpdateSchemaBundleMetadata" + } + } + ] + }, + "GetSchemaBundle": { + "requestType": "GetSchemaBundleRequest", + "responseType": "SchemaBundle", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/instances/*/tables/*/schemaBundles/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/instances/*/tables/*/schemaBundles/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSchemaBundles": { + "requestType": "ListSchemaBundlesRequest", + "responseType": "ListSchemaBundlesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/instances/*/tables/*}/schemaBundles", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/instances/*/tables/*}/schemaBundles" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteSchemaBundle": { + "requestType": "DeleteSchemaBundleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/instances/*/tables/*/schemaBundles/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/instances/*/tables/*/schemaBundles/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "RestoreTableRequest": { + "oneofs": { + "source": { + "oneof": [ + "backup" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "tableId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Backup" + } + } + } + }, + "RestoreTableMetadata": { + "oneofs": { + "sourceInfo": { + "oneof": [ + "backupInfo" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "sourceType": { + "type": "RestoreSourceType", + "id": 2 + }, + "backupInfo": { + "type": "BackupInfo", + "id": 3 + }, + "optimizeTableOperationName": { + "type": "string", + "id": 4 + }, + "progress": { + "type": "OperationProgress", + "id": 5 + } + } + }, + "OptimizeRestoredTableMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "progress": { + "type": "OperationProgress", + "id": 2 + } + } + }, + "CreateTableRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "tableId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "table": { + "type": "Table", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "initialSplits": { + "rule": "repeated", + "type": "Split", + "id": 4 + } + }, + "nested": { + "Split": { + "fields": { + "key": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "CreateTableFromSnapshotRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "tableId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceSnapshot": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Snapshot" + } + } + } + }, + "DropRowRangeRequest": { + "oneofs": { + "target": { + "oneof": [ + "rowKeyPrefix", + "deleteAllDataFromTable" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "rowKeyPrefix": { + "type": "bytes", + "id": 2 + }, + "deleteAllDataFromTable": { + "type": "bool", + "id": 3 + } + } + }, + "ListTablesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "view": { + "type": "Table.View", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListTablesResponse": { + "fields": { + "tables": { + "rule": "repeated", + "type": "Table", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTableRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "view": { + "type": "Table.View", + "id": 2 + } + } + }, + "UpdateTableRequest": { + "fields": { + "table": { + "type": "Table", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateTableMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "DeleteTableRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + } + } + }, + "UndeleteTableRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + } + } + }, + "UndeleteTableMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "ModifyColumnFamiliesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "modifications": { + "rule": "repeated", + "type": "Modification", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Modification": { + "oneofs": { + "mod": { + "oneof": [ + "create", + "update", + "drop" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "create": { + "type": "ColumnFamily", + "id": 2 + }, + "update": { + "type": "ColumnFamily", + "id": 3 + }, + "drop": { + "type": "bool", + "id": 4 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "GenerateConsistencyTokenRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + } + } + }, + "GenerateConsistencyTokenResponse": { + "fields": { + "consistencyToken": { + "type": "string", + "id": 1 + } + } + }, + "CheckConsistencyRequest": { + "oneofs": { + "mode": { + "oneof": [ + "standardReadRemoteWrites", + "dataBoostReadLocalWrites" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "consistencyToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "standardReadRemoteWrites": { + "type": "StandardReadRemoteWrites", + "id": 3 + }, + "dataBoostReadLocalWrites": { + "type": "DataBoostReadLocalWrites", + "id": 4 + } + } + }, + "StandardReadRemoteWrites": { + "fields": {} + }, + "DataBoostReadLocalWrites": { + "fields": {} + }, + "CheckConsistencyResponse": { + "fields": { + "consistent": { + "type": "bool", + "id": 1 + } + } + }, + "SnapshotTableRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "cluster": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + }, + "snapshotId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + } + } + }, + "GetSnapshotRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Snapshot" + } + } + } + }, + "ListSnapshotsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSnapshotsResponse": { + "fields": { + "snapshots": { + "rule": "repeated", + "type": "Snapshot", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteSnapshotRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Snapshot" + } + } + } + }, + "SnapshotTableMetadata": { + "fields": { + "originalRequest": { + "type": "SnapshotTableRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "CreateTableFromSnapshotMetadata": { + "fields": { + "originalRequest": { + "type": "CreateTableFromSnapshotRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "CreateBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + }, + "backupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "Backup", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateBackupMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "sourceTable": { + "type": "string", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "UpdateBackupRequest": { + "fields": { + "backup": { + "type": "Backup", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Backup" + } + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Backup" + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CopyBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Cluster" + } + }, + "backupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceBackup": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Backup" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CopyBackupMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Backup" + } + }, + "sourceBackupInfo": { + "type": "BackupInfo", + "id": 2 + }, + "progress": { + "type": "OperationProgress", + "id": 3 + } + } + }, + "CreateAuthorizedViewRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "authorizedViewId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authorizedView": { + "type": "AuthorizedView", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateAuthorizedViewMetadata": { + "fields": { + "originalRequest": { + "type": "CreateAuthorizedViewRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "ListAuthorizedViewsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "AuthorizedView.ResponseView", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAuthorizedViewsResponse": { + "fields": { + "authorizedViews": { + "rule": "repeated", + "type": "AuthorizedView", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAuthorizedViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "view": { + "type": "AuthorizedView.ResponseView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateAuthorizedViewRequest": { + "fields": { + "authorizedView": { + "type": "AuthorizedView", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateAuthorizedViewMetadata": { + "fields": { + "originalRequest": { + "type": "UpdateAuthorizedViewRequest", + "id": 1 + }, + "requestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "DeleteAuthorizedViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateSchemaBundleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "schemaBundleId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "schemaBundle": { + "type": "SchemaBundle", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateSchemaBundleMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "UpdateSchemaBundleRequest": { + "fields": { + "schemaBundle": { + "type": "SchemaBundle", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreWarnings": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateSchemaBundleMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "GetSchemaBundleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/SchemaBundle" + } + } + } + }, + "ListSchemaBundlesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigtableadmin.googleapis.com/SchemaBundle" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSchemaBundlesResponse": { + "fields": { + "schemaBundles": { + "rule": "repeated", + "type": "SchemaBundle", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteSchemaBundleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/SchemaBundle" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreInfo": { + "oneofs": { + "sourceInfo": { + "oneof": [ + "backupInfo" + ] + } + }, + "fields": { + "sourceType": { + "type": "RestoreSourceType", + "id": 1 + }, + "backupInfo": { + "type": "BackupInfo", + "id": 2 + } + } + }, + "ChangeStreamConfig": { + "fields": { + "retentionPeriod": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "Table": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/Table", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/tables/{table}" + }, + "oneofs": { + "automatedBackupConfig": { + "oneof": [ + "automatedBackupPolicy" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "clusterStates": { + "keyType": "string", + "type": "ClusterState", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "columnFamilies": { + "keyType": "string", + "type": "ColumnFamily", + "id": 3 + }, + "granularity": { + "type": "TimestampGranularity", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "restoreInfo": { + "type": "RestoreInfo", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "changeStreamConfig": { + "type": "ChangeStreamConfig", + "id": 8 + }, + "deletionProtection": { + "type": "bool", + "id": 9 + }, + "automatedBackupPolicy": { + "type": "AutomatedBackupPolicy", + "id": 13 + }, + "rowKeySchema": { + "type": "Type.Struct", + "id": 15 + } + }, + "nested": { + "ClusterState": { + "fields": { + "replicationState": { + "type": "ReplicationState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionInfo": { + "rule": "repeated", + "type": "EncryptionInfo", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ReplicationState": { + "values": { + "STATE_NOT_KNOWN": 0, + "INITIALIZING": 1, + "PLANNED_MAINTENANCE": 2, + "UNPLANNED_MAINTENANCE": 3, + "READY": 4, + "READY_OPTIMIZING": 5 + } + } + } + }, + "TimestampGranularity": { + "values": { + "TIMESTAMP_GRANULARITY_UNSPECIFIED": 0, + "MILLIS": 1 + } + }, + "View": { + "values": { + "VIEW_UNSPECIFIED": 0, + "NAME_ONLY": 1, + "SCHEMA_VIEW": 2, + "REPLICATION_VIEW": 3, + "ENCRYPTION_VIEW": 5, + "FULL": 4 + } + }, + "AutomatedBackupPolicy": { + "fields": { + "retentionPeriod": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "frequency": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "AuthorizedView": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/AuthorizedView", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}", + "(google.api.resource).plural": "authorizedViews", + "(google.api.resource).singular": "authorizedView" + }, + "oneofs": { + "authorizedView": { + "oneof": [ + "subsetView" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "subsetView": { + "type": "SubsetView", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + }, + "deletionProtection": { + "type": "bool", + "id": 4 + } + }, + "nested": { + "FamilySubsets": { + "fields": { + "qualifiers": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "qualifierPrefixes": { + "rule": "repeated", + "type": "bytes", + "id": 2 + } + } + }, + "SubsetView": { + "fields": { + "rowPrefixes": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "familySubsets": { + "keyType": "string", + "type": "FamilySubsets", + "id": 2 + } + } + }, + "ResponseView": { + "values": { + "RESPONSE_VIEW_UNSPECIFIED": 0, + "NAME_ONLY": 1, + "BASIC": 2, + "FULL": 3 + } + } + } + }, + "ColumnFamily": { + "fields": { + "gcRule": { + "type": "GcRule", + "id": 1 + }, + "valueType": { + "type": "Type", + "id": 3 + } + } + }, + "GcRule": { + "oneofs": { + "rule": { + "oneof": [ + "maxNumVersions", + "maxAge", + "intersection", + "union" + ] + } + }, + "fields": { + "maxNumVersions": { + "type": "int32", + "id": 1 + }, + "maxAge": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "intersection": { + "type": "Intersection", + "id": 3 + }, + "union": { + "type": "Union", + "id": 4 + } + }, + "nested": { + "Intersection": { + "fields": { + "rules": { + "rule": "repeated", + "type": "GcRule", + "id": 1 + } + } + }, + "Union": { + "fields": { + "rules": { + "rule": "repeated", + "type": "GcRule", + "id": 1 + } + } + } + } + }, + "EncryptionInfo": { + "fields": { + "encryptionType": { + "type": "EncryptionType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionStatus": { + "type": "google.rpc.Status", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + }, + "nested": { + "EncryptionType": { + "values": { + "ENCRYPTION_TYPE_UNSPECIFIED": 0, + "GOOGLE_DEFAULT_ENCRYPTION": 1, + "CUSTOMER_MANAGED_ENCRYPTION": 2 + } + } + } + }, + "Snapshot": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/Snapshot", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "sourceTable": { + "type": "Table", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSizeBytes": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 7 + } + }, + "nested": { + "State": { + "values": { + "STATE_NOT_KNOWN": 0, + "READY": 1, + "CREATING": 2 + } + } + } + }, + "Backup": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "sourceTable": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceBackup": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sizeBytes": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupType": { + "type": "BackupType", + "id": 11 + }, + "hotToStandardTime": { + "type": "google.protobuf.Timestamp", + "id": 12 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2 + } + }, + "BackupType": { + "values": { + "BACKUP_TYPE_UNSPECIFIED": 0, + "STANDARD": 1, + "HOT": 2 + } + } + } + }, + "BackupInfo": { + "fields": { + "backup": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceTable": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceBackup": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RestoreSourceType": { + "values": { + "RESTORE_SOURCE_TYPE_UNSPECIFIED": 0, + "BACKUP": 1 + } + }, + "ProtoSchema": { + "fields": { + "protoDescriptors": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SchemaBundle": { + "options": { + "(google.api.resource).type": "bigtableadmin.googleapis.com/SchemaBundle", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}", + "(google.api.resource).plural": "schemaBundles", + "(google.api.resource).singular": "schemaBundle" + }, + "oneofs": { + "type": { + "oneof": [ + "protoSchema" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "protoSchema": { + "type": "ProtoSchema", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Type": { + "oneofs": { + "kind": { + "oneof": [ + "bytesType", + "stringType", + "int64Type", + "float32Type", + "float64Type", + "boolType", + "timestampType", + "dateType", + "aggregateType", + "structType", + "arrayType", + "mapType", + "protoType", + "enumType" + ] + } + }, + "fields": { + "bytesType": { + "type": "Bytes", + "id": 1 + }, + "stringType": { + "type": "String", + "id": 2 + }, + "int64Type": { + "type": "Int64", + "id": 5 + }, + "float32Type": { + "type": "Float32", + "id": 12 + }, + "float64Type": { + "type": "Float64", + "id": 9 + }, + "boolType": { + "type": "Bool", + "id": 8 + }, + "timestampType": { + "type": "Timestamp", + "id": 10 + }, + "dateType": { + "type": "Date", + "id": 11 + }, + "aggregateType": { + "type": "Aggregate", + "id": 6 + }, + "structType": { + "type": "Struct", + "id": 7 + }, + "arrayType": { + "type": "Array", + "id": 3 + }, + "mapType": { + "type": "Map", + "id": 4 + }, + "protoType": { + "type": "Proto", + "id": 13 + }, + "enumType": { + "type": "Enum", + "id": 14 + } + }, + "nested": { + "Bytes": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "raw" + ] + } + }, + "fields": { + "raw": { + "type": "Raw", + "id": 1 + } + }, + "nested": { + "Raw": { + "fields": {} + } + } + } + } + }, + "String": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "utf8Raw", + "utf8Bytes" + ] + } + }, + "fields": { + "utf8Raw": { + "type": "Utf8Raw", + "id": 1, + "options": { + "deprecated": true + } + }, + "utf8Bytes": { + "type": "Utf8Bytes", + "id": 2 + } + }, + "nested": { + "Utf8Raw": { + "options": { + "deprecated": true + }, + "fields": {} + }, + "Utf8Bytes": { + "fields": {} + } + } + } + } + }, + "Int64": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "bigEndianBytes", + "orderedCodeBytes" + ] + } + }, + "fields": { + "bigEndianBytes": { + "type": "BigEndianBytes", + "id": 1 + }, + "orderedCodeBytes": { + "type": "OrderedCodeBytes", + "id": 2 + } + }, + "nested": { + "BigEndianBytes": { + "fields": { + "bytesType": { + "type": "Bytes", + "id": 1, + "options": { + "deprecated": true + } + } + } + }, + "OrderedCodeBytes": { + "fields": {} + } + } + } + } + }, + "Bool": { + "fields": {} + }, + "Float32": { + "fields": {} + }, + "Float64": { + "fields": {} + }, + "Timestamp": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "unixMicrosInt64" + ] + } + }, + "fields": { + "unixMicrosInt64": { + "type": "Int64.Encoding", + "id": 1 + } + } + } + } + }, + "Date": { + "fields": {} + }, + "Struct": { + "fields": { + "fields": { + "rule": "repeated", + "type": "Field", + "id": 1 + }, + "encoding": { + "type": "Encoding", + "id": 2 + } + }, + "nested": { + "Field": { + "fields": { + "fieldName": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + } + } + }, + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "singleton", + "delimitedBytes", + "orderedCodeBytes" + ] + } + }, + "fields": { + "singleton": { + "type": "Singleton", + "id": 1 + }, + "delimitedBytes": { + "type": "DelimitedBytes", + "id": 2 + }, + "orderedCodeBytes": { + "type": "OrderedCodeBytes", + "id": 3 + } + }, + "nested": { + "Singleton": { + "fields": {} + }, + "DelimitedBytes": { + "fields": { + "delimiter": { + "type": "bytes", + "id": 1 + } + } + }, + "OrderedCodeBytes": { + "fields": {} + } + } + } + } + }, + "Proto": { + "fields": { + "schemaBundleId": { + "type": "string", + "id": 1 + }, + "messageName": { + "type": "string", + "id": 2 + } + } + }, + "Enum": { + "fields": { + "schemaBundleId": { + "type": "string", + "id": 1 + }, + "enumName": { + "type": "string", + "id": 2 + } + } + }, + "Array": { + "fields": { + "elementType": { + "type": "Type", + "id": 1 + } + } + }, + "Map": { + "fields": { + "keyType": { + "type": "Type", + "id": 1 + }, + "valueType": { + "type": "Type", + "id": 2 + } + } + }, + "Aggregate": { + "oneofs": { + "aggregator": { + "oneof": [ + "sum", + "hllppUniqueCount", + "max", + "min" + ] + } + }, + "fields": { + "inputType": { + "type": "Type", + "id": 1 + }, + "stateType": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sum": { + "type": "Sum", + "id": 4 + }, + "hllppUniqueCount": { + "type": "HyperLogLogPlusPlusUniqueCount", + "id": 5 + }, + "max": { + "type": "Max", + "id": 6 + }, + "min": { + "type": "Min", + "id": 7 + } + }, + "nested": { + "Sum": { + "fields": {} + }, + "Max": { + "fields": {} + }, + "Min": { + "fields": {} + }, + "HyperLogLogPlusPlusUniqueCount": { + "fields": {} + } + } + } + } + } + } + } + } + }, + "v2": { + "options": { + "csharp_namespace": "Google.Cloud.Bigtable.V2", + "go_package": "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb", + "java_multiple_files": true, + "java_outer_classname": "ResponseParamsProto", + "java_package": "com.google.bigtable.v2", + "php_namespace": "Google\\Cloud\\Bigtable\\V2", + "ruby_package": "Google::Cloud::Bigtable::V2", + "(google.api.resource_definition).type": "bigtableadmin.googleapis.com/MaterializedView", + "(google.api.resource_definition).pattern": "projects/{project}/instances/{instance}/materializedViews/{materialized_view}" + }, + "nested": { + "Bigtable": { + "options": { + "(google.api.default_host)": "bigtable.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigtable.data,https://www.googleapis.com/auth/bigtable.data.readonly,https://www.googleapis.com/auth/cloud-bigtable.data,https://www.googleapis.com/auth/cloud-bigtable.data.readonly,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ReadRows": { + "requestType": "ReadRowsRequest", + "responseType": "ReadRowsResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:readRows", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{materialized_view_name=projects/*/instances/*/materializedViews/*}:readRows", + "(google.api.http).additional_bindings.body": "*", + "(google.api.routing).routing_parameters.field": "materialized_view_name", + "(google.api.routing).routing_parameters.path_template": "{name=projects/*/instances/*}/**", + "(google.api.method_signature)": "table_name,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:readRows", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readRows", + "body": "*" + }, + { + "post": "/v2/{materialized_view_name=projects/*/instances/*/materializedViews/*}:readRows", + "body": "*" + } + ] + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "table_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}" + }, + { + "field": "app_profile_id" + }, + { + "field": "authorized_view_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}/**" + }, + { + "field": "materialized_view_name", + "path_template": "{name=projects/*/instances/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "table_name" + }, + { + "(google.api.method_signature)": "table_name,app_profile_id" + } + ] + }, + "SampleRowKeys": { + "requestType": "SampleRowKeysRequest", + "responseType": "SampleRowKeysResponse", + "responseStream": true, + "options": { + "(google.api.http).get": "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys", + "(google.api.http).additional_bindings.get": "/v2/{materialized_view_name=projects/*/instances/*/materializedViews/*}:sampleRowKeys", + "(google.api.routing).routing_parameters.field": "materialized_view_name", + "(google.api.routing).routing_parameters.path_template": "{name=projects/*/instances/*}/**", + "(google.api.method_signature)": "table_name,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys", + "additional_bindings": [ + { + "get": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:sampleRowKeys" + }, + { + "get": "/v2/{materialized_view_name=projects/*/instances/*/materializedViews/*}:sampleRowKeys" + } + ] + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "table_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}" + }, + { + "field": "app_profile_id" + }, + { + "field": "authorized_view_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}/**" + }, + { + "field": "materialized_view_name", + "path_template": "{name=projects/*/instances/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "table_name" + }, + { + "(google.api.method_signature)": "table_name,app_profile_id" + } + ] + }, + "MutateRow": { + "requestType": "MutateRowRequest", + "responseType": "MutateRowResponse", + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRow", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRow", + "(google.api.http).additional_bindings.body": "*", + "(google.api.routing).routing_parameters.field": "authorized_view_name", + "(google.api.routing).routing_parameters.path_template": "{table_name=projects/*/instances/*/tables/*}/**", + "(google.api.method_signature)": "table_name,row_key,mutations,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRow", + "body": "*", + "additional_bindings": { + "post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRow", + "body": "*" + } + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "table_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}" + }, + { + "field": "app_profile_id" + }, + { + "field": "authorized_view_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "table_name,row_key,mutations" + }, + { + "(google.api.method_signature)": "table_name,row_key,mutations,app_profile_id" + } + ] + }, + "MutateRows": { + "requestType": "MutateRowsRequest", + "responseType": "MutateRowsResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRows", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRows", + "(google.api.http).additional_bindings.body": "*", + "(google.api.routing).routing_parameters.field": "authorized_view_name", + "(google.api.routing).routing_parameters.path_template": "{table_name=projects/*/instances/*/tables/*}/**", + "(google.api.method_signature)": "table_name,entries,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRows", + "body": "*", + "additional_bindings": { + "post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRows", + "body": "*" + } + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "table_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}" + }, + { + "field": "app_profile_id" + }, + { + "field": "authorized_view_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "table_name,entries" + }, + { + "(google.api.method_signature)": "table_name,entries,app_profile_id" + } + ] + }, + "CheckAndMutateRow": { + "requestType": "CheckAndMutateRowRequest", + "responseType": "CheckAndMutateRowResponse", + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:checkAndMutateRow", + "(google.api.http).additional_bindings.body": "*", + "(google.api.routing).routing_parameters.field": "authorized_view_name", + "(google.api.routing).routing_parameters.path_template": "{table_name=projects/*/instances/*/tables/*}/**", + "(google.api.method_signature)": "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow", + "body": "*", + "additional_bindings": { + "post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:checkAndMutateRow", + "body": "*" + } + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "table_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}" + }, + { + "field": "app_profile_id" + }, + { + "field": "authorized_view_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "table_name,row_key,predicate_filter,true_mutations,false_mutations" + }, + { + "(google.api.method_signature)": "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id" + } + ] + }, + "PingAndWarm": { + "requestType": "PingAndWarmRequest", + "responseType": "PingAndWarmResponse", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/instances/*}:ping", + "(google.api.http).body": "*", + "(google.api.routing).routing_parameters.field": "app_profile_id", + "(google.api.routing).routing_parameters.path_template": "{name=projects/*/instances/*}", + "(google.api.method_signature)": "name,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/instances/*}:ping", + "body": "*" + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "name", + "path_template": "{name=projects/*/instances/*}" + }, + { + "field": "app_profile_id" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.api.method_signature)": "name,app_profile_id" + } + ] + }, + "ReadModifyWriteRow": { + "requestType": "ReadModifyWriteRowRequest", + "responseType": "ReadModifyWriteRowResponse", + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readModifyWriteRow", + "(google.api.http).additional_bindings.body": "*", + "(google.api.routing).routing_parameters.field": "authorized_view_name", + "(google.api.routing).routing_parameters.path_template": "{table_name=projects/*/instances/*/tables/*}/**", + "(google.api.method_signature)": "table_name,row_key,rules,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow", + "body": "*", + "additional_bindings": { + "post": "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readModifyWriteRow", + "body": "*" + } + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "table_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}" + }, + { + "field": "app_profile_id" + }, + { + "field": "authorized_view_name", + "path_template": "{table_name=projects/*/instances/*/tables/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "table_name,row_key,rules" + }, + { + "(google.api.method_signature)": "table_name,row_key,rules,app_profile_id" + } + ] + }, + "GenerateInitialChangeStreamPartitions": { + "requestType": "GenerateInitialChangeStreamPartitionsRequest", + "responseType": "GenerateInitialChangeStreamPartitionsResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:generateInitialChangeStreamPartitions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "table_name,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:generateInitialChangeStreamPartitions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "table_name" + }, + { + "(google.api.method_signature)": "table_name,app_profile_id" + } + ] + }, + "ReadChangeStream": { + "requestType": "ReadChangeStreamRequest", + "responseType": "ReadChangeStreamResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v2/{table_name=projects/*/instances/*/tables/*}:readChangeStream", + "(google.api.http).body": "*", + "(google.api.method_signature)": "table_name,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{table_name=projects/*/instances/*/tables/*}:readChangeStream", + "body": "*" + } + }, + { + "(google.api.method_signature)": "table_name" + }, + { + "(google.api.method_signature)": "table_name,app_profile_id" + } + ] + }, + "PrepareQuery": { + "requestType": "PrepareQueryRequest", + "responseType": "PrepareQueryResponse", + "options": { + "(google.api.http).post": "/v2/{instance_name=projects/*/instances/*}:prepareQuery", + "(google.api.http).body": "*", + "(google.api.routing).routing_parameters.field": "app_profile_id", + "(google.api.routing).routing_parameters.path_template": "{name=projects/*/instances/*}", + "(google.api.method_signature)": "instance_name,query,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{instance_name=projects/*/instances/*}:prepareQuery", + "body": "*" + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "instance_name", + "path_template": "{name=projects/*/instances/*}" + }, + { + "field": "app_profile_id" + } + ] + } + }, + { + "(google.api.method_signature)": "instance_name,query" + }, + { + "(google.api.method_signature)": "instance_name,query,app_profile_id" + } + ] + }, + "ExecuteQuery": { + "requestType": "ExecuteQueryRequest", + "responseType": "ExecuteQueryResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v2/{instance_name=projects/*/instances/*}:executeQuery", + "(google.api.http).body": "*", + "(google.api.routing).routing_parameters.field": "app_profile_id", + "(google.api.routing).routing_parameters.path_template": "{name=projects/*/instances/*}", + "(google.api.method_signature)": "instance_name,query,app_profile_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{instance_name=projects/*/instances/*}:executeQuery", + "body": "*" + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "instance_name", + "path_template": "{name=projects/*/instances/*}" + }, + { + "field": "app_profile_id" + } + ] + } + }, + { + "(google.api.method_signature)": "instance_name,query" + }, + { + "(google.api.method_signature)": "instance_name,query,app_profile_id" + } + ] + } + } + }, + "ReadRowsRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "authorizedViewName": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "materializedViewName": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/MaterializedView" + } + }, + "appProfileId": { + "type": "string", + "id": 5 + }, + "rows": { + "type": "RowSet", + "id": 2 + }, + "filter": { + "type": "RowFilter", + "id": 3 + }, + "rowsLimit": { + "type": "int64", + "id": 4 + }, + "requestStatsView": { + "type": "RequestStatsView", + "id": 6 + }, + "reversed": { + "type": "bool", + "id": 7 + } + }, + "nested": { + "RequestStatsView": { + "values": { + "REQUEST_STATS_VIEW_UNSPECIFIED": 0, + "REQUEST_STATS_NONE": 1, + "REQUEST_STATS_FULL": 2 + } + } + } + }, + "ReadRowsResponse": { + "fields": { + "chunks": { + "rule": "repeated", + "type": "CellChunk", + "id": 1 + }, + "lastScannedRowKey": { + "type": "bytes", + "id": 2 + }, + "requestStats": { + "type": "RequestStats", + "id": 3 + } + }, + "nested": { + "CellChunk": { + "oneofs": { + "rowStatus": { + "oneof": [ + "resetRow", + "commitRow" + ] + } + }, + "fields": { + "rowKey": { + "type": "bytes", + "id": 1 + }, + "familyName": { + "type": "google.protobuf.StringValue", + "id": 2 + }, + "qualifier": { + "type": "google.protobuf.BytesValue", + "id": 3 + }, + "timestampMicros": { + "type": "int64", + "id": 4 + }, + "labels": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "value": { + "type": "bytes", + "id": 6 + }, + "valueSize": { + "type": "int32", + "id": 7 + }, + "resetRow": { + "type": "bool", + "id": 8 + }, + "commitRow": { + "type": "bool", + "id": 9 + } + } + } + } + }, + "SampleRowKeysRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "authorizedViewName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "materializedViewName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/MaterializedView" + } + }, + "appProfileId": { + "type": "string", + "id": 2 + } + } + }, + "SampleRowKeysResponse": { + "fields": { + "rowKey": { + "type": "bytes", + "id": 1 + }, + "offsetBytes": { + "type": "int64", + "id": 2 + } + } + }, + "MutateRowRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "authorizedViewName": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "appProfileId": { + "type": "string", + "id": 4 + }, + "rowKey": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mutations": { + "rule": "repeated", + "type": "Mutation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "idempotency": { + "type": "Idempotency", + "id": 8 + } + } + }, + "MutateRowResponse": { + "fields": {} + }, + "MutateRowsRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "authorizedViewName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "appProfileId": { + "type": "string", + "id": 3 + }, + "entries": { + "rule": "repeated", + "type": "Entry", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Entry": { + "fields": { + "rowKey": { + "type": "bytes", + "id": 1 + }, + "mutations": { + "rule": "repeated", + "type": "Mutation", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "idempotency": { + "type": "Idempotency", + "id": 3 + } + } + } + } + }, + "MutateRowsResponse": { + "oneofs": { + "_rateLimitInfo": { + "oneof": [ + "rateLimitInfo" + ] + } + }, + "fields": { + "entries": { + "rule": "repeated", + "type": "Entry", + "id": 1 + }, + "rateLimitInfo": { + "type": "RateLimitInfo", + "id": 3, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Entry": { + "fields": { + "index": { + "type": "int64", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + } + } + } + } + }, + "RateLimitInfo": { + "fields": { + "period": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "factor": { + "type": "double", + "id": 2 + } + } + }, + "CheckAndMutateRowRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "authorizedViewName": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "appProfileId": { + "type": "string", + "id": 7 + }, + "rowKey": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "predicateFilter": { + "type": "RowFilter", + "id": 6 + }, + "trueMutations": { + "rule": "repeated", + "type": "Mutation", + "id": 4 + }, + "falseMutations": { + "rule": "repeated", + "type": "Mutation", + "id": 5 + } + } + }, + "CheckAndMutateRowResponse": { + "fields": { + "predicateMatched": { + "type": "bool", + "id": 1 + } + } + }, + "PingAndWarmRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "appProfileId": { + "type": "string", + "id": 2 + } + } + }, + "PingAndWarmResponse": { + "fields": {} + }, + "ReadModifyWriteRowRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "authorizedViewName": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/AuthorizedView" + } + }, + "appProfileId": { + "type": "string", + "id": 4 + }, + "rowKey": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rules": { + "rule": "repeated", + "type": "ReadModifyWriteRule", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ReadModifyWriteRowResponse": { + "fields": { + "row": { + "type": "Row", + "id": 1 + } + } + }, + "GenerateInitialChangeStreamPartitionsRequest": { + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "appProfileId": { + "type": "string", + "id": 2 + } + } + }, + "GenerateInitialChangeStreamPartitionsResponse": { + "fields": { + "partition": { + "type": "StreamPartition", + "id": 1 + } + } + }, + "ReadChangeStreamRequest": { + "oneofs": { + "startFrom": { + "oneof": [ + "startTime", + "continuationTokens" + ] + } + }, + "fields": { + "tableName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Table" + } + }, + "appProfileId": { + "type": "string", + "id": 2 + }, + "partition": { + "type": "StreamPartition", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "continuationTokens": { + "type": "StreamContinuationTokens", + "id": 6 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "heartbeatDuration": { + "type": "google.protobuf.Duration", + "id": 7 + } + } + }, + "ReadChangeStreamResponse": { + "oneofs": { + "streamRecord": { + "oneof": [ + "dataChange", + "heartbeat", + "closeStream" + ] + } + }, + "fields": { + "dataChange": { + "type": "DataChange", + "id": 1 + }, + "heartbeat": { + "type": "Heartbeat", + "id": 2 + }, + "closeStream": { + "type": "CloseStream", + "id": 3 + } + }, + "nested": { + "MutationChunk": { + "fields": { + "chunkInfo": { + "type": "ChunkInfo", + "id": 1 + }, + "mutation": { + "type": "Mutation", + "id": 2 + } + }, + "nested": { + "ChunkInfo": { + "fields": { + "chunkedValueSize": { + "type": "int32", + "id": 1 + }, + "chunkedValueOffset": { + "type": "int32", + "id": 2 + }, + "lastChunk": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "DataChange": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "sourceClusterId": { + "type": "string", + "id": 2 + }, + "rowKey": { + "type": "bytes", + "id": 3 + }, + "commitTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "tiebreaker": { + "type": "int32", + "id": 5 + }, + "chunks": { + "rule": "repeated", + "type": "MutationChunk", + "id": 6 + }, + "done": { + "type": "bool", + "id": 8 + }, + "token": { + "type": "string", + "id": 9 + }, + "estimatedLowWatermark": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "USER": 1, + "GARBAGE_COLLECTION": 2, + "CONTINUATION": 3 + } + } + } + }, + "Heartbeat": { + "fields": { + "continuationToken": { + "type": "StreamContinuationToken", + "id": 1 + }, + "estimatedLowWatermark": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "CloseStream": { + "fields": { + "status": { + "type": "google.rpc.Status", + "id": 1 + }, + "continuationTokens": { + "rule": "repeated", + "type": "StreamContinuationToken", + "id": 2 + }, + "newPartitions": { + "rule": "repeated", + "type": "StreamPartition", + "id": 3 + } + } + } + } + }, + "ExecuteQueryRequest": { + "oneofs": { + "dataFormat": { + "oneof": [ + "protoFormat" + ] + } + }, + "fields": { + "instanceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "appProfileId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "query": { + "type": "string", + "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "REQUIRED" + } + }, + "preparedQuery": { + "type": "bytes", + "id": 9 + }, + "protoFormat": { + "type": "ProtoFormat", + "id": 4, + "options": { + "deprecated": true + } + }, + "resumeToken": { + "type": "bytes", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "params": { + "keyType": "string", + "type": "Value", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExecuteQueryResponse": { + "oneofs": { + "response": { + "oneof": [ + "metadata", + "results" + ] + } + }, + "fields": { + "metadata": { + "type": "ResultSetMetadata", + "id": 1 + }, + "results": { + "type": "PartialResultSet", + "id": 2 + } + } + }, + "PrepareQueryRequest": { + "oneofs": { + "dataFormat": { + "oneof": [ + "protoFormat" + ] + } + }, + "fields": { + "instanceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigtableadmin.googleapis.com/Instance" + } + }, + "appProfileId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "query": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "protoFormat": { + "type": "ProtoFormat", + "id": 4 + }, + "paramTypes": { + "keyType": "string", + "type": "Type", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PrepareQueryResponse": { + "fields": { + "metadata": { + "type": "ResultSetMetadata", + "id": 1 + }, + "preparedQuery": { + "type": "bytes", + "id": 2 + }, + "validUntil": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "Row": { + "fields": { + "key": { + "type": "bytes", + "id": 1 + }, + "families": { + "rule": "repeated", + "type": "Family", + "id": 2 + } + } + }, + "Family": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "columns": { + "rule": "repeated", + "type": "Column", + "id": 2 + } + } + }, + "Column": { + "fields": { + "qualifier": { + "type": "bytes", + "id": 1 + }, + "cells": { + "rule": "repeated", + "type": "Cell", + "id": 2 + } + } + }, + "Cell": { + "fields": { + "timestampMicros": { + "type": "int64", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + }, + "labels": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "rawValue", + "rawTimestampMicros", + "bytesValue", + "stringValue", + "intValue", + "boolValue", + "floatValue", + "timestampValue", + "dateValue", + "arrayValue" + ] + } + }, + "fields": { + "type": { + "type": "Type", + "id": 7 + }, + "rawValue": { + "type": "bytes", + "id": 8 + }, + "rawTimestampMicros": { + "type": "int64", + "id": 9 + }, + "bytesValue": { + "type": "bytes", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "intValue": { + "type": "int64", + "id": 6 + }, + "boolValue": { + "type": "bool", + "id": 10 + }, + "floatValue": { + "type": "double", + "id": 11 + }, + "timestampValue": { + "type": "google.protobuf.Timestamp", + "id": 12 + }, + "dateValue": { + "type": "google.type.Date", + "id": 13 + }, + "arrayValue": { + "type": "ArrayValue", + "id": 4 + } + } + }, + "ArrayValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "RowRange": { + "oneofs": { + "startKey": { + "oneof": [ + "startKeyClosed", + "startKeyOpen" + ] + }, + "endKey": { + "oneof": [ + "endKeyOpen", + "endKeyClosed" + ] + } + }, + "fields": { + "startKeyClosed": { + "type": "bytes", + "id": 1 + }, + "startKeyOpen": { + "type": "bytes", + "id": 2 + }, + "endKeyOpen": { + "type": "bytes", + "id": 3 + }, + "endKeyClosed": { + "type": "bytes", + "id": 4 + } + } + }, + "RowSet": { + "fields": { + "rowKeys": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "rowRanges": { + "rule": "repeated", + "type": "RowRange", + "id": 2 + } + } + }, + "ColumnRange": { + "oneofs": { + "startQualifier": { + "oneof": [ + "startQualifierClosed", + "startQualifierOpen" + ] + }, + "endQualifier": { + "oneof": [ + "endQualifierClosed", + "endQualifierOpen" + ] + } + }, + "fields": { + "familyName": { + "type": "string", + "id": 1 + }, + "startQualifierClosed": { + "type": "bytes", + "id": 2 + }, + "startQualifierOpen": { + "type": "bytes", + "id": 3 + }, + "endQualifierClosed": { + "type": "bytes", + "id": 4 + }, + "endQualifierOpen": { + "type": "bytes", + "id": 5 + } + } + }, + "TimestampRange": { + "fields": { + "startTimestampMicros": { + "type": "int64", + "id": 1 + }, + "endTimestampMicros": { + "type": "int64", + "id": 2 + } + } + }, + "ValueRange": { + "oneofs": { + "startValue": { + "oneof": [ + "startValueClosed", + "startValueOpen" + ] + }, + "endValue": { + "oneof": [ + "endValueClosed", + "endValueOpen" + ] + } + }, + "fields": { + "startValueClosed": { + "type": "bytes", + "id": 1 + }, + "startValueOpen": { + "type": "bytes", + "id": 2 + }, + "endValueClosed": { + "type": "bytes", + "id": 3 + }, + "endValueOpen": { + "type": "bytes", + "id": 4 + } + } + }, + "RowFilter": { + "oneofs": { + "filter": { + "oneof": [ + "chain", + "interleave", + "condition", + "sink", + "passAllFilter", + "blockAllFilter", + "rowKeyRegexFilter", + "rowSampleFilter", + "familyNameRegexFilter", + "columnQualifierRegexFilter", + "columnRangeFilter", + "timestampRangeFilter", + "valueRegexFilter", + "valueRangeFilter", + "cellsPerRowOffsetFilter", + "cellsPerRowLimitFilter", + "cellsPerColumnLimitFilter", + "stripValueTransformer", + "applyLabelTransformer" + ] + } + }, + "fields": { + "chain": { + "type": "Chain", + "id": 1 + }, + "interleave": { + "type": "Interleave", + "id": 2 + }, + "condition": { + "type": "Condition", + "id": 3 + }, + "sink": { + "type": "bool", + "id": 16 + }, + "passAllFilter": { + "type": "bool", + "id": 17 + }, + "blockAllFilter": { + "type": "bool", + "id": 18 + }, + "rowKeyRegexFilter": { + "type": "bytes", + "id": 4 + }, + "rowSampleFilter": { + "type": "double", + "id": 14 + }, + "familyNameRegexFilter": { + "type": "string", + "id": 5 + }, + "columnQualifierRegexFilter": { + "type": "bytes", + "id": 6 + }, + "columnRangeFilter": { + "type": "ColumnRange", + "id": 7 + }, + "timestampRangeFilter": { + "type": "TimestampRange", + "id": 8 + }, + "valueRegexFilter": { + "type": "bytes", + "id": 9 + }, + "valueRangeFilter": { + "type": "ValueRange", + "id": 15 + }, + "cellsPerRowOffsetFilter": { + "type": "int32", + "id": 10 + }, + "cellsPerRowLimitFilter": { + "type": "int32", + "id": 11 + }, + "cellsPerColumnLimitFilter": { + "type": "int32", + "id": 12 + }, + "stripValueTransformer": { + "type": "bool", + "id": 13 + }, + "applyLabelTransformer": { + "type": "string", + "id": 19 + } + }, + "nested": { + "Chain": { + "fields": { + "filters": { + "rule": "repeated", + "type": "RowFilter", + "id": 1 + } + } + }, + "Interleave": { + "fields": { + "filters": { + "rule": "repeated", + "type": "RowFilter", + "id": 1 + } + } + }, + "Condition": { + "fields": { + "predicateFilter": { + "type": "RowFilter", + "id": 1 + }, + "trueFilter": { + "type": "RowFilter", + "id": 2 + }, + "falseFilter": { + "type": "RowFilter", + "id": 3 + } + } + } + } + }, + "Mutation": { + "oneofs": { + "mutation": { + "oneof": [ + "setCell", + "addToCell", + "mergeToCell", + "deleteFromColumn", + "deleteFromFamily", + "deleteFromRow" + ] + } + }, + "fields": { + "setCell": { + "type": "SetCell", + "id": 1 + }, + "addToCell": { + "type": "AddToCell", + "id": 5 + }, + "mergeToCell": { + "type": "MergeToCell", + "id": 6 + }, + "deleteFromColumn": { + "type": "DeleteFromColumn", + "id": 2 + }, + "deleteFromFamily": { + "type": "DeleteFromFamily", + "id": 3 + }, + "deleteFromRow": { + "type": "DeleteFromRow", + "id": 4 + } + }, + "nested": { + "SetCell": { + "fields": { + "familyName": { + "type": "string", + "id": 1 + }, + "columnQualifier": { + "type": "bytes", + "id": 2 + }, + "timestampMicros": { + "type": "int64", + "id": 3 + }, + "value": { + "type": "bytes", + "id": 4 + } + } + }, + "AddToCell": { + "fields": { + "familyName": { + "type": "string", + "id": 1 + }, + "columnQualifier": { + "type": "Value", + "id": 2 + }, + "timestamp": { + "type": "Value", + "id": 3 + }, + "input": { + "type": "Value", + "id": 4 + } + } + }, + "MergeToCell": { + "fields": { + "familyName": { + "type": "string", + "id": 1 + }, + "columnQualifier": { + "type": "Value", + "id": 2 + }, + "timestamp": { + "type": "Value", + "id": 3 + }, + "input": { + "type": "Value", + "id": 4 + } + } + }, + "DeleteFromColumn": { + "fields": { + "familyName": { + "type": "string", + "id": 1 + }, + "columnQualifier": { + "type": "bytes", + "id": 2 + }, + "timeRange": { + "type": "TimestampRange", + "id": 3 + } + } + }, + "DeleteFromFamily": { + "fields": { + "familyName": { + "type": "string", + "id": 1 + } + } + }, + "DeleteFromRow": { + "fields": {} + } + } + }, + "ReadModifyWriteRule": { + "oneofs": { + "rule": { + "oneof": [ + "appendValue", + "incrementAmount" + ] + } + }, + "fields": { + "familyName": { + "type": "string", + "id": 1 + }, + "columnQualifier": { + "type": "bytes", + "id": 2 + }, + "appendValue": { + "type": "bytes", + "id": 3 + }, + "incrementAmount": { + "type": "int64", + "id": 4 + } + } + }, + "StreamPartition": { + "fields": { + "rowRange": { + "type": "RowRange", + "id": 1 + } + } + }, + "StreamContinuationTokens": { + "fields": { + "tokens": { + "rule": "repeated", + "type": "StreamContinuationToken", + "id": 1 + } + } + }, + "StreamContinuationToken": { + "fields": { + "partition": { + "type": "StreamPartition", + "id": 1 + }, + "token": { + "type": "string", + "id": 2 + } + } + }, + "ProtoFormat": { + "fields": {} + }, + "ColumnMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + } + } + }, + "ProtoSchema": { + "fields": { + "columns": { + "rule": "repeated", + "type": "ColumnMetadata", + "id": 1 + } + } + }, + "ResultSetMetadata": { + "oneofs": { + "schema": { + "oneof": [ + "protoSchema" + ] + } + }, + "fields": { + "protoSchema": { + "type": "ProtoSchema", + "id": 1 + } + } + }, + "ProtoRows": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 2 + } + } + }, + "ProtoRowsBatch": { + "fields": { + "batchData": { + "type": "bytes", + "id": 1 + } + } + }, + "PartialResultSet": { + "oneofs": { + "partialRows": { + "oneof": [ + "protoRowsBatch" + ] + }, + "_batchChecksum": { + "oneof": [ + "batchChecksum" + ] + } + }, + "fields": { + "protoRowsBatch": { + "type": "ProtoRowsBatch", + "id": 3 + }, + "batchChecksum": { + "type": "uint32", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "resumeToken": { + "type": "bytes", + "id": 5 + }, + "reset": { + "type": "bool", + "id": 7 + }, + "estimatedBatchSize": { + "type": "int32", + "id": 4 + } + } + }, + "Idempotency": { + "fields": { + "token": { + "type": "bytes", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Type": { + "oneofs": { + "kind": { + "oneof": [ + "bytesType", + "stringType", + "int64Type", + "float32Type", + "float64Type", + "boolType", + "timestampType", + "dateType", + "aggregateType", + "structType", + "arrayType", + "mapType", + "protoType", + "enumType" + ] + } + }, + "fields": { + "bytesType": { + "type": "Bytes", + "id": 1 + }, + "stringType": { + "type": "String", + "id": 2 + }, + "int64Type": { + "type": "Int64", + "id": 5 + }, + "float32Type": { + "type": "Float32", + "id": 12 + }, + "float64Type": { + "type": "Float64", + "id": 9 + }, + "boolType": { + "type": "Bool", + "id": 8 + }, + "timestampType": { + "type": "Timestamp", + "id": 10 + }, + "dateType": { + "type": "Date", + "id": 11 + }, + "aggregateType": { + "type": "Aggregate", + "id": 6 + }, + "structType": { + "type": "Struct", + "id": 7 + }, + "arrayType": { + "type": "Array", + "id": 3 + }, + "mapType": { + "type": "Map", + "id": 4 + }, + "protoType": { + "type": "Proto", + "id": 13 + }, + "enumType": { + "type": "Enum", + "id": 14 + } + }, + "nested": { + "Bytes": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "raw" + ] + } + }, + "fields": { + "raw": { + "type": "Raw", + "id": 1 + } + }, + "nested": { + "Raw": { + "fields": { + "escapeNulls": { + "type": "bool", + "id": 1 + } + } + } + } + } + } + }, + "String": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "utf8Raw", + "utf8Bytes" + ] + } + }, + "fields": { + "utf8Raw": { + "type": "Utf8Raw", + "id": 1, + "options": { + "deprecated": true + } + }, + "utf8Bytes": { + "type": "Utf8Bytes", + "id": 2 + } + }, + "nested": { + "Utf8Raw": { + "options": { + "deprecated": true + }, + "fields": {} + }, + "Utf8Bytes": { + "fields": { + "nullEscapeChar": { + "type": "string", + "id": 1 + } + } + } + } + } + } + }, + "Int64": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "bigEndianBytes", + "orderedCodeBytes" + ] + } + }, + "fields": { + "bigEndianBytes": { + "type": "BigEndianBytes", + "id": 1 + }, + "orderedCodeBytes": { + "type": "OrderedCodeBytes", + "id": 2 + } + }, + "nested": { + "BigEndianBytes": { + "fields": { + "bytesType": { + "type": "Bytes", + "id": 1, + "options": { + "deprecated": true + } + } + } + }, + "OrderedCodeBytes": { + "fields": {} + } + } + } + } + }, + "Bool": { + "fields": {} + }, + "Float32": { + "fields": {} + }, + "Float64": { + "fields": {} + }, + "Timestamp": { + "fields": { + "encoding": { + "type": "Encoding", + "id": 1 + } + }, + "nested": { + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "unixMicrosInt64" + ] + } + }, + "fields": { + "unixMicrosInt64": { + "type": "Int64.Encoding", + "id": 1 + } + } + } + } + }, + "Date": { + "fields": {} + }, + "Struct": { + "fields": { + "fields": { + "rule": "repeated", + "type": "Field", + "id": 1 + }, + "encoding": { + "type": "Encoding", + "id": 2 + } + }, + "nested": { + "Field": { + "fields": { + "fieldName": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + } + } + }, + "Encoding": { + "oneofs": { + "encoding": { + "oneof": [ + "singleton", + "delimitedBytes", + "orderedCodeBytes" + ] + } + }, + "fields": { + "singleton": { + "type": "Singleton", + "id": 1 + }, + "delimitedBytes": { + "type": "DelimitedBytes", + "id": 2 + }, + "orderedCodeBytes": { + "type": "OrderedCodeBytes", + "id": 3 + } + }, + "nested": { + "Singleton": { + "fields": {} + }, + "DelimitedBytes": { + "fields": { + "delimiter": { + "type": "bytes", + "id": 1 + } + } + }, + "OrderedCodeBytes": { + "fields": {} + } + } + } + } + }, + "Proto": { + "fields": { + "schemaBundleId": { + "type": "string", + "id": 1 + }, + "messageName": { + "type": "string", + "id": 2 + } + } + }, + "Enum": { + "fields": { + "schemaBundleId": { + "type": "string", + "id": 1 + }, + "enumName": { + "type": "string", + "id": 2 + } + } + }, + "Array": { + "fields": { + "elementType": { + "type": "Type", + "id": 1 + } + } + }, + "Map": { + "fields": { + "keyType": { + "type": "Type", + "id": 1 + }, + "valueType": { + "type": "Type", + "id": 2 + } + } + }, + "Aggregate": { + "oneofs": { + "aggregator": { + "oneof": [ + "sum", + "hllppUniqueCount", + "max", + "min" + ] + } + }, + "fields": { + "inputType": { + "type": "Type", + "id": 1 + }, + "stateType": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sum": { + "type": "Sum", + "id": 4 + }, + "hllppUniqueCount": { + "type": "HyperLogLogPlusPlusUniqueCount", + "id": 5 + }, + "max": { + "type": "Max", + "id": 6 + }, + "min": { + "type": "Min", + "id": 7 + } + }, + "nested": { + "Sum": { + "fields": {} + }, + "Max": { + "fields": {} + }, + "Min": { + "fields": {} + }, + "HyperLogLogPlusPlusUniqueCount": { + "fields": {} + } + } + } + } + }, + "ReadIterationStats": { + "fields": { + "rowsSeenCount": { + "type": "int64", + "id": 1 + }, + "rowsReturnedCount": { + "type": "int64", + "id": 2 + }, + "cellsSeenCount": { + "type": "int64", + "id": 3 + }, + "cellsReturnedCount": { + "type": "int64", + "id": 4 + } + } + }, + "RequestLatencyStats": { + "fields": { + "frontendServerLatency": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "FullReadStatsView": { + "fields": { + "readIterationStats": { + "type": "ReadIterationStats", + "id": 1 + }, + "requestLatencyStats": { + "type": "RequestLatencyStats", + "id": 2 + } + } + }, + "RequestStats": { + "oneofs": { + "statsView": { + "oneof": [ + "fullReadStatsView" + ] + } + }, + "fields": { + "fullReadStatsView": { + "type": "FullReadStatsView", + "id": 1 + } + } + }, + "FeatureFlags": { + "fields": { + "reverseScans": { + "type": "bool", + "id": 1 + }, + "mutateRowsRateLimit": { + "type": "bool", + "id": 3 + }, + "mutateRowsRateLimit2": { + "type": "bool", + "id": 5 + }, + "lastScannedRowResponses": { + "type": "bool", + "id": 4 + }, + "routingCookie": { + "type": "bool", + "id": 6 + }, + "retryInfo": { + "type": "bool", + "id": 7 + }, + "clientSideMetricsEnabled": { + "type": "bool", + "id": 8 + }, + "trafficDirectorEnabled": { + "type": "bool", + "id": 9 + }, + "directAccessRequested": { + "type": "bool", + "id": 10 + }, + "peerInfo": { + "type": "bool", + "id": 11 + } + } + }, + "PeerInfo": { + "fields": { + "googleFrontendId": { + "type": "int64", + "id": 1 + }, + "applicationFrontendId": { + "type": "int64", + "id": 2 + }, + "applicationFrontendZone": { + "type": "string", + "id": 3 + }, + "applicationFrontendSubzone": { + "type": "string", + "id": 4 + }, + "transportType": { + "type": "TransportType", + "id": 5 + } + }, + "nested": { + "TransportType": { + "values": { + "TRANSPORT_TYPE_UNKNOWN": 0, + "TRANSPORT_TYPE_EXTERNAL": 1, + "TRANSPORT_TYPE_CLOUD_PATH": 2, + "TRANSPORT_TYPE_DIRECT_ACCESS": 3, + "TRANSPORT_TYPE_SESSION_UNKNOWN": 4, + "TRANSPORT_TYPE_SESSION_EXTERNAL": 5, + "TRANSPORT_TYPE_SESSION_CLOUD_PATH": 6, + "TRANSPORT_TYPE_SESSION_DIRECT_ACCESS": 7 + } + } + } + }, + "ResponseParams": { + "oneofs": { + "_zoneId": { + "oneof": [ + "zoneId" + ] + }, + "_clusterId": { + "oneof": [ + "clusterId" + ] + }, + "_afeId": { + "oneof": [ + "afeId" + ] + } + }, + "fields": { + "zoneId": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "afeId": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "testproxy": { + "options": { + "go_package": "cloud.google.com/go/bigtable/testproxy/testproxypb;testproxypb", + "java_multiple_files": true, + "java_package": "com.google.cloud.bigtable.testproxy" + }, + "nested": { + "OptionalFeatureConfig": { + "values": { + "OPTIONAL_FEATURE_CONFIG_DEFAULT": 0, + "OPTIONAL_FEATURE_CONFIG_ENABLE_ALL": 1 + } + }, + "CreateClientRequest": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + }, + "dataTarget": { + "type": "string", + "id": 2 + }, + "projectId": { + "type": "string", + "id": 3 + }, + "instanceId": { + "type": "string", + "id": 4 + }, + "appProfileId": { + "type": "string", + "id": 5 + }, + "perOperationTimeout": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "optionalFeatureConfig": { + "type": "OptionalFeatureConfig", + "id": 7 + }, + "securityOptions": { + "type": "SecurityOptions", + "id": 8 + } + }, + "nested": { + "SecurityOptions": { + "fields": { + "accessToken": { + "type": "string", + "id": 1 + }, + "useSsl": { + "type": "bool", + "id": 2 + }, + "sslEndpointOverride": { + "type": "string", + "id": 3 + }, + "sslRootCertsPem": { + "type": "string", + "id": 4 + } + } + } + } + }, + "CreateClientResponse": { + "fields": {} + }, + "CloseClientRequest": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + } + } + }, + "CloseClientResponse": { + "fields": {} + }, + "RemoveClientRequest": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + } + } + }, + "RemoveClientResponse": { + "fields": {} + }, + "ReadRowRequest": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + }, + "tableName": { + "type": "string", + "id": 4 + }, + "rowKey": { + "type": "string", + "id": 2 + }, + "filter": { + "type": "google.bigtable.v2.RowFilter", + "id": 3 + } + } + }, + "RowResult": { + "fields": { + "status": { + "type": "google.rpc.Status", + "id": 1 + }, + "row": { + "type": "google.bigtable.v2.Row", + "id": 2 + } + } + }, + "ReadRowsRequest": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + }, + "request": { + "type": "google.bigtable.v2.ReadRowsRequest", + "id": 2 + }, + "cancelAfterRows": { + "type": "int32", + "id": 3 + } + } + }, + "RowsResult": { + "fields": { + "status": { + "type": "google.rpc.Status", + "id": 1 + }, + "rows": { + "rule": "repeated", + "type": "google.bigtable.v2.Row", + "id": 2 + } + } + }, + "MutateRowRequest": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + }, + "request": { + "type": "google.bigtable.v2.MutateRowRequest", + "id": 2 + } + } + }, + "MutateRowResult": { + "fields": { + "status": { + "type": "google.rpc.Status", + "id": 1 + } + } + }, + "MutateRowsRequest": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + }, + "request": { + "type": "google.bigtable.v2.MutateRowsRequest", + "id": 2 + } + } + }, + "MutateRowsResult": { + "fields": { + "status": { + "type": "google.rpc.Status", + "id": 1 + }, + "entries": { + "rule": "repeated", + "type": "google.bigtable.v2.MutateRowsResponse.Entry", + "id": 2 + } + } + }, + "CheckAndMutateRowRequest": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + }, + "request": { + "type": "google.bigtable.v2.CheckAndMutateRowRequest", + "id": 2 + } + } + }, + "CheckAndMutateRowResult": { + "fields": { + "status": { + "type": "google.rpc.Status", + "id": 1 + }, + "result": { + "type": "google.bigtable.v2.CheckAndMutateRowResponse", + "id": 2 + } + } + }, + "SampleRowKeysRequest": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + }, + "request": { + "type": "google.bigtable.v2.SampleRowKeysRequest", + "id": 2 + } + } + }, + "SampleRowKeysResult": { + "fields": { + "status": { + "type": "google.rpc.Status", + "id": 1 + }, + "samples": { + "rule": "repeated", + "type": "google.bigtable.v2.SampleRowKeysResponse", + "id": 2 + } + } + }, + "ReadModifyWriteRowRequest": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + }, + "request": { + "type": "google.bigtable.v2.ReadModifyWriteRowRequest", + "id": 2 + } + } + }, + "ExecuteQueryRequest": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + }, + "request": { + "type": "google.bigtable.v2.ExecuteQueryRequest", + "id": 2 + } + } + }, + "ExecuteQueryResult": { + "fields": { + "status": { + "type": "google.rpc.Status", + "id": 1 + }, + "metadata": { + "type": "ResultSetMetadata", + "id": 4 + }, + "rows": { + "rule": "repeated", + "type": "SqlRow", + "id": 3 + } + } + }, + "ResultSetMetadata": { + "fields": { + "columns": { + "rule": "repeated", + "type": "google.bigtable.v2.ColumnMetadata", + "id": 1 + } + } + }, + "SqlRow": { + "fields": { + "values": { + "rule": "repeated", + "type": "google.bigtable.v2.Value", + "id": 1 + } + } + }, + "CloudBigtableV2TestProxy": { + "options": { + "(google.api.default_host)": "bigtable-test-proxy-not-accessible.googleapis.com" + }, + "methods": { + "CreateClient": { + "requestType": "CreateClientRequest", + "responseType": "CreateClientResponse" + }, + "CloseClient": { + "requestType": "CloseClientRequest", + "responseType": "CloseClientResponse" + }, + "RemoveClient": { + "requestType": "RemoveClientRequest", + "responseType": "RemoveClientResponse" + }, + "ReadRow": { + "requestType": "ReadRowRequest", + "responseType": "RowResult" + }, + "ReadRows": { + "requestType": "ReadRowsRequest", + "responseType": "RowsResult" + }, + "MutateRow": { + "requestType": "MutateRowRequest", + "responseType": "MutateRowResult" + }, + "BulkMutateRows": { + "requestType": "MutateRowsRequest", + "responseType": "MutateRowsResult" + }, + "CheckAndMutateRow": { + "requestType": "CheckAndMutateRowRequest", + "responseType": "CheckAndMutateRowResult" + }, + "SampleRowKeys": { + "requestType": "SampleRowKeysRequest", + "responseType": "SampleRowKeysResult" + }, + "ReadModifyWriteRow": { + "requestType": "ReadModifyWriteRowRequest", + "responseType": "RowResult" + }, + "ExecuteQuery": { + "requestType": "ExecuteQueryRequest", + "responseType": "ExecuteQueryResult" + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "RoutingProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI" + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "routing": { + "type": "google.api.RoutingRule", + "id": 72295729, + "extend": "google.protobuf.MethodOptions" + }, + "RoutingRule": { + "fields": { + "routingParameters": { + "rule": "repeated", + "type": "RoutingParameter", + "id": 2 + } + } + }, + "RoutingParameter": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "pathTemplate": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "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 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, + "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 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "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 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 + } + }, + "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": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "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 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + }, + "reserved": [ + [ + 4, + 4 + ], + "stream" + ] + }, + "MethodDescriptorProto": { + "edition": "proto2", + "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": { + "edition": "proto2", + "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 + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + "php_generic_services", + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "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 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "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 + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false, + "deprecated": true + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "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 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } + } + }, + "extensions": [ + [ + 1000, + 9994 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + }, + "reserved": [ + [ + 1, + 1 + ] + ] + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "overridableFeatures": { + "type": "FeatureSet", + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 + } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1", + "cc_enable_arenas": true + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/date;date", + "java_multiple_files": true, + "java_outer_classname": "DateProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP", + "cc_enable_arenas": true + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + }, + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/handwritten/bigtable/testproxy/services/bulk-mutate-rows.ts b/handwritten/bigtable/testproxy/services/bulk-mutate-rows.ts new file mode 100644 index 00000000000..3b873cfb036 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/bulk-mutate-rows.ts @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as grpc from '@grpc/grpc-js'; + +import {normalizeCallback, ClientImplMaker, getTableInfo} from './utils'; +import {google} from '../protos/protos'; +import {PartialFailureError} from '../../src'; +type IMutateRowsRequest = google.bigtable.testproxy.IMutateRowsRequest; +type IMutateRowsResult = google.bigtable.testproxy.IMutateRowsResult; + +interface ErrorCode { + code?: number; +} + +export const bulkMutateRows: ClientImplMaker< + IMutateRowsRequest, + IMutateRowsResult +> = ({clientMap}) => + normalizeCallback(async rawRequest => { + const {request} = rawRequest; + const {entries, tableName} = request.request!; + + const {clientId} = request; + const bigtable = clientMap.get(clientId!); + const table = getTableInfo(bigtable, tableName!); + + try { + const mutateOptions = { + rawMutation: true, + }; + await table.mutate(entries, mutateOptions); + return { + status: {code: grpc.status.OK, details: []}, + entries: [], + }; + } catch (e) { + const error = e as PartialFailureError & ErrorCode; + const entries = error.errors + ? Array.from(error.errors.entries()).map(([index, err]) => ({ + index: index + 1, + status: { + code: (err as ErrorCode).code, + message: err.message, + }, + })) + : []; + return { + status: { + code: error.code ? error.code : grpc.status.UNKNOWN, + details: [], + message: error.message, + }, + entries, + }; + } + }); diff --git a/handwritten/bigtable/testproxy/services/check-and-mutate-row.ts b/handwritten/bigtable/testproxy/services/check-and-mutate-row.ts new file mode 100644 index 00000000000..0e7ca7c5663 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/check-and-mutate-row.ts @@ -0,0 +1,109 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as grpc from '@grpc/grpc-js'; + +import {ClientImplMaker, getTableInfo, normalizeCallback} from './utils'; +import {createFlatMutationsListWithFnInverse} from './utils/request/createFlatMutationsList'; +import {mutationParseInverse} from './utils/request/mutateInverse'; +import {google} from '../protos/protos'; +import {RawFilter} from '../../src'; +import {GoogleError} from 'google-gax'; +type ICheckAndMutateRowRequest = + google.bigtable.testproxy.ICheckAndMutateRowRequest; +type ICheckAndMutateRowResult = + google.bigtable.testproxy.ICheckAndMutateRowResult; + +/** + * Transforms mutations from the gRPC layer format to the handwritten layer format. + * This function takes an array of gRPC layer mutations (google.bigtable.v2.IMutation[]) and converts + * them back to the format used by the handwritten layer. It essentially reverses the transformation + * performed by Mutation.parse. It's used internally by the test proxy for checkAndMutateRow. + * + * @param {google.bigtable.v2.IMutation[]} gapicLayerMutations An array of mutations in the gRPC layer format. + * @returns {FilterConfigOption[]} An array of mutations in the handwritten layer format. + */ +function handwrittenLayerMutations( + gapicLayerMutations: google.bigtable.v2.IMutation[], +) { + return gapicLayerMutations + .map(mutation => + createFlatMutationsListWithFnInverse( + [ + { + mutations: [mutation], + }, + ], + mutationParseInverse, + 1, + ), + ) + .flat(); +} + +/** + * Converts a byte array (or string) back to a string. This is the inverse of + * Mutation.convertToBytes. + * + * @param {Bytes} bytes The byte array or string to convert. + * @returns {string} The converted string. + */ +function convertFromBytes(bytes: Buffer | string | Uint8Array): string { + if (Buffer.isBuffer(bytes)) { + return bytes.toString(); + } else if (typeof bytes === 'string') { + return bytes; + } else if (bytes instanceof Uint8Array) { + return Buffer.from(bytes).toString(); + } else { + throw new Error('Invalid input type. Must be Buffer or string.'); + } +} + +export const checkAndMutateRow: ClientImplMaker< + ICheckAndMutateRowRequest, + ICheckAndMutateRowResult +> = ({clientMap}) => + normalizeCallback(async rawRequest => { + const {request} = rawRequest; + const {clientId, request: checkAndMutateRowRequest} = request; + const {appProfileId, falseMutations, rowKey, tableName, trueMutations} = + checkAndMutateRowRequest!; + const onMatch = handwrittenLayerMutations(trueMutations!); + const onNoMatch = handwrittenLayerMutations(falseMutations!); + const id = convertFromBytes(rowKey!); + const bigtable = clientMap.get(clientId!)!; + bigtable.appProfileId = + appProfileId === '' ? bigtable.appProfileId! : appProfileId!; + const table = getTableInfo(bigtable, tableName!); + const row = table.row(id); + const filter: RawFilter[] = []; + const filterConfig = {onMatch, onNoMatch}; + try { + const [, result] = await row.filter(filter, filterConfig); + return { + status: {code: grpc.status.OK, details: []}, + result, + }; + } catch (e) { + const error = e as GoogleError; + return { + status: { + code: error.code ? error.code : grpc.status.UNKNOWN, + details: [], + message: error.message, + }, + }; + } + }); diff --git a/handwritten/bigtable/testproxy/services/close-client.ts b/handwritten/bigtable/testproxy/services/close-client.ts new file mode 100644 index 00000000000..1d19bb2050b --- /dev/null +++ b/handwritten/bigtable/testproxy/services/close-client.ts @@ -0,0 +1,46 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {google} from '../protos/protos'; +import {ClientImplMaker, normalizeCallback} from './utils'; +import {closeBigtableClient} from './utils/bigtable-client'; +type ICloseClientRequest = google.bigtable.testproxy.ICloseClientRequest; +type ICloseClientResponse = google.bigtable.testproxy.ICloseClientResponse; + +import {log} from './utils/log'; + +export const closeClient: ClientImplMaker< + ICloseClientRequest, + ICloseClientResponse +> = ({clientMap}) => + normalizeCallback(async rawRequest => { + const request = rawRequest.request; + const {clientId} = request; + const bigtable = clientMap.get(clientId!); + + log.info( + 'close client %s (%s)', + clientId, + bigtable ? 'exists' : "doesn't exist", + ); + + if (bigtable) { + // closeBigtableClient closes the BigtableClient, but not the Bigtable + // object itself. We need to close the Bigtable object as well. + await closeBigtableClient(bigtable); + await bigtable.close(); + log.info('client %s closed', clientId); + } + return {}; + }); diff --git a/handwritten/bigtable/testproxy/services/create-client.ts b/handwritten/bigtable/testproxy/services/create-client.ts new file mode 100644 index 00000000000..c2a52295657 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/create-client.ts @@ -0,0 +1,115 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {ClientImplMaker, normalizeCallback} from './utils'; +import {google} from '../protos/protos'; + +import * as grpc from '@grpc/grpc-js'; +import {Bigtable} from '../../src'; +import {createBigtableClient} from './utils/bigtable-client'; +import {log} from './utils/log'; + +function durationToMilliseconds( + duration: google.protobuf.Duration | google.protobuf.IDuration, +) { + const secondsInMs = parseInt(duration.seconds as string, 10) * 1000; + const nanosInMs = duration.nanos! / 1000000; + return secondsInMs + nanosInMs; +} + +type ICreateClientRequest = google.bigtable.testproxy.ICreateClientRequest; +type ICreateClientResponse = google.bigtable.testproxy.ICreateClientResponse; + +interface HasCredential { + callCredential?: {jsonServiceAccount: string}; +} + +interface MethodConfig { + timeout_millis: number; + retry_codes_name: string; + retry_params_name: string; +} + +export const createClient: ClientImplMaker< + ICreateClientRequest, + ICreateClientResponse +> = ({clientMap}) => + normalizeCallback(async rawRequest => { + // TODO: Handle refresh periods + const {request} = rawRequest; + const clientConfig = JSON.parse( + JSON.stringify(require('../../src/v2/bigtable_client_config.json')), + ); + const { + callCredential, + clientId, + projectId, + instanceId, + dataTarget: apiEndpoint, + appProfileId, + } = request as ICreateClientRequest & HasCredential; + + if (!(clientId && projectId && instanceId && apiEndpoint)) { + throw Object.assign( + new Error( + 'clientId, projectId, instanceId, and apiEndpoint must be provided.', + ), + {code: grpc.status.INVALID_ARGUMENT}, + ); + } + + log.info( + 'create client %s (%s)', + clientId, + clientMap.has(clientId) ? 'exists' : "doesn't exist", + ); + + if (clientMap.has(clientId)) { + throw Object.assign(new Error(`Client ${clientId} already exists`), { + code: grpc.status.ALREADY_EXISTS, + }); + } + + // TODO: Implement support to SSL connection + let authClient; + if (callCredential && callCredential.jsonServiceAccount) { + authClient = JSON.parse(callCredential.jsonServiceAccount); + } + if (request.perOperationTimeout) { + /** + * This block of code ensures the server times out for every method call + * after the amount of time specified in request.perOperationTimeout. + */ + Object.entries( + clientConfig.interfaces['google.bigtable.v2.Bigtable'].methods, + ).forEach(([, v]) => { + (v as MethodConfig).timeout_millis = durationToMilliseconds( + request.perOperationTimeout!, + ); + }); + } + + const options = { + projectId, + apiEndpoint, + authClient, + appProfileId: appProfileId!, + clientConfig, + }; + log.info('created bigtable client %s', clientId); + const bigtable = new Bigtable(options); + createBigtableClient(bigtable); + clientMap.set(clientId!, bigtable); + return {}; + }); diff --git a/handwritten/bigtable/testproxy/services/execute-query.ts b/handwritten/bigtable/testproxy/services/execute-query.ts new file mode 100644 index 00000000000..43b3668aa84 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/execute-query.ts @@ -0,0 +1,79 @@ +// Copyright 2025-2026 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {GoogleError} from 'google-gax'; +import * as grpc from '@grpc/grpc-js'; +import { + parseMetadata, + parseRows, + parseParameters, +} from './utils/request/createExecuteQueryResponse'; +import {ClientImplMaker, normalizeCallback} from './utils'; +import {ExecuteQueryOptions} from '../../src/instance'; + +import {google} from '../protos/protos'; +type IExecuteQueryRequest = google.bigtable.testproxy.IExecuteQueryRequest; +type IExecuteQueryResult = google.bigtable.testproxy.IExecuteQueryResult; +type ExecuteQueryParameters = ExecuteQueryOptions['parameters']; + +export const executeQuery: ClientImplMaker< + IExecuteQueryRequest, + IExecuteQueryResult +> = ({clientMap}) => + normalizeCallback(async rawRequest => { + const {request} = rawRequest; + const {clientId} = request; + const queryRequest = request.request!; + + const {instanceName} = queryRequest; + const bigtable = clientMap.get(clientId!); + const instance = bigtable.instance(instanceName!); + + try { + const [parameters, parameterTypes] = await parseParameters( + // The empty object here is equivalent to `params` in the proto. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + queryRequest.params || ({} as any), + ); + const [preparedStatement] = await instance.prepareStatement({ + query: queryRequest.query!, + parameterTypes: parameterTypes, + }); + const [rows] = await instance.executeQuery({ + preparedStatement, + parameters: parameters as ExecuteQueryParameters, + retryOptions: {}, + }); + + const parsedMetadata = await parseMetadata(preparedStatement); + const parsedRows = await parseRows(preparedStatement, rows); + + return { + status: {code: grpc.status.OK, details: []}, + rows: parsedRows, + metadata: {columns: parsedMetadata}, + }; + } catch (e) { + console.error(e); // Log the error for debugging + const error = e as GoogleError; + return { + status: { + code: error.code || grpc.status.UNKNOWN, + // e.details must be in an empty array for the test runner to return the status. This is tracked in b/383096533. + details: [], + message: error.message, + }, + }; + } + }); diff --git a/handwritten/bigtable/testproxy/services/index.ts b/handwritten/bigtable/testproxy/services/index.ts new file mode 100644 index 00000000000..9555690d664 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/index.ts @@ -0,0 +1,57 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {bulkMutateRows} from './bulk-mutate-rows'; +import {checkAndMutateRow} from './check-and-mutate-row'; +import {ClientMap} from './utils/client-map'; +import {closeClient} from './close-client'; +import {createClient} from './create-client'; +import {mutateRow} from './mutate-row'; +import {readModifyWriteRow} from './read-modify-write-row'; +import {readRow} from './read-row'; +import {readRows} from './read-rows'; +import {removeClient} from './remove-client'; +import {sampleRowKeys} from './sample-row-keys'; +import {executeQuery} from './execute-query'; + +import {google} from '../protos/protos'; +import {handleUnaryCall} from '@grpc/grpc-js'; +type CloudBigtableV2TestProxy = + google.bigtable.testproxy.CloudBigtableV2TestProxy; + +export {CloudBigtableV2TestProxy}; + +export interface ServiceImplementations { + // We don't really care about the specific return types here. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: handleUnaryCall; +} + +export function getServicesImplementation(): ServiceImplementations { + const clientMap = new ClientMap(); + + return { + bulkMutateRows: bulkMutateRows({clientMap}), + checkAndMutateRow: checkAndMutateRow({clientMap}), + createClient: createClient({clientMap}), + closeClient: closeClient({clientMap}), + mutateRow: mutateRow({clientMap}), + readModifyWriteRow: readModifyWriteRow({clientMap}), + readRow: readRow({clientMap}), + readRows: readRows({clientMap}), + removeClient: removeClient({clientMap}), + sampleRowKeys: sampleRowKeys({clientMap}), + executeQuery: executeQuery({clientMap}), + }; +} diff --git a/handwritten/bigtable/testproxy/services/mutate-row.ts b/handwritten/bigtable/testproxy/services/mutate-row.ts new file mode 100644 index 00000000000..a50a11e0b25 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/mutate-row.ts @@ -0,0 +1,58 @@ +// Copyright 2022-2026 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import * as grpc from '@grpc/grpc-js'; +import {GoogleError} from 'google-gax'; +import {google} from '../protos/protos'; +type IMutateRowRequest = google.bigtable.testproxy.IMutateRowRequest; +type IMutateRowResult = google.bigtable.testproxy.IMutateRowResult; + +import {ClientImplMaker, normalizeCallback} from './utils'; +import {getBigtableClient} from './utils/bigtable-client'; + +export const mutateRow: ClientImplMaker< + IMutateRowRequest, + IMutateRowResult +> = ({clientMap}) => + normalizeCallback(async rawRequest => { + const {request} = rawRequest; + const {request: mutateRequest} = request; + const {mutations, tableName, rowKey} = mutateRequest!; + const {clientId} = request; + const bigtable = clientMap.get(clientId!); + const appProfileId = bigtable.appProfileId; + const client = getBigtableClient(bigtable); + + try { + await client.mutateRow({ + appProfileId, + mutations, + tableName, + rowKey, + }); + + return { + status: {code: grpc.status.OK, details: []}, + }; + } catch (e) { + const error = e as GoogleError; + return { + status: { + code: error.code ? error.code : grpc.status.UNKNOWN, + message: error.message, + details: [], + }, + }; + } + }); diff --git a/handwritten/bigtable/testproxy/services/read-modify-write-row.ts b/handwritten/bigtable/testproxy/services/read-modify-write-row.ts new file mode 100644 index 00000000000..a94cd8412fb --- /dev/null +++ b/handwritten/bigtable/testproxy/services/read-modify-write-row.ts @@ -0,0 +1,57 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as grpc from '@grpc/grpc-js'; +import {GoogleError} from 'google-gax'; + +import {google} from '../protos/protos'; +type IReadModifyWriteRowRequest = + google.bigtable.testproxy.IReadModifyWriteRowRequest; +type IRowResult = google.bigtable.testproxy.IRowResult; + +import {ClientImplMaker, getTableInfo, normalizeCallback} from './utils'; +import {getRMWRRequestInverse} from './utils/request/readModifyWriteRow'; + +export const readModifyWriteRow: ClientImplMaker< + IReadModifyWriteRowRequest, + IRowResult +> = ({clientMap}) => + normalizeCallback(async rawRequest => { + const {request} = rawRequest; + const {clientId, request: readModifyWriteRow} = request; + const {appProfileId, tableName} = readModifyWriteRow!; + const handWrittenRequest = getRMWRRequestInverse(readModifyWriteRow!); + const bigtable = clientMap.get(clientId!); + if (appProfileId && appProfileId !== '') { + bigtable.appProfileId = appProfileId; + } + const table = getTableInfo(bigtable, tableName!); + const row = table.row(handWrittenRequest.id); + try { + const [result] = await row.createRules(handWrittenRequest.rules!); + return { + status: {code: grpc.status.OK, details: []}, + row: result.row, + }; + } catch (e) { + const error = e as GoogleError; + return { + status: { + code: error.code ? error.code : grpc.status.UNKNOWN, + details: [], + message: error.message, + }, + }; + } + }); diff --git a/handwritten/bigtable/testproxy/services/read-row.ts b/handwritten/bigtable/testproxy/services/read-row.ts new file mode 100644 index 00000000000..de742d55ef5 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/read-row.ts @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as grpc from '@grpc/grpc-js'; + +import {google} from '../protos/protos'; +type IReadRowRequest = google.bigtable.testproxy.IReadRowRequest; +type IRowResult = google.bigtable.testproxy.IRowResult; + +import { + ClientImplMaker, + normalizeCallback, + getRowResponse, + getTableInfo, +} from './utils'; +import {GoogleError} from 'google-gax'; + +export const readRow: ClientImplMaker = ({ + clientMap, +}) => + normalizeCallback(async rawRequest => { + const {clientId, rowKey, tableName} = rawRequest.request; + const columns = {}; + + try { + const bigtable = clientMap.get(clientId!); + const table = getTableInfo(bigtable, tableName!); + const row = table.row(rowKey!); + + const res = await row.get(columns); + const firstRow = getRowResponse(res[0]); + + return { + status: {code: grpc.status.OK, details: []}, + row: firstRow, + }; + } catch (e) { + const error = e as GoogleError; + return { + status: { + code: error.code || grpc.status.FAILED_PRECONDITION, + // e.details must be in an empty array for the test runner to return the status. This is tracked in b/383096533. + details: [], + message: error.message, + }, + }; + } + }); diff --git a/handwritten/bigtable/testproxy/services/read-rows.ts b/handwritten/bigtable/testproxy/services/read-rows.ts new file mode 100644 index 00000000000..d1e9f02d338 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/read-rows.ts @@ -0,0 +1,98 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as grpc from '@grpc/grpc-js'; +import {GoogleError} from 'google-gax'; + +import {google} from '../protos/protos'; +type IReadRowsRequest = google.bigtable.testproxy.IReadRowsRequest; +type IReadRowsRequestV2 = google.bigtable.v2.IReadRowsRequest; +type IRowsResult = google.bigtable.testproxy.IRowsResult; +type IRowRange = google.bigtable.v2.IRowRange; + +import { + ClientImplMaker, + getRowResponse, + getTableInfo, + normalizeCallback, +} from './utils'; +import {GetRowsOptions} from '../../src'; + +const getRowsOptions = (readRowsRequest: IReadRowsRequestV2) => { + const getRowsRequest: GetRowsOptions = {}; + + if (readRowsRequest.rows) { + const {rowRanges} = readRowsRequest.rows; + if (rowRanges) { + getRowsRequest.ranges = rowRanges.map( + ({startKeyClosed, endKeyClosed}: IRowRange) => ({ + start: {inclusive: true, value: String(startKeyClosed)}, + end: {inclusive: true, value: String(endKeyClosed)}, + }), + ); + } + + const {rowKeys} = readRowsRequest.rows; + if (rowKeys) { + getRowsRequest.keys = rowKeys.map(String); + } + } + + const {rowsLimit} = readRowsRequest; + if (rowsLimit && rowsLimit !== '0') { + getRowsRequest.limit = parseInt(rowsLimit as string, 10); + } + return getRowsRequest; +}; + +const getReadRowsRequest = (request: IReadRowsRequest) => { + const readRowsRequest = request ? request.request : undefined; + if (!readRowsRequest || !readRowsRequest.tableName) { + throw Object.assign(new Error('table_name must be provided in request.'), { + code: grpc.status.INVALID_ARGUMENT, + }); + } + return readRowsRequest; +}; + +export const readRows: ClientImplMaker = ({ + clientMap, +}) => + normalizeCallback(async rawRequest => { + const request = rawRequest.request; + const {clientId} = request; + const readRowsRequest = getReadRowsRequest(request); + const {tableName} = readRowsRequest; + const bigtable = clientMap.get(clientId!); + const table = getTableInfo(bigtable, tableName || ''); + const rowsOptions = getRowsOptions(readRowsRequest); + try { + const [rows] = await table.getRows(rowsOptions); + return { + status: {code: grpc.status.OK, details: []}, + rows: rows.map(getRowResponse), + }; + } catch (e) { + const error = e as GoogleError; + return { + status: { + // This might be zero/undefined if it's a disconnected client error. + code: error.code || grpc.status.FAILED_PRECONDITION, + // e.details must be in an empty array for the test runner to return the status. This is tracked in b/383096533. + details: [], + message: error.message, + }, + }; + } + }); diff --git a/handwritten/bigtable/testproxy/services/remove-client.ts b/handwritten/bigtable/testproxy/services/remove-client.ts new file mode 100644 index 00000000000..f99f2f839df --- /dev/null +++ b/handwritten/bigtable/testproxy/services/remove-client.ts @@ -0,0 +1,37 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {ClientImplMaker, normalizeCallback} from './utils'; + +import {google} from '../protos/protos'; +import {deleteBigtableClient} from './utils/bigtable-client'; +type IRemoveClientRequest = google.bigtable.testproxy.IRemoveClientRequest; +type IRemoveClientResponse = google.bigtable.testproxy.IRemoveClientResponse; + +export const removeClient: ClientImplMaker< + IRemoveClientRequest, + IRemoveClientResponse +> = ({clientMap}) => + normalizeCallback(async rawRequest => { + const request = rawRequest.request; + const {clientId} = request; + const bigtable = clientMap.get(clientId!); + + if (bigtable) { + await deleteBigtableClient(bigtable); + await bigtable.close(); + clientMap.delete(clientId!); + } + return {}; + }); diff --git a/handwritten/bigtable/testproxy/services/sample-row-keys.ts b/handwritten/bigtable/testproxy/services/sample-row-keys.ts new file mode 100644 index 00000000000..12dfabc138e --- /dev/null +++ b/handwritten/bigtable/testproxy/services/sample-row-keys.ts @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as grpc from '@grpc/grpc-js'; +import {GoogleError} from 'google-gax'; +import {ClientImplMaker, normalizeCallback} from './utils'; + +import {google} from '../protos/protos'; +import {log} from './utils/log'; +type ISampleRowKeysRequest = google.bigtable.testproxy.ISampleRowKeysRequest; +type ISampleRowKeysResult = google.bigtable.testproxy.ISampleRowKeysResult; + +export const sampleRowKeys: ClientImplMaker< + ISampleRowKeysRequest, + ISampleRowKeysResult +> = ({clientMap}) => + normalizeCallback(async rawRequest => { + const {request} = rawRequest; + const {clientId, request: sampleRowKeysRequest} = request; + const {tableName} = sampleRowKeysRequest!; + + const bigtable = clientMap.get(clientId!); + + const [, , , instanceId, , tableId] = tableName!.split('/'); + const instance = bigtable.instance(instanceId); + const table = instance.table(tableId); + + try { + const response = await table.sampleRowKeys(); + + log.info('sampleRowKeys response %o', response); + return { + status: {code: grpc.status.OK, details: []}, + samples: response[0].map(sample => ({ + rowKey: sample.key, + offsetBytes: sample.offset, + })), + }; + } catch (e) { + const error = e as GoogleError; + + return { + status: { + // This might be zero/undefined if it's a disconnected client error. + code: error.code || grpc.status.FAILED_PRECONDITION, + details: [], + }, + }; + } + }); diff --git a/handwritten/bigtable/testproxy/services/utils/bigtable-client.ts b/handwritten/bigtable/testproxy/services/utils/bigtable-client.ts new file mode 100644 index 00000000000..9a693f2af50 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/utils/bigtable-client.ts @@ -0,0 +1,60 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import * as grpc from '@grpc/grpc-js'; +import {Bigtable} from '../../../src'; +import {ClientSideMetricsConfigManager} from '../../../src/client-side-metrics/metrics-config-manager'; +import {IMetricsHandler} from '../../../src/client-side-metrics/metrics-handler'; +import {BigtableClient} from '../../../src/v2'; + +const v2 = Symbol.for('v2'); + +export function createBigtableClient(bigtable: Bigtable) { + const handlers: IMetricsHandler[] = []; + bigtable._metricsConfigManager = new ClientSideMetricsConfigManager(handlers); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const bigtableAny = bigtable as any; + + // We'll store these in the Bigtable object so that we can access them from the + // test proxy. + if (bigtableAny[v2]) { + throw Object.assign(new Error('should not have a BigtableClient already'), { + code: grpc.status.ALREADY_EXISTS, + }); + } + bigtableAny[v2] = new BigtableClient(bigtable.options.BigtableClient); +} + +export function getBigtableClient(bigtable: Bigtable): BigtableClient { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (bigtable as any)[v2]; +} + +export async function closeBigtableClient(bigtable: Bigtable) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const bigtableAny = bigtable as any; + + const bigtableClient = bigtableAny[v2] as BigtableClient; + await bigtableClient.close(); +} + +export async function deleteBigtableClient(bigtable: Bigtable) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const bigtableAny = bigtable as any; + + await closeBigtableClient(bigtable); + + delete bigtableAny[v2]; +} diff --git a/handwritten/bigtable/testproxy/services/utils/client-map.ts b/handwritten/bigtable/testproxy/services/utils/client-map.ts new file mode 100644 index 00000000000..3c515ff7659 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/utils/client-map.ts @@ -0,0 +1,65 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as grpc from '@grpc/grpc-js'; +import {Bigtable} from '../../../src'; + +export interface ServiceHandlerParams { + clientMap: ClientMap; +} + +export interface WrappedRequest { + request: RequestType; +} + +export type ClientImpl = ( + rawRequest: WrappedRequest, +) => Promise; + +export type ClientImplCallback = ( + rawRequest: WrappedRequest, + response: (error: Error | null, response: ResponseType | null) => void, +) => void; + +export interface ClientImplMaker { + // The maker returns a gRPC handler function + ( + handlerParams: ServiceHandlerParams, + ): ClientImplCallback; +} + +export class ClientMap extends Map { + // TODO: we might need to implement a way to lock + // currently used client instances here + get(key: string) { + if (!key) { + const err = { + code: grpc.status.INVALID_ARGUMENT, + details: 'Client id is not defined.', + }; + throw Object.assign(new Error(err.details), err); + } + + const res = super.get(key); + if (!res) { + const err = { + code: grpc.status.NOT_FOUND, + details: `Client ${key} not found.`, + }; + throw Object.assign(new Error(err.details), err); + } + + return res; + } +} diff --git a/handwritten/bigtable/testproxy/services/utils/get-row-response.ts b/handwritten/bigtable/testproxy/services/utils/get-row-response.ts new file mode 100644 index 00000000000..04d9010cbb1 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/utils/get-row-response.ts @@ -0,0 +1,38 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +export const getRowResponse = ({ + id, + data, +}: { + id: string; + data: Record; +}) => ({ + key: Buffer.from(id), + families: Object.entries(data).map(([familyKey, familyValue]) => ({ + name: familyKey, + columns: Object.entries(familyValue as Record).map( + ([columnKey, columnValue]) => ({ + qualifier: Buffer.from(columnKey), + cells: (columnValue as Record[]).map( + ({labels, timestamp, value}) => ({ + timestampMicros: timestamp, + value: Buffer.from(value as any), + labels, + }), + ), + }), + ), + })), +}); diff --git a/handwritten/bigtable/testproxy/services/utils/get-table-info.ts b/handwritten/bigtable/testproxy/services/utils/get-table-info.ts new file mode 100644 index 00000000000..17d0b38cd38 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/utils/get-table-info.ts @@ -0,0 +1,21 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {Bigtable} from '../../../src'; + +export const getTableInfo = (bigtable: Bigtable, tableName: string) => { + const [, , , instanceId, , tableId] = tableName.split('/'); + const instance = bigtable.instance(instanceId); + return instance.table(tableId); +}; diff --git a/handwritten/bigtable/testproxy/services/utils/index.ts b/handwritten/bigtable/testproxy/services/utils/index.ts new file mode 100644 index 00000000000..76a74daf8a1 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/utils/index.ts @@ -0,0 +1,18 @@ +// Copyright 2025-2026 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +export * from './client-map'; +export * from './get-row-response'; +export * from './get-table-info'; +export * from './normalize-callback'; diff --git a/handwritten/bigtable/testproxy/services/utils/log.ts b/handwritten/bigtable/testproxy/services/utils/log.ts new file mode 100644 index 00000000000..8493d2b6afb --- /dev/null +++ b/handwritten/bigtable/testproxy/services/utils/log.ts @@ -0,0 +1,18 @@ +// Copyright 2025-2026 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {loggingUtils as logging} from 'google-gax'; + +// Debug logger to use with the testproxy. +export const log = logging.log('cbt-testproxy'); diff --git a/handwritten/bigtable/testproxy/services/utils/normalize-callback.ts b/handwritten/bigtable/testproxy/services/utils/normalize-callback.ts new file mode 100644 index 00000000000..d61f7b369e5 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/utils/normalize-callback.ts @@ -0,0 +1,44 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as grpc from '@grpc/grpc-js'; + +import {callbackify} from 'node:util'; +import {ClientImpl, ClientImplCallback, WrappedRequest} from './client-map'; + +export const normalizeCallback = ( + fn: ClientImpl, +): ClientImplCallback => + callbackify(async (rawRequest: WrappedRequest) => { + let res: ResponseType; + try { + res = await fn(rawRequest); + } catch (err) { + const e = err as Error; + + // sends original errors directly to standard error since + // callbackify is going to swallow them later + console.error(e); + + throw Object.assign( + new Error(e.message), + { + code: grpc.status.UNKNOWN, + details: [e.message], + }, + e, + ); + } + return res; + }); diff --git a/handwritten/bigtable/testproxy/services/utils/request/createExecuteQueryResponse.ts b/handwritten/bigtable/testproxy/services/utils/request/createExecuteQueryResponse.ts new file mode 100644 index 00000000000..7a61e522bb9 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/utils/request/createExecuteQueryResponse.ts @@ -0,0 +1,226 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import * as protos from '../../../protos/protos'; +import {SqlTypes} from '../../../../src'; +import {MetadataConsumer} from '../../../../src/execute-query/metadataconsumer'; +import { + convertJsValueToValue, + executeQueryTypeToPBType, +} from '../../../../src/execute-query/parameterparsing'; +import {PreparedStatement} from '../../../../src/execute-query/preparedstatement'; +import {ExecuteQueryStreamTransformWithMetadata} from '../../../../src/execute-query/queryresultrowtransformer'; +import { + QueryResultRow, + SqlValue, + EncodedKeyMap, + Struct, + BigtableMap, + ExecuteQueryParameterValue, +} from '../../../../src/execute-query/values'; +import * as is from 'is'; + +async function getMetadataFromPreparedStatement( + preparedStatement: PreparedStatement, +): Promise { + return await new Promise((resolve, reject) => { + preparedStatement.getData( + ( + err?: Error, + preparedQueryBytes?: Uint8Array | string, + metadata?: SqlTypes.ResultSetMetadata, + ) => { + if (err) { + reject(err); + } else { + resolve(metadata!); + } + }, + 100, + ); + }); +} + +export async function parseMetadata(preparedStatement: PreparedStatement) { + const metadata = await getMetadataFromPreparedStatement(preparedStatement); + const values = metadata.columns.map((v, i) => { + return [metadata.getFieldNameAtIndex(i), executeQueryTypeToPBType(v)]; + }); + return values.map(v => + protos.google.bigtable.v2.ColumnMetadata.create({ + name: v[0] as string, + type: v[1] as protos.google.bigtable.v2.IType, + }), + ); +} + +function convertToArray( + value: SqlValue, + type: SqlTypes.ArrayType, +): protos.google.bigtable.v2.IValue { + if (!is.array(value)) { + throw new Error(`Value ${value} cannot be converted to an array.`); + } + const arrayValue = value as Array; + return { + arrayValue: { + values: arrayValue.map((element, index) => { + try { + return convertAnyValueToPb(element, type.elementType); + // eslint-disable-next-line + } catch (conversionError: any) { + if (conversionError instanceof Error) { + throw new Error( + `Error while converting element ${index} of an array: ${conversionError.message}`, + ); + } else { + throw conversionError; + } + } + }), + }, + }; +} + +function convertToStruct( + value: SqlValue, + type: SqlTypes.StructType, +): protos.google.bigtable.v2.IValue { + if (!(typeof value === 'object' && value instanceof Struct)) { + throw new Error(`Value ${value} cannot be converted to an array.`); + } + const arrayValue = value as Struct; + return { + arrayValue: { + values: arrayValue.values.map((element, index) => { + try { + return convertAnyValueToPb(element, type.get(index)); + // eslint-disable-next-line + } catch (convertionError: any) { + if (convertionError instanceof Error) { + throw new Error( + `Error while converting element ${index} of a Struct to field of type ${ + type.get(index).type + }: ${convertionError.message}`, + ); + } else { + throw convertionError; + } + } + }), + }, + }; +} + +function convertToMap( + value: SqlValue, + type: SqlTypes.MapType, +): protos.google.bigtable.v2.IValue { + if (!(value instanceof EncodedKeyMap)) { + throw new Error(`Value ${value} cannot be converted to a map.`); + } + const arrayValue = value as BigtableMap; + return { + arrayValue: { + values: Array.from(arrayValue.entries()).flatMap(([key, value]) => { + return { + arrayValue: { + values: [ + convertMapEntry(key, type.keyType, key, 'key'), + convertMapEntry(value, type.valueType, key, 'value'), + ], + }, + }; + }), + }, + }; +} + +function convertMapEntry( + value: SqlValue, + type: SqlTypes.Type, + keyName: string | bigint | Uint8Array | null, + keyOrValue: 'key' | 'value', +): protos.google.bigtable.v2.IValue { + try { + return convertAnyValueToPb(value, type); + // eslint-disable-next-line + } catch (convertionError: any) { + if (convertionError instanceof Error) { + throw new Error( + `Error while converting element ${keyName} of a Map to map ${keyOrValue} of type ${type.type}: ${convertionError.message}`, + ); + } else { + throw convertionError; + } + } +} + +function convertAnyValueToPb( + value: SqlValue, + type: SqlTypes.Type, +): protos.google.bigtable.v2.IValue { + if (value === null || value === undefined) { + return protos.google.bigtable.v2.Value.create({}); + } + if (type.type === 'array') { + return convertToArray(value, type); + } else if (type.type === 'struct') { + return convertToStruct(value, type); + } else if (type.type === 'map') { + return convertToMap(value, type); + } else { + return convertJsValueToValue(value as ExecuteQueryParameterValue, type); + } +} + +export async function parseRows( + preparedStatement: PreparedStatement, + rows: QueryResultRow[], +) { + const metadata = await getMetadataFromPreparedStatement(preparedStatement); + const parsedRows = rows.map(row => { + const rowValues = metadata.columns.map((type, i) => { + const value = row.get(i); + return convertAnyValueToPb(value, type); + }); + return {values: rowValues}; + }); + return parsedRows; +} + +export async function parseParameters(params: { + [param: string]: protos.google.bigtable.v2.Value; +}) { + const parameters: {[param: string]: SqlValue} = {}; + const parameterTypes: {[param: string]: SqlTypes.Type} = {}; + const transfomer = new ExecuteQueryStreamTransformWithMetadata( + null as any, + () => false, + 'utf-8', + {}, + ); + for (const [paramName, pbValue] of Object.entries(params)) { + const type = MetadataConsumer.parsePBType( + pbValue.type as protos.google.bigtable.v2.Type, + ); + const value = transfomer.valueToJsType(pbValue, type); + parameters[paramName] = value; + parameterTypes[paramName] = type; + } + return [parameters, parameterTypes] as [ + {[param: string]: SqlValue}, + {[param: string]: SqlTypes.Type}, + ]; +} diff --git a/handwritten/bigtable/testproxy/services/utils/request/createFlatMutationsList.ts b/handwritten/bigtable/testproxy/services/utils/request/createFlatMutationsList.ts new file mode 100644 index 00000000000..e88744de9a9 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/utils/request/createFlatMutationsList.ts @@ -0,0 +1,73 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {FilterConfigOption} from '../../../../src/row'; +import {Mutation} from '../../../../src/mutation'; +import arrify = require('arrify'); + +/** + * Creates a flattened list of mutations by applying a transformation function to each entry in an array of FilterConfigOptions. + * + * This function takes an array of `FilterConfigOption` objects and a transformation function `f`. It applies `f` to each + * `FilterConfigOption` (after casting it to a `Mutation` object) and extracts the `mutations` property from the result of `f`. + * The `mutations` property is expected to be an array of type `T`, which extends `google.bigtable.v2.IMutation`. + * Finally, it flattens the resulting array of `T[]` into a single, concatenated array of `T`. + * + * @template T The type of mutation objects within the `mutations` array returned by `f`. Must extend `google.bigtable.v2.IMutation`. + * @param {FilterConfigOption[]} entries An array of `FilterConfigOption` objects, each representing a set of mutations. + * @param {function(Mutation): {mutations: T[]}} f The transformation function to apply to each `FilterConfigOption`. + * This function takes a `Mutation` object as input and must return an object with a `mutations` property that is an array of `T` objects. + * @returns {T[]} A flattened array of mutations of type `T`, created by concatenating the `mutations` arrays returned by applying `f` to each entry. + */ +export function createFlatMutationsListWithFn( + entries: FilterConfigOption[], + f: (entry: Mutation) => {mutations: T[]}, +) { + const e2 = arrify(entries).map(entry => f(entry as Mutation).mutations!); + return e2.reduce((a, b) => a.concat(b), []); +} + +/** + * Partially inverts createFlatMutationsListWithFn, reconstructing the original + * FilterConfigOption[] by assuming 'f' converts Mutations to their protobuf + * representation. Note: This does *not* invert the transformation performed by 'f' itself. + * + * @param {T[]} entries The flattened mutations list. + * @param {Function} fInverse The inverse of the function 'f' used in createFlatMutationsListWithFn. MUST BE PROVIDED and MUST correctly invert 'f'. + * @param {number} numEntries The original number of entries. This is REQUIRED as the flattening operation loses this information. + * @returns {FilterConfigOption[]} The reconstructed FilterConfigOption array. + */ +export function createFlatMutationsListWithFnInverse( + entries: T[], + fInverse: (entry: T) => Mutation, + numEntries: number, +): FilterConfigOption[] { + const invertedEntries: FilterConfigOption[] = []; + const mutationsPerEntry = entries.length / numEntries; + + for (let i = 0; i < numEntries; i++) { + const start = i * mutationsPerEntry; + const end = start + mutationsPerEntry; + const entryMutations = entries.slice(start, end) as unknown as T[]; // Type cast to align with fInverse input + + const invertedEntry: FilterConfigOption = {}; + for (const mutation of entryMutations) { + Object.assign(invertedEntry, fInverse(mutation)); // Apply inverse function to each mutation + } + + invertedEntries.push(invertedEntry); + } + + return invertedEntries; +} diff --git a/handwritten/bigtable/testproxy/services/utils/request/mutateInverse.ts b/handwritten/bigtable/testproxy/services/utils/request/mutateInverse.ts new file mode 100644 index 00000000000..164c8654201 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/utils/request/mutateInverse.ts @@ -0,0 +1,97 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {Data, Mutation, Bytes} from '../../../../src/mutation'; +import * as protos from '../../../protos/protos'; + +/** + * Inverts the Mutation.parse function. Reconstructs a Mutation object from its + * protobuf representation. + * + * @param {protos.google.bigtable.v2.IMutateRowRequest} req The protobuf representation of the mutation. + * @returns {Mutation} The reconstructed Mutation object. + */ +export function mutationParseInverse(req: { + mutations: protos.google.bigtable.v2.IMutation[]; +}): Mutation { + let method: string | undefined; + let data: Data; + + if (req.mutations && req.mutations.length > 0) { + if (req.mutations[0].setCell) { + method = Mutation.methods.INSERT; + const localData = {} as any; + + req.mutations.forEach(m => { + const cell = m.setCell; + if (cell) { + const family = cell.familyName!; + const qualifier = Mutation.convertFromBytes( + cell.columnQualifier! as Bytes, + ); + + // Now TypeScript knows that 'data' is an object, and 'family' is a string key + if (!localData[family]) { + localData[family] = {}; + } + localData[family][qualifier as string] = { + value: Mutation.convertFromBytes(cell?.value as Bytes), + timestamp: cell?.timestampMicros, + }; + } + }); + data = localData; + } else if ( + req.mutations.some( + m => m.deleteFromColumn || m.deleteFromFamily || m.deleteFromRow, + ) + ) { + method = Mutation.methods.DELETE; + const localData: Data[] = []; + + req.mutations.forEach(m => { + if (m.deleteFromColumn) { + const col = m.deleteFromColumn; + + const column = { + family: col?.familyName, + qualifier: Mutation.convertFromBytes(col?.columnQualifier as Bytes), + }; + + const qualifier = `${column.family}:${column.qualifier}`; + + if ( + col?.timeRange?.startTimestampMicros && + col?.timeRange.endTimestampMicros + ) { + const time = { + start: col?.timeRange?.startTimestampMicros, + end: col?.timeRange.endTimestampMicros, + }; + localData.push({column: qualifier, time}); + } else { + localData.push(qualifier); + } + } else if (m.deleteFromFamily) { + localData.push(m.deleteFromFamily?.familyName); + } else if (m.deleteFromRow) { + localData.push({}); // Represent deleteFromRow as an empty object + } + }); + data = localData; + } + } + + return {method: method!, data} as Mutation; // method cannot be undefined here, assert non-null +} diff --git a/handwritten/bigtable/testproxy/services/utils/request/readModifyWriteRow.ts b/handwritten/bigtable/testproxy/services/utils/request/readModifyWriteRow.ts new file mode 100644 index 00000000000..7f032a85f31 --- /dev/null +++ b/handwritten/bigtable/testproxy/services/utils/request/readModifyWriteRow.ts @@ -0,0 +1,124 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +import {Rule} from '../../../../src/row'; +import {Bytes, Mutation} from '../../../../src/mutation'; +import arrify = require('arrify'); +import * as protos from '../../../protos/protos'; + +type RMRWRequest = protos.google.bigtable.v2.IReadModifyWriteRowRequest; + +interface RMWRRequestData { + reqOpts: { + tableName?: string; + authorizedViewName?: string; + }; + id: string; + rules: Rule | Rule[]; + appProfileId?: string; +} + +/** + * This function will create a request that can be passed into the + * readModifyWriteRequest method in the Gapic layer. + * + * @param {RMWRRequestData} request The readModifyWrite request information + * that will be used to build the readModifyWrite request that will be sent to + * the Gapic layer. + * @returns {RMRWRequest} A request that can be passed into the + * readModifyWriteRow method in the Gapic layer. + */ +export function getRMWRRequest(request: RMWRRequestData): RMRWRequest { + const {reqOpts, id, rules, appProfileId} = request; + if (!rules || (rules as Rule[]).length === 0) { + throw new Error('At least one rule must be provided.'); + } + + const requestRules = arrify(rules).map(rule => { + const column = Mutation.parseColumnName((rule as Rule).column); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const ruleData: any = { + familyName: column.family, + columnQualifier: Mutation.convertToBytes(column.qualifier!), + }; + + if ((rule as Rule).append) { + ruleData.appendValue = Mutation.convertToBytes((rule as Rule).append); + } + + if ((rule as Rule).increment) { + ruleData.incrementAmount = (rule as Rule).increment; + } + + return ruleData; + }); + + return Object.assign( + { + rowKey: Mutation.convertToBytes(id), + rules: requestRules, + }, + reqOpts, + appProfileId ? {appProfileId} : null, + ); +} + +/** + * This function will translate a request that is appropriate for the + * readModifyWriteRow method in the Gapic layer into a request for the + * handwritten layer that calls the readModifyWriteRow method under the hood. + * + * @param {RMWRRequest} request The request that is in a format that can be + * passed into the readModifyWriteRow Gapic layer method + * @return {RMWRRequestData} A readModifyWriteRow request that can be passed + * into getRMWRRequest and return the original `request` parameter. + */ +export function getRMWRRequestInverse(request: RMRWRequest): RMWRRequestData { + const rules: Rule[] = []; + if (request.rules) { + for (const rule of request.rules) { + const ruleData: Rule = { + column: `${rule.familyName}:${Mutation.convertFromBytes(rule.columnQualifier as Bytes)}`, + }; + + if (rule.appendValue) { + ruleData.append = Mutation.convertFromBytes( + rule.appendValue as Bytes, + ) as string; + } + + if (rule.incrementAmount) { + ruleData.increment = rule.incrementAmount as number; + } + + rules.push(ruleData); + } + } + + const tableName = request.tableName as string; + const authorizedViewName = request.authorizedViewName as string; + const appProfileId = request.appProfileId as string; + return Object.assign( + { + reqOpts: Object.assign( + {}, + tableName ? {tableName} : null, + authorizedViewName ? {authorizedViewName} : null, + ), + id: Mutation.convertFromBytes(request.rowKey as Bytes) as string, + rules: rules, + }, + appProfileId ? {appProfileId} : null, + ); +} diff --git a/handwritten/bigtable/testproxy/test_proxy_proto_list.json b/handwritten/bigtable/testproxy/test_proxy_proto_list.json new file mode 100644 index 00000000000..9dccad3ae9b --- /dev/null +++ b/handwritten/bigtable/testproxy/test_proxy_proto_list.json @@ -0,0 +1,3 @@ +[ + "../protos/test_proxy.proto" +] diff --git a/handwritten/bigtable/tsconfig.json b/handwritten/bigtable/tsconfig.json new file mode 100644 index 00000000000..1896d9670b6 --- /dev/null +++ b/handwritten/bigtable/tsconfig.json @@ -0,0 +1,27 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "testproxy/*.ts", + "testproxy/**/*.ts", + "src/v2/bigtable_client_config.json", + "src/admin/v2/bigtable_table_admin_client_config.json", + "src/admin/v2/bigtable_instance_admin_client_config.json", + "test-common/*.ts", + "test-common/**/*.ts", + "protos/protos.json" + ] +} diff --git a/handwritten/bigtable/webpack.config.js b/handwritten/bigtable/webpack.config.js new file mode 100644 index 00000000000..42e316fc864 --- /dev/null +++ b/handwritten/bigtable/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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: 'bigtable', + filename: './bigtable.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', +}; diff --git a/release-please-submodules.json b/release-please-submodules.json index 511b36c0d49..5c561d6a102 100644 --- a/release-please-submodules.json +++ b/release-please-submodules.json @@ -23,6 +23,7 @@ "handwritten/bigquery-storage": { "component": "bigquery-storage" }, + "handwritten/bigtable": {}, "handwritten/cloud-profiler": { "component": "cloud-profiler" },